/* Recuro · bone page, dark bands (the map: hero, panels, flow; the case). Colour comes from the images. */
@font-face {
  font-family: 'Schibsted Grotesk';
  src: url('../fonts/schibsted-grotesk-latin.woff2') format('woff2');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #14110e;
  --ink-2: #1c1814;
  --paper: #ede8e0;
  --muted: #a8a096;
  --muted-light: #675f55;
  --signal: #f0c987; /* the map's light, the three stat values on the dark case band, the loading orb, the step arrows' focus ring; nowhere else */
  --brass: #7a5a1c; /* the one accent on bone: calculator result, text-link underlines and hover, the focused field's hairline */
  --header-h: 5.2rem; /* main.js replaces this with the measured header height */
  --glass-opacity: 1; /* ink glass behind text over the live canvas: fully opaque under the text, so no thread, plate or glow shows through */

  /* semantic: light (bone) by default */
  --bg: var(--paper);
  --fg: var(--ink);
  --mut: var(--muted-light);
  --line: rgb(20 17 14 / 0.14);
  --line-strong: rgb(20 17 14 / 0.4);
  --scrim-opacity: 0.72;

  --font: 'Schibsted Grotesk', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --step-0: 1rem;
  --step-1: clamp(1.125rem, 1.05rem + 0.35vw, 1.3rem);
  --step-2: clamp(1.4rem, 1.2rem + 0.9vw, 1.9rem);
  --step-3: clamp(1.8rem, 1.4rem + 1.8vw, 2.9rem);
  --step-4: clamp(2.4rem, 1.6rem + 3.6vw, 4.6rem);
  --step-hero: clamp(3.1rem, 1rem + 9.6vw, 10.5rem);

  --gutter: clamp(1.25rem, 0.6rem + 3vw, 3.5rem);
  --section: clamp(5rem, 3rem + 9vw, 11rem);
  --max: 1360px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* dark bands: the map (hero, six panels, flow), the case band, and the home header while it is over the map */
.map, .case, body:not(.subpage) > .site-header {
  --bg: var(--ink);
  --fg: var(--paper);
  --mut: var(--muted);
  --line: rgb(237 232 224 / 0.14);
  --line-strong: rgb(237 232 224 / 0.4);
  color: var(--fg);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 0.5rem); }
/* set by the inline head script for German visitors until main.js has translated the page; visibility keeps the layout */
html.i18n-pending [data-i18n] { visibility: hidden; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; border-radius: 2px; }

.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }

.skip {
  position: absolute; left: var(--gutter); top: -4rem; z-index: 20;
  background: var(--fg); color: var(--bg); padding: 0.6rem 1rem; text-decoration: none;
}
.skip:focus { top: 1rem; }
/* skip-link target takes focus but is not an interactive control */
main:focus { outline: none; }

.eyebrow {
  font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--mut); margin-bottom: 1.5rem;
}

/* ---------- header ---------- */
.site-header { position: absolute; inset: 0 0 auto; z-index: 10; }
/* main.js sets header-live when it can watch the map: the header then follows the page, dark over the map, bone after it */
html.header-live .site-header { position: fixed; background: var(--bg); border-bottom: 1px solid var(--line); }
html.past-map body:not(.subpage) > .site-header {
  --bg: var(--paper); --fg: var(--ink); --mut: var(--muted-light);
  --line: rgb(20 17 14 / 0.14); --line-strong: rgb(20 17 14 / 0.4);
}
.nav {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 1.25rem var(--gutter);
  font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase;
}
.nav-links { display: flex; gap: 2rem; }
.nav a { text-decoration: none; }
.nav-links a, .nav-book { opacity: 0.88; transition: opacity 0.2s var(--ease-out); }
.nav-links a:hover, .nav-book:hover { opacity: 1; text-decoration: underline; }
.wordmark {
  font-size: 1.35rem; font-weight: 600; letter-spacing: -0.04em; text-transform: none;
}
.wordmark span { font-size: 0.6em; font-weight: 400; letter-spacing: 0; opacity: 0.7; margin-left: 0.05em; }
.nav-end { display: flex; justify-content: flex-end; align-items: center; gap: 1.5rem; white-space: nowrap; }
.lang-toggle {
  font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit;
  background: none; border: 0; padding: 0.75rem 0; cursor: pointer; opacity: 0.7;
}
.lang-toggle:hover { opacity: 1; }

@media (max-width: 760px) {
  .nav { grid-template-columns: auto 1fr; }
  .nav-links { display: none; }
  .wordmark { grid-column: 1; }
  .nav-end { gap: 1rem; }
}
/* phones: the hero button sits right below, so the nav link would only crowd the wordmark */
@media (max-width: 560px) {
  .nav-book { display: none; }
}

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 100svh; display: grid; align-items: end;
  overflow: hidden; isolation: isolate; background: var(--ink-2);
}
.hero-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 60% 50%; z-index: -2;
}
/* bottom scrim keeps the headline readable on any photo */
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(to top, rgb(20 17 14 / var(--scrim-opacity)) 0%, rgb(20 17 14 / calc(var(--scrim-opacity) * 0.55)) 38%, rgb(20 17 14 / 0) 70%),
    linear-gradient(to bottom, rgb(20 17 14 / 0.5) 0%, rgb(20 17 14 / 0) 22%);
}
.hero-inner {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(15rem, 22rem);
  gap: 2rem 3rem; align-items: end;
  padding: 8rem var(--gutter) clamp(1.5rem, 1rem + 2vw, 3rem);
}
.hero-title {
  font-size: var(--step-hero); font-weight: 560; letter-spacing: -0.055em; line-height: 0.88;
  max-width: 11ch; text-wrap: balance;
}
.hero-side { display: grid; gap: 1.5rem; justify-items: start; padding-bottom: 0.6rem; }
.hero-sub { font-size: var(--step-1); line-height: 1.45; max-width: 30ch; }

@media (max-width: 760px) {
  .hero-inner { grid-template-columns: 1fr; }
}

.btn-outline {
  display: inline-flex; align-items: center; gap: 0.6em; min-height: 44px;
  border: 1px solid var(--fg); padding: 0.7rem 1.15rem;
  font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none;
  transition: background-color 0.25s var(--ease-out), color 0.25s var(--ease-out), transform 0.15s var(--ease-out);
}
.btn-outline:hover { background: var(--fg); color: var(--bg); }
.btn-outline:active { transform: scale(0.97); }

/* ---------- map: hero, six panel beats, flow ---------- */
.map { position: relative; overflow-x: clip; background: var(--ink); }
/* the WebGL canvas, layered on later; hidden until a script sets html.map-live */
.stage { position: fixed; inset: 0; z-index: 0; display: none; width: 100%; height: 100%; }
html.map-live .stage { display: block; opacity: 0; transition: opacity 0.6s var(--ease-out); }
html.map-shown .stage { opacity: 1; }
.map > :not(.stage) { position: relative; z-index: 1; }
/* the hub's play control, laid over the hub by the map script; it takes taps but leaves vertical swipes to the page */
.map > .hub-btn {
  position: fixed; left: 0; top: 0; z-index: 3; background: transparent; border: 0; border-radius: 12px; cursor: pointer;
  touch-action: pan-y; -webkit-tap-highlight-color: transparent;
}
.map > .hub-btn:focus-visible { outline: 2px solid var(--paper); outline-offset: 4px; }
/* the fixed canvas must not show through or over the bone page after the map */
html.map-live .map { clip-path: inset(0); }
/* the live hero: the canvas is the backdrop; the photo fades out over it, the bottom scrim stays for the headline */
html.map-live .hero { background: transparent; }
html.map-live .hero::after {
  background:
    linear-gradient(to top, rgb(20 17 14 / 0.86) 0%, rgb(20 17 14 / 0.62) 42%, rgb(20 17 14 / 0) 80%),
    linear-gradient(to bottom, rgb(20 17 14 / 0.5) 0%, rgb(20 17 14 / 0) 22%);
}
html.map-live .hero-img { visibility: hidden; opacity: 0; transition: opacity 0.6s var(--ease-out), visibility 0s linear 0.6s; }
/* Text over the live canvas sits on ink glass. A shadow spreads it past the box, so no layout box differs from the static page. */
/* desktop panel text: ink glass that feathers into the scene over 2.5rem on every side. The solid part reaches 1.5rem past the text box. */
@media (min-width: 760px) {
  /* the map script fades a beat's text (and its glass) out before the camera moves on, so the glass never covers the plate arriving next */
  html.map-live .beat-grid { opacity: var(--fade, 1); }
  html.map-live .beat-text { position: relative; isolation: isolate; }
  html.map-live .beat-text::before {
    content: ''; position: absolute; z-index: -1; inset: -4rem; pointer-events: none;
    background: rgb(20 17 14 / var(--glass-opacity));
    -webkit-mask-image: linear-gradient(to right, transparent, #000 2.5rem, #000 calc(100% - 2.5rem), transparent), linear-gradient(to bottom, transparent, #000 2.5rem, #000 calc(100% - 2.5rem), transparent);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(to right, transparent, #000 2.5rem, #000 calc(100% - 2.5rem), transparent), linear-gradient(to bottom, transparent, #000 2.5rem, #000 calc(100% - 2.5rem), transparent);
    mask-composite: intersect;
  }
}
/* the flow text sits on ink glass as wide as the screen; its top edge fades in over 2rem and its lower edge fades out over 3rem, so no box edge shows */
html.map-live .flow-head::before {
  content: ''; position: absolute; z-index: -1; top: -3rem; bottom: -3rem; left: calc(50% - 50vw); right: calc(50% - 50vw); pointer-events: none;
  background: linear-gradient(to bottom, rgb(20 17 14 / 0) 0, rgb(20 17 14 / var(--glass-opacity)) 2rem, rgb(20 17 14 / var(--glass-opacity)) calc(100% - 3rem), rgb(20 17 14 / 0) 100%);
}
html.map-live:not(.map-shown) .hero-img { visibility: visible; opacity: 1; }

.beat { display: flex; align-items: center; min-height: 100svh; padding-block: calc(var(--section) * 0.5); }
.beat-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: center; }
.beat-text { grid-column: 1 / span 5; grid-row: 1; }
.beat-still { grid-column: 7 / span 6; grid-row: 1; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
/* odd panels: text left; even panels: text right */
.beat[data-panel='stock'] .beat-text, .beat[data-panel='staff'] .beat-text, .beat[data-panel='invoices'] .beat-text { grid-column: 8 / span 5; }
.beat[data-panel='stock'] .beat-still, .beat[data-panel='staff'] .beat-still, .beat[data-panel='invoices'] .beat-still { grid-column: 1 / span 6; }

.beat-meta { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.beat-index { font-size: 0.75rem; letter-spacing: 0.16em; color: var(--mut); font-variant-numeric: tabular-nums; }
.beat-title { font-size: var(--step-3); font-weight: 560; letter-spacing: -0.035em; line-height: 1.05; overflow-wrap: break-word; text-wrap: balance; }
.beat-list { margin-top: clamp(1.75rem, 1.4rem + 1.4vw, 2.5rem); border-top: 1px solid var(--line); }
.beat-row { padding: 1.1rem 0 1.2rem; border-bottom: 1px solid var(--line); }
.beat-row dt { font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--mut); }
.beat-row dd { margin-top: 0.45rem; max-width: 46ch; }

/* One tall section with and without the map: the text pins under the header, and the map (live) or its still (static) holds below it. */
.flow { min-height: 220svh; padding-block: 2rem 0; }
.flow-hold { display: contents; }
.flow-head {
  position: sticky; top: calc(var(--header-h) + 0.75rem); z-index: 2; padding-block: 1.25rem 1.5rem;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter);
}
.flow-head > * { grid-column: 1 / -1; }
.flow-head .eyebrow { margin-bottom: 0.75rem; }
.flow-title { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.6rem); font-weight: 560; letter-spacing: -0.045em; line-height: 1; max-width: 12ch; text-wrap: balance; overflow-wrap: break-word; }
.flow-body { grid-column: 6 / span 7; margin-top: 0.75rem; font-size: var(--step-0); line-height: 1.45; max-width: 60ch; }
@media (min-width: 760px) {
  .flow-head .eyebrow { grid-row: 1; }
  .flow-title { grid-row: 2; grid-column: 1 / span 5; }
  .flow-body { grid-row: 2; grid-column: 6 / span 7; margin-top: 0; align-self: end; }
}
/* static: the still hangs in the lower part of the screen under the pinned text; live: it is hidden but keeps its box */
.flow-still { display: block; position: sticky; top: 40svh; margin-top: clamp(1.5rem, 1rem + 2vw, 3rem); aspect-ratio: 21 / 9; object-fit: cover; }

/* the canvas shows the panels once it is live, so the stills stay as empty space */
html.map-live .beat-still, html.map-live .flow-still { visibility: hidden; opacity: 0; transition: opacity 0.6s var(--ease-out), visibility 0s linear 0.6s; }
html.map-live:not(.map-shown) :is(.beat-still, .flow-still) { visibility: visible; opacity: 1; }

@media (max-width: 759px) {
  /* Phone: scrollytelling. The top part under the header is the stage (the canvas when live, the panel's still when not);
     the text sits below it on opaque ink. Each panel is a frame pinned under the header while the next frame rises over it
     from below, so text never enters the stage. Same boxes with and without the map. */
  :root { --stage-share: 0.44; --stage-h: calc((100svh - var(--header-h)) * var(--stage-share)); }
  @media (max-height: 700px) { :root { --stage-share: 0.36; } }
  .beats { display: flow-root; }
  .beat {
    position: sticky; top: var(--header-h); display: block; min-height: 0; padding: 0;
    height: calc(100svh - var(--header-h)); margin-bottom: 60svh;
  }
  .beat-grid { display: flex; flex-direction: column; width: 100%; height: 100%; margin: 0; }
  .beat-still, .beat[data-panel] .beat-still { order: 0; flex: none; width: 100%; height: var(--stage-h); aspect-ratio: auto; object-fit: cover; }
  .beat-text, .beat[data-panel] .beat-text {
    order: 1; flex: 1 1 auto; min-height: 0; padding: 0.9rem var(--gutter) 0; background: var(--ink); box-shadow: none; overflow: clip;
  }
  .motion .beat-text.reveal { opacity: 1; transform: none; transition: none; }
  .beat-meta { margin-bottom: 0.5rem; }
  .beat-title { font-size: clamp(1.45rem, 1.2rem + 1.2vw, 1.8rem); }
  .beat-list { margin-top: 0.7rem; }
  .beat-row { padding: 0.6rem 0 0.65rem; }
  .beat-row dt { font-size: 0.68rem; }
  .beat-row dd { margin-top: 0.3rem; font-size: 0.9rem; line-height: 1.38; }
  /* flow: the text scrolls away, then the assembled map holds on its own, filling the screen under the header */
  .flow { min-height: 0; padding-block: 0; }
  .flow-head.wrap { position: static; display: block; width: 100%; margin: 0; padding: 1.5rem var(--gutter) 1.75rem; background: var(--ink); }
  html.map-live .flow-head::before { content: none; }
  .flow-hold { display: block; position: relative; height: 190svh; }
  .flow-still { position: sticky; top: calc(var(--header-h) + 1rem); width: calc(100% - 2 * var(--gutter)); margin: 0 auto; height: calc(100svh - var(--header-h) - 2rem); aspect-ratio: auto; object-fit: contain; }
}

.tag {
  display: inline-block; font-size: 0.75rem; font-weight: 400; letter-spacing: 0.12em; text-transform: uppercase;
  border: 1px solid var(--line-strong); padding: 0.2rem 0.5rem;
}

/* ---------- calculator ---------- */
.calc { padding-block: var(--section) calc(var(--section) * 0.8); }
.calc-prompt {
  font-size: var(--step-3); font-weight: 480; letter-spacing: -0.035em; line-height: 1.1;
  max-width: 24ch; margin-bottom: clamp(2.5rem, 2rem + 2vw, 4rem); text-wrap: balance;
}
.calc-form {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem;
  max-width: 46rem; align-items: end;
}
.field { display: grid; gap: 0.5rem; }
.field-k { font-size: 0.8rem; color: var(--mut); }
.field-v {
  font: inherit; font-size: var(--step-2); letter-spacing: -0.03em; color: var(--fg);
  font-variant-numeric: tabular-nums;
  background: none; border: 0; border-bottom: 1px solid var(--line-strong); border-radius: 0;
  padding: 0.15rem 0 0.35rem; width: 100%; min-width: 0;
}
input.field-v { transition: border-color 0.2s var(--ease-out); }
input.field-v:hover { border-bottom-color: var(--fg); }
input.field-v:focus { outline: none; border-bottom-color: var(--brass); }
input.field-v:focus-visible { outline: 2px solid var(--fg); outline-offset: 4px; }
input.field-v[aria-invalid='true'] { border-bottom-style: dashed; color: var(--mut); }
.field-result .field-v { border-bottom-color: transparent; white-space: nowrap; color: var(--brass); }
.field-v .sep { font-variant-numeric: normal; } /* a tabular comma is as wide as a digit */
.calc-hint { min-height: 1.4em; margin-top: 1rem; font-size: 0.9rem; color: var(--fg); }
.calc-hint:empty { margin-top: 0; min-height: 0; }
.calc-note { margin-top: 2rem; max-width: 46ch; font-size: 0.95rem; color: var(--mut); line-height: 1.6; }

@media (max-width: 560px) {
  .calc-form { grid-template-columns: 1fr 1fr; }
  .field-result { grid-column: 1 / -1; }
}

/* ---------- rule ---------- */
.rule { position: relative; overflow: clip; padding-block: var(--section); border-top: 1px solid var(--line); }
/* ink-dot version of the sentence (particles.js); the DOM text stays for readers and copy */
.particles { position: absolute; pointer-events: none; }
.rule-text.is-particles { color: transparent; }
.rule-text { touch-action: pan-y; }
.rule-text {
  font-size: var(--step-4); font-weight: 520; letter-spacing: -0.045em; line-height: 0.98;
  max-width: 17ch; text-wrap: balance;
}
.rule-body { margin: 2.5rem 0 0 auto; max-width: 44ch; color: var(--mut); }

/* ---------- case ---------- */
.case { background: var(--ink-2); padding-bottom: var(--section); }
.case-media img { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; object-position: 0% 88%; } /* 21:9 shows 64% of the 3:2 photo's height: this window runs from 33% to 98%, so the whole logo, "& coffee" included, has a margin below it */
.case-body { padding-top: clamp(3rem, 2rem + 4vw, 6rem); }
.case-title { font-size: var(--step-4); font-weight: 560; letter-spacing: -0.045em; line-height: 1; }
.case-client { margin-top: 0.75rem; color: var(--mut); }
.case-text { margin-top: 2rem; font-size: var(--step-1); max-width: 40ch; line-height: 1.5; }
.stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: clamp(3rem, 2rem + 3vw, 5rem); border-top: 1px solid var(--line);
}
.stat { padding: 1.5rem 1.5rem 0 0; }
.stat + .stat { padding-left: 1.5rem; border-left: 1px solid var(--line); }
.stat dt { color: var(--signal); font-size: var(--step-3); font-weight: 500; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat dd { margin-top: 0.75rem; color: var(--mut); font-size: 0.95rem; max-width: 28ch; }
.stat-note { display: block; margin-top: 0.4rem; font-style: normal; font-size: 0.8rem; letter-spacing: 0.02em; }

@media (max-width: 760px) {
  .case-media img { aspect-ratio: 4 / 3; }
  .stats { grid-template-columns: 1fr; }
  .stat, .stat + .stat { padding: 1.4rem 0; border-left: 0; border-bottom: 1px solid var(--line); }
}

/* ---------- about ---------- */
.about {
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(2.5rem, 1rem + 5vw, 7rem); align-items: start; padding-block: var(--section);
}
.about-media img { width: 100%; max-width: 26rem; aspect-ratio: 4 / 5; object-fit: cover; }
.about-title { font-size: var(--step-3); font-weight: 560; letter-spacing: -0.035em; line-height: 1.05; }
.about-text { margin-top: 1.5rem; font-size: var(--step-1); line-height: 1.55; max-width: 48ch; }
.track-title { margin-top: 3rem; font-size: 0.75rem; font-weight: 400; letter-spacing: 0.16em; text-transform: uppercase; color: var(--mut); }
.track { margin-top: 1rem; border-top: 1px solid var(--line); }
.track li { padding: 1rem 0; border-bottom: 1px solid var(--line); max-width: 62ch; }
.text-link {
  display: inline-block; margin-top: 2rem; padding: 0.6rem 0;
  font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none;
  border-bottom: 1px solid var(--brass);
}
.text-link:hover, .text-link:focus-visible { color: var(--brass); opacity: 1; }

@media (max-width: 760px) {
  .about { grid-template-columns: 1fr; }
  .about-media img { max-width: 18rem; }
}

/* ---------- book ---------- */
.book { padding-block: var(--section); border-top: 1px solid var(--line); }
.book-title {
  font-size: var(--step-4); font-weight: 560; letter-spacing: -0.045em; line-height: 1;
  max-width: 14ch; text-wrap: balance;
}
.book-text { margin: 2rem 0 2.5rem; font-size: var(--step-1); max-width: 44ch; line-height: 1.5; }
.book-note { margin-top: 1.25rem; font-size: 0.85rem; color: var(--mut); max-width: 52ch; }

/* ---------- footer ---------- */
.site-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
  padding-block: 2rem 2.5rem; border-top: 1px solid var(--line);
  font-size: 0.8rem; color: var(--mut);
}
.site-footer a { padding-block: 0.5rem; text-decoration-color: var(--brass); }
.site-footer a:hover, .site-footer a:focus-visible { color: var(--brass); }

/* ---------- legal + 404 ---------- */
.page { padding-block: 9rem var(--section); }
.page-title { font-size: var(--step-4); font-weight: 560; letter-spacing: -0.045em; line-height: 1; max-width: 16ch; }
.page h2 { margin-top: 3.5rem; font-size: var(--step-2); font-weight: 520; letter-spacing: -0.025em; }
.page p, .page address { margin-top: 1rem; max-width: 62ch; font-style: normal; }
.page .text-link { margin-top: 3rem; }

/* ---------- reveal motion: only when JS opted in and motion is allowed ---------- */
.motion .reveal {
  opacity: 0; transform: translateY(14px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 70ms);
}
.motion .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .motion .reveal { opacity: 1; transform: none; transition: none; }
}

/* Loading screen (index only): the head script sets html.loading while the 3D map starts; js/loader/ takes it down. */
.loader { display: none; }
html.loading .loader {
  position: fixed; inset: 0; z-index: 30; display: grid; place-content: center; justify-items: center; gap: 0.75rem;
  background: var(--ink); color: var(--paper); transition: opacity 0.4s var(--ease-out);
}
.loader-orb { width: 7.5rem; height: 7.5rem; color: var(--signal); transition: transform 0.4s var(--ease-out); }
html.loading-out .loader { opacity: 0; pointer-events: none; }
html.loading-out .loader-orb { transform: scale(1.08); }
/* under the loader the stills and the canvas swap at once, so the loader's own fade is the only one */
html.loading :is(.stage, .hero-img, .beat-still, .flow-still) { transition: none; }

/* ---------- step arrows: previous / next, fixed bottom right; solid ink so they read over footage, steel and bone ---------- */
.stepnav {
  position: fixed; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 20; display: grid; gap: 8px;
}
.stepnav-btn {
  display: grid; place-items: center; width: 48px; height: 48px; padding: 0; cursor: pointer;
  background: var(--ink); color: var(--paper); border: 1px solid rgb(237 232 224 / 0.6);
  transition: transform 0.15s var(--ease-out), opacity 0.25s var(--ease-out), color 0.2s, border-color 0.2s;
}
/* hover only where a pointer hovers: on touch screens it would stick gold after a tap */
@media (hover: hover) { .stepnav-btn:hover { color: var(--paper); border-color: var(--paper); } }
.stepnav-btn:focus-visible { color: var(--signal); border-color: currentColor; outline: 2px solid currentColor; outline-offset: 3px; }
.stepnav-btn:active { transform: scale(0.94); }
.stepnav-btn[aria-disabled='true'] { opacity: 0.35; cursor: default; color: var(--paper); border-color: rgb(237 232 224 / 0.6); transform: none; }
.stepnav-hint {
  position: absolute; right: calc(100% + 8px); bottom: 0; height: 48px; display: grid; place-items: center; padding: 0 0.9rem;
  background: var(--ink); color: var(--paper); border: 1px solid rgb(237 232 224 / 0.6);
  font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap;
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.3s var(--ease-out), visibility 0s linear 0.3s;
}
.stepnav.hint .stepnav-hint { opacity: 1; visibility: visible; transition: opacity 0.3s var(--ease-out); }
@media (prefers-reduced-motion: reduce) { .stepnav-hint, .stepnav.hint .stepnav-hint { transition: none; } }
html.loading .stepnav { visibility: hidden; }
/* phone: side by side in the header bar, left of the language switch (stepnav.js sets --stepnav-right). Bottom right
   covered body text at 6 of 12 stops on a 375 x 667 screen: the phone text frames run to the bottom edge. */
@media (max-width: 759px) {
  .stepnav { grid-auto-flow: column; top: calc((var(--header-h) - 48px) / 2); bottom: auto; right: var(--stepnav-right, 7.5rem); }
  .stepnav-hint { top: calc(100% + 8px); bottom: auto; right: 0; }
}
/* ---------- end step arrows ---------- */

