/* Site layout. Page-level rules only.
   Reusable parts live in css/components.css. Values come from css/tokens.css.
   Section styles live in css/sections-a.css and css/sections-b.css.
   Site-wide layers (nav, pill, heat prints, sound) live in css/fx.css. */

html { scroll-behavior: auto; }
body { min-height: 100svh; }
main { position: relative; z-index: 1; }

.wrap { max-width: 1240px; margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: 860px; }

/* A normal section */
.sec { position: relative; padding-block: clamp(72px, 12vw, 180px); }
.sec-head { display: grid; gap: var(--s-4); max-width: 900px; margin-bottom: clamp(28px, 5vw, 64px); }
.sec-label { font: 500 var(--fs-label)/1.2 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0; }
.sec-label b { color: var(--text); font-weight: 500; }

/* A pinned section: a tall track with a screen-high stage that sticks.
   Set the scroll length with --len (in screens). js/main.js reports progress. */
.track { position: relative; height: calc(var(--len, 3) * 100svh); }
.stage { position: sticky; top: 0; height: 100svh; overflow: hidden; display: grid; }

/* Reveal on scroll: add data-reveal. Stagger with style="--i:1" */
[data-reveal] {
  opacity: 0; transform: translate3d(0, 28px, 0);
  transition: opacity var(--t-reveal) var(--ease-out), transform var(--t-reveal) var(--ease-out);
  transition-delay: calc(var(--i, 0) * 90ms);
}
[data-reveal].is-in { opacity: 1; transform: none; }

/* Before the loader ends, nothing scrolls */
html:not(.is-loaded) body { overflow: hidden; }

/* Small helpers */
.stack { display: grid; gap: var(--s-4); }
.row { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
.center { text-align: center; justify-items: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sample { font: 400 .625rem/1.3 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: color-mix(in oklch, var(--text) 45%, transparent); margin: 0; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; }
}
