/* Otelow — styles.css
   Charte lexicale côté Otelow : sonde, trajectoire, étape, station, cap, journal de bord.
   « Régie de live » et « EN DIRECT » appartiennent au produit Tramevia Dock. */

@property --accent { syntax: "<color>"; inherits: true; initial-value: #f1eee6; }
@property --segment { syntax: "<color>"; inherits: true; initial-value: #f1eee6; }

/* polices servies par le site (aucun appel à Google : RGPD), sous-ensemble latin */
@font-face { font-family: "Archivo"; src: url("assets/fonts/archivo.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("assets/fonts/manrope.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("assets/fonts/ibm-plex-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("assets/fonts/ibm-plex-mono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Archivo Fallback"; src: local("Arial"); size-adjust: 112%; font-weight: 800; }

:root {
  --bg: #0d0d0f;
  --bg-intro: #0a0a0b;
  --fg: #f1eee6;
  --fg-2: #b9b5ad;
  --fg-3: #a19e97;
  --muted: #8d8a83;
  --line: #26262b;
  --line-2: #3a3a42;
  --lav: #d3bfff;
  --night: #211a32;
  --ink: #30264d;
  --orange: #ff5b3a;
  --dock: #141417;
  --font-title: "Archivo", "Archivo Fallback", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --font-tram: "Manrope", system-ui, sans-serif;
  --gutter: 64px;
  --col: 1040px;
  --header: 64px;
  --radius: 30px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header) + 16px); -webkit-text-size-adjust: 100%; }

body {
  position: relative;
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-title);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  --accent: #f1eee6;
  --segment: #f1eee6;
  transition: --accent .4s, --segment .4s, background-color .4s;
}
body[data-station="tramevia"] { --segment: #d3bfff; --accent: #d3bfff; }
body[data-station="dock"] { --segment: #ff5b3a; --accent: #ff5b3a; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; border-radius: 999px; }
::selection { background: var(--fg); color: var(--bg); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: var(--col); margin: 0 auto; }

/* --- Typographie ----------------------------------------------------- */

.mono {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.mono b { color: var(--fg); font-weight: 500; }
.mono--sm { font-size: 10px; }

.title {
  font-family: var(--font-title);
  font-weight: 800;
  font-stretch: 115%;
  letter-spacing: -.035em;
  line-height: .98;
  text-wrap: balance;
}
.title .dim { color: var(--fg-2); }
.h1 { font-size: clamp(52px, 6.4vw, 88px); }
.h2 { font-size: clamp(38px, 4vw, 56px); }

.lede { color: var(--fg-2); max-width: 46ch; font-family: var(--font-tram); font-size: 18px; }

/* --- Boutons ----------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -.01em;
  white-space: nowrap;
  transition: transform .15s var(--ease), background-color .25s, border-color .25s, color .25s;
}
.btn:hover { transform: translateY(-2px); }
.btn .icon { width: 16px; height: 16px; flex: none; }
.btn--light { background: var(--fg); color: var(--bg); }
.btn--light:hover { background: #fff; }
.btn--outline { border-color: var(--line-2); color: var(--fg); }
.btn--outline:hover { border-color: var(--fg-3); }
.btn--lav { background: var(--lav); color: var(--ink); }
.btn--orange { background: var(--orange); color: #140804; }
.btn--sm { padding: 0 16px; font-size: 14px; }

.icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* --- La sonde (point blanc + halo qui respire) ------------------------ */

.probe, #sonde { position: relative; width: 6px; height: 6px; border-radius: 50%; background: var(--fg); flex: none; }
.probe::before, #sonde::before {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .14;
  animation: breathe 2s ease-in-out infinite alternate;
  transition: background-color .4s;
}
@keyframes breathe { from { transform: scale(.7); } to { transform: scale(1); } }

#sonde {
  position: fixed;
  top: 45vh;
  left: 0;
  margin: -3px 0 0 -3px;
  z-index: 2;
  pointer-events: none;
  will-change: transform;
  background: none;
}
#sonde::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--fg); }
#sonde::before { inset: -23px; opacity: .12; }
#sonde.is-moving::before { animation-play-state: paused; }
#sonde.ignite::after { animation: ignite .9s var(--ease) both; }
#sonde.ignite::before { animation: halo .9s var(--ease) both, breathe 2s 1s ease-in-out infinite alternate; }
#sonde.glide { transition: transform .8s cubic-bezier(.65, 0, .35, 1); }
@keyframes ignite { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes halo { 0% { transform: scale(0); } 60% { transform: scale(1.85); } 100% { transform: scale(.7); } }
html.is-intro #sonde:not(.ignite) { visibility: hidden; }

/* --- Calques --------------------------------------------------------- */

#ciel { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 1; transition: opacity .7s; }
.page { position: relative; z-index: 1; }

#stations { position: absolute; top: 0; left: 0; width: 0; height: 0; z-index: 2; }
.st {
  position: absolute;
  width: 32px; height: 32px;
  margin: -16px 0 0 -16px;
  border-radius: 50%;
}
.st span {
  position: absolute;
  left: calc(100% - 6px);
  top: 50%;
  margin: -4px 0 0 0;
  writing-mode: vertical-rl;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .15em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--muted);
  transition: color .3s;
}
.st.passed span { color: var(--fg); }
.st[data-tab="dock"] span { left: auto; right: calc(100% - 6px); }

/* --- En-tête ------------------------------------------------------------ */

.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 3;
  height: var(--header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 var(--gutter);
  background: rgba(13, 13, 15, .85);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-stretch: 115%;
  letter-spacing: .02em;
  font-size: 18px;
}
.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu__toggle { display: none; }
.nav { display: flex; gap: 8px; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; font-size: 14px; color: var(--fg-2); transition: color .2s, transform .15s var(--ease); }
.nav a:hover { color: var(--fg); transform: translateY(-2px); }
body[data-station="tramevia"] .nav a[href="#tramevia"],
body[data-station="dock"] .nav a[href="#dock"],
body[data-station="missions"] .nav a[href="#missions"],
body[data-station="contact"] .nav a[href="#contact"] { color: var(--fg); }

/* --- Sections ------------------------------------------------------- */

.section { padding: clamp(80px, 9vw, 120px) var(--gutter); }
.section--cross { margin-top: 360px; }
.section__head { display: flex; flex-direction: column; gap: 24px; margin-bottom: 40px; }
.section__note { margin-top: 28px; }
.kicker { display: inline-flex; align-items: center; gap: 12px; }
.kicker::after { content: ""; width: 1px; height: 8px; background: currentColor; }

/* --- Héros · Origine ----------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 64px;
  align-items: center;
  min-height: 100vh;
  max-width: calc(var(--col) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 160px var(--gutter) 80px;
}
.hero__copy { display: flex; flex-direction: column; gap: 28px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Carte de route */
.map { border: 1px solid var(--line); border-radius: 20px; background: rgba(13, 13, 15, .7); padding: 24px; }
.map__svg { width: 100%; height: auto; overflow: visible; }
.map__route { fill: none; stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 6; opacity: .6; }
.map__done { fill: none; stroke: var(--fg); stroke-width: 1.5; }
.map__stations circle { fill: var(--bg); stroke: var(--muted); stroke-width: 1; transition: fill .3s, stroke .3s; }
.map__stations circle.passed { fill: var(--fg); stroke: var(--fg); }
.map__stations circle.passed[data-st="1"] { fill: var(--lav); stroke: var(--lav); }
.map__stations circle.passed[data-st="2"] { fill: var(--orange); stroke: var(--orange); }
.map__stations circle.passed.hollow { fill: var(--bg); }
.map__label { font-family: var(--font-mono); font-size: 9px; letter-spacing: .15em; text-transform: uppercase; fill: var(--muted); }
.map__chip text { font-family: var(--font-tram); font-weight: 700; font-size: 11px; text-anchor: middle; }
.map__chip--1 rect { fill: var(--night); stroke: var(--lav); stroke-opacity: .4; }
.map__chip--1 text { fill: var(--lav); }
.map__chip--2 rect:first-child { fill: var(--dock); stroke: var(--line-2); }
.map__chip--2 text { fill: var(--fg); text-anchor: start; }
.map__live { fill: var(--orange); stroke: none; }
.map__chip text.map__livetxt { font-family: var(--font-mono); font-weight: 500; font-size: 7px; letter-spacing: .1em; fill: #140804; text-anchor: middle; }
.map__probe { fill: var(--fg); }
.map__foot { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 18px; }
.meter { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; }
.meter i { display: block; width: 3px; height: 16px; background: var(--line-2); transform: scaleY(.06); transform-origin: bottom; }
.meter i:last-child { background: var(--accent); }

/* --- Étape 01 · Tramevia --------------------------------------------- */

#tramevia .kicker { color: var(--lav); }
.tram-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; }
.tram-head .section__head { flex: 1; }

/* Le T en 3D (vidéo Blender) : joué à chaque arrivée sur l'étape et au survol, par main.js ; au repos, l'affiche montre la dernière image */
.tmark { position: relative; flex: none; transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .3s ease-out; width: 260px; aspect-ratio: 1; margin-bottom: 24px; border-radius: 28px; overflow: hidden; background: #120e1f; box-shadow: 0 0 0 1px rgba(211, 191, 255, .22), 0 30px 90px -30px rgba(211, 191, 255, .55); }
.tmark__vid { display: block; width: 100%; height: 100%; object-fit: cover; }
.tmark::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 40px 10px #120e1f; pointer-events: none; }
body[data-station="tramevia"] .tmark { animation: tmark-glow 2.4s var(--ease) both; }
@keyframes tmark-glow { 40% { box-shadow: 0 0 0 1px rgba(211, 191, 255, .6), 0 30px 120px -20px rgba(211, 191, 255, .9); } }

/* Les boutons de l'étape sont attirés par le pointeur (translate, posé par etape01.js) */
#tramevia .btn { translate: var(--tx, 0) var(--ty, 0); transition: transform .15s var(--ease), translate .35s var(--ease), background-color .25s, border-color .25s, color .25s; }

/* Défilement : le T glisse dans son cadre (parallaxe, navigateurs qui le savent) */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .tmark__vid { scale: 1.12; animation: tmark-par linear both; animation-timeline: view(); }
    @keyframes tmark-par { from { translate: 0 7%; } to { translate: 0 -7%; } }
  }
}

/* Le titre monte ligne par ligne */
.h2 .ln { display: inline-block; }
.tram-head .is-in .ln, #missions .is-in .ln { animation: ln-up .9s var(--ease) calc(.15s + var(--i) * .18s) both; }
@keyframes ln-up { from { opacity: 0; transform: translateY(.45em); filter: blur(8px); } }

.showcase {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
  padding: 48px;
  border-radius: var(--radius);
  background: radial-gradient(700px circle at var(--mx, 20%) var(--my, 0%), rgba(211, 191, 255, .13), transparent 60%), var(--night);
  font-family: var(--font-tram);
}
.showcase .mono { color: var(--lav); opacity: .8; }
.showcase__copy { display: flex; flex-direction: column; gap: 24px; }
.showcase .lede { color: #cfc6e6; font-size: 17px; }
.services { display: flex; flex-wrap: wrap; gap: 8px; }
.showcase.is-in .services li { animation: chip .5s var(--ease) calc(.45s + var(--i) * .07s) both; }
@keyframes chip { from { opacity: 0; transform: translateY(10px) scale(.9); } }
.services li { padding: 6px 14px; border: 1px solid rgba(211, 191, 255, .3); border-radius: 999px; font-size: 14px; color: #e4dcf7; }

.browser { display: block; border-radius: 16px; background: var(--ink); border: 1px solid rgba(211, 191, 255, .22); overflow: hidden; transition: transform .25s var(--ease), border-color .25s; }
.browser { transform: perspective(1400px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
.browser:hover { border-color: rgba(211, 191, 255, .5); }
.browser__bar { display: flex; align-items: center; gap: 6px; padding: 12px 14px; border-bottom: 1px solid rgba(211, 191, 255, .18); }
.browser__bar i { width: 9px; height: 9px; border-radius: 50%; background: rgba(211, 191, 255, .45); }
.browser__bar .url { margin-left: 12px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; color: rgba(211, 191, 255, .75); }
/* Le site défile seul dans la fenêtre : accueil, réalisations, prestations (pause au survol) */
.browser__view { display: block; aspect-ratio: 16 / 9; overflow: hidden; }
.browser img { display: block; width: 100%; height: auto; }
.showcase.is-in .browser img { animation: site-pan 26s 1.2s ease-in-out infinite alternate; }
.browser:hover img { animation-play-state: paused; }
@keyframes site-pan { 0%, 10% { transform: none; } 40%, 55% { transform: translateY(-38%); } 85%, 100% { transform: translateY(-77.5%); } }

/* Côté code : un atelier. L'éditeur se tape ligne par ligne (--i), puis chaque valeur se modifie et l'aperçu se reconstruit (etape01.js) */
.lab-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 24px 48px; margin: 96px 0 32px; font-family: var(--font-tram); }
.lab-head__copy { display: flex; flex-direction: column; gap: 16px; max-width: 560px; }
.lab { position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; align-items: stretch; padding: 28px; border: 1px solid rgba(211, 191, 255, .14); border-radius: var(--radius); background: radial-gradient(700px circle at var(--mx, 30%) var(--my, 0%), rgba(211, 191, 255, .09), transparent 60%), #0f0c17; }

.editor { position: relative; display: flex; flex-direction: column; border: 1px solid rgba(211, 191, 255, .22); border-radius: 20px; overflow: hidden; background: #110e1a; box-shadow: 0 30px 80px -40px rgba(211, 191, 255, .35); font-family: var(--font-mono); font-size: 13px; line-height: 1.75; }
.editor__bar { display: flex; align-items: center; gap: 6px; padding: 10px 12px 10px 16px; border-bottom: 1px solid rgba(211, 191, 255, .14); }
.editor__bar i { width: 9px; height: 9px; border-radius: 50%; background: rgba(211, 191, 255, .35); }
.editor__bar span { margin-left: 12px; font-size: 11px; letter-spacing: .08em; color: rgba(211, 191, 255, .7); }
.editor__reset { margin-left: auto; min-height: 30px; padding: 0 12px; border: 1px solid rgba(211, 191, 255, .25); border-radius: 999px; background: none; font: inherit; font-size: 11px; letter-spacing: .06em; color: rgba(211, 191, 255, .8); cursor: pointer; transition: border-color .2s, color .2s; }
.editor__reset:hover { border-color: var(--lav); color: var(--lav); }
.editor__body { flex: 1; margin: 0; padding: 18px 20px 18px 0; overflow-x: auto; counter-reset: ln; color: #ddd6ee; }
.editor__body code { font: inherit; }
.editor .l { display: block; white-space: pre; }
.editor__body .l::before { counter-increment: ln; content: counter(ln); display: inline-block; width: 44px; padding-right: 16px; text-align: right; color: rgba(211, 191, 255, .28); }
.editor b { font-weight: 400; }
.editor .c { color: #7d7593; font-style: italic; }
.editor .k { color: #c9a8ff; }
.editor .s { color: #b8f28d; }
.editor .f { color: #8fd3ff; }
.editor .n { color: #ffb38a; }
.editor .p { color: var(--lav); }
.editor .ok { color: #b8f28d; }
.editor .w { color: #ffd166; }

/* Les valeurs à essayer : des champs et des boutons, soulignés en pointillé */
.tok { margin: 0; padding: 0 2px; border: 0; border-radius: 4px; background: rgba(211, 191, 255, .07); box-shadow: inset 0 -1px 0 currentColor; font: inherit; line-height: inherit; color: inherit; cursor: pointer; transition: background-color .2s; }
.tok.s { color: #b8f28d; }
.tok.n { color: #ffb38a; }
.tok:hover, .tok:focus-visible { background: rgba(211, 191, 255, .16); outline: none; }
.tok:focus-visible { box-shadow: inset 0 -1px 0 currentColor, 0 0 0 2px var(--lav); }
.tok--in { padding: 0; cursor: text; caret-color: var(--lav); }
.tok.is-hit { animation: tok-hit .5s var(--ease); }
@keyframes tok-hit { 30% { background: rgba(211, 191, 255, .45); transform: scale(1.08); } }

.editor__term { min-height: 104px; padding: 14px 20px 18px; border-top: 1px solid rgba(211, 191, 255, .14); background: #0c0a12; color: #cfc6e6; }
.editor__term .l { white-space: pre-wrap; }
.editor__term .tl { display: block; white-space: pre-wrap; animation: tl-in .35s var(--ease) both; }
.editor__term .tl + .tl { animation-delay: .08s; }
.editor__term .tl.wait b { display: inline-block; animation: spin 1s linear infinite; }
@keyframes tl-in { from { opacity: 0; transform: translateX(-6px); } }
@keyframes spin { to { transform: rotate(360deg); } }
.caret { display: inline-block; width: 8px; height: 1.1em; margin-left: 6px; vertical-align: -3px; background: var(--lav); animation: caret 1s steps(1) infinite; }
.lab.is-in .l { animation: type .5s steps(24, end) calc(.35s + var(--i) * .22s) both; }
@keyframes type { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes caret { 50% { opacity: 0; } }

/* Le pointeur fantôme : il montre une fois comment jouer, puis laisse la main */
.ghost { position: absolute; left: 0; top: 0; z-index: 2; width: 22px; height: 22px; fill: #f3effa; stroke: #110e1a; stroke-width: 1.4; stroke-linejoin: round; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .6)); opacity: 0; transform: translate(70%, 420px); transition: transform .9s var(--ease), opacity .4s; pointer-events: none; }
.ghost.is-on { opacity: 1; }
.ghost.is-click { scale: .82; transition: transform .9s var(--ease), opacity .4s, scale .12s; }

.stats { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 12px 40px; margin: 0; }
.stats dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-3); }
.stats dd { margin: 4px 0 0; font-family: var(--font-title); font-size: 34px; font-weight: 800; letter-spacing: -.02em; color: var(--lav); }

/* L'aperçu : un vrai petit site, reconstruit à chaque changement (balayage, puis apparition en cascade) */
.preview { --pv: #d3bfff; position: relative; display: flex; flex-direction: column; border-radius: 20px; overflow: hidden; background: #f6f3ee; color: #1a1622; box-shadow: 0 30px 80px -40px var(--pv); font-family: var(--font-tram); transition: box-shadow .6s; }
.preview[data-color="corail"] { --pv: #ff7a59; }
.preview[data-color="menthe"] { --pv: #6fdcae; }
.preview[data-color="ciel"] { --pv: #7cc8ff; }
.preview[data-color="soleil"] { --pv: #ffc94d; }
.preview__bar { display: flex; align-items: center; gap: 6px; padding: 12px 14px; background: #ebe6de; border-bottom: 1px solid #ddd6cc; }
.preview__bar i { width: 9px; height: 9px; border-radius: 50%; background: #cfc6b8; }
.preview__bar .url { margin-left: 12px; padding: 3px 12px; border-radius: 999px; background: #f6f3ee; font-family: var(--font-mono); font-size: 11px; color: #5d566a; }
.preview__state { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: #2f8a5b; }
.preview__state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(47, 138, 91, .18); }
.preview.is-building .preview__state { color: #b07a00; }
.preview.is-building .preview__state::before { box-shadow: 0 0 0 3px rgba(176, 122, 0, .18); }

.preview__screen { position: relative; flex: 1; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-rows: auto 1fr; gap: 20px 24px; align-items: center; padding: 18px 26px 28px; min-height: 340px; transition: filter .3s, opacity .3s; }
.preview__screen::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 40%; background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--pv) 45%, transparent) 85%, var(--pv)); opacity: 0; pointer-events: none; transform: translateY(-100%); }
.preview.is-building .preview__screen { filter: blur(3px) saturate(.6); opacity: .55; }
.preview.is-building .preview__screen::after { animation: scan .65s cubic-bezier(.6, 0, .4, 1) both; }
@keyframes scan { 0% { opacity: 1; transform: translateY(-100%); } 100% { opacity: 1; transform: translateY(260%); } }
.preview.is-built[data-anim="true"] .pv-a { animation: pv-in .7s var(--ease) calc(var(--d) * .07s) both; }
@keyframes pv-in { from { opacity: 0; transform: translateY(14px); filter: blur(4px); } }

.pv-nav { grid-column: 1 / -1; align-self: start; display: flex; justify-content: space-between; align-items: center; padding-bottom: 14px; border-bottom: 1px solid #e4ded4; }
.pv-logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; letter-spacing: -.01em; }
.pv-logo i { width: 14px; height: 14px; border-radius: 4px; background: var(--pv); transition: background-color .4s; }
.pv-links { display: inline-flex; gap: 10px; }
.pv-links i { width: 34px; height: 6px; border-radius: 3px; background: #d9d2c6; }
.pv-hero { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; min-width: 0; }
.pv-kicker { margin: 0; font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #6d6578; }
.pv-title { margin: 0; max-width: 100%; font-family: var(--font-title); font-size: clamp(24px, 2.3vw, 32px); font-weight: 800; line-height: 1.05; letter-spacing: -.03em; overflow-wrap: anywhere; }
.pv-text { display: flex; flex-direction: column; gap: 6px; width: 100%; margin: 0; }
.pv-text i { height: 6px; border-radius: 3px; background: #ddd6cb; }
.pv-text i + i { width: 70%; }
.pv-btn { display: inline-flex; align-items: center; min-height: 34px; padding: 0 16px; border-radius: 999px; background: var(--pv); font-size: 12px; font-weight: 700; color: #1a1622; transition: background-color .4s; }
.pv-art { display: none; }
.preview[data-style="vitrine"] .pv-art--vitrine, .preview[data-style="reservation"] .pv-art--resa { display: block; }
.preview[data-style="boutique"] .pv-art--boutique { display: grid; }

.pv-art--vitrine { position: relative; aspect-ratio: 1; }
.pv-art--vitrine i { position: absolute; display: block; background: var(--pv); transition: background-color .4s; }
.pv-art--vitrine i:nth-child(1) { inset: 6% 10% 22% 18%; border-radius: 50%; opacity: .9; }
.pv-art--vitrine i:nth-child(2) { left: 4%; bottom: 6%; width: 46%; height: 34%; border-radius: 18px; background: #1a1622; }
.pv-art--vitrine i:nth-child(3) { right: 4%; bottom: 14%; width: 26%; aspect-ratio: 1; border-radius: 50%; background: none; border: 6px solid var(--pv); }
.preview[data-anim="true"] .pv-art--vitrine i:nth-child(1) { animation: float 5s ease-in-out infinite alternate; }
.preview[data-anim="true"] .pv-art--vitrine i:nth-child(3) { animation: float 4s ease-in-out -2s infinite alternate-reverse; }
@keyframes float { to { transform: translateY(-8%) rotate(6deg); } }

.preview[data-style="boutique"] .preview__screen { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; }
.preview[data-style="boutique"] .pv-text { display: none; }
.pv-art--boutique { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-self: start; }
.pv-prod { display: flex; flex-direction: column; gap: 4px; padding: 8px 8px 10px; border-radius: 14px; background: #fff; box-shadow: 0 6px 20px -12px rgba(26, 22, 34, .4); font-size: 12px; }
.pv-prod i { aspect-ratio: 4 / 3; margin-bottom: 4px; border-radius: 10px; background: linear-gradient(150deg, var(--pv), color-mix(in srgb, var(--pv) 40%, #fff)); }
.pv-prod em { font-style: normal; font-family: var(--font-mono); font-size: 11px; color: #6d6578; }
.preview[data-anim="true"] .pv-prod:hover { transform: translateY(-3px); }

.pv-art--resa { padding: 16px; border-radius: 16px; background: #fff; box-shadow: 0 10px 30px -16px rgba(26, 22, 34, .4); }
.pv-day { display: block; margin-bottom: 12px; font-size: 13px; font-weight: 800; }
.pv-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pv-slots i { padding: 8px 0; border: 1px solid #e4ded4; border-radius: 10px; font-style: normal; font-family: var(--font-mono); font-size: 11px; text-align: center; color: #5d566a; }
.pv-slots .on { border-color: transparent; background: var(--pv); font-weight: 500; color: #1a1622; }
.preview[data-anim="true"] .pv-slots .on { animation: slot 1.6s ease-in-out infinite; }
@keyframes slot { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--pv) 30%, transparent); } }

.subhead { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 12px 24px; margin: 72px 0 28px; }
.h3 { font-size: clamp(28px, 2.6vw, 36px); }

.works { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.work { display: flex; flex-direction: column; height: 100%; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: var(--dock); transition: transform .25s var(--ease), border-color .25s; }
.work { transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
.work:hover { transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-4px); border-color: rgba(211, 191, 255, .45); }
.work { position: relative; }
.work img { display: block; width: 100%; height: auto; transform-origin: 50% 0; transition: transform .7s var(--ease); }
.work:hover img { transform: scale(1.05); }
.work::after { content: ""; position: absolute; inset: 0; z-index: 1; background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 30%), rgba(243, 239, 250, .14), transparent 55%); opacity: 0; transition: opacity .35s; pointer-events: none; }
.work:hover::after { opacity: 1; }
.work__body { position: relative; border-top: 1px solid var(--line); background: var(--dock); display: flex; flex-direction: column; gap: 8px; padding: 20px 22px 22px; flex: 1; font-family: var(--font-tram); }
.work__body .mono { color: var(--lav); opacity: .8; }
.work__name { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.work__name .icon { width: 16px; height: 16px; transition: transform .25s var(--ease); }
.work:hover .work__name .icon { transform: translate(2px, -2px); }
.work__desc { color: var(--fg-3); font-size: 15px; }
.works li:nth-child(3n+2) { transition-delay: .08s; }
.works li:nth-child(3n) { transition-delay: .16s; }

/* --- Étape 02 · Tramevia Dock --------------------------------------- */

#dock .kicker { color: var(--orange); }
.dock-intro { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px 48px; align-items: end; margin-bottom: 48px; }
.dock-intro .section__head { margin-bottom: 0; }
.dock-intro__copy { display: flex; flex-direction: column; gap: 20px; }
.badges, .platforms { display: flex; flex-wrap: wrap; gap: 8px; }
.badge { display: inline-flex; align-items: center; min-height: 28px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 999px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-2); }
.badge--orange { border-color: rgba(255, 91, 58, .55); color: var(--orange); }
.platforms li { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-tram); font-size: 14px; color: var(--fg-2); }
.platforms li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.platforms li + li { margin-left: 10px; }

/* La grande capture : légèrement inclinée, elle se redresse à l'apparition */
.stage { margin: 0; perspective: 1600px; }
.stage img { display: block; width: 100%; height: auto; border: 1px solid var(--line-2); border-radius: 22px; box-shadow: 0 40px 120px -50px rgba(255, 91, 58, .55); transform: rotateX(14deg) scale(.94); transform-origin: 50% 100%; transition: transform 1.2s var(--ease); }
.stage.is-in img { transform: none; }
.stage figcaption, .tour__copy { font-family: var(--font-tram); color: var(--fg-3); }
.stage figcaption { margin-top: 16px; font-size: 14px; text-align: center; }

.tour { display: flex; flex-direction: column; gap: 96px; margin: 112px 0 96px; }
.tour__row { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.tour__row--flip .tour__media { order: 2; }
.tour__media { position: relative; }
.tour__media > img { display: block; width: 100%; height: auto; border: 1px solid var(--line-2); border-radius: 20px; background: #0f0f12; }
.tour__media--scene { padding-right: 18%; }
.tour__media .tour__phone { position: absolute; right: 0; bottom: -40px; width: 30%; border-radius: 18px; box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .8); }
.tour__media--tall > img { aspect-ratio: 900 / 1080; object-fit: cover; object-position: top; }
.tour__copy { display: flex; flex-direction: column; gap: 16px; font-size: 16px; }
.tour__copy .mono { color: var(--orange); }
.tour__copy h3 { font-family: var(--font-title); font-size: clamp(26px, 2.4vw, 34px); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; color: var(--fg); }
.tour__copy .dim { color: var(--fg-2); }

.dock-cta { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 24px; padding: 32px 36px; border: 1px solid rgba(255, 91, 58, .35); border-radius: var(--radius); background: radial-gradient(120% 140% at 0% 0%, rgba(255, 91, 58, .14), transparent 60%), var(--dock); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* --- Étape 03 · Journal de bord --------------------------------------- */
/* Un tracé doré (couleur de Saturne) se remplit au défilement (--p, posé par etapes.js) ; chaque point s'allume quand la tête du tracé le dépasse */

#missions { --sat: #e8c99a; }
#missions .kicker { color: var(--sat); }
#missions .stats dd { color: var(--sat); }
.log-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 24px 48px; }
.log-head .section__head { flex: 1 1 520px; }
.log-head .stats { margin-bottom: 48px; }

.log { --rail: 168px; position: relative; margin-top: 16px; }
.log__list { --p: 1; position: relative; display: flex; flex-direction: column; gap: 28px; margin: 0; padding: 8px 0 0; list-style: none; }
.log__list::after { content: ""; position: absolute; left: var(--rail); top: 0; bottom: var(--end, 0px); width: 2px; margin-left: -1px; border-radius: 2px; }
.log__list::after { background: linear-gradient(to bottom, rgba(232, 201, 154, .15), var(--sat)); transform: scaleY(var(--p)); transform-origin: top; box-shadow: 0 0 14px rgba(232, 201, 154, .45); }
.log__head { position: absolute; left: var(--rail); top: 0; z-index: 1; opacity: 0; transition: opacity .3s; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #fff6e6; box-shadow: 0 0 0 4px rgba(232, 201, 154, .25), 0 0 24px 6px rgba(232, 201, 154, .7); pointer-events: none; }
.log.is-moving .log__head { opacity: 1; }

.log__month { position: relative; padding-left: calc(var(--rail) + 40px); margin-top: 28px; }
.log__month:first-child { margin-top: 0; }
.log__month span { font-family: var(--font-title); font-size: clamp(44px, 6vw, 84px); font-weight: 800; letter-spacing: -.04em; line-height: 1; color: transparent; -webkit-text-stroke: 1px rgba(232, 201, 154, .45); }

.entry { position: relative; display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); align-items: start; }
.entry__date { padding: 30px 32px 0 0; text-align: right; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3); transition: color .4s; }
.entry::before { content: ""; position: absolute; left: var(--rail); top: 34px; z-index: 1; width: 14px; height: 14px; margin-left: -7px; border: 2px solid var(--line-2); border-radius: 50%; background: var(--bg); transition: border-color .4s, background-color .4s, box-shadow .4s, transform .4s var(--ease); }
.entry.is-lit::before { border-color: var(--sat); background: var(--sat); box-shadow: 0 0 0 5px rgba(232, 201, 154, .16), 0 0 18px rgba(232, 201, 154, .6); transform: scale(1.1); }
.entry.is-lit .entry__date { color: var(--sat); }

.entry__card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; align-items: center; margin-left: 40px; padding: 26px 28px; border: 1px solid var(--line); border-radius: 22px; background: radial-gradient(500px circle at var(--mx, 0%) var(--my, 0%), rgba(232, 201, 154, .08), transparent 60%), var(--dock); font-family: var(--font-tram); transition: border-color .3s, transform .8s var(--ease); }
.entry__card:has(.entry__media) { grid-template-columns: minmax(0, 1fr) minmax(0, 300px); }
.entry__card:hover { border-color: rgba(232, 201, 154, .4); }
.entry__copy { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.entry__copy h3 { font-family: var(--font-title); font-size: clamp(22px, 2vw, 28px); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.entry__copy p { color: var(--fg-2); font-size: 15px; }
.entry__tag { display: inline-flex; align-items: center; gap: 8px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--c); }
.entry__tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.entry__tag--tram { --c: var(--lav); }
.entry__tag--dock { --c: var(--orange); }
.entry__tag--otelow { --c: #9fd0ff; }
.entry__tag--olvyra { --c: #b9b5ad; }
.entry__tag--now { --c: var(--sat); }
.entry__link { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; font-size: 14px; font-weight: 700; color: var(--fg); }
.entry__link .icon { width: 15px; height: 15px; transition: transform .25s var(--ease); }
.entry__link:hover .icon { transform: translate(2px, -2px); }
.entry__media { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border: 1px solid var(--line-2); border-radius: 14px; transition: transform .6s var(--ease); }
video.entry__media { object-position: 50% 8%; }   /* le haut du T et de son anneau restent dans le cadre */
.entry__card:hover .entry__media { transform: scale(1.03) rotate(-.6deg); }

/* Les cartes arrivent de la droite, le point de « Aujourd'hui » bat */
.log .entry.reveal { transform: none; }
.log .entry.reveal:not(.is-in) .entry__card { transform: translateX(28px); }
.entry--now .entry__card { border-color: rgba(232, 201, 154, .4); background: radial-gradient(120% 140% at 0% 0%, rgba(232, 201, 154, .14), transparent 60%), var(--dock); }
.entry--now.is-lit::before { animation: now 2s ease-in-out infinite; }
@keyframes now { 50% { box-shadow: 0 0 0 12px rgba(232, 201, 154, 0), 0 0 28px rgba(232, 201, 154, .9); } }
/* L'allumage (etapes.js pose .is-live sur .log, hors mouvement réduit) : la tête du tracé laisse une traînée qui s'allonge avec la vitesse,
   chaque point lance une onde et des étincelles, un fil relie le point à sa carte, un faisceau fait le tour de la carte et l'image se dévoile */
.log__head::before { content: ""; position: absolute; left: 50%; bottom: 50%; width: 2px; height: calc(20px + var(--v, 0) * 1px); margin-left: -1px; border-radius: 2px; background: linear-gradient(to top, #fff6e6, rgba(232, 201, 154, 0)); transform: scaleY(var(--dir, 1)); transform-origin: bottom; }
.log__spark { position: absolute; left: var(--rail); z-index: 2; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%; background: #fff6e6; box-shadow: 0 0 8px 1px var(--sat); pointer-events: none; animation: spark .9s cubic-bezier(.15, .7, .3, 1) forwards; }
@keyframes spark { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }
.entry::after { content: ""; position: absolute; left: var(--rail); top: 34px; width: 14px; height: 14px; margin-left: -7px; border: 1px solid var(--sat); border-radius: 50%; opacity: 0; pointer-events: none; }
.log.is-live .entry.is-lit::after { animation: ring 1s var(--ease) forwards; }
@keyframes ring { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(5); } }

.entry__card { position: relative; }
.entry__card::before { content: ""; position: absolute; top: 40px; left: -34px; width: 34px; height: 1px; background: linear-gradient(90deg, var(--sat), rgba(232, 201, 154, .25)); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease) .1s; }
.entry.is-lit .entry__card::before { transform: scaleX(1); }
.entry.is-lit .entry__card { border-color: rgba(232, 201, 154, .2); }
.entry__card::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: linear-gradient(105deg, transparent 35%, var(--sat) 50%, transparent 65%) 150% 0 / 300% 100% no-repeat; -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; pointer-events: none; }
.log.is-live .entry.is-lit .entry__card::after { animation: beam 1.5s var(--ease) .15s; }
@keyframes beam { 0% { opacity: 0; background-position: 150% 0; } 15%, 80% { opacity: 1; } 100% { opacity: 0; background-position: -50% 0; } }

.log.is-live .entry__media { clip-path: inset(0 100% 0 0 round 14px); transition: clip-path 1.1s var(--ease) .2s, transform .6s var(--ease); }
.log.is-live .entry.is-lit .entry__media { clip-path: inset(0 0 0 0 round 14px); }

/* Les mois se remplissent d'or de gauche à droite en montant vers le tracé (--f, posé par etapes.js) */
.log__month span { display: inline-block; background: linear-gradient(90deg, var(--sat), #fff6e6) 0 0 / calc(var(--f, 0) * 100%) 100% no-repeat; -webkit-background-clip: text; background-clip: text; transform: translateX(calc((1 - var(--f, 1)) * 64px)); }

/* « Aujourd'hui » : un éclat d'or tourne autour de la carte */
@property --a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.entry--now .entry__card::after, .log.is-live .entry--now.is-lit .entry__card::after { opacity: 1; background: conic-gradient(from var(--a), transparent 0 62%, rgba(232, 201, 154, .2) 75%, #fff6e6 88%, transparent 100%); animation: orbit 5s linear infinite; }
@keyframes orbit { to { --a: 360deg; } }

/* --- Arrivée · Contact ----------------------------------------------- */

.contact { padding-top: 200px; padding-bottom: max(160px, 60vh); }   /* assez de page sous l'Arrivée pour que la sonde (45 % de l'écran) l'atteigne */
.contact__inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 36px; }
.contact .title { max-width: 14ch; font-size: clamp(52px, 5.4vw, 72px); }

/* --- Pied de page · Fin du tracé ----------------------------------- */

.footer {
  position: relative;
  z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 48px var(--gutter) 40px;
  text-align: center;
}
.footer ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; }
.footer a:hover, .footer button:hover { color: var(--fg); }
.footer button { cursor: pointer; }

/* --- Repères de coin --------------------------------------------- */

.hud { position: fixed; bottom: 32px; z-index: 3; pointer-events: none; transition: opacity .2s; line-height: 1.6; background: rgba(13, 13, 15, .85); padding: 2px 6px; margin: 0 -6px; }
.hud--bl { left: 32px; }
.hud--br { right: 32px; text-align: right; }
.hud--br span { display: block; }
.hud::after { content: ""; display: inline-block; width: 1px; height: 8px; margin-left: 8px; background: currentColor; vertical-align: 0; }
.hud__station { color: var(--accent); transition: color .4s; }
body[data-footer] .hud { opacity: 0; }
@media (min-width: 1441px) { .hud { font-size: 12px; } }

/* --- Intro · Calage du cap --------------------------------------------- */

html.is-intro, html.is-intro body { background: var(--bg-intro); overflow: hidden; }
html.is-intro .header, html.is-intro .page, html.is-intro .footer, html.is-intro .hud, html.is-intro #stations { opacity: 0; visibility: hidden; }
.header, .page, .footer, #stations { transition: opacity .3s, visibility .3s; }
html.is-intro #ciel { opacity: 0; }
html.is-intro.sky #ciel { opacity: 1; transition-duration: 1.6s; }   /* le ciel se lève lentement */

.intro {
  position: fixed; inset: 0; z-index: 10;
  display: grid; place-items: center; align-content: center;
  gap: 24px;
  padding: 0 var(--gutter);
  --blur: 12px;
  --shot: 2400ms;   /* le tir qui ouvre le passage précède l'anneau (SHOT dans main.js) */
}
.intro[hidden] { display: none; }
.intro__gl { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }   /* anneau et tunnel, en lumière */
.intro.fade { opacity: 0; transition: opacity .8s; }
.intro.skip *, .intro.skip *::before, .intro.skip *::after { animation-duration: 0s !important; animation-delay: 0s !important; transition: none !important; }

.intro__ctrl { position: fixed; top: 14px; right: var(--gutter); display: flex; gap: 8px; z-index: 11; }
.intro__hud { position: fixed; top: 22px; left: var(--gutter); display: flex; align-items: center; gap: 20px; opacity: 0; }
.intro.go .intro__hud { animation: fadein .6s .4s both; }
.intro__label { color: var(--fg-3); }
.intro__hud .probe { margin-right: 4px; }
.intro__status { color: var(--muted); }
@media (max-width: 640px) { .intro__hud { top: auto; bottom: 24px; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.intro__rule {
  position: fixed; top: calc(50% + 24px); left: 50%;
  width: 320px; margin-left: -160px;
  opacity: 0;
}
.intro.go .intro__rule { animation: rule-in .5s .2s var(--ease) both, rule-out .4s 2s forwards; }   /* la visée suit le tir */
.intro__ticks { width: 100%; height: 16px; transform-origin: left; }
.intro.go .intro__ticks { animation: draw .5s .2s var(--ease) both; }
.intro__ticks line { stroke: var(--line-2); stroke-width: 1; }
.intro__ticks line.big { stroke: var(--muted); }
.intro__cursor { position: absolute; top: 0; left: 0; width: 2px; height: 14px; background: var(--orange); }
.intro.go .intro__cursor { animation: seek 1.4s .4s both; }
.intro__rule .mono { position: absolute; top: 22px; }
.intro__rule .mono:nth-of-type(1) { left: 0; }
.intro__rule .mono:nth-of-type(2) { left: 50%; transform: translateX(-50%); }
.intro__rule .mono:nth-of-type(3) { right: 0; }
@keyframes rule-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rule-out { from { opacity: 1; } to { opacity: 0; visibility: hidden; } }
@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes seek { 0% { left: 0; } 50% { left: 100%; } 80% { left: 22%; } 95% { left: 55%; } 100% { left: 52%; } }

.intro__title {
  display: flex;
  font-family: var(--font-title);
  font-weight: 800;
  font-stretch: 125%;
  letter-spacing: -.03em;
  font-size: clamp(52px, 14vw, 236px);
  line-height: .9;
  margin-top: 24px;
}
.intro__title span {
  display: block;
  opacity: 0;
  will-change: transform, filter;
}
.intro.go .intro__title { animation: dive 1s calc(var(--shot) + 9.25s) cubic-bezier(.5, 0, .85, .4) forwards; }   /* 7,55 s + le ralenti (LAG dans main.js) : le titre file vers nous quand on plonge */
.intro.go .intro__title span { animation: letter .6s var(--ease) both; animation-delay: calc(var(--shot) + 4300ms + var(--i) * 120ms); }
@keyframes away { to { opacity: 0; transform: scale(1.12); filter: blur(10px); } }
@keyframes dive { to { opacity: 0; transform: scale(1.7); filter: blur(14px); } }
@keyframes letter {
  from { opacity: 0; transform: scale(.55); filter: blur(var(--blur)); text-shadow: -8px 0 var(--lav), 8px 0 var(--orange); }   /* chaque lettre arrive du fond */
  to { opacity: 1; transform: none; filter: none; text-shadow: 0 0 transparent; }
}
.intro__sub { font-family: var(--font-tram); font-weight: 500; font-size: 18px; color: var(--fg-2); text-align: center; opacity: 0; }
.intro.go .intro__sub { animation: rise .6s calc(var(--shot) + 5.1s) var(--ease) both, away .7s calc(var(--shot) + 9.05s) var(--ease) forwards; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

  display: flex; flex-direction: column; justify-content: center; gap: 4px;
  height: 96px; padding: 0 var(--gutter);
  font-family: var(--font-tram); font-weight: 700; font-size: 22px;
  transform: translateY(110%);
}

/* Arrivée : après l'intro, le site apparaît par couches */
html.arrive .header { animation: arrive 1.2s .5s both; }
html.arrive .hero .kicker { animation: arrive-rise 1s .7s var(--ease) both; }
html.arrive .hero .h1 { animation: arrive-rise 1.1s .85s var(--ease) both; }
html.arrive .hero .lede { animation: arrive-rise 1s 1.05s var(--ease) both; }
html.arrive .hero__actions { animation: arrive-rise 1s 1.2s var(--ease) both; }
html.arrive .map { animation: arrive-rise 1.2s 1.35s var(--ease) both; }
html.arrive .hud, html.arrive #stations { animation: arrive 1s 1.7s both; }
@keyframes arrive { from { opacity: 0; } }
@keyframes arrive-rise { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } }

/* --- Apparition au défilement ------------------------------------- */

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* --- Responsive ------------------------------------------------------ */

@media (max-width: 1023px) {
  :root { --gutter: 20px; }
  .h1 { font-size: 52px; }
  .h2 { font-size: 38px; }
  .contact .title { font-size: 52px; }
  .hero { grid-template-columns: 1fr; gap: 48px; min-height: 0; padding-top: 120px; }
  .map { max-width: 420px; }
  .section--cross { margin-top: 96px; }
  .contact { padding-top: 120px; }
  .showcase, .dock-intro, .lab, .tour__row { grid-template-columns: 1fr; }
  .lab { padding: 16px; gap: 16px; }
  .lab-head { margin-top: 72px; }
  .tour__row--flip .tour__media { order: 0; }
  .tour { gap: 72px; margin: 72px 0; }
  .tour__row { gap: 28px; }
  .tmark { width: 200px; border-radius: 24px; }
  .showcase { padding: 24px; gap: 32px; }
  .works { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .log { --rail: 120px; }
  .entry__card:has(.entry__media) { grid-template-columns: 1fr; }
  .entry__media { max-width: 420px; }
  .header .btn--outline span { display: none; }
  .header .btn--outline { padding: 0 12px; }
  .menu__toggle { display: inline-flex; }
  .nav { display: none; position: absolute; right: 0; top: calc(100% + 8px); flex-direction: column; gap: 4px; min-width: 220px; padding: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 20px; }
  .menu[open] .nav { display: flex; }
  .st span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  #sonde::before { inset: -10px; }
  .hud--br { display: none; }
  .hud--bl { left: 20px; bottom: 20px; }
  .intro { --blur: 0px; }
  .intro__rule { width: 220px; margin-left: -110px; }
  .intro__ctrl .btn { padding: 0 12px; }
}

@media (max-width: 480px) {
  .btn { width: 100%; justify-content: center; }
  .intro__ctrl .btn, .header .btn, .nav a, .footer .btn { width: auto; }
  .hero__actions .btn, .actions .btn { width: 100%; }
}

@media (max-width: 640px) {
  .works { grid-template-columns: 1fr; }
  .subhead { margin-top: 56px; }
  .tram-head { flex-direction: column-reverse; align-items: flex-start; gap: 0; }
  .tmark { width: 160px; margin-bottom: 20px; }
  .editor { font-size: 11.5px; }
  .editor__body .l::before { width: 32px; padding-right: 12px; }
  .lab { padding: 0; border: 0; background: none; }
  .preview__screen { grid-template-columns: 1fr; min-height: 0; padding: 16px 18px 22px; }
  .pv-art--vitrine { width: 60%; justify-self: center; }
  .pv-art--boutique { gap: 8px; }
  .stats dd { font-size: 28px; }
  .stats { gap: 12px 28px; }
  .dock-cta { padding: 24px; }
  .log { --rail: 9px; }
  .log .entry.reveal:not(.is-in) .entry__card { transform: translateY(16px); }
  .entry { grid-template-columns: 1fr; padding-left: 32px; }
  .entry::before, .entry::after { top: 3px; }
  .entry__card::before { display: none; }
  .entry__date { padding: 0 0 10px; text-align: left; }
  .entry__card { margin-left: 0; padding: 20px; gap: 18px; }
  .log__month { padding-left: 32px; }
  .log-head .stats { margin-bottom: 32px; }
}

/* --- Mouvement réduit ----------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .stage img { transform: none; }
  #sonde::before { transform: scale(.85); }
}

/* =====================================================================
   Version Système : voyage lumineux dans le système solaire
   ===================================================================== */

#sonde { display: none; }                      /* la sonde est dessinée dans le canvas, en comète */
.hero { grid-template-columns: minmax(0, 1fr) 40%; }
.hero__copy { position: relative; z-index: 1; }

/* Calque des étiquettes d'étape, au-dessus du canvas */
#scene { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }

/* Étiquette d'étape : un repère de télémétrie, posé au bout du trait qui part de la planète */
.tag {
  position: absolute; left: 0; top: 0;
  display: flex; flex-direction: column; gap: 4px;
  padding: 0 0 8px 12px;
  border-left: 1px solid var(--tag, var(--lav));
  white-space: nowrap;
}
.tag .mono { font-size: 10px; letter-spacing: .14em; color: var(--tag, var(--lav)); text-transform: uppercase; }
.tag b { font-family: var(--font-title); font-weight: 600; font-size: 22px; line-height: 1; color: var(--fg); text-shadow: 0 0 18px rgba(13, 13, 15, .9); }

/* L'intro laisse voir le canvas : son fond reste transparent */
html.is-intro, html.is-intro body { background: var(--bg-intro); }
.intro__title { text-shadow: 0 0 40px rgba(10, 10, 11, .9); }

@media (max-width: 1023px) {
  .hero { grid-template-columns: 1fr; }
  .tag b { font-size: 18px; }
}

/* pages Mentions légales et Confidentialité */
.legal { max-width: 820px; margin: 0 auto; }
.legal .h2 { margin: 18px 0 10px; }
.legal h2 { font-weight: 700; font-size: 21px; margin: 40px 0 10px; }
.legal p:not(.mono), .legal li { color: var(--fg-2); font-family: var(--font-tram); font-size: 16px; line-height: 1.65; }
.legal p + p, .legal ul + p { margin-top: 10px; }
.legal ul { padding-left: 20px; list-style: disc; display: grid; gap: 8px; margin-top: 10px; }
.legal strong { color: var(--fg); font-weight: 700; }
.legal a:not(.btn) { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.legal code { font-family: var(--font-mono); font-size: 14px; color: var(--fg); }
.legal__back { margin-top: 48px; }
