/* Wahala City landing. A fixed 3D island inside a notched game frame, with the tour's text scrolling over it.
   Colours and the display font come from src/look.js, which writes the custom properties below onto <html>.
   The values here are the default (Tribal Broots on Adire indigo), so the page is right before any script runs. */

@font-face { font-family: "Tribal Broots"; src: url("./assets/fonts/TribalBroots.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Nomad Tribes"; src: url("./assets/fonts/NomadTribes.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Yoru"; src: url("./assets/fonts/Yoru.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Ciscela"; src: url("./assets/fonts/Ciscela-Regular.woff2") format("woff2"); font-display: swap; }

:root {
  --bg: #0c0d36;
  --bg-2: #161a55;
  --ink: #f1f2ff;
  --soft: #b4bcf5;
  --accent: #ff7a2f;
  --on-accent: #140c06;
  --line: #3a3d72;
  --line-2: #696da8;
  --water: #0a0b2c;
  --display: "Tribal Broots", "Archivo", system-ui, sans-serif;
  --display-scale: 1;
  --display-track: 0.01em;
  --sans: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --pad: clamp(20px, 5.5vw, 88px);
  --fi: 10px;          /* frame inset */
  --fc: 28px;          /* frame corner chamfer */
  --fn: 14px;          /* frame notch depth */
  --band: 0vh;         /* half-height of the intro's letterbox slit */
  --hud-b: max(22px, env(safe-area-inset-bottom));

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);     /* expo out */
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  --z-scene: 0; --z-scrim: 1; --z-tags: 2; --z-main: 3; --z-hud: 5; --z-intro: 20; --z-lab: 30;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16.5px; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; transition: background-color .6s ease, color .6s ease; }
html.pre, html.pre body { overflow: hidden; height: 100%; }
a { color: inherit; }
p, h1, h2, h3, dl, dd, ul { margin: 0; }
button { font: inherit; color: inherit; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 1em; height: 1em; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 999px; }

/* ───────── the scene, cut into a notched frame ───────── */
#scene {
  position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: var(--z-scene);
  clip-path: polygon(
    var(--fi) calc(var(--fi) + var(--fc)), calc(var(--fi) + var(--fc)) var(--fi),
    calc(100% - var(--fi) - var(--fc)) var(--fi), calc(100% - var(--fi)) calc(var(--fi) + var(--fc)),
    calc(100% - var(--fi)) 30%, calc(100% - var(--fi) - var(--fn)) calc(30% + var(--fn)),
    calc(100% - var(--fi) - var(--fn)) calc(46% - var(--fn)), calc(100% - var(--fi)) 46%,
    calc(100% - var(--fi)) calc(100% - var(--fi) - var(--fc)), calc(100% - var(--fi) - var(--fc)) calc(100% - var(--fi)),
    calc(var(--fi) + var(--fc)) calc(100% - var(--fi)), var(--fi) calc(100% - var(--fi) - var(--fc)),
    var(--fi) 72%, calc(var(--fi) + var(--fn)) calc(72% - var(--fn)),
    calc(var(--fi) + var(--fn)) calc(56% + var(--fn)), var(--fi) 56%);
  transition: clip-path 1.6s var(--ease-out);
}
/* before you enter, the island is a sliver: a letterbox slit across the middle of the screen */
html.pre #scene {
  clip-path: polygon(
    var(--fi) calc(50% - var(--band)), var(--fi) calc(50% - var(--band)),
    calc(100% - var(--fi)) calc(50% - var(--band)), calc(100% - var(--fi)) calc(50% - var(--band)),
    calc(100% - var(--fi)) 50%, calc(100% - var(--fi)) 50%,
    calc(100% - var(--fi)) 50%, calc(100% - var(--fi)) 50%,
    calc(100% - var(--fi)) calc(50% + var(--band)), calc(100% - var(--fi)) calc(50% + var(--band)),
    var(--fi) calc(50% + var(--band)), var(--fi) calc(50% + var(--band)),
    var(--fi) 50%, var(--fi) 50%,
    var(--fi) 50%, var(--fi) 50%);
  transition: clip-path 1.4s var(--ease-out);
}
html.pre.ready { --band: clamp(56px, 11vh, 120px); }
body.nogl #scene { display: none; }

/* small registration ticks just outside the frame, like a camera's viewfinder */
.frame-ticks { position: fixed; inset: 0; z-index: var(--z-scrim); pointer-events: none; opacity: 1; transition: opacity 1s ease .6s; }
.frame-ticks::before, .frame-ticks::after { content: ""; position: absolute; top: 50%; width: 3px; height: 64px; translate: 0 -50%; background: repeating-linear-gradient(180deg, var(--line-2) 0 1px, transparent 1px 8px); }
.frame-ticks::before { left: 3px; }
.frame-ticks::after { right: 3px; }
html.pre .frame-ticks { opacity: 0; transition-delay: 0s; }

.scrim { position: fixed; inset: 0; z-index: var(--z-scrim); pointer-events: none; opacity: 0; }
.scrim-l { background: linear-gradient(90deg, color-mix(in srgb, var(--bg) 94%, transparent) 0%, color-mix(in srgb, var(--bg) 74%, transparent) 30%, color-mix(in srgb, var(--bg) 30%, transparent) 46%, transparent 60%); }
.scrim-r { background: linear-gradient(270deg, color-mix(in srgb, var(--bg) 94%, transparent) 0%, color-mix(in srgb, var(--bg) 74%, transparent) 30%, color-mix(in srgb, var(--bg) 30%, transparent) 46%, transparent 60%); }
/* behind a title in the middle of the frame */
.scrim-c { background: radial-gradient(ellipse 46% 40% at 50% 52%, color-mix(in srgb, var(--bg) 78%, transparent) 0%, color-mix(in srgb, var(--bg) 46%, transparent) 55%, transparent 100%); transition: opacity .3s linear; }
.scrim-b { background: linear-gradient(0deg, color-mix(in srgb, var(--bg) 92%, transparent) 0%, color-mix(in srgb, var(--bg) 70%, transparent) 34%, transparent 64%); }
/* the HUD along the bottom always gets a little shade to sit on */
body::after { content: ""; position: fixed; left: 0; right: 0; bottom: 0; height: 22vh; z-index: var(--z-scrim); pointer-events: none; background: linear-gradient(0deg, color-mix(in srgb, var(--bg) 70%, transparent), transparent); }

/* ───────── place markers pinned to the model ───────── */
#tags { position: fixed; inset: 0; z-index: var(--z-tags); pointer-events: none; overflow: hidden; }
.tag { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; opacity: 0; transition: opacity .45s ease; will-change: transform, opacity; }
.tag.on { opacity: 1; }
.t-label { white-space: nowrap; font-size: 12px; line-height: 1; font-weight: 600; font-stretch: 85%; letter-spacing: .02em; color: var(--ink); padding: 5px 9px; border-radius: 999px; background: color-mix(in srgb, var(--bg) 78%, transparent); border: 1px solid var(--line); transition: color .25s, background-color .25s, border-color .25s, transform .35s var(--ease-out); }
.t-line { width: 1px; height: 22px; background: linear-gradient(var(--line-2), var(--ink)); transform-origin: 50% 100%; transform: scaleY(0); transition: transform .5s var(--ease-out) .05s; }
.tag.on .t-line { transform: scaleY(1); }
.t-dot { width: 7px; height: 7px; rotate: 45deg; background: var(--accent); outline: 2px solid color-mix(in srgb, var(--bg) 60%, transparent); margin-top: -1px; }
.tag.big .t-label { font-family: var(--display); font-weight: 400; font-size: calc(22px * var(--display-scale)); letter-spacing: var(--display-track); padding: 7px 14px 6px; text-transform: uppercase; }
.tag.big .t-line { height: 46px; }
.tag.sea .t-label { background: none; border: 0; font-style: italic; font-weight: 500; font-stretch: 100%; letter-spacing: .22em; color: color-mix(in srgb, var(--ink) 55%, var(--water)); text-transform: uppercase; font-size: 11px; }
.tag.sea .t-line, .tag.sea .t-dot { display: none; }
.tag.hot .t-label { background: var(--accent); color: var(--on-accent); border-color: var(--accent); transform: translateY(-3px); }
html[data-palette="paper"] .tag.sea .t-label { color: #456; }

/* ───────── HUD: top ───────── */
.hud-top { position: fixed; z-index: var(--z-hud); left: 0; right: 0; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: calc(var(--fi) + 18px) calc(var(--fi) + 30px) 0; padding-top: max(calc(var(--fi) + 18px), env(safe-area-inset-top)); pointer-events: none; transition: opacity .8s ease .9s, transform 1s var(--ease-out) .9s; }
.hud-top > * { pointer-events: auto; }
html.pre .hud-top { opacity: 0; transform: translateY(-10px); transition-delay: 0s; }
.mark { font-family: var(--display); font-size: calc(24px * var(--display-scale)); letter-spacing: var(--display-track); line-height: 1; text-decoration: none; text-transform: uppercase; padding: 6px 2px; }
html[data-font="ciscela"] .mark { text-transform: none; }

.sound-toggle { display: inline-flex; align-items: center; gap: 9px; height: 40px; padding: 0 16px 0 13px; border-radius: 999px; border: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 60%, transparent); cursor: pointer; font-size: 12.5px; font-weight: 650; font-stretch: 80%; letter-spacing: .08em; text-transform: uppercase; transition: border-color .25s, background-color .25s, color .25s; }
.sound-toggle:hover { border-color: var(--line-2); }
.sound-toggle svg { font-size: 17px; }
.sound-toggle .on, .sound-toggle[aria-pressed="true"] .off { display: none; }
.sound-toggle[aria-pressed="true"] .on { display: block; color: var(--accent); }
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.eq i { width: 2px; height: 3px; border-radius: 2px; background: currentColor; opacity: .5; }
.sound-toggle[aria-pressed="true"] .eq i { opacity: 1; background: var(--accent); animation: eq 1s ease-in-out infinite alternate; }
.eq i:nth-child(2) { animation-delay: -.4s !important; animation-duration: .8s !important; }
.eq i:nth-child(3) { animation-delay: -.7s !important; animation-duration: 1.15s !important; }
.eq i:nth-child(4) { animation-delay: -.2s !important; animation-duration: .9s !important; }
@keyframes eq { from { height: 3px; } to { height: 12px; } }

.progress { position: absolute; left: calc(var(--fi) + var(--fc)); right: calc(var(--fi) + var(--fc)); top: calc(var(--fi) - 1px); height: 2px; }
.progress i { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }

/* ───────── HUD: bottom (readouts in the corners, the tour ruler in the middle) ───────── */
.hud-bottom { position: fixed; z-index: var(--z-hud); left: 0; right: 0; bottom: var(--hud-b); display: flex; justify-content: space-between; padding: 0 calc(var(--fi) + 30px); pointer-events: none; transition: opacity .8s ease 1.1s; }
html.pre .hud-bottom, html.pre .rail, html.at-foot .hud-bottom, html.at-foot .rail { opacity: 0; transition-delay: 0s; }
html.at-foot .rail { pointer-events: none; }
/* over the footer's text the top bar needs its own backing */
html.at-foot .hud-top { background: linear-gradient(var(--bg) 62%, transparent); padding-bottom: 18px; transition: background-color .3s; }
.ro { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-stretch: 80%; font-weight: 500; letter-spacing: .03em; color: var(--soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ro svg { font-size: 14px; color: var(--accent); }
.ro b { font-weight: 650; color: var(--ink); }
.ro-clock { padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); }

.rail { position: fixed; z-index: var(--z-hud); left: 50%; bottom: calc(var(--hud-b) - 4px); translate: -50% 0; width: min(620px, calc(100vw - 560px)); transition: opacity .8s ease 1.2s; }
.rail ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; position: relative; }
.rail li { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.rail .ch-label { font-size: 11.5px; font-stretch: 80%; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); text-decoration: none; white-space: nowrap; transition: color .25s; }
.rail li.on .ch-label, .rail .ch-label:hover { color: var(--ink); }
.ticks { display: flex; justify-content: space-around; align-items: flex-end; height: 16px; background: repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 7px) 0 100% / 100% 5px no-repeat; }
.tick { all: unset; position: relative; width: 9px; height: 16px; cursor: pointer; display: flex; justify-content: center; align-items: flex-end; }
.tick::before { content: ""; width: 1px; height: 9px; background: var(--line-2); transition: height .35s var(--ease-out), background-color .25s, width .25s; }
.tick:hover::before { height: 13px; background: var(--ink); }
.tick.on::before { height: 16px; width: 3px; border-radius: 2px; background: var(--accent); }
.tick:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.needle { position: absolute; bottom: -6px; left: 0; width: 1px; height: 4px; background: var(--accent); pointer-events: none; }

/* ───────── the tour ───────── */
main { position: relative; z-index: var(--z-main); }
.beat { min-height: 190vh; padding: 0 var(--pad); display: flex; align-items: flex-start; }
.copy { position: sticky; top: 0; height: 100vh; height: 100svh; width: 100%; display: flex; align-items: flex-end; padding-bottom: max(118px, 15vh); pointer-events: none; }
.beat.r .copy { justify-content: flex-end; }
.inner { pointer-events: auto; width: min(440px, 100%); opacity: 0; transform: translateY(16px); transition: opacity .55s ease, transform .9s var(--ease-out); }
.beat.on .inner { opacity: 1; transform: none; }

h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: var(--display-track); text-transform: uppercase; text-wrap: balance; }
html[data-font="ciscela"] :is(h1, h2, h3, .mark, .foot-logo, .intro-mark) { text-transform: none; }

/* a place: a dossier pinned to one side, low in the frame */
.where { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 13px; font-weight: 600; font-stretch: 80%; letter-spacing: .03em; color: var(--soft); }
.where svg { font-size: 15px; color: var(--accent); margin-right: -2px; }
.where span + span:not(.coord)::before { content: "/"; margin-right: 8px; color: var(--line-2); }
.where .coord { margin-left: auto; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--line-2); }
.dossier { padding-top: 14px; border-top: 1px solid var(--line-2); }
.place { font-size: calc(clamp(44px, 5vw, 72px) * var(--display-scale)); line-height: .9; margin: 14px 0 16px; }
.beat .dossier > p:not(.where) { color: color-mix(in srgb, var(--ink) 82%, var(--soft)); max-width: 44ch; text-wrap: pretty; }

.pins { list-style: none; padding: 0; margin-top: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.pins li { display: flex; align-items: center; gap: 9px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; font-weight: 500; line-height: 1.3; color: var(--soft); transition: color .2s; }
.pins li::before { content: ""; flex: none; width: 6px; height: 6px; rotate: 45deg; border: 1px solid var(--line-2); transition: background-color .2s, border-color .2s; }
.pins li.mapped { color: var(--ink); cursor: default; }
.pins li.mapped::before { background: var(--accent); border-color: var(--accent); }
.pins li.mapped:hover { color: var(--accent); }

.legend { margin-top: 22px; display: grid; gap: 0; font-size: 14.5px; }
.legend div { display: flex; align-items: baseline; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); }
.legend dt { color: var(--soft); }
.legend div::after { content: ""; order: 2; flex: 1; border-bottom: 1px dotted var(--line-2); translate: 0 -4px; }
.legend dd { order: 3; font-family: var(--display); font-size: calc(21px * var(--display-scale)); letter-spacing: var(--display-track); line-height: 1; font-variant-numeric: tabular-nums; }

/* chapter openers, the hero and the outro sit in the middle of the frame */
:is(.hero, .chapter, .outro) .copy { align-items: center; justify-content: center; padding-bottom: 0; text-align: center; }
:is(.hero, .chapter, .outro) .inner { width: min(980px, 100%); display: flex; flex-direction: column; align-items: center; }

.chapter .inner { transform: scale(.96); filter: blur(6px); transition: opacity .6s ease, transform 1.1s var(--ease-out), filter .8s var(--ease-out); }
.chapter.on .inner { transform: none; filter: none; }
.ch-no { display: flex; align-items: baseline; gap: 2px; font-size: 14px; font-weight: 600; font-stretch: 80%; letter-spacing: .06em; color: var(--soft); font-variant-numeric: tabular-nums; }
.ch-no b { color: var(--accent); font-weight: 700; }
.chapter h2 { font-size: calc(clamp(60px, 8.4vw, 116px) * var(--display-scale)); line-height: .88; margin: 14px 0 10px; }
.ch-where { font-size: 14px; font-weight: 600; font-stretch: 80%; letter-spacing: .05em; color: var(--soft); }
.lede { font-size: clamp(18px, 1.55vw, 22px); line-height: 1.42; color: var(--ink); max-width: 32ch; text-wrap: balance; margin-top: 18px; }

.hero { min-height: 160vh; }
.presents { font-size: 13.5px; font-weight: 600; font-stretch: 80%; letter-spacing: .1em; text-transform: uppercase; color: var(--soft); }
.logo { display: flex; flex-direction: column; align-items: center; line-height: .82; margin: 18px 0 6px; }
.logo-1 { font-size: calc(clamp(76px, 12.5vw, 176px) * var(--display-scale)); }
.logo-2 { display: flex; align-items: center; gap: .45em; font-size: calc(clamp(36px, 5.2vw, 72px) * var(--display-scale)); color: var(--accent); margin-top: .12em; }
.logo-2::before, .logo-2::after { content: ""; width: 1.6em; height: 2px; background: currentColor; }
.logo .ch { display: inline-block; }
.logo .word { display: inline-flex; }
.hero .wbtn, .outro .wbtn { margin-top: 34px; }

.outro { min-height: 130vh; }
.outro h2 { font-size: calc(clamp(48px, 6.6vw, 96px) * var(--display-scale)); line-height: .92; max-width: 13ch; }

/* ───────── buttons: a pill with a stitched inner ring; the fill bursts in from where the pointer enters ───────── */
.wbtn {
  --h: 58px;
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; gap: 16px; height: var(--h); padding: 0 8px 0 28px;
  border-radius: 999px; border: 1.5px solid var(--ink); background: color-mix(in srgb, var(--bg) 35%, transparent); color: var(--ink);
  font-family: var(--display); font-size: calc(18px * var(--display-scale)); letter-spacing: var(--display-track); line-height: 1; text-transform: uppercase; text-decoration: none; white-space: nowrap;
  cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none;
  transition: color .35s ease, border-color .35s ease, transform .3s var(--ease-out);
}
html[data-font="ciscela"] .wbtn { text-transform: none; }
.wbtn::before { content: ""; position: absolute; inset: 4px; border-radius: inherit; border: 1px dashed color-mix(in srgb, currentColor 42%, transparent); pointer-events: none; transition: inset .4s var(--ease-out); }
.wbtn-fill { position: absolute; inset: 0; z-index: -1; background-color: var(--accent); background-image: radial-gradient(circle, color-mix(in srgb, var(--on-accent) 20%, transparent) 1.1px, transparent 1.6px); background-size: 8px 8px; clip-path: circle(0% at var(--mx, 50%) var(--my, 50%)); transition: clip-path .6s var(--ease-out); }
.wbtn-label { position: relative; padding-top: .08em; }
.wbtn-knob { position: relative; display: grid; place-items: center; width: calc(var(--h) - 16px); height: calc(var(--h) - 16px); border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 20px; overflow: hidden; transition: background-color .35s ease, color .35s ease; }
.wbtn-knob svg { transition: transform .5s var(--ease-out); }
.wbtn:hover, .wbtn:focus-visible { color: var(--on-accent); border-color: var(--accent); }
.wbtn:hover::before, .wbtn:focus-visible::before { inset: 5px; }
.wbtn:hover .wbtn-fill, .wbtn:focus-visible .wbtn-fill { clip-path: circle(140% at var(--mx, 50%) var(--my, 50%)); }
.wbtn:hover .wbtn-knob, .wbtn:focus-visible .wbtn-knob { background: var(--on-accent); color: var(--accent); }
.wbtn:hover .wbtn-knob svg { animation: knob-slide .55s var(--ease-out); }
.wbtn:active { transform: scale(.965); }
.wbtn.ghost { border-color: var(--line-2); color: var(--soft); padding: 0 28px; background: transparent; }
.wbtn.ghost .wbtn-fill { background-color: var(--ink); background-image: none; }
.wbtn.ghost:hover, .wbtn.ghost:focus-visible { color: var(--bg); border-color: var(--ink); }
.wbtn:focus-visible { outline-offset: 4px; }
@keyframes knob-slide { 0% { transform: translateY(0); } 45% { transform: translateY(var(--slide, 130%)); } 46% { transform: translateY(calc(var(--slide, 130%) * -1)); } 100% { transform: translateY(0); } }
.wbtn[href="#top"] { --slide: -130%; }
[data-enter="sound"] { --slide: 0; }
[data-enter="sound"]:hover .wbtn-knob svg { animation: pulse .7s var(--ease-out); }
@keyframes pulse { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* ───────── footer ───────── */
footer { position: relative; z-index: var(--z-main); background: var(--bg); padding: 10vh var(--pad) var(--hud-b); overflow: hidden; }
/* release line: what's coming and where */
.soon { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 28px; padding-bottom: 5vh; margin-bottom: 5vh; border-bottom: 1px solid var(--line); }
.soon-title { display: flex; align-items: center; gap: .3em; font-size: calc(clamp(34px, 4.2vw, 60px) * var(--display-scale)); line-height: .9; }
.soon-dot { width: .22em; height: .22em; border-radius: 50%; background: var(--accent); flex: none; animation: soon-pulse 2.4s ease-in-out infinite; }
@keyframes soon-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.platforms { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.platforms li { display: inline-flex; align-items: center; height: 46px; padding: 0 22px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 14px; font-weight: 650; font-stretch: 80%; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
/* what the game is and who makes it, in plain words */
.about { display: grid; grid-template-columns: 1.6fr 1fr; gap: 28px 64px; padding-bottom: 6vh; margin-bottom: 5vh; border-bottom: 1px solid var(--line); }
.about h3 { font-size: calc(24px * var(--display-scale)); line-height: 1; margin-bottom: 12px; }
.about p { max-width: 62ch; color: color-mix(in srgb, var(--ink) 80%, var(--soft)); text-wrap: pretty; }
.about p + p { margin-top: 12px; }
.foot-logo { display: flex; justify-content: space-between; align-items: baseline; gap: .2em; font-family: var(--display); font-size: calc(17.5vw * var(--display-scale)); letter-spacing: var(--display-track); line-height: .8; text-transform: uppercase; color: var(--ink); white-space: nowrap; }
.foot-logo span:last-child { color: var(--accent); }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 4vh; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--soft); }

/* ───────── intro ───────── */
#intro { position: fixed; inset: 0; z-index: var(--z-intro); display: grid; grid-template-rows: 1fr calc(var(--band) * 2) 1fr; padding: 0 var(--pad); transition: grid-template-rows 1.4s var(--ease-out), opacity .6s ease; }
html.pre.ready #intro { --band: clamp(56px, 11vh, 120px); }
.intro-top { display: flex; align-items: flex-end; justify-content: center; padding-bottom: 26px; }
.intro-mark { font-family: var(--display); font-size: calc(clamp(42px, 7vw, 92px) * var(--display-scale)); letter-spacing: var(--display-track); line-height: .9; text-transform: uppercase; }
html[data-font="ciscela"] .intro-mark { text-transform: none; }
.intro-bottom { grid-row: 3; position: relative; display: flex; justify-content: center; padding-top: 26px; }
.intro-meter { position: absolute; top: 26px; width: min(520px, 100%); display: grid; grid-template-columns: 1fr auto; gap: 10px; font-size: 12.5px; font-weight: 600; font-stretch: 80%; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); transition: opacity .5s ease, transform .7s var(--ease-out); }
.intro-pct { font-variant-numeric: tabular-nums; color: var(--ink); }
.intro-track { grid-column: 1 / -1; display: block; height: 1px; background: var(--line); }
.intro-track b { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); transition: transform .5s var(--ease-out); }
.gate { display: flex; flex-direction: column; align-items: center; gap: 22px; opacity: 0; visibility: hidden; transform: translateY(14px); transition: opacity .7s ease .5s, transform 1s var(--ease-out) .5s, visibility 0s linear .5s; }
.gate-line { font-size: clamp(16px, 1.4vw, 19px); color: var(--soft); text-align: center; }
.gate-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
html.pre.ready .intro-meter { opacity: 0; transform: translateY(-8px); }
html.pre.ready .gate { opacity: 1; visibility: visible; transform: none; }
html:not(.pre) #intro { opacity: 0; pointer-events: none; visibility: hidden; transition: opacity .5s ease, visibility 0s linear .6s; }

/* the logo stamps in letter by letter after you enter */
html.stamping .hero .inner { opacity: 1; transform: none; }
html.stamping .logo .ch { opacity: 0; transform: translateY(.18em) scale(1.25); filter: blur(8px); }
html.stamping .logo .ch.in { opacity: 1; transform: none; filter: none; transition: opacity .25s ease, transform .55s var(--ease-out), filter .4s ease; }
html.stamping .hero :is(.presents, .lede, .wbtn) { opacity: 0; transform: translateY(10px); }
html.stamping.stamped .hero :is(.presents, .lede, .wbtn) { opacity: 1; transform: none; transition: opacity .7s ease, transform 1s var(--ease-out); }
html.stamping.stamped .hero .lede { transition-delay: .12s; }
html.stamping.stamped .hero .wbtn { transition-delay: .24s; }
html.pre .hero .inner { opacity: 0; }

/* ───────── design lab (open with ?lab or Shift+L) ───────── */
#lab { position: fixed; z-index: var(--z-lab); right: calc(var(--fi) + 20px); top: 84px; width: 270px; padding: 14px; border-radius: 22px; background: var(--bg-2); border: 1px solid var(--line-2); color: var(--ink); font-size: 13px; }
#lab header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
#lab .x { all: unset; cursor: pointer; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 999px; border: 1px solid var(--line); }
#lab fieldset { border: 0; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
#lab legend { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); margin-bottom: 6px; padding: 0; }
#lab fieldset button { cursor: pointer; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; font-size: 12.5px; }
#lab fieldset button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
#lab p { margin-top: 12px; font-size: 11.5px; color: var(--soft); line-height: 1.4; }

/* ───────── no WebGL: the words still work on their own ───────── */
body.nogl .inner { opacity: 1; transform: none; filter: none; }
body.nogl .beat { min-height: auto; padding-top: 12vh; padding-bottom: 12vh; }
body.nogl .copy { position: relative; height: auto; padding-bottom: 0; }
body.nogl .hero .copy { min-height: 90vh; }
body.nogl .rail, body.nogl .hud-bottom { display: none; }

/* ───────── small screens: the place sits at the bottom, the island above it ───────── */
@media (max-width: 1100px) {
  .rail { width: min(520px, calc(100vw - 80px)); bottom: calc(var(--hud-b) + 26px); }
  .hud-bottom { padding: 0 calc(var(--fi) + 18px); }
  .copy { padding-bottom: max(150px, 19vh); }
}
@media (max-width: 820px) {
  :root { --fi: 6px; --fc: 16px; --fn: 8px; }
  body { font-size: 15.5px; }
  .hud-top { padding-left: calc(var(--fi) + 16px); padding-right: calc(var(--fi) + 12px); }
  .mark { font-size: calc(20px * var(--display-scale)); }
  .sound-word { display: none; }
  .sound-toggle { padding: 0 13px; }
  .ro-r, #ro-xy { display: none; }
  .rail { width: calc(100vw - 40px); bottom: var(--hud-b); }
  .rail .ch-label { font-size: 10.5px; }
  .rail li:not(.on) .ch-label { opacity: 0; }
  .hud-bottom { display: none; }
  .beat, .beat.r { padding: 0 20px; }
  .beat.r .copy { justify-content: flex-start; }
  .copy { padding-bottom: 84px; }
  .inner { width: 100%; }
  .place { font-size: calc(46px * var(--display-scale)); margin: 10px 0 12px; }
  .pins { margin-top: 14px; }
  .pins li { font-size: 13px; padding: 6px 0; }
  .legend { margin-top: 14px; font-size: 13.5px; }
  .legend div { padding: 5px 0; }
  .scrim-l, .scrim-r { display: none; }
  .scrim-b { background: linear-gradient(0deg, color-mix(in srgb, var(--bg) 96%, transparent) 0%, color-mix(in srgb, var(--bg) 86%, transparent) 42%, color-mix(in srgb, var(--bg) 40%, transparent) 62%, transparent 80%); }
  .scrim-c { background: radial-gradient(ellipse 85% 34% at 50% 52%, color-mix(in srgb, var(--bg) 80%, transparent) 0%, color-mix(in srgb, var(--bg) 50%, transparent) 55%, transparent 100%); }
  .t-label { font-size: 11px; }
  .tag.big .t-label { font-size: calc(17px * var(--display-scale)); }
  .tag.big .t-line { height: 30px; }
  .wbtn { --h: 54px; }
  .gate-actions { flex-direction: column; align-items: stretch; width: min(320px, 100%); }
  .gate-actions .wbtn { justify-content: space-between; }
  .gate-actions .wbtn.ghost { justify-content: center; }
  .logo-2::before, .logo-2::after { width: 1em; }
  .foot-logo { font-size: calc(16vw * var(--display-scale)); }
  .platforms li { height: 40px; padding: 0 16px; font-size: 12.5px; }
  .about { grid-template-columns: 1fr; }
}
@media (min-width: 821px) { .scrim-b { display: none; } }

@media (prefers-reduced-motion: reduce) {
  #scene, html.pre #scene, #intro { transition: none; }
  .inner, .chapter .inner { transition: opacity .3s linear; transform: none; filter: none; }
  .eq i, .wbtn:hover .wbtn-knob svg, .soon-dot { animation: none !important; }
  .wbtn-fill { transition: none; }
  html.stamping .logo .ch { transform: none; filter: none; }
}
