:root {
  --fond: #07070a;
  --rouge: #ff3347;
  --rouge-doux: #ff8a95;
  --cyan: #43deff;
  --texte: #eef1f6;
  --gris: #8a93a6;
  --mono: Consolas, "SFMono-Regular", Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fond); color: var(--texte); font-family: system-ui, "Segoe UI", Arial, sans-serif; }
body { overflow-x: hidden; }

/* ---- Barre du haut ---- */
.barre { position: fixed; inset: 0 0 auto; z-index: 10; display: flex; justify-content: space-between; align-items: flex-start;
  padding: 16px clamp(16px, 3vw, 36px); pointer-events: none; }
/* Logo : le blason yann2012.com (généré dans Flow, détouré ; source vectorielle dans generation/logo/).
   Effet : un reflet de lumière glisse sur le métal (découpé à la forme du logo par un masque), une fois au
   chargement puis au survol ; au survol, le blason grossit un peu (sans lueur). */
.marque { pointer-events: auto; position: relative; display: block; transition: transform .35s cubic-bezier(.3,.7,.3,1), filter .35s; }
.marque img { display: block; height: clamp(96px, min(14vw, 18vh), 210px); width: auto; filter: drop-shadow(0 2px 8px rgba(0,0,0,.6)); }
.marque::after { content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.75) 48%, rgba(190,245,255,.35) 52%, transparent 62%) 160% 0 / 250% 100% no-repeat;
  -webkit-mask: url("assets/logo-yann2012@2x.webp?v=3") center / contain no-repeat; mask: url("assets/logo-yann2012@2x.webp?v=3") center / contain no-repeat; }
.marque.passe::after { animation: reflet-logo 3s cubic-bezier(.45,0,.4,1) 1; }
@keyframes reflet-logo { from { background-position: 160% 0; } to { background-position: -60% 0; } }
.marque:hover, .marque:focus-visible { transform: scale(1.04); }
.marque:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; }
.etat { margin-top: 10px; font: 12px var(--mono); letter-spacing: 3px; color: var(--gris); display: flex; align-items: center; gap: 8px; }
.etat i { width: 8px; height: 8px; border-radius: 50%; background: var(--rouge); box-shadow: 0 0 10px var(--rouge); }
.etat b { color: var(--texte); font-weight: 400; }

/* ---- La piste : sa hauteur fixe la longueur du scroll ; la scène reste collée ----
   Variables pilotées par scroll.js (0 → 1) : --p (tout), --zoom (entrée dans la visière),
   --ecrans (allumage des écrans), --sys (SYSTEM_12), --plonge (plongée dans Yann City). */
.piste { position: relative; height: 2500vh; }
.scene { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
/* le canevas ; en attendant la 1re image, l'image de départ en fond. Le zoom vers la visière est
   un « transform » posé par scroll.js ; on floute un peu : on passe « derrière » le verre */
.film { position: absolute; inset: 0; width: 100%; height: 100%; display: block; background: var(--fond) url("assets/debut.jpg") 50% 30% / cover;
  filter: grayscale(var(--zoom, 0)) brightness(calc(1 - var(--zoom, 0) * .45)); will-change: transform; }
.voile { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 60% 70% at 50% 40%, transparent 40%, rgba(7,7,10,.75) 100%),
              linear-gradient(to top, rgba(7,7,10,.8), transparent 30%);
  opacity: calc(.7 - var(--zoom, 0) * .7); }

/* ---- Titre, terminal, indice : la phase « transformation » ---- */
.titre { position: absolute; left: clamp(16px, 5vw, 72px); bottom: clamp(90px, 14vh, 150px);
  opacity: calc(1 - var(--p, 0) * 12); transform: translateY(calc(var(--p, 0) * -160px)); }
.titre h1 { margin: 0; font: italic 900 clamp(44px, 8vw, 116px)/.9 "Arial Black", Arial, sans-serif; letter-spacing: -3px; }
.titre h1 span { color: var(--rouge); }
.titre p { margin: 10px 0 0; font: 13px var(--mono); letter-spacing: 5px; color: var(--gris); }

.terminal { position: absolute; left: clamp(16px, 4vw, 56px); top: 50%; transform: translateY(-50%);
  width: min(330px, 40vw); font: 12px/1.9 var(--mono); letter-spacing: 1.5px; color: var(--rouge-doux);
  text-shadow: 0 0 8px rgba(255,51,71,.5); opacity: calc(1 - var(--zoom, 0) * 3); }
.terminal .ligne { opacity: 0; transform: translateX(-10px); transition: opacity .35s, transform .35s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.terminal .ligne.vue { opacity: 1; transform: none; }
.terminal .ligne b { color: #fff; font-weight: 400; }

/* Voile derrière le terminal : assombrit la colonne gauche (le mur de données y est clair et rouge),
   s'efface avec le terminal. Contraste visé ≥ 3,5:1 sur la pire image. */
.titre, .terminal { z-index: 1; }                    /* au-dessus du voile */
.terminal-fond { position: absolute; left: 0; top: 0; bottom: 0; width: min(520px, 48vw); pointer-events: none;
  background: linear-gradient(to right, rgba(7,7,10,.86) 0, rgba(7,7,10,.8) 55%, rgba(7,7,10,0) 100%);
  opacity: calc(1 - var(--zoom, 0) * 3); }
/* 1re ligne du terminal : l'invitation à défiler, flèche qui clignote */
.terminal .ligne .appel-defiler { color: #fff; }

/* ---- La visière : plus de voile rouge ; juste un léger assombrissement autour, la vraie visière reste visible ---- */
.visiere { position: absolute; inset: 0; pointer-events: none; opacity: var(--zoom, 0);
  background: radial-gradient(ellipse 70% 60% at 50% 45%, transparent 55%, rgba(5,3,6,.6) 100%); }
.visiere.interactive { pointer-events: auto; }

/* Les deux écrans sont projetés DANS les deux verres : scroll.js place .hud exactement sur la vitre
   (--gx, --gy, --gw, --gh en px) ; chaque écran occupe un verre, découpé autour de l'arête du nez. */
.hud { position: absolute; left: var(--gx, 0); top: var(--gy, 0); width: var(--gw, 0); height: var(--gh, 0);
  opacity: calc(1 - var(--plonge, 0) * 2.5); }
/* Les deux écrans : repris À L'IDENTIQUE de la scène de la chambre (intro « porte ») — deux écrans plats
   côte à côte, allumés en fondu (le Carnet puis Yann City), mêmes couleurs, mêmes textes, mêmes proportions
   (chaque écran ≈ 16:10, séparés par un petit espace comme les deux moniteurs du bureau). */
.ecran { position: absolute; top: 12%; height: 76%; width: 47%; overflow: hidden; opacity: 0; transition: opacity .8s; }
.ecran.allume { opacity: 1; }
.ecran.gauche { left: 1%; background: radial-gradient(ellipse at 30% 20%, #10204a, #060b1c 70%); box-shadow: 0 0 40px rgba(67,222,255,.25); }
.ecran.droit { right: 1%; box-shadow: 0 0 60px rgba(67,222,255,.35); }
.ecran pre { margin: 5% 6%; font: clamp(7px, 1.25vw, 18px)/1.6 Consolas, monospace; color: #6bedd0; white-space: pre; }
.ecran pre i { color: #7fa9c7; font-style: normal; } .ecran pre b { color: #ffc578; font-weight: 400; }
.ecran .ville, .plongee .ville { position: absolute; inset: 0; background: #0b1020 url("assets/yann-city-anonyme.webp") 47% center / cover; }
.ecran.droit .ville { filter: brightness(.55) saturate(.9); }
.ecran .court { display: none; }                     /* version téléphone du Carnet (voir @media plus bas) */
.ecran .appel { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; background: rgba(3,6,14,.35); }
.ecran .appel strong { font: italic 900 clamp(14px, 2.6vw, 38px)/1 "Arial Black", Arial, sans-serif; color: #fff; letter-spacing: -1px; }
.ecran .appel strong span { color: #43deff; }
.ecran .appel small { display: block; margin-top: .8em; font-size: clamp(7px, .85vw, 12px); letter-spacing: 3px; color: #bff4ff; }.clignote { animation: clignote .9s steps(1) infinite; }
@keyframes clignote { 50% { opacity: 0; } }
/* ---- SYSTEM_12 dans la bande d'écran : repris À L'IDENTIQUE de la version « chambre ».
   Les deux coques du casque se referment (bords cyan lumineux) et ne laissent qu'une bande au centre,
   où le texte s'enchaîne ligne par ligne. --ferme (0 → 1) est piloté par scroll.js. ---- */
.coque { position: absolute; left: -10%; right: -10%; height: 55%; z-index: 6; background: #02040a; pointer-events: none;
  opacity: calc(var(--ferme, 0) * 25); }   /* invisible (liseré cyan compris) tant que le casque ne se ferme pas */
.coque.haut { top: 0; border-radius: 0 0 50% 50% / 0 0 22% 22%; transform: translateY(calc(-100% + var(--ferme, 0) * 42%));
  box-shadow: 0 6px 0 -2px #43deff, 0 10px 40px rgba(67,222,255,.6); }
.coque.bas { bottom: 0; border-radius: 50% 50% 0 0 / 22% 22% 0 0; transform: translateY(calc(100% - var(--ferme, 0) * 42%));
  box-shadow: 0 -6px 0 -2px #43deff, 0 -10px 40px rgba(67,222,255,.6); }
.voile-casque { position: absolute; inset: 0; z-index: 5; pointer-events: none; opacity: var(--ferme, 0);
  background: radial-gradient(ellipse at center, rgba(3,8,20,.85), rgba(2,4,10,.96)); }
.balayage { position: absolute; inset: 0; z-index: 7; pointer-events: none; opacity: var(--ferme, 0);
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.28) 0 1px, transparent 1px 3px), radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,.75) 100%); }
.hud-texte { position: absolute; left: 50%; top: 50%; z-index: 8; transform: translate(-50%,-50%); width: min(580px, 86vw);
  font-family: Consolas, "Courier New", monospace; color: #bff4ff; text-shadow: 0 0 8px rgba(67,222,255,.7);
  opacity: calc(var(--ferme, 0) * 1.6 - .6); pointer-events: none; }
.hud-texte.interactive { pointer-events: auto; }
.hud-texte .h-titre { font-size: 12px; letter-spacing: 4px; color: #43deff; margin-bottom: 18px; }
.hud-texte .ligne { font-size: clamp(12px, 2.3vw, 15px); letter-spacing: 1.5px; margin: 7px 0; white-space: nowrap; overflow: hidden; min-height: 1.2em; }
.hud-texte .ok { color: #6bedd0; }
.hud-texte .jauge { height: 3px; background: rgba(67,222,255,.15); margin-top: 18px; overflow: hidden; }
.hud-texte .jauge i { display: block; height: 100%; width: 100%; transform: scaleX(0); transform-origin: 0 50%; background: #43deff; box-shadow: 0 0 12px #43deff; }
.hud-texte .pourcent { font-size: 11px; letter-spacing: 2px; color: #7fa9c7; margin-top: 6px; text-align: right; }
.hud-texte .bienvenue { margin-top: 16px; font-size: clamp(16px, 3vw, 22px); letter-spacing: 3px; color: #fff; opacity: 0; transition: opacity .3s; }
.hud-texte .bienvenue.vue { opacity: 1; }
.hud-texte.glitch { animation: glitch .25s steps(2) 2; }
@keyframes glitch { 25% { transform: translate(calc(-50% - 3px), -50%) skewX(-8deg); } 50% { transform: translate(calc(-50% + 3px), -50%); } }
.curseur::after { content: "▌"; animation: clignote .8s steps(1) infinite; margin-left: 2px; }
/* Identification (même allure que la version chambre) */
.connexion { display: none; margin: 10px 0 6px; gap: 8px; }
.hud-texte.demande .connexion { display: grid; }
.connexion label { display: grid; grid-template-columns: 11em 1fr; align-items: center; gap: 10px; }
.connexion label span { color: #7fcfe0; letter-spacing: 2px; }
.connexion input { background: rgba(8,20,34,.75); border: 1px solid rgba(67,222,255,.45); border-radius: 3px;
  color: #e8fbff; font: inherit; letter-spacing: 1px; padding: 6px 9px; outline: none; min-width: 0; }
.connexion input:focus { border-color: #43deff; box-shadow: 0 0 12px rgba(67,222,255,.45); }
.connexion .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.connexion button { font: inherit; letter-spacing: 2px; cursor: pointer; padding: 7px 14px; border-radius: 3px;
  border: 1px solid #43deff; background: rgba(67,222,255,.14); color: #e8fbff; }
.connexion button:hover, .connexion button:focus-visible { background: rgba(67,222,255,.3); outline: none; }
.connexion button.visiteur { border-color: rgba(191,244,255,.35); background: transparent; color: #9fbfcc; }
.connexion button:disabled { opacity: .5; cursor: wait; }
.connexion .erreur { min-height: 1.4em; color: #ffb36b; letter-spacing: 1px; }
/* ---- La plongée : un calque ville dont scroll.js règle la position (de l'écran de droite au plein écran) ---- */
.plongee { position: absolute; left: 0; top: 0; width: 100px; height: 100px; overflow: hidden; border-radius: 10px; opacity: 0; pointer-events: none;
  box-shadow: 0 0 80px rgba(67,222,255,.35); }
.plongee.vue { opacity: 1; }

/* ---- Arrivée ---- */
.arrivee { position: absolute; left: 50%; bottom: clamp(60px, 12vh, 120px); transform: translate(-50%, calc((1 - var(--arrivee, 0)) * 30px));
  width: min(92vw, 720px); text-align: center; opacity: var(--arrivee, 0); pointer-events: none; text-shadow: 0 2px 20px rgba(0,0,0,.8); }
.arrivee.active { pointer-events: auto; }
.sur-titre { margin: 0; font: 12px var(--mono); letter-spacing: 5px; color: #bff4ff; }
.arrivee h2 { margin: 12px 0 26px; font: italic 900 clamp(30px, 5vw, 64px)/1 "Arial Black", Arial, sans-serif; letter-spacing: -2px; }
.arrivee h2 span { color: var(--cyan); }
.entrer { display: inline-flex; gap: 12px; align-items: center; padding: 14px 26px; border: 1px solid var(--cyan); border-radius: 4px;
  font: 13px var(--mono); letter-spacing: 4px; color: #fff; text-decoration: none; background: rgba(7,20,30,.6);
  box-shadow: 0 0 22px rgba(67,222,255,.25); }
.entrer:hover, .entrer:focus-visible { background: rgba(67,222,255,.28); outline: none; }
.entrer b { color: var(--cyan); font-weight: 400; }

/* ---- Mobile ---- */
@media (max-width: 820px) {
  .film { background: var(--fond); }   /* pas d'image d'attente paysage : elle serait cadrée autrement que les images verticales */
  .terminal { top: auto; bottom: 0; left: 0; right: 0; transform: none; width: auto; font-size: 10px; line-height: 1.75;
    padding: 40px 16px 18px; background: linear-gradient(to top, rgba(7,7,10,.6), rgba(7,7,10,.35) 55%, transparent);
    text-shadow: 0 1px 3px #000, 0 0 8px rgba(255,51,71,.5); }
  .titre { bottom: auto; top: 14vh; }
  .marque img { height: 104px; }
  /* Téléphone : l'image entière en largeur, dans le haut de l'écran ; ses bords haut et bas se fondent
     dans le noir. Le Carnet en deux lignes lisibles au lieu du terminal complet. */
  .voile, .terminal-fond { display: none; }   /* (téléphone : le terminal a déjà son propre fond, sous l'image) */   /* le fondu des bords est dessiné dans le canevas, au ras de l'image */
  .ecran pre { display: none; }
  .ecran .court { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 0 6%; }
  .ecran .court strong { font: italic 900 clamp(15px, 4.6vw, 24px)/1 "Arial Black", Arial, sans-serif; color: #fff; letter-spacing: -.5px; }
  .ecran .court strong span { color: #6bedd0; }
  .ecran .court small { display: block; margin-top: .7em; font: 11px/1.3 Consolas, Menlo, monospace; color: #7fa9c7; letter-spacing: 1px; }
  .ecran .appel small { font-size: 11px; }
  .connexion label { grid-template-columns: 1fr; gap: 4px; }
  .hud-texte .ligne { white-space: normal; }
}
/* ---- Sans animation (réglage « Réduire les animations ») : rien ne disparaît, tout s'immobilise.
   Une page qui se lit de haut en bas : le nom, les deux écrans, SYSTEM_12 (identification),
   puis, après le choix, l'accueil et le lien vers Yann City (sinon : impasse). ---- */
@media (prefers-reduced-motion: reduce) {
  .marque.passe::after { animation: none; }
  .marque { transition: none; }
  .piste { height: auto; }
  .scene { position: relative; height: auto; min-height: 100vh; overflow: visible; display: flex; flex-direction: column;
    align-items: center; gap: 32px; padding: 84px 16px 56px; }
  .film, .terminal-fond, .terminal, .plongee, .voile, .voile-casque, .coque, .balayage { display: none; }
  .titre { position: static; opacity: 1; transform: none; align-self: stretch; max-width: 900px; margin: 0 auto; width: 100%; }
  .visiere { position: relative; inset: auto; width: 100%; max-width: 900px; opacity: 1; background: none; }
  .hud { position: relative; left: auto; top: auto; width: 100%; height: auto; aspect-ratio: 2.4 / 1; opacity: 1; }
  .ecran { opacity: 1; transition: none; }
  .hud-texte { position: static; transform: none; opacity: 1; pointer-events: auto; }
  .hud-texte .jauge, .hud-texte .pourcent { display: none; }
  .arrivee { display: none; position: static; transform: none; opacity: 1; }
  .arrivee.active { display: block; }
  .clignote, .curseur::after { animation: none; }
}

/* Production : raccourci vers le Carnet quand Yann est déjà connecté (ajouté par scroll.js) */
.vers-carnet { pointer-events: auto; position: absolute; right: clamp(16px, 3vw, 36px); top: 44px; padding: 9px 16px; border-radius: 4px;
  border: 1px solid rgba(67,222,255,.6); background: rgba(5,14,22,.7); color: #e8fbff; text-decoration: none;
  font: 600 13px/1 Sarpanch, system-ui, sans-serif; letter-spacing: .06em; }
.vers-carnet b { color: var(--cyan); font-weight: 400; margin-left: 4px; }
.vers-carnet:hover, .vers-carnet:focus-visible { background: rgba(67,222,255,.2); outline: none; }
.connexion button.visiteur:disabled { opacity: .45; cursor: not-allowed; }

/* 1re ligne du terminal « > FAIS DÉFILER POUR INITIALISER » : un faisceau d'un pixel la balaie lentement, les lettres
   s'éclaircissent à son passage, son point d'impact glisse sur un fin rail. S'éteint dès le premier scroll (--p). */
@property --xl { syntax: "<percentage>"; inherits: true; initial-value: -6%; }
.terminal .defiler-laser { position: relative; display: inline-block; padding-bottom: 7px;
  animation: balaye-ligne 5.2s cubic-bezier(.6,0,.4,1) infinite;
  background: linear-gradient(90deg, transparent, rgba(67,222,255,.32) 8%, rgba(67,222,255,.32) 92%, transparent) 0 calc(100% - 2px) / 100% 1px no-repeat; }
.terminal .defiler-laser::before { content: attr(data-t); position: absolute; inset: 0; padding: inherit; color: transparent; text-shadow: none;
  background: linear-gradient(90deg, transparent calc(var(--xl) - 14%), rgba(255,150,160,.6) calc(var(--xl) - 5%), #fff8ee calc(var(--xl) - .5%), transparent var(--xl));
  -webkit-background-clip: text; background-clip: text; }
.terminal .defiler-laser::after { content: ""; position: absolute; top: -2px; bottom: 0; left: var(--xl); width: 7px; translate: -3px 0;
  background: radial-gradient(circle at 50% calc(100% - 2px), #fff 1.5px, rgba(255,58,80,.85) 2.6px, transparent 4.5px),
              linear-gradient(90deg, transparent 3px, #fff 3px 4px, transparent 4px);
  filter: drop-shadow(0 0 4px rgba(255,58,80,.9));
  opacity: calc(min(1, (var(--xl) + 6%) / 6%) * min(1, (106% - var(--xl)) / 6%) * max(0, 1 - var(--p, 0) * 60)); }
@keyframes balaye-ligne { 0% { --xl: -6%; } 70%, 100% { --xl: 106%; } }
@media (prefers-reduced-motion: reduce) { .terminal .defiler-laser { animation: none; } }
