/* FORMES Galerie (the exhibition site, formerly the "motion edition"): one sculpture travels through the page in real 3D (motion.js).
   The page itself is text over a fixed WebGL canvas; overlays are placed from the 3D every frame. */
:root {
  --bg: #0b0b0d;
  --fg: #ece7dd;
  --mute: #aaa59c;
  --ink: #15171b;
  --ink-mute: #6c675f;
  --brass: #b8925f;
  --ember: #ff9a52;
  --line: rgba(236, 231, 221, .55);
  --serif: "Cormorant Garamond", "Shippori Mincho", serif;
  --mincho: "Shippori Mincho", "Hiragino Mincho ProN", serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;
  --gutter: clamp(18px, 4.2vw, 68px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--mincho); font-size: 15px; line-height: 1.85; letter-spacing: .03em; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

/* ---------- layers behind and over the page ---------- */
.gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
.fallback { display: none; position: fixed; inset: 0; z-index: 0; background: #0b0b0d url(../assets/img/strata-full.jpg) center / contain no-repeat; }
.no-gl .gl { display: none; }
.no-gl .fallback { display: block; }
.blueprint {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0;
  background-image:
    linear-gradient(rgba(150, 190, 255, .16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(150, 190, 255, .16) 1px, transparent 1px),
    linear-gradient(rgba(150, 190, 255, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(150, 190, 255, .07) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-position: center;
}
.vignette { position: fixed; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(ellipse 75% 70% at 50% 46%, transparent 55%, rgba(0, 0, 0, .5) 100%); transition: opacity .6s; }
.is-light .vignette { opacity: .25; }
.grain {
  position: fixed; inset: -60%; z-index: 6; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain .9s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

.overlay { position: fixed; inset: 0; z-index: 3; pointer-events: none; color: var(--fg); }
.leaders { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.leaders line { stroke: currentColor; stroke-width: 1; opacity: .55; }
.leaders circle { fill: var(--fg); }
.tag { position: absolute; top: 0; left: 0; font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; white-space: nowrap; opacity: 0; will-change: transform, opacity; }
.tag b { display: block; font-family: var(--mincho); font-size: 15px; font-weight: 500; letter-spacing: .06em; margin-bottom: 2px; }
.tag span { color: var(--mute); }
.tag.is-left { text-align: right; }

.dims { position: absolute; inset: 0; opacity: 0; color: #d7e5ff; }
.dims__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.dims__svg line { stroke: #cfe0ff; stroke-width: 1; }
.dims__label { position: absolute; top: 0; left: 0; margin: 0; font-family: var(--mono); font-size: 12px; letter-spacing: .1em; white-space: nowrap; }
.dims__note { position: absolute; top: 0; left: 0; margin: 0; font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; line-height: 1.9; color: rgba(215, 229, 255, .75); white-space: pre; }
.nozzle-tag { position: absolute; top: 0; left: 0; opacity: 0; font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; color: var(--ember); white-space: nowrap; }

.names { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
.names a { position: absolute; top: 0; left: 0; width: 150px; margin-left: -75px; text-align: center; color: var(--ink); opacity: 0; pointer-events: auto; will-change: transform, opacity; }
.names a b { display: block; font-family: var(--serif); font-weight: 400; font-size: 21px; line-height: 1.05; }
.names a small { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--ink-mute); margin-top: 4px; }
.names a:hover b { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }

/* ---------- loader ---------- */
.loader { position: fixed; inset: 0; z-index: 20; background: #0b0b0d; display: grid; place-content: center; justify-items: center; gap: 18px; }
.loader__word { margin: 0; font-family: var(--serif); font-weight: 300; font-size: 34px; letter-spacing: .55em; padding-left: .55em; }
.loader__bar { width: min(220px, 50vw); height: 1px; background: rgba(236, 231, 221, .15); }
.loader__bar i { display: block; height: 100%; background: var(--fg); transform-origin: left; transform: scaleX(0); }
.loader__pct { margin: 0; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; color: var(--mute); }

/* ---------- header + chapter rail ---------- */
.head { position: fixed; top: 0; left: 0; right: 0; z-index: 8; display: flex; justify-content: space-between; align-items: center; padding: 20px var(--gutter); color: var(--fg); transition: color .6s; }
.head__logo { font-family: var(--serif); font-size: 21px; letter-spacing: .34em; }
.head__logo sup { font-family: var(--mono); font-size: 9px; letter-spacing: .12em; margin-left: 2px; }
.head__shop { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; }
.rail { position: fixed; right: var(--gutter); top: 50%; z-index: 8; transform: translateY(-50%); display: grid; gap: 12px; color: var(--fg); transition: color .6s; }
.rail button { display: flex; align-items: center; justify-content: flex-end; gap: 10px; font-family: var(--mono); font-size: 10px; letter-spacing: .14em; opacity: .38; transition: opacity .4s; }
.rail button i { width: 14px; height: 1px; background: currentColor; transition: width .5s cubic-bezier(.16, 1, .3, 1); }
.rail button span { opacity: 0; transform: translateX(6px); transition: opacity .4s, transform .5s cubic-bezier(.16, 1, .3, 1); }
.rail button:hover span, .rail button.is-on span { opacity: 1; transform: none; }
.rail button.is-on { opacity: 1; }
.rail button.is-on i { width: 36px; }
.is-light .head, .is-light .rail, .is-light .overlay { color: var(--ink); }
@media (max-width: 760px) { .rail { display: none; } }

/* ---------- chapters ---------- */
main { position: relative; z-index: 4; }
.ch { position: relative; }
.ch__stage { position: sticky; top: 0; height: 100vh; height: 100svh; pointer-events: none; }
.ch__copy { position: absolute; max-width: min(600px, 86vw); }
.ch__copy--tl { left: var(--gutter); top: 15vh; }
.ch__copy--bl { left: var(--gutter); bottom: 12vh; }
.ch__copy--tr { right: calc(var(--gutter) + 170px); top: 15vh; text-align: right; }
.ch__copy--center { left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; max-width: 92vw; }
.ch[data-tone="light"] { color: var(--ink); }
.kicker { margin: 0; font-family: var(--mono); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--brass); }
.h { margin: 16px 0 0; font-family: var(--mincho); font-weight: 500; font-size: clamp(30px, 4.4vw, 66px); line-height: 1.28; letter-spacing: .04em; }
.h--big { font-size: clamp(38px, 6.4vw, 104px); }
.h .ln { display: inline-block; white-space: nowrap; }
.h .c { display: inline-block; will-change: transform, opacity; }
.lead { margin: 22px 0 0; color: var(--mute); max-width: 31em; font-size: 16px; }
.ch__copy--tr .lead { margin-left: auto; }
.ch[data-tone="light"] .lead { color: var(--ink-mute); }
.count { white-space: nowrap; margin: 20px 0 0; font-family: var(--serif); font-weight: 300; font-size: clamp(54px, 7.4vw, 116px); line-height: 1; font-variant-numeric: tabular-nums; }
.count small { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; margin-left: 8px; color: var(--mute); }
.cue { position: absolute; left: 0; right: 0; bottom: 30px; width: max-content; margin: 0 auto; display: grid; justify-items: center; gap: 10px; font-family: var(--mono); font-size: 10px; letter-spacing: .3em; text-transform: uppercase; color: var(--mute); }
.cue i { width: 1px; height: 46px; background: linear-gradient(var(--fg), transparent); animation: cue 2.2s cubic-bezier(.65, 0, .35, 1) infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }
.cta { margin: 40px 0 0; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; pointer-events: auto; }
.btn { display: inline-block; padding: 14px 26px; border: 1px solid var(--fg); font-family: var(--mono); font-size: 12px; letter-spacing: .12em; transition: background .4s, color .4s; }
.btn:hover { background: var(--fg); color: var(--bg); }
.btn--ghost { border-color: rgba(236, 231, 221, .35); }
.scrub { position: absolute; left: 0; right: 0; bottom: 7vh; margin: 0 auto; width: min(560px, 80vw); display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; }
.scrub p { margin: 0; white-space: nowrap; }
.scrub__no span { font-family: var(--serif); font-size: 26px; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.scrub__no small { color: var(--ink-mute); }
.scrub__bar { height: 1px; background: rgba(21, 23, 27, .18); }
.scrub__bar i { display: block; height: 100%; background: var(--ink); transform-origin: left; transform: scaleX(0); }
.scrub__name { min-width: 9em; text-align: right; font-family: var(--serif); font-size: 17px; letter-spacing: .04em; }
[data-at] { opacity: 0; }
.no-anim [data-at] { opacity: 1; }

@media (max-width: 760px) {
  .ch__copy--tl, .ch__copy--tr { top: 11vh; left: var(--gutter); right: var(--gutter); text-align: left; }
  .ch__copy--bl { bottom: 9vh; }
  .scrub { bottom: 4vh; gap: 12px; width: auto; left: var(--gutter); right: var(--gutter); }
  .cue { display: none; }
  .scrub__name { min-width: 0; font-size: 15px; }
  .lead { font-size: 14px; }
}

/* ---------- footer ---------- */
.foot { position: relative; z-index: 4; background: #0b0b0d; padding: 40px var(--gutter) 44px; border-top: 1px solid rgba(236, 231, 221, .12); }
.foot__links { display: flex; flex-wrap: wrap; gap: 12px 28px; font-family: var(--mono); font-size: 12px; letter-spacing: .06em; }
.foot__note { margin: 18px 0 0; font-family: var(--mono); font-size: 12px; color: var(--mute); }
.foot__note a { text-decoration: underline; text-underline-offset: 3px; }
