/* ==================================================================
   dolly.404 · Le cadre
   ------------------------------------------------------------------
   Presque tout est dans la scène WebGL. Ici : la typographie des
   repères autour du viseur, la navigation, le chargement, et la
   version texte (sans WebGL / lecteurs d'écran).
   Bodoni Moda   la voix (noms, titres)
   Space Mono    l'étiquette technique (repères du viseur)
================================================================== */

@font-face { font-family: "Bodoni Moda"; font-style: normal; font-weight: 400 900; font-display: swap; src: url(../fonts/bodoni-moda.woff2) format("woff2-variations"), url(../fonts/bodoni-moda.woff2) format("woff2"); }
@font-face { font-family: "Bodoni Moda"; font-style: italic; font-weight: 400 900; font-display: swap; src: url(../fonts/bodoni-moda-italic.woff2) format("woff2-variations"), url(../fonts/bodoni-moda-italic.woff2) format("woff2"); }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(../fonts/jost.woff2) format("woff2-variations"), url(../fonts/jost.woff2) format("woff2"); }
@font-face { font-family: "Space Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/space-mono-400.woff2) format("woff2"); }
@font-face { font-family: "Space Mono"; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/space-mono-700.woff2) format("woff2"); }
@font-face { font-family: "Special Elite"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/special-elite.woff2) format("woff2"); }
@font-face { font-family: "Permanent Marker"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/permanent-marker.woff2) format("woff2"); }

:root {
  --paper: #F3F1EB;
  --ink: #0C0C0B;
  --ink-2: rgba(12, 12, 11, 0.62);
  --ink-3: rgba(12, 12, 11, 0.4);
  --red: #D42A1C;
  --f-disp: "Bodoni Moda", Didot, Georgia, serif;
  --f-mono: "Space Mono", ui-monospace, Menlo, monospace;
  --f-body: Jost, "Helvetica Neue", Arial, sans-serif;
  --gx: clamp(16px, 2.2vw, 32px);
  --halo: 0 0 3px var(--paper), 0 0 8px var(--paper), 0 0 14px var(--paper);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.45 var(--f-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  overscroll-behavior: none;
}
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
kbd { font: inherit; opacity: 0.55; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 1.5px solid var(--red); outline-offset: 3px; }

#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: default; }
#gl.is-link { cursor: pointer; }
#gl.is-drag { cursor: grabbing; }

/* ---------- barre du haut ---------- */
.top {
  position: fixed; z-index: 5; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: calc(20px + env(safe-area-inset-top)) var(--gx) 0;
  pointer-events: none;
}
.top a { pointer-events: auto; text-decoration: none; text-shadow: var(--halo); }
.brand { font: italic 400 23px/1.25 var(--f-disp); letter-spacing: -0.01em; display: inline-block; }
.nav { display: flex; gap: clamp(14px, 2vw, 30px); font: 400 11px/1 var(--f-mono); letter-spacing: 0.1em; text-transform: uppercase; }
.nav a { position: relative; padding: 6px 0; color: var(--ink-2); transition: color 0.3s; }
.nav a:hover, .nav a[aria-current] { color: var(--ink); }
.nav a[aria-current]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1.5px; background: var(--red);
}

/* ---------- repères du viseur ---------- */
.labels { position: fixed; inset: 0; z-index: 3; pointer-events: none; }
.lb {
  position: fixed; left: 0; top: 0; margin: 0;
  font: 400 11px/1.35 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase;
  white-space: nowrap; text-shadow: var(--halo);
  will-change: transform; transition: opacity 0.35s;
}
.lb p { margin: 0; }
.lb-title { font: italic 400 clamp(20px, 2vw, 28px)/1.2 var(--f-disp); letter-spacing: 0; text-transform: none; }
.lb-meta { margin-top: 5px !important; color: var(--ink-2); }
.lb-tr { color: var(--ink-2); }
.labels.swap .lb { opacity: 0; }
body.is-plan .lb-meta, body.is-plan .lb-tr { display: none; }
body.is-plan .hint { opacity: 0; }
body.is-open .lb-meta, body.is-open .lb-tl, body.is-open .lb-tr { opacity: 0; }

.act { z-index: 4; display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; pointer-events: auto; }
.act a, .act button { text-decoration: none; letter-spacing: 0.08em; text-transform: uppercase; padding: 4px 0; border-bottom: 1px solid var(--ink-3); transition: border-color 0.25s; }
.act a:hover, .act button:hover { border-color: var(--red); }
.act .mail { font: italic 400 17px/1 var(--f-disp); text-transform: none; letter-spacing: 0; }
.act .act-note { color: var(--ink-2); text-transform: none; letter-spacing: 0.02em; }

/* ---------- échelle des stations ---------- */
.scale {
  position: fixed; z-index: 4; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex; align-items: flex-end; height: 26px;
}
.scale button { position: relative; width: 13px; height: 26px; }
.scale button::before {
  content: ""; position: absolute; left: 6px; bottom: 4px; width: 1px; height: 7px;
  background: var(--ink); opacity: 0.45; transition: height 0.3s, opacity 0.3s;
}
.scale button.t::before { height: 4px; }
.scale button.gap { margin-left: 10px; }
.scale button:hover::before, .scale button.cur::before { opacity: 1; height: 13px; }
.scale-pos { position: absolute; left: 0; bottom: 0; width: 7px; height: 2px; margin-left: 3px; background: var(--red); will-change: transform; }

.hint {
  position: fixed; z-index: 4; left: var(--gx); bottom: calc(18px + env(safe-area-inset-bottom)); margin: 0;
  font: 400 10.5px/1 var(--f-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2);
  text-shadow: var(--halo); transition: opacity 0.6s;
}
.hint.off { opacity: 0; }

.tip {
  position: fixed; z-index: 6; left: 0; top: 0; margin: 0; pointer-events: none;
  font: 400 10.5px/1 var(--f-mono); letter-spacing: 0.1em; text-transform: uppercase;
  background: var(--ink); color: var(--paper); padding: 5px 7px 4px;
  opacity: 0; transition: opacity 0.2s;
}
.tip.on { opacity: 1; }

/* ---------- chargement ---------- */
.boot {
  position: fixed; inset: 0; z-index: 10; background: var(--paper);
  display: grid; place-content: center; justify-items: center; gap: 14px;
  transition: opacity 0.7s, visibility 0s 0.7s;
}
.boot p { margin: 0; }
.boot-b { font: italic 400 clamp(40px, 6vw, 72px)/1.2 var(--f-disp); padding: 6px 12px; }
.boot-l { font: 400 11px/1 var(--f-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); }
body.is-in .boot { opacity: 0; visibility: hidden; }

/* avant l'ouverture du cadre, les repères attendent */
body:not(.is-ready) .labels, body:not(.is-ready) .act, body:not(.is-ready) .scale, body:not(.is-ready) .hint, body:not(.is-ready) .nav { opacity: 0; }
.labels, .act, .scale, .hint, .nav { transition: opacity 0.8s; }

/* ---------- version texte ---------- */
.flat { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
body.no-gl { overflow: auto; }
body.no-gl #gl, body.no-gl .labels, body.no-gl .act, body.no-gl .scale, body.no-gl .hint, body.no-gl .boot, body.no-gl .nav { display: none; }
body.no-gl .flat { position: static; width: auto; height: auto; clip: auto; overflow: visible; max-width: 720px; margin: 0 auto; padding: 96px var(--gx) 80px; }
body.no-gl .flat h1 { font: italic 400 56px/1 var(--f-disp); margin: 0 0 12px; }
body.no-gl .flat h2 { font: 400 13px/1 var(--f-mono); letter-spacing: 0.12em; text-transform: uppercase; margin: 56px 0 14px; }
body.no-gl .flat dt { font: italic 400 20px/1.2 var(--f-disp); margin-top: 14px; }
body.no-gl .flat dd { margin: 4px 0 0; }
.noscript { position: fixed; inset: auto 0 0; padding: 16px var(--gx); font: 400 12px/1.4 var(--f-mono); }

@media (max-width: 760px) {
  .brand { font-size: 20px; }
  .nav { gap: 12px; font-size: 10px; letter-spacing: 0.06em; }
  .lb { font-size: 10px; }
  .lb-title { font-size: 19px; }
  .hint { display: none; }
  .scale button { width: 11px; }
  .scale button::before { left: 5px; }
  .scale button.gap { margin-left: 6px; }
  .act { gap: 14px; }
  kbd { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0s !important; }
}
