/* ============================================================
   PARCOURS PRIMAIRE — démo Agriculteur · design-system PACIFIK'AI
   Tokens : cdc/registre.ndjson#NAV-02 + .design/design.html
   Contrainte : perf <500KB, 0 lib motion, mobile-first (TEC-04)
   Interdits : radius arche · personnes IA · cookie banner
   ============================================================ */
:root {
  /* Filières (NAV-02, non négociable) */
  --mer: #1B6FA8;      --mer-tint: #EAF4FB;
  --terre: #2c6b3a;    --terre-tint: #EEF7EF;  --terre-bright: #3E8E4F;
  --transfo: #A65B10;  --transfo-tint: #FDF1E1;  --transfo-bright: #E08A2E;
  /* Socle */
  --ink: #123B57;         /* bleu profond — texte */
  --ink-soft: #4a6d84;
  --paper: #FBF6EC;       /* crème — fond */
  --paper-2: #fffdf8;
  --hibiscus: #E85A6A;    /* accent chaud */
  --line: #e6ddca;
  --shadow: 0 1px 2px rgba(18,59,87,.06), 0 8px 24px -12px rgba(18,59,87,.18);
  --shadow-lg: 0 2px 4px rgba(18,59,87,.05), 0 24px 48px -20px rgba(18,59,87,.28);
  /* Filière active (par défaut Terre = Agriculteur) */
  --accent: var(--terre);
  --accent-tint: var(--terre-tint);
  --radius: 14px;        /* 4 coins symétriques — jamais d'arche */
  --radius-sm: 9px;
  --tap: 44px;           /* cible tactile mini */
  --maxw: 1120px;
  --ease: cubic-bezier(.22,.61,.36,1);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
}
.f-mer     { --accent: var(--mer);     --accent-tint: var(--mer-tint); }
.f-terre   { --accent: var(--terre);   --accent-tint: var(--terre-tint); }
.f-transfo { --accent: var(--transfo); --accent-tint: var(--transfo-tint); }

/* Reset + PWA app-like (checklist Codex : safe-area, overscroll, tap) */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { animation-duration:.01ms !important; transition-duration:.01ms !important; } }
p, li, dd, figcaption { text-wrap: pretty; }

body {
  font-family: var(--font); color: var(--ink); background: var(--paper);
  line-height: 1.62; overscroll-behavior-y: none; -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body { min-height: 100svh; }
img, svg { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
input, select, textarea { font-size: 16px; } /* iOS anti-zoom focus */

/* Typo fluide */
h1,h2,h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.01em; color: var(--ink);
  text-wrap: balance; }   /* évite le mot seul sur la dernière ligne d'un titre */
/* L'interligne se desserre quand la taille baisse : 1.1 va à un titre d'affichage,
   pas à un h3 de 18px qui court sur trois lignes en mobile. */
h1 { line-height: 1.16; }
h2 { line-height: 1.16; }
h3 { line-height: 1.3; }
.display { line-height: 1.05; }
.display { font-size: clamp(2rem, 6vw, 3.6rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
h3 { font-size: clamp(1.15rem, 2.6vw, 1.4rem); }
.lead { font-size: clamp(1.05rem, 2.4vw, 1.28rem); color: var(--ink-soft); }
.eyebrow { max-width: 58ch; font-family: var(--font); font-weight: 700; font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(18px, 5vw, 40px); }


/* Header / nav filières (NAV-03, wayfinding NAV-04) */
.top { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 14px; height: 60px; }
.top { padding-top: env(safe-area-inset-top); }
.brand { display: flex; align-items: center; gap: 10px; min-height: var(--tap); font-family: var(--display); font-weight: 600; font-size: 1.05rem; }
.brand .seed { width: 26px; height: 26px; flex: none; }
.fil-nav { margin-left: auto; display: flex; gap: 6px; }
.fil-nav a { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 44px; min-width: 44px; padding: 0 13px; border-radius: 999px; font-size: .86rem; font-weight: 600; color: var(--ink-soft); border: 1.5px solid transparent; transition: .2s var(--ease); }
.fil-nav a .dot { width: 9px; height: 9px; border-radius: 50%; }
.fil-nav a:hover { background: var(--paper-2); color: var(--ink); }
.fil-nav a.on { color: var(--ink); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: var(--accent-tint); }
.fil-nav .m-only { display: none; }

/* Wayfinding "Tu es ici" — progression 1·2·3·4 */
.steps { display: flex; align-items: center; gap: 0; font-size: .78rem; color: var(--ink-soft); padding: 10px 0; flex-wrap: wrap; }
.steps .st { display: inline-flex; align-items: center; gap: 7px; min-height: var(--tap); }
.steps .st b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #e9dfc9; color: var(--ink-soft); font-size: .72rem; font-weight: 700; font-family: var(--font); }
.steps .st.done b { background: var(--accent); color: #fff; }
.steps .st.now b { background: var(--ink); color: #fff; box-shadow: 0 0 0 4px var(--accent-tint); }
.steps .st.now span { color: var(--ink); font-weight: 700; }
.steps .sep { width: 20px; height: 1.5px; background: var(--line); margin: 0 8px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: var(--tap); line-height: 1.2; padding: 0 20px; border-radius: 999px; font-weight: 650; font-size: .96rem; transition: transform .18s var(--ease), box-shadow .2s var(--ease), background .2s; will-change: transform; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 26px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost { background: var(--paper-2); border: 1.5px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Cards */
.card { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* Reveal on scroll — SEULEMENT si JS actif (fallback : tout visible) */
html.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
html.js .reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; } .reveal.d2 { transition-delay: .16s; } .reveal.d3 { transition-delay: .24s; }

/* Footer */
.foot { border-top: 1px solid var(--line); background: var(--paper-2); margin-top: 72px; }
.foot .wrap { padding-block: 34px; display: flex; gap: 20px; flex-wrap: wrap; align-items: center; justify-content: space-between; color: var(--ink-soft); font-size: .85rem; }
.foot a { text-decoration: underline; text-underline-offset: 3px; }

/* Offline badge (wow archipels) */
.net { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(160%); opacity: 0; visibility: hidden; pointer-events: none; z-index: 60; display: flex; align-items: center; gap: 9px; padding: 10px 16px; border-radius: 999px; font-size: .86rem; font-weight: 600; color: #fff; background: var(--ink); box-shadow: var(--shadow-lg); transition: transform .4s var(--ease); }
.net.show { transform: translateX(-50%) translateY(0); opacity: 1; visibility: visible; }
.net { transition: transform .4s var(--ease), opacity .3s, visibility .3s; }
.net.on { background: var(--terre); }
.net .pulse { width: 9px; height: 9px; border-radius: 50%; background: #fff; }

@media (max-width: 720px) {
  .fil-nav .lbl { display: none; }
  .fil-nav a { padding: 0 10px; }
  .foot .wrap { flex-direction: column; align-items: flex-start; }
}

/* ── Langage éditorial (remplace les callout-boxes) ── */
.ic { width: 1.15em; height: 1.15em; vertical-align: -0.22em; }
.note-ed { max-width: 760px; margin: 26px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line); background: none; font-size: .92rem; color: var(--ink-soft); }
.note-ed .note-k { display: block; font-size: .7rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: color-mix(in srgb, var(--accent) 62%, #4a2e08); margin-bottom: 5px; }
.note-ed.center { margin-inline: auto; text-align: left; }
.note-ed b { color: var(--ink); }

/* Lien d'évitement — première tabulation au clavier, invisible à la souris (WCAG 2.4.1) */
.skip { position: absolute; left: -9999px; top: 0; z-index: 100; }
.skip:focus { left: 8px; top: 8px; width: auto; height: auto; padding: 12px 18px;
  background: var(--ink); color: #fff; border-radius: var(--radius-sm); font-weight: 650; }
/* Titre de section pour les lecteurs d'écran, sans effet visuel (évite les sauts de niveau) */
.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; }

/* Ancres : l'en-tête est collant — sans marge de défilement, la cible atterrit
   dessous et le titre visé reste masqué (mesuré jusqu'à 73px sur mobile). */
[id] { scroll-margin-top: calc(72px + env(safe-area-inset-top)); }
@media (max-width: 720px) { [id] { scroll-margin-top: calc(124px + env(safe-area-inset-top)); } }

/* Mesure de lecture : au-delà de ~75 caractères, l'œil perd le début de la ligne suivante.
   Les blocs de texte courant sont bornés ; les conteneurs de mise en page ne le sont pas. */
.block-head p, .lead, .note-ed, .secteur-src { max-width: 62ch; }
/* Garde-fou : un paragraphe de contenu ne dépasse pas la mesure de lecture.
   Les conteneurs qui fixent déjà la leur (cartes, bandeau CTA, tableaux) sont exclus. */
section p:not([class]), main > p:not([class]) { max-width: 62ch; }
