/* ==========================================================================
   revision.tn — feuille de style partagée (index, atelier, fiche)

   Typographie : deux familles, chacune avec un rôle.
   - Archivo (variable, axe de largeur) = l'interface. Les titres passent en
     semi-étendu (font-stretch 112,5 %) : c'est la voix du site.
   - Newsreader = le contenu des cours, uniquement sur la fiche Seyès.
   Pas de mono, pas de mot en italique glissé dans les titres.
   ========================================================================== */

/* 1. TOKENS ------------------------------------------------------------- */
/* Polices hébergées par le site (plus de requête vers Google, et disponibles hors ligne) */
@font-face { font-family: 'Archivo'; font-style: normal; font-display: swap; font-weight: 100 900; font-stretch: 62% 125%; src: url('/vendor/fonts/archivo-latin-wdth.woff2') format('woff2-variations'), url('/vendor/fonts/archivo-latin-wdth.woff2') format('woff2'); }
@font-face { font-family: 'Newsreader'; font-style: normal; font-display: swap; font-weight: 400; src: url('/vendor/fonts/newsreader-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Newsreader'; font-style: normal; font-display: swap; font-weight: 500 700; src: url('/vendor/fonts/newsreader-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Newsreader'; font-style: italic; font-display: swap; font-weight: 400 700; src: url('/vendor/fonts/newsreader-latin-400-italic.woff2') format('woff2'); }

/* Mode sombre : le cahier de nuit. Papier bleu nuit, encre crème, stylo rouge. */
:root, :root[data-theme="dark"] {
  --bg: #0E1322;
  --surface: #141A2C;
  --surface-2: #1A2136;
  --border: rgba(178, 192, 235, 0.13);
  --border-strong: rgba(178, 192, 235, 0.28);
  --text: #EEEAE0;
  --text-2: #AEB5C8;
  --text-3: #959DB3;

  --accent: #9AA5FF;
  --accent-bg: rgba(154, 165, 255, 0.12);
  --on-btn: #0E1322;
  --ok: #62C58B;
  --warn: #F0B947;

  /* Couleurs de matières (identiques à tdlfi.space) */
  --c-geo: #5CB8D1;
  --c-hggsp: #6DBB8A;
  --c-ses: #8C98FF;
  --c-philo: #F0B947;
  --c-ang: #B195FF;
  --c-sci: #9DB0C3;
  --c-droit: #A7A7AD;
  --c-neutral: #7A8196;

  /* Fiche Seyès */
  --paper: #111829;
  --rule: rgba(140, 160, 255, 0.2);
  --rule-fine: rgba(140, 160, 255, 0.07);
  --margin-red: rgba(255, 107, 94, 0.62);
  --highlight: rgba(255, 214, 90, 0.26);
  --red: #FF6B5E;

  /* Papier de la page et ombres */
  --grid: rgba(150, 170, 255, 0.10);
  --grid-x: rgba(150, 170, 255, 0.055);
  --grid-fine: rgba(150, 170, 255, 0.03);
  --shadow-ink: rgba(0, 0, 0, 0.55);
  --margin-op: 0.55;

  color-scheme: dark;
}

:root[data-theme="light"] {
  /* Mode clair : le cahier. Papier crème, encre bleu nuit, stylo rouge. */
  --bg: #F5F1E6;
  --surface: #FBF8EE;
  --surface-2: #EFEADB;
  --border: rgba(29, 43, 83, 0.16);
  --border-strong: rgba(29, 43, 83, 0.34);
  --text: #1D2B53;
  --text-2: #4A5578;
  --text-3: #5A6484;

  --accent: #2B3FB8;
  --accent-bg: rgba(43, 63, 184, 0.09);
  --on-btn: #F5F1E6;
  --red: #C8372D;
  --ok: #2C7A4B;
  --warn: #8F5E00;

  --c-geo: #16708A;
  --c-hggsp: #2F6B45;
  --c-ses: #3346D3;
  --c-philo: #B07A0A;
  --c-ang: #7A4FD0;
  --c-sci: #5E7185;
  --c-droit: #3A3A3E;
  --c-neutral: #8A8C91;

  --paper: #FFFDF6;
  --rule: rgba(60, 86, 170, 0.26);
  --rule-fine: rgba(60, 86, 170, 0.08);
  --margin-red: rgba(200, 55, 45, 0.75);
  --highlight: rgba(246, 214, 74, 0.7);

  --grid: rgba(80, 110, 190, 0.2);
  --grid-x: rgba(80, 110, 190, 0.12);
  --grid-fine: rgba(80, 110, 190, 0.07);
  --shadow-ink: rgba(29, 43, 83, 0.45);
  --margin-op: 0.7;

  color-scheme: light;
}

:root {
  --sans: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --serif: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --wide: 112.5%;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 140ms;
  --t-enter: 420ms;

  --container: 1200px;
  --gutter: clamp(16px, 4vw, 56px);
}
@media (min-width: 1900px) { :root { --container: 1440px; } }

/* 2. BASE --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: clamp(16px, 0.5vw + 12px, 22px);
  scroll-behavior: smooth;
  scroll-padding-top: calc(6rem + env(safe-area-inset-top));
  background: var(--bg);
  scrollbar-color: var(--border-strong) transparent;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis: none;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  transition: background-color var(--t-enter), color var(--t-enter);
}

h1, h2, h3 { font-family: var(--sans); font-stretch: var(--wide); font-weight: 600; letter-spacing: -0.03em; line-height: 1.04; margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
ul, ol { list-style: none; margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.meta { font-size: 0.8125rem; line-height: 1.5; color: var(--text-3); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }

/* Surligneur : se pose une fois quand le bloc apparaît */
.hl {
  background-image: linear-gradient(transparent 56%, var(--highlight) 56% 94%, transparent 94%);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  -webkit-box-decoration-break: clone;
          box-decoration-break: clone;
}
.js .reveal .hl { background-size: 0% 100%; transition: background-size 900ms var(--ease) 450ms; }
.js .reveal.is-in .hl { background-size: 100% 100%; }

/* 3. FOND ------------------------------------------------------------
   Grille Seyès fixe, très discrète : le papier d'un cahier.
   ----------------------------------------------------------------------- */
.bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; contain: strict;
  background-image: linear-gradient(to bottom, transparent 31px, var(--text) 31px), linear-gradient(to right, transparent 31px, var(--text) 31px);
  background-size: 100% 32px, 32px 100%; opacity: 0.045;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 85%); mask-image: linear-gradient(to bottom, #000, transparent 85%); }

/* 4. NAVIGATION --------------------------------------------------------- */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 92%, transparent); border-bottom: 1px solid var(--border); }
.nav-inner { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; height: 64px; display: flex; align-items: center; gap: 24px; }

.brand { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 1.1875rem; letter-spacing: -0.04em; line-height: 1; }
.brand b { font-stretch: var(--wide); font-weight: 600; }
.brand b span { font-weight: 400; color: var(--text-2); }
.brand .tag { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.02em; color: var(--text-2); border: 1px solid var(--border-strong); padding: 2px 6px; }

.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a { white-space: nowrap; padding: 8px 12px; font-size: 0.9rem; color: var(--text-2); transition: color var(--t-fast), background-color var(--t-fast); }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); background: var(--surface); }

.icon-btn { width: 40px; height: 40px; flex: none; border: 1px solid var(--border); background: transparent; display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); transition: color var(--t-fast), background-color var(--t-fast); }
.icon-btn:hover { color: var(--text); background: var(--surface); }
.icon-btn svg { width: 18px; height: 18px; }
.i-sun { display: none; }
:root[data-theme="light"] .i-sun { display: block; }
:root[data-theme="light"] .i-moon { display: none; }
.nav-menu-btn { display: none; }

@media (max-width: 860px) {
  .nav-links {
    position: absolute; top: calc(64px + env(safe-area-inset-top)); left: 0; right: 0; flex-direction: column; margin: 0; padding: 8px var(--gutter) 16px;
    background: var(--bg); border-bottom: 1px solid var(--border);
    opacity: 0; visibility: hidden; transform: translate3d(0, -4px, 0);
    transition: opacity var(--t-fast), transform var(--t-fast), visibility var(--t-fast);
  }
  .nav-links a { padding: 12px 8px; font-size: 1rem; }
  .nav.is-open .nav-links { opacity: 1; visibility: visible; transform: none; }
  .nav-menu-btn { display: inline-flex; }
  .btn.nav-cta { display: none; }
  .nav-inner .icon-btn.theme { margin-left: auto; }
}
@media (min-width: 861px) { .nav-inner .icon-btn.theme { order: 5; } .nav-cta { order: 6; } }

/* 5. BOUTONS ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 16px; border: 1px solid transparent;
  font-weight: 500; font-size: 0.9375rem; white-space: nowrap;
  transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.btn:active { transform: scale(0.98); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary { background: var(--text); color: var(--on-btn); }
.btn-primary:hover { background: var(--accent); }
:root[data-theme="light"] .btn-primary:hover { color: #fff; }
.btn-secondary { background: transparent; border-color: var(--text); color: var(--text); }
.btn-secondary:hover { background: var(--text); color: var(--on-btn); }
.btn-sm { height: 36px; font-size: 0.875rem; }
.btn[disabled] { opacity: 0.4; pointer-events: none; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
@media (max-width: 480px) { .cta-row .btn { width: 100%; } }

.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-size: 0.875rem; font-weight: 500; border-bottom: 1px solid var(--border-strong); padding-bottom: 2px; transition: border-color var(--t-fast); white-space: nowrap; }
.link-arrow:hover { border-color: var(--text); }
.link-arrow svg { width: 12px; height: 12px; }

/* 6. FICHE SEYÈS -------------------------------------------------------- */
.sheet {
  --r: 2rem;
  --k: var(--c-neutral);
  position: relative;
  background-color: var(--paper);
  background-image:
    linear-gradient(to right, transparent calc(var(--r) * 2 - 1px), var(--margin-red) calc(var(--r) * 2 - 1px) calc(var(--r) * 2 + 1px), transparent calc(var(--r) * 2 + 1px)),
    repeating-linear-gradient(to bottom, transparent 0 calc(var(--r) - 1px), var(--rule) calc(var(--r) - 1px) var(--r)),
    repeating-linear-gradient(to right, transparent 0 calc(var(--r) - 1px), var(--rule-fine) calc(var(--r) - 1px) var(--r)),
    repeating-linear-gradient(to bottom, transparent 0 calc(var(--r) / 4 - 1px), var(--rule-fine) calc(var(--r) / 4 - 1px) calc(var(--r) / 4));
  border: 1px solid var(--border-strong);
  padding: var(--r) var(--r) var(--r) calc(var(--r) * 2 + var(--r) / 2);
  line-height: var(--r);
  overflow: hidden;
}
.sheet > *, .sheet section > * { margin: 0; }
.sheet-kicker { display: flex; align-items: center; gap: 8px; font-family: var(--sans); font-size: 0.8125rem; color: var(--text-3); }
.sheet-kicker::before { content: ""; width: 8px; height: 8px; background: var(--k); flex: none; }
.sheet-title { font-family: var(--sans); font-stretch: var(--wide); font-weight: 600; font-size: 1.625rem; letter-spacing: -0.035em; line-height: var(--r); }
.sheet-chapter { font-family: var(--sans); font-size: 0.9375rem; color: var(--text-2); }
.sheet-h { font-family: var(--sans); font-stretch: var(--wide); font-weight: 600; font-size: 1.0625rem; letter-spacing: -0.02em; line-height: var(--r); margin-top: var(--r) !important; color: var(--text); }
.sheet-line { font-family: var(--serif); font-size: 1.0625rem; color: var(--text); }
.sheet-line.pad { margin-top: var(--r); }
.sheet-line b { font-weight: 500; }
.sheet .date b { font-family: var(--sans); font-weight: 600; font-size: 0.9375rem; font-variant-numeric: tabular-nums; color: var(--k); margin-right: 2px; }
.sheet .piege b { font-family: var(--sans); font-weight: 600; font-size: 0.9375rem; color: var(--warn); }
.sheet .retenir b { font-family: var(--sans); font-weight: 600; font-size: 0.9375rem; }
.sheet mark { background: linear-gradient(transparent 14%, var(--highlight) 14% 86%, transparent 86%); color: inherit; padding: 0 2px; margin: 0 -2px; }
.sheet-list li { position: relative; font-family: var(--serif); font-size: 1.0625rem; padding-left: 20px; color: var(--text); }
.sheet-list li::before { content: ""; position: absolute; left: 4px; top: calc(var(--r) / 2 - 2px); width: 5px; height: 5px; background: var(--k); }
.sheet-list.plan li { padding-left: 28px; }
.sheet-list.plan li::before { content: attr(data-n); width: auto; height: auto; background: none; top: 0; left: 0; font-family: var(--sans); font-weight: 600; font-size: 0.875rem; color: var(--k); }

/* Couleurs de matière pour la fiche */
.k-geo { --k: var(--c-geo); } .k-hggsp { --k: var(--c-hggsp); } .k-ses { --k: var(--c-ses); } .k-philo { --k: var(--c-philo); }
.k-ang { --k: var(--c-ang); } .k-sci { --k: var(--c-sci); } .k-droit { --k: var(--c-droit); }

/* 7. MISE EN PAGE COMMUNE ---------------------------------------------- */
.page { padding-top: calc(64px + env(safe-area-inset-top)); }
.masthead { display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; padding-block: 12px; border-bottom: 1px solid var(--border); }
.masthead a { transition: color var(--t-fast); }
.masthead a:hover { color: var(--text); }

.section { padding-block: clamp(48px, 8vw, 96px); border-top: 1px solid var(--border); }
.split { display: grid; gap: clamp(24px, 4vw, 48px); align-items: start; }
@media (min-width: 900px) { .split { grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr); } }
.section-head h2 { font-size: clamp(1.875rem, 3.8vw, 3.25rem); max-width: 14ch; }
.section-head p { margin-top: 16px; font-size: 1.0625rem; line-height: 1.55; color: var(--text-2); max-width: 30rem; }
.section-head .btn { margin-top: 0; }
.eyebrow { display: block; margin-bottom: 16px; }

.card { background: var(--surface); border: 1px solid var(--border); }
.panel { padding: clamp(16px, 2.2vw, 24px); }

/* Formulaires */
.field + .field { margin-top: 24px; }
.field-label { display: block; margin-bottom: 8px; font-size: 0.875rem; font-weight: 500; color: var(--text-2); }
.input, .textarea { width: 100%; border: 1px solid var(--border-strong); background: var(--bg); padding: 12px; transition: border-color var(--t-fast); }
.input { height: 44px; padding-block: 0; }
.textarea { min-height: 112px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:focus, .textarea:focus { outline: none; border-color: var(--accent); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .row-2 { grid-template-columns: 1fr; } }

.segmented { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--border-strong); }
.seg { position: relative; }
.seg + .seg { border-left: 1px solid var(--border-strong); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: 12px 4px; font-size: 0.875rem; color: var(--text-2); cursor: pointer; transition: color var(--t-fast), background-color var(--t-fast); }
.seg span:hover { color: var(--text); }
.seg input:checked + span { background: var(--text); color: var(--on-btn); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
@media (max-width: 420px) { .segmented { grid-template-columns: 1fr; } .seg + .seg { border-left: 0; border-top: 1px solid var(--border-strong); } }

.panel-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; flex-wrap: wrap; }
.status { font-size: 0.8125rem; color: var(--text-3); }
.status.is-busy { color: var(--accent); }
.status.is-ready { color: var(--ok); }
.status.is-warn { color: var(--warn); }

/* 8. FOOTER ------------------------------------------------------------- */
.footer { border-top: 1px solid var(--border); padding-block: 40px calc(40px + env(safe-area-inset-bottom)); }
.footer-grid { display: grid; gap: 32px; }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; align-items: start; } }
.footer p { margin-top: 12px; font-size: 0.9375rem; color: var(--text-2); max-width: 26rem; }
.footer h2 { font-size: 0.8125rem; font-stretch: 100%; font-weight: 500; letter-spacing: 0; color: var(--text-3); margin-bottom: 12px; }
.theme-switch { display: inline-flex; border: 1px solid var(--border-strong); }
.theme-switch button { border: 0; background: transparent; padding: 8px 12px; font-size: 0.8125rem; color: var(--text-2); transition: color var(--t-fast), background-color var(--t-fast); }
.theme-switch button + button { border-left: 1px solid var(--border-strong); }
.theme-switch button[aria-pressed="true"] { background: var(--text); color: var(--on-btn); }

/* 9. ENTRÉE AU SCROLL --------------------------------------------------- */
.js .reveal { opacity: 0; transform: translate3d(0, 12px, 0); transition: opacity var(--t-enter) var(--ease), transform var(--t-enter) var(--ease); transition-delay: var(--d, 0ms); }
.js .reveal.is-in { opacity: 1; transform: none; }
.reduced-motion .reveal { transition: none; opacity: 1; transform: none; }
.reduced-motion .hl { transition: none !important; background-size: 100% 100% !important; }
html.reduced-motion { scroll-behavior: auto; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bg *, .bg { animation: none !important; }
  .ink, .trace, .curve { stroke-dashoffset: 0; }
  .js .reveal { transition: none; opacity: 1; transform: none; }
  .btn:active { transform: none; }
}

/* 10. IMPRESSION -------------------------------------------------------- */
@media print {
  :root { --paper: #fff; --text: #111; --text-2: #333; --text-3: #555; --rule: rgba(51, 70, 211, 0.25); --rule-fine: rgba(51, 70, 211, 0.08); --highlight: rgba(250, 204, 21, 0.55); }
  body { background: #fff; color: #111; }
  .nav, .bg, .footer, .no-print { display: none !important; }
  .page { padding-top: 0; }
  .sheet { border: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .js .reveal { opacity: 1; transform: none; }
}


/* 7. LE CAHIER (clair : papier crème ; sombre : cahier de nuit) ----------
   Tout ce bloc s'applique aux deux thèmes ; seules les couleurs changent. Aucune image, aucune police
   en plus : papier Seyès en dégradés CSS (une seule couche fixe, qui ne
   bouge pas au défilement), marge rouge, ombres statiques.
   ----------------------------------------------------------------------- */
:root .bg {
  background-image:
    linear-gradient(to bottom, transparent 31px, var(--grid) 31px),
    linear-gradient(to right, transparent 31px, var(--grid-x) 31px),
    linear-gradient(to bottom, transparent 7px, var(--grid-fine) 7px);
  background-size: 100% 32px, 32px 100%, 100% 8px;
  opacity: 1; -webkit-mask-image: none; mask-image: none;
}
/* La marge rouge : à gauche du contenu, derrière la barre de navigation */
:root .bg::before,
:root .bg::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 2px; background: var(--red);
  left: max(8px, calc((100vw - min(100vw - 2 * var(--gutter), var(--container))) / 2 - 28px)); opacity: var(--margin-op);
}
:root .bg::after { left: calc(max(8px, calc((100vw - min(100vw - 2 * var(--gutter), var(--container))) / 2 - 28px)) + 6px); opacity: 0.28; width: 1px; }

/* Titres : l'écriture du cahier (Newsreader, déjà chargée pour la fiche) */
:root :is(h1, h2, h3) { font-family: var(--serif); font-stretch: 100%; font-weight: 500; letter-spacing: -0.025em; line-height: 1.08; }
:root .brand b { font-family: var(--serif); font-stretch: 100%; font-weight: 500; letter-spacing: -0.02em; font-size: 1.25rem; }
:root .sheet-title, :root .sheet-h { font-family: var(--serif); font-stretch: 100%; font-weight: 500; letter-spacing: -0.015em; }
:root .sheet-h { font-size: 1.3125rem; font-weight: 600; }
:root .footer h2 { font-family: var(--sans); }

/* Boutons : encre pleine, ombre rouge décalée (comme un tampon) */
:root .btn-primary { box-shadow: 4px 4px 0 var(--red); transition: background-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast); }
:root .btn-primary:hover { background: var(--text); color: var(--on-btn); box-shadow: 2px 2px 0 var(--red); transform: translate(2px, 2px); }
:root .btn-secondary { border-width: 2px; }
:root .btn[disabled] { box-shadow: none; }
:root .card { box-shadow: 0 12px 24px -18px var(--shadow-ink); background: var(--surface); }
:root .nav { background: color-mix(in srgb, var(--bg) 94%, transparent); }

/* Titre d'accueil : le soulignement au stylo rouge remplace le surligneur */
:root[data-theme] .hero h1 .hl {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 20' preserveAspectRatio='none'%3E%3Cpath d='M2 12C40 3 90 17 140 8S250 6 298 11' fill='none' stroke='%23C8372D' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-size: 100% 0.2em; background-position: 0 100%; background-repeat: no-repeat; padding-bottom: 0.14em;
}
:root[data-theme="dark"] .hero h1 .hl { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 20' preserveAspectRatio='none'%3E%3Cpath d='M2 12C40 3 90 17 140 8S250 6 298 11' fill='none' stroke='%23FF6B5E' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E"); }
.js .hero h1:not(.is-in) .hl { background-size: 0% 0.2em; }
:root .hero h1 { max-width: 11ch; }

/* La fiche posée sur le cahier, tamponnée, annotée au stylo rouge */
.hero-sheet { position: relative; }
.pen-note { font-family: var(--serif); font-style: italic; font-size: 0.9375rem; line-height: 1.3; color: var(--red); }
:root .hero-sheet .sheet { box-shadow: 0 18px 30px -16px var(--shadow-ink), 0 2px 6px var(--shadow-ink); }
@media (min-width: 980px) { :root .hero-sheet .sheet { transform: rotate(1.4deg); } }
.stamp { position: absolute; top: -14px; right: -6px; z-index: 2; padding: 3px 10px; border: 3px solid var(--red); border-radius: 4px; color: var(--red); font-weight: 800; font-size: 0.8125rem; letter-spacing: 0.12em; transform: rotate(7deg); background: color-mix(in srgb, var(--bg) 70%, transparent); pointer-events: none; }

/* Passage que le contrôle n'a pas retrouvé dans le cours : au stylo rouge, en pointillés */
.flag { color: var(--red); border-bottom: 2px dotted var(--red); white-space: nowrap; font-family: var(--sans); font-size: 0.8125em; padding-bottom: 1px; }


/* 8. APPLICATION INSTALLÉE ET MAC ---------------------------------------- */
/* Barre de navigation : verre dépoli, comme les barres d'outils de macOS */
.nav { padding-top: env(safe-area-inset-top); padding-inline: env(safe-area-inset-left) env(safe-area-inset-right); }
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .nav, :root .nav { background: color-mix(in srgb, var(--bg) 78%, transparent); -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px); }
}
/* Écrans Retina : filets plus fins */
@media (min-resolution: 2dppx) { .nav { border-bottom-width: 0.5px; } }
/* Survols seulement avec une souris ou un pavé tactile */
@media (hover: none) { .format-row:hover svg { transform: none; } }

/* Dans l'application installée : comportement d'app, pas de page web */
@media (display-mode: standalone), (display-mode: window-controls-overlay) {
  body { overscroll-behavior-y: none; }
  .nav, .btn, .icon-btn, .toc, .theme-switch, .footer h2 { -webkit-user-select: none; user-select: none; }
  .install-hint { display: none !important; }
}

/* Installer l'application */
.install { margin-top: 16px; display: grid; gap: 8px; justify-items: start; }
.install[hidden], .install-hint[hidden] { display: none; }
.install-hint { font-size: 0.875rem; color: var(--text-3); line-height: 1.5; }
.install-hint kbd { font-family: var(--sans); font-size: 0.8125rem; padding: 1px 6px; border: 1px solid var(--border-strong); border-radius: 4px; color: var(--text-2); }
