/* Brand guidelines template - shared look, chrome and motion helpers.
   Brand colours and fonts arrive as CSS variables from assets/brand/brand.css. */

:root {
  --ink: #000;
  --paper: #fff;
  --panel: #1c1c1c;
  --accent: #ffba49;
  --ok: #dafeb7;
  --bad: #ba1200;
  --line: 3px;
  --r: 18px;
  --bar-h: 64px;
  --gutter: clamp(16px, 4vw, 56px);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 400; }
ol, ul { margin: 0; padding: 0; list-style: none; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
::selection { background: var(--accent); color: var(--ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.svgi { fill: currentColor; width: auto; }

.wrap { width: min(1440px, 100%); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------------------------------------------------------------- type */
.t-display { font-family: var(--font-accent); text-transform: uppercase; line-height: .86; font-weight: 400; letter-spacing: 0; }
.t-title { font-family: var(--font-heading); font-weight: 400; line-height: 1.02; letter-spacing: -.01em; font-size: clamp(42px, 6.4vw, 96px); }
.t-label { font-family: var(--font-accent); text-transform: uppercase; letter-spacing: .02em; font-weight: 400; }
.t-mono { font-family: var(--font-mono); }
.eyebrow { font-family: var(--font-mono); font-size: 13px; letter-spacing: .02em; display: inline-flex; gap: 10px; align-items: center; }
.eyebrow::before { content: ""; width: 26px; height: var(--line); background: currentColor; }
.lede { font-size: clamp(17px, 1.4vw, 20px); max-width: 46ch; }

.sec { padding: clamp(80px, 12vw, 170px) 0 0; }
.sec-head { display: grid; gap: 22px; margin-bottom: clamp(36px, 5vw, 64px); }
.sec-head--split { grid-template-columns: 1fr; align-items: end; }
@media (min-width: 900px) { .sec-head--split { grid-template-columns: 1.1fr 1fr; column-gap: 48px; } }

/* SplitText masks */
.sl-mask { padding-bottom: .06em; margin-bottom: -.06em; }

/* ---------------------------------------------------------------- top bar */
.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--bar-h); z-index: 60;
  background: var(--ink); color: var(--paper);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 var(--gutter);
  transition: transform .5s var(--ease-out);
}
.topbar.is-hidden { transform: translateY(-100%); }
.tb-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.tb-logo .svgi { height: 26px; }
.tb-doc { font-family: var(--font-mono); font-size: 14px; white-space: nowrap; display: flex; gap: 12px; align-items: center; }
.tb-doc::before { content: "|"; opacity: .9; }
.tb-right { display: flex; align-items: center; gap: 18px; }
.tb-page { font-family: var(--font-mono); font-size: 14px; white-space: nowrap; }
.tb-mark .svgi { height: 26px; }
.menu-btn {
  display: inline-flex; align-items: center; gap: 12px; height: 40px; padding: 0 8px 0 18px;
  border-radius: 999px; background: var(--paper); color: var(--ink);
  font-family: var(--font-accent); text-transform: uppercase; font-size: 19px; line-height: 1;
}
.menu-btn .mb-dot { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); display: grid; place-items: center; }
.menu-btn .mb-dot i { width: 10px; height: 2px; background: var(--paper); display: block; box-shadow: 0 -4px 0 var(--paper), 0 4px 0 var(--paper); transition: box-shadow .3s; }
.menu-btn:hover .mb-dot i { box-shadow: 0 -3px 0 var(--paper), 0 3px 0 var(--paper); }
@media (max-width: 700px) {
  .tb-doc, .tb-page { display: none; }
  .tb-logo .svgi { height: 22px; }
}

/* ---------------------------------------------------------------- menu */
.menu {
  position: fixed; inset: 0; z-index: 70; background: var(--ink); color: var(--paper);
  display: none; overflow: auto; overscroll-behavior: contain;
}
.menu.is-open { display: block; }
.menu-inner { min-height: 100%; display: grid; grid-template-rows: auto 1fr auto; gap: 32px; padding-top: 22px; padding-bottom: 32px; }
.menu-top { display: flex; justify-content: space-between; align-items: center; }
.menu-close .mb-dot i { box-shadow: none; transform: rotate(45deg); position: relative; }
.menu-close .mb-dot i::after { content: ""; position: absolute; inset: 0; background: var(--paper); transform: rotate(90deg); }
html.no-motion .pt { display: none; }
.menu-head { font-family: var(--font-heading); font-size: clamp(44px, 7vw, 100px); line-height: 1; }
.menu-list { display: grid; align-content: center; gap: 2px; }
.menu-row {
  position: relative; display: grid; grid-template-columns: auto auto 1fr auto; align-items: baseline; gap: 14px;
  padding: 10px 14px; border-radius: 12px; overflow: hidden;
  font-family: var(--font-mono); font-size: clamp(17px, 2vw, 26px);
  isolation: isolate;
}
.menu-row::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--row-bg, var(--accent));
  transform: scaleX(0); transform-origin: left; transition: transform .55s var(--ease-out);
}
.menu-row .mr-num { opacity: .55; font-size: .7em; }
.menu-row .mr-dots { align-self: end; height: 2px; margin-bottom: .38em; background-image: radial-gradient(circle, currentColor 1px, transparent 1.4px); background-size: 8px 2px; background-repeat: repeat-x; transform-origin: left; }
.menu-row .mr-page { font-variant-numeric: tabular-nums; }
.menu-row .mr-soon { font-family: var(--font-accent); font-size: .6em; text-transform: uppercase; padding: 3px 8px 2px; border: 2px solid currentColor; border-radius: 999px; opacity: .6; }
a.menu-row:hover, a.menu-row:focus-visible { color: var(--row-ink, var(--ink)); }
a.menu-row:hover::before, a.menu-row:focus-visible::before { transform: scaleX(1); }
.menu-row.is-current { color: var(--row-ink, var(--ink)); }
.menu-row.is-current::before { transform: scaleX(1); }
.menu-row.is-off { opacity: .5; cursor: default; }
.menu-foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 13px; opacity: .8; }

/* ---------------------------------------------------------------- pattern band */
.band { overflow: hidden; line-height: 0; background: var(--ink); }
.band-track { display: flex; width: max-content; will-change: transform; }
.band .tile { width: var(--tile, 40px); height: var(--tile, 40px); flex: none; display: block; }
.band .tile svg { width: 100%; height: 100%; }

/* ---------------------------------------------------------------- loader */
.loader {
  position: fixed; inset: 0; z-index: 100; background: var(--ink); color: var(--paper);
  display: grid; grid-template-rows: 1fr auto; pointer-events: all;
}
html.is-visited .loader, html.no-motion .loader { display: none; }
.loader-mid { display: grid; place-items: center; }
.loader-mark { width: clamp(120px, 16vw, 220px); }
.loader-mark svg { width: 100%; height: auto; overflow: visible; }
.loader-meta { display: flex; justify-content: space-between; align-items: end; padding: 0 var(--gutter) 18px; font-family: var(--font-mono); font-size: 14px; }
.loader-count { font-family: var(--font-accent); font-size: clamp(56px, 9vw, 120px); line-height: .8; font-variant-numeric: tabular-nums; }
.loader .band { --tile: calc(100vw / 20); }

/* ---------------------------------------------------------------- page transition */
/* The overlay is one viewport tall plus a pattern band above and below, so it can sit fully off screen. */
.pt { --pt-band: 56px; position: fixed; left: 0; right: 0; top: calc(-1 * var(--pt-band)); height: calc(100vh + 2 * var(--pt-band)); z-index: 90; pointer-events: none; transform: translateY(100%); }
html.pt-in .pt { transform: none; }
.pt-panel { position: absolute; left: 0; right: 0; top: var(--pt-band); bottom: var(--pt-band); background: var(--ink); }
.pt .band { position: absolute; left: 0; right: 0; --tile: var(--pt-band); }
.pt .band-top { top: 0; }
.pt .band-bot { bottom: 0; }
.pt-label { position: absolute; left: var(--gutter); bottom: calc(var(--pt-band) + 22px); color: var(--paper); font-family: var(--font-accent); text-transform: uppercase; font-size: clamp(48px, 9vw, 140px); line-height: .85; }

/* ---------------------------------------------------------------- cursor */
.cursor { position: fixed; left: 0; top: 0; z-index: 120; pointer-events: none; display: none; opacity: 0; transition: opacity .2s; }
html.has-cursor .cursor { display: block; }
html.has-cursor, html.has-cursor * { cursor: none !important; }
html.has-cursor input[type="range"], html.has-cursor input[type="text"], html.has-cursor textarea { cursor: auto !important; }
/* studio mark cursor: the hotspot (arrow tip) sits on the pointer */
.cm { position: absolute; left: 0; top: 0; transform: translate(calc(var(--hx) * -1), calc(var(--hy) * -1)); transform-origin: var(--hx) var(--hy); transition: scale .25s var(--ease-out); }
.cm-layer { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; fill: #000; will-change: transform;
  filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px #fff) drop-shadow(0 0 .6px #fff); }
.cm--plain .svgi { width: 30px; height: auto; color: #000; }
.cursor.is-down .cm { scale: .84; }
.cursor-label {
  position: absolute; left: 30px; top: 22px; white-space: nowrap;
  padding: 6px 12px 4px; border-radius: 999px; background: var(--ink); color: var(--paper);
  font-family: var(--font-accent); text-transform: uppercase; font-size: 16px; line-height: 1;
  border: 2px solid var(--paper);
  transform: scale(0); transform-origin: 0 0; transition: transform .35s var(--ease-out);
}
.cursor.has-label .cursor-label { transform: scale(1); }

/* ---------------------------------------------------------------- toast + burst */
.toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 110; transform: translate(-50%, 250%);
  display: flex; align-items: center; gap: 12px; padding: 10px 18px 10px 10px;
  background: var(--ink); color: var(--paper); border-radius: 999px; border: var(--line) solid var(--paper);
  box-shadow: 0 0 0 var(--line) var(--ink);
  font-family: var(--font-mono); font-size: 15px; pointer-events: none;
}
.toast-dot { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--paper); }
.toast b { font-family: var(--font-accent); font-weight: 400; font-size: 20px; line-height: 1; text-transform: uppercase; }
.burst-star { position: fixed; left: 0; top: 0; width: 18px; height: 18px; z-index: 115; pointer-events: none; }

/* ---------------------------------------------------------------- section rail */
.rail { position: fixed; right: 10px; top: 50%; transform: translateY(-50%); z-index: 40; display: none; flex-direction: column; gap: 4px; }
@media (min-width: 1100px) { .rail { display: flex; } }
.rail a { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 4px 0; font-family: var(--font-mono); font-size: 12px; }
.rail a span { padding: 4px 9px 3px; border-radius: 999px; background: var(--ink); color: var(--paper); opacity: 0; transform: translateX(8px); transition: opacity .3s, transform .4s var(--ease-out); white-space: nowrap; }
.rail a i { width: 12px; height: 4px; border-radius: 4px; background: var(--ink); box-shadow: 0 0 0 1.5px var(--paper); transition: width .45s var(--ease-out), background .3s; }
.rail a.is-active i { width: 30px; background: var(--accent); box-shadow: 0 0 0 1.5px var(--ink); }
.rail:hover a span, .rail a:focus-visible span { opacity: 1; transform: none; }

/* ---------------------------------------------------------------- buttons, chips, switch */
.btn {
  display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 22px;
  border: var(--line) solid var(--ink); border-radius: 999px; background: var(--paper); color: var(--ink);
  font-family: var(--font-accent); text-transform: uppercase; font-size: 21px; line-height: 1;
  transition: background .3s, color .3s, transform .3s var(--ease-out);
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn:active { transform: scale(.96); }
.btn[disabled] { opacity: .35; pointer-events: none; }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover { background: var(--accent); color: var(--ink); }

.switch { display: inline-flex; align-items: center; gap: 12px; font-family: var(--font-accent); text-transform: uppercase; font-size: 22px; line-height: 1; }
.sw-track { position: relative; width: 74px; height: 40px; border-radius: 999px; background: var(--ink); border: var(--line) solid var(--ink); transition: background .35s; }
.sw-knob { position: absolute; top: 3px; left: 3px; width: 28px; height: 28px; border-radius: 50%; background: var(--paper); box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.switch[aria-checked="true"] .sw-track { background: var(--bad); }
.switch .sw-a, .switch .sw-b { transition: opacity .3s; }
.switch[aria-checked="false"] .sw-b, .switch[aria-checked="true"] .sw-a { opacity: .35; }

/* ---------------------------------------------------------------- next chapter footer */
.next { margin-top: clamp(90px, 12vw, 170px); background: var(--ink); color: var(--paper); }
.next .band { --tile: 44px; }
.next-link { display: block; padding: clamp(40px, 6vw, 80px) 0 clamp(26px, 4vw, 48px); }
.next-row { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.next-title { font-size: clamp(64px, 14vw, 230px); display: block; }
.next-arrow { width: clamp(56px, 8vw, 120px); height: clamp(56px, 8vw, 120px); border-radius: 50%; background: var(--paper); color: var(--ink); display: grid; place-items: center; font-family: var(--font-accent); font-size: clamp(30px, 4vw, 60px); transition: transform .5s var(--ease-out), background .3s; flex: none; }
.next-link:hover .next-arrow { transform: rotate(-45deg) scale(1.06); background: var(--accent); }
.next-soon { font-family: var(--font-accent); text-transform: uppercase; font-size: 18px; border: 2px solid currentColor; border-radius: 999px; padding: 6px 12px 4px; opacity: .7; }
.credit { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 22px 0 28px; border-top: 2px solid rgba(255,255,255,.25); font-family: var(--font-mono); font-size: 13px; }
.credit a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------------------------------------------------------------- reveal states */
html.js [data-fade] { opacity: 0; }
html.no-motion [data-fade] { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
