/* Académie Ferris — variables, thèmes, typographie, réinitialisation.
   Chargé en premier : tout le reste en dépend. */

:root {
  --bg: #f7f3ee;
  --surface: #fffdfa;
  --surface-2: #efe6db;
  --ink: #322b26;
  --ink-soft: #6f6157;
  --border: #e2d5c6;
  --border-strong: #d3c2af;
  --accent: #cf4b12;
  --accent-soft: #f4dccb;
  --accent-ink: #fff8f3;
  --ferris: #e6560f;
  --ferris-shell: #f28347;
  --ferris-dark: #b53c08;
  --good: #1f6f5c;
  --good-soft: #d7e7e0;
  --bad: #b41f2a;
  --term-bg: #201a16;
  --term-ink: #e9ddd0;
  --term-dim: #9a8a7b;
  --term-green: #7fc9a6;
  --term-red: #f2897f;
  --term-blue: #7fb4d6;
  --armor: #8b96a5;
  --armor-light: #c4ccd6;
  --armor-dark: #58616f;
  --gold: #ecc14e;
  --gold-dark: #b58a2a;
  --hat: #7a4a24;
  --hat-light: #93582d;
  --hat-dark: #48290f;
  --hat-band: #351d0b;
  /* Scaphandre : le crabe s'affiche sur fond clair ET sur fond sombre, donc le
     blanc de la combinaison est légèrement bleuté pour ne pas brûler en clair.
     Le hublot est translucide — c'est ce qui laisse voir les yeux au travers. */
  --suit: #e6edf5;
  --suit-dark: #a9b8c9;
  --suit-deep: #7d8ea1;
  /* Le verre est très peu teinté : c'est ce qui laisse les yeux lisibles au
     travers. L'eau, elle, doit rester franche sous ce voile. */
  --verre: rgba(188, 224, 245, 0.18);
  --verre-bord: rgba(224, 242, 252, 0.72);
  --eau: rgba(70, 165, 212, 0.55);
  --eau-bord: rgba(186, 232, 250, 0.85);
  --shadow: 0 1px 2px rgba(48, 34, 24, .06), 0 12px 34px -14px rgba(48, 34, 24, .28);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #191411;
    --surface: #221b16;
    --surface-2: #2c231d;
    --ink: #ece2d8;
    --ink-soft: #b2a293;
    --border: #382c24;
    --border-strong: #4a3a2f;
    --accent: #ff6a33;
    --accent-soft: #3a271c;
    --accent-ink: #1a0f08;
    --ferris: #f2703a;
    --ferris-shell: #f79769;
    --ferris-dark: #c04f1f;
    --good: #55b89c;
    --good-soft: #22332d;
    --bad: #e56a6a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px -16px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #191411;
  --surface: #221b16;
  --surface-2: #2c231d;
  --ink: #ece2d8;
  --ink-soft: #b2a293;
  --border: #382c24;
  --border-strong: #4a3a2f;
  --accent: #ff6a33;
  --accent-soft: #3a271c;
  --accent-ink: #1a0f08;
  --ferris: #f2703a;
  --ferris-shell: #f79769;
  --ferris-dark: #c04f1f;
  --good: #55b89c;
  --good-soft: #22332d;
  --bad: #e56a6a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px -16px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.6;
  font-size: 16px;
}
h1, h2, h3 { font-family: "Bricolage Grotesque", "IBM Plex Sans", sans-serif; font-weight: 700; text-wrap: balance; margin: 0; letter-spacing: -0.01em; }
code, kbd, .mono { font-family: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace; }
.eyebrow {
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .7rem;
  color: var(--ink-soft);
}
a { color: var(--accent); }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 22px; }

/* ---------- accessibilité ---------- */
/* Le lien d'évitement n'existe que pour le clavier : caché hors du flux, il
   revient à l'écran dès qu'il prend le focus. On ne le met pas en
   `display: none`, qui le retirerait aussi de l'ordre de tabulation. */
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 16px; border-radius: 0 0 10px 10px; font-weight: 600;
  text-decoration: none; transition: top .15s;
}
.skip-link:focus { top: 0; }

/* Lisible par un lecteur d'écran, invisible à l'œil. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Le focus doit se voir partout, y compris sur les surfaces sombres. */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.editor-card :focus-visible, .cexo-editor :focus-visible, .console:focus-visible {
  outline-color: var(--gold); outline-offset: -2px;
}
/* Un titre reçoit le focus au changement de vue : pas de liseré pour autant,
   il n'est pas interactif — l'annonce suffit. */
#app > *:focus, h1[tabindex]:focus { outline: none; }

/* ---------- état du réseau ---------- */
/* Discret et permanent : hors ligne, le site marche toujours — ce n'est pas
   une erreur, juste une promesse en moins. Posé au-dessus de tout, hors du
   flux, pour ne dépendre d'aucune vue. */
.netbadge {
  position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%);
  z-index: 60; max-width: min(92vw, 640px);
  padding: 8px 16px; border-radius: 999px;
  background: var(--surface); color: var(--ink-soft);
  border: 1px solid var(--border-strong);
  box-shadow: 0 6px 22px rgba(0, 0, 0, .18);
  font-size: .82rem; line-height: 1.35; text-align: center;
}
@media (max-width: 560px) {
  .netbadge { font-size: .76rem; padding: 7px 12px; bottom: 10px; }
}
