/* Prototype du site EKRIN (jetable, file://). Coquille commune : bandeau prototype,
   en-tête, pied de page, sections. Toutes les valeurs viennent de tokens.css (charte v1.0).
   Chaque module garde ses propres règles sous sa classe racine :
   .histoire (récit filmé), .flash (outils éKlair Flash), .stop (O32 et O33), .accueil, .concept. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--fg-1); font: 400 var(--t-body)/var(--lh-body) var(--font-body); overflow-x: clip; }
button, input, select, textarea { font: inherit; color: inherit; }
img, video, canvas, svg { max-width: 100%; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
a { color: inherit; text-underline-offset: 3px; }

/* Bandeau prototype : toujours visible en haut, jamais dans le site réel */
.proto-barre { position: relative; z-index: 50; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; padding: 8px clamp(16px, 4vw, 48px); font: 400 var(--t-meta)/1.4 var(--font-mono); letter-spacing: var(--track-meta); text-transform: uppercase; background: var(--ek-ink); color: var(--fg-2); border-bottom: 1px solid var(--rule); }
.proto-barre nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.proto-barre a { text-decoration: none; }
.proto-barre a:hover, .proto-barre a[aria-current="page"] { color: var(--ek-laiton); }

/* En-tête du site */
.entete { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 14px clamp(16px, 4vw, 48px); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule); }
.entete .logo { display: block; height: 22px; }
.entete .logo img { height: 100%; width: auto; display: block; }
.entete nav { display: flex; align-items: center; gap: 4px 22px; font: 500 14px/1 var(--font-body); }
.entete nav a { text-decoration: none; color: var(--fg-2); padding: 6px 0; }
.entete nav a:hover, .entete nav a[aria-current="page"] { color: var(--heading); }
.entete nav a.cta { color: var(--cta-ink); background: var(--cta); padding: 10px 16px; border-radius: var(--r-pill); }
.entete nav a.cta:hover { background: var(--cta-hover); color: var(--cta-ink); }
/* W5 : « Diagnostic éKlair » est le bouton plein, « Nous écrire » passe en contour */
.entete nav a.ecrire { color: var(--fg-1); border: 1px solid var(--rule-strong); padding: 9px 15px; border-radius: var(--r-pill); }
.entete nav a.ecrire:hover { border-color: var(--ek-laiton); color: var(--heading); }
.entete nav a.cta, .entete nav a.ecrire { white-space: nowrap; }
.entete nav a.connexion { color: var(--fg-1); white-space: nowrap; padding-left: 22px; border-left: 1px solid var(--rule-strong); }
.entete .menu { display: none; }
/* Les outils atteints depuis index.html#diagnostic ne passent pas sous l'en-tête collant */
#histoire-flash-a, #histoire-flash-c { scroll-margin-top: 72px; }
@media (max-width: 860px) {
  .entete nav a:not(.cta):not(.garde):not(.ecrire):not(.connexion) { display: none; }
  .entete nav a.connexion { padding-left: 0; border-left: 0; }
}
@media (max-width: 560px) {
  .entete { gap: 12px; }
  .entete nav a.ecrire, .entete nav a.connexion { display: none; }
}

/* Une section claire dans une page sombre : les rôles du mode clair de tokens.css (:root), sur fond blanc */
.mode-clair {
  --bg: var(--ek-white); --surface: var(--ek-chalk); --surface-2: var(--ek-mist);
  --heading: var(--ek-ink); --fg-1: var(--ek-ink); --fg-2: var(--ek-forest);
  --rule: rgba(31, 77, 58, 0.16); --rule-strong: rgba(31, 77, 58, 0.32);
  --cta: var(--ek-forest); --cta-hover: var(--ek-ink); --cta-ink: var(--ek-white);
  --gain: var(--ek-forest); --figure: var(--ek-laiton); --focus: var(--ek-forest);
  background: var(--bg); color: var(--fg-1);
}

/* Sections de page */
.section { max-width: 1320px; margin: 0 auto; padding: clamp(56px, 9vw, 120px) clamp(16px, 4vw, 48px); }
.section + .section { border-top: 1px solid var(--rule); }
.section-tete { max-width: 760px; margin-bottom: clamp(28px, 4vw, 48px); }
.section-tete h2.surtitre { margin: 0; padding-top: 0; font: 400 var(--t-meta)/1.4 var(--font-mono); letter-spacing: var(--track-meta); color: var(--fg-2); } /* titre de section au format surtitre (Oli, 21 octobre) */
.surtitre, .etiquette { font: 400 var(--t-meta)/1.4 var(--font-mono); letter-spacing: var(--track-meta); text-transform: uppercase; color: var(--fg-2); }
.section-tete h2, .titre-2 { margin: 10px 0 0; font: 400 clamp(32px, 4.6vw, 51px)/var(--lh-h1) var(--font-display); text-transform: uppercase; letter-spacing: var(--track-heading); color: var(--heading); padding-top: 0.12em; }
.section-tete .chapeau, .chapeau { margin: 14px 0 0; font: italic 400 clamp(19px, 2.2vw, 22px)/var(--lh-dek) var(--font-dek); max-width: 44ch; }
.texte { max-width: 62ch; color: var(--fg-2); }
.chiffre-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Boutons et liens d'action */
.bouton { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: var(--control-h, 44px); padding: 0 22px; border: 0; border-radius: var(--r-pill); background: var(--cta); color: var(--cta-ink); font: 500 15px/1 var(--font-body); text-decoration: none; cursor: pointer; transition: background var(--d-ui) var(--ease); }
.bouton:hover { background: var(--cta-hover); }
.bouton-ligne { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 18px; border: 1px solid var(--rule-strong); border-radius: var(--r-pill); background: transparent; color: var(--fg-1); font: 500 14px/1 var(--font-body); text-decoration: none; cursor: pointer; }
.bouton-ligne:hover { border-color: var(--ek-laiton); color: var(--heading); }

/* Marqueurs de prototype : ce qui est une doublure, ce qui reste à confirmer */
.doublure { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border: 1px dashed var(--ek-laiton); border-radius: var(--r-pill); font: 400 11px/1.3 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ek-laiton); max-width: 100%; }
.a-confirmer { display: inline-block; padding: 2px 7px; border-radius: var(--r-pill); background: var(--ek-laiton); color: var(--ek-ink); font: 400 11px/1.3 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; }
.source { font: 400 12px/1.5 var(--font-mono); color: var(--fg-2); }

/* Pied de page */
.pied { border-top: 1px solid var(--rule); padding: 40px clamp(16px, 4vw, 48px) 56px; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: end; max-width: 1320px; margin: 0 auto; color: var(--fg-2); font-size: 14px; }
.pied img { height: 20px; width: auto; display: block; margin-bottom: 12px; }
.pied .devise { font: italic 400 18px/1.3 var(--font-dek); color: var(--fg-1); margin: 0; }
.pied nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.pied a { text-decoration: none; }
.pied a:hover { color: var(--heading); }
/* Oli, 22 octobre : les pages légales, tout en bas, sur toute la largeur du pied */
.pied .pied-legal { grid-column: 1 / -1; padding-top: 18px; border-top: 1px solid var(--rule); font: 400 11px/1.4 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; }
.pied .pied-legal a[aria-current="page"] { color: var(--heading); }
@media (max-width: 700px) { .pied { grid-template-columns: 1fr; } }
