/* ============================================================
   BRUK GETNET — base
   Tokens, reset, type system, chrome (nav / locator / cursor).
   The whole document reads two variables that JavaScript
   interpolates against scroll position: --bg and --ink.
   ============================================================ */

:root {
  /* interpolated at runtime — these are the opening values */
  --bg: #070708;
  --ink: #F4F3F1;
  --accent: #DFB571;
  --tone: 0;                 /* 0 = dark environment, 1 = light environment */

  /* derived, so every element adapts to the transition for free */
  --ink-80: color-mix(in oklab, var(--ink) 80%, var(--bg));
  --ink-60: color-mix(in oklab, var(--ink) 58%, var(--bg));
  --ink-40: color-mix(in oklab, var(--ink) 38%, var(--bg));
  --ink-20: color-mix(in oklab, var(--ink) 20%, var(--bg));
  --line: color-mix(in oklab, var(--ink) 14%, var(--bg));
  --line-soft: color-mix(in oklab, var(--ink) 8%, var(--bg));
  --surface: color-mix(in oklab, var(--ink) 5%, var(--bg));
  --surface-2: color-mix(in oklab, var(--ink) 9%, var(--bg));

  --font-display: 'Archivo', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Instrument Serif', 'Times New Roman', Times, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --t-hero: clamp(3.9rem, 17.5vw, 17rem);
  --t-xl: clamp(2.5rem, 8vw, 8.5rem);
  --t-lg: clamp(2rem, 5vw, 4.8rem);
  --t-mid: clamp(1.55rem, 3.2vw, 3rem);
  --t-body: clamp(1rem, 1.05vw, 1.15rem);
  --t-sm: 0.9rem;
  --t-xs: 0.78rem;
  --t-mono: 0.72rem;

  --pad: clamp(1.25rem, 5vw, 6rem);
  --navh: clamp(56px, 5.4vw, 72px);
  --maxw: 1680px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
html.rm { scroll-behavior: auto; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--t-body);
  font-weight: 350;
  line-height: 1.55;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure, pre, blockquote { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, svg, picture { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; }
a { color: inherit; text-decoration: none; }
b, strong { font-weight: 500; }

::selection { background: var(--ink); color: var(--bg); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

.u-sr, .skip:not(:focus) {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip:focus {
  position: fixed;
  z-index: 200;
  top: 1rem; left: 1rem;
  padding: 0.7rem 1.1rem;
  background: var(--ink);
  color: var(--bg);
  font-size: var(--t-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── environment: fixed texture that answers to the current tone ───────── */
.env { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

.env__grain {
  position: absolute; inset: -50%;
  opacity: calc(0.34 - var(--tone) * 0.22);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  will-change: opacity;
}

.env__vignette {
  position: absolute; inset: 0;
  opacity: calc(1 - var(--tone) * 0.86);
  background:
    radial-gradient(120% 90% at 50% 45%, transparent 38%, rgba(0, 0, 0, 0.55) 100%);
}

main { position: relative; z-index: 1; }

/* ── scenes ───────────────────────────────────────────────────────────── */
.scene { position: relative; }
.tone { position: absolute; left: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ── navigation ───────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  z-index: 60;
  top: 0; left: 0; right: 0;
  padding: 0 var(--pad);
}
/* A scrim, not a bar. The page keeps flowing underneath, but the strip the nav
   type actually occupies is opaque, so nothing ever collides with it. The mask
   fades the blur out too, which is what keeps the lower edge from showing a seam. */
.nav::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: calc(var(--navh) * 1.85);
  background: var(--bg);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 54%, rgba(0, 0, 0, 0.5) 76%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 54%, rgba(0, 0, 0, 0.5) 76%, transparent 100%);
  opacity: 0;
  transition: opacity 0.5s var(--ease);
  pointer-events: none;
}
.nav.is-stuck::before { opacity: 1; }

.nav__inner {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: var(--navh);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 0.85rem 0 0.5rem;
}
.nav__right { display: flex; flex-direction: column; align-items: flex-end; gap: 0.3rem; }

.nav__mark {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-size: var(--t-xs);
  letter-spacing: 0.02em;
}
.nav__mono {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: 0.1em;
  color: var(--accent);
}
.nav__name {
  font-weight: 450;
  letter-spacing: 0.01em;
  transition: opacity 0.4s var(--ease);
}

.nav__links { display: flex; gap: clamp(1rem, 2.2vw, 2.4rem); }
.nav__links a {
  position: relative;
  font-size: var(--t-xs);
  font-weight: 400;
  color: var(--ink-60);
  padding: 0.35rem 0;
  transition: color 0.35s var(--ease);
}
.nav__links a::after {
  content: '';
  position: absolute; left: 0; bottom: 0.1rem;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease);
}
.nav__links a:hover, .nav__links a[aria-current='true'] { color: var(--ink); }
.nav__links a:hover::after, .nav__links a[aria-current='true']::after { transform: scaleX(1); }

.nav__progress {
  max-width: var(--maxw);
  margin: 0 auto;
  height: 1px;
  background: var(--line-soft);
}
.nav__progress i {
  display: block;
  height: 100%;
  background: var(--ink-60);
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
}

.nav__toggle { display: none; align-items: center; gap: 0.55rem; cursor: pointer; }
.nav__toggle-label { font-size: var(--t-xs); }
.nav__toggle-bars { display: block; width: 20px; }
.nav__toggle-bars i {
  display: block; height: 1px; background: var(--ink);
  transition: transform 0.4s var(--ease);
}
.nav__toggle-bars i:first-child { margin-bottom: 5px; }
.nav__toggle[aria-expanded='true'] .nav__toggle-bars i:first-child { transform: translateY(3px) rotate(9deg); }
.nav__toggle[aria-expanded='true'] .nav__toggle-bars i:last-child { transform: translateY(-3px) rotate(-9deg); }

.menu {
  position: fixed;
  z-index: 55;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2rem;
  padding: 18vh var(--pad) var(--pad);
  opacity: 0;
  transition: opacity 0.45s var(--ease);
}
.menu[hidden] { display: none; }
.menu.is-open { opacity: 1; }
.menu nav { display: grid; gap: 0.2rem; }
.menu nav a {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 11vw, 3.6rem);
  font-weight: 500;
  font-stretch: 92%;
  letter-spacing: -0.03em;
  line-height: 1.12;
  opacity: 0;
  transform: translateY(0.4em);
}
.menu.is-open nav a { animation: menuIn 0.7s var(--ease) forwards; }
.menu.is-open nav a:nth-child(2) { animation-delay: 0.05s; }
.menu.is-open nav a:nth-child(3) { animation-delay: 0.1s; }
.menu.is-open nav a:nth-child(4) { animation-delay: 0.15s; }
.menu.is-open nav a:nth-child(5) { animation-delay: 0.2s; }
@keyframes menuIn { to { opacity: 1; transform: none; } }
.menu__foot { margin-top: auto; font-size: var(--t-sm); color: var(--ink-60); }

/* ── locator: quiet chapter marker, tucked under the nav links ────────── */
.locator {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--ink-40);
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.6s var(--ease);
}
.nav.is-stuck .locator { opacity: 1; }
.locator__num { color: var(--ink-60); }
.locator__rule { display: block; width: clamp(24px, 4vw, 48px); height: 1px; background: var(--line); }
.locator__rule i {
  display: block; height: 100%; background: var(--accent);
  transform: scaleX(0); transform-origin: left; will-change: transform;
}
.locator__label { min-width: 8ch; text-align: right; }

/* ── custom cursor: a hairline ring, nothing more ──────────────────────── */
.cursor { display: none; }
html.fine .cursor {
  display: block;
  position: fixed;
  z-index: 90;
  top: 0; left: 0;
  width: 26px; height: 26px;
  margin: -13px 0 0 -13px;
  border: 1px solid var(--ink-40);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s linear, width 0.35s var(--ease), height 0.35s var(--ease),
              margin 0.35s var(--ease), border-color 0.35s var(--ease), background-color 0.35s var(--ease);
  will-change: transform;
}
html.fine .cursor.is-on { opacity: 1; }
html.fine .cursor.is-link {
  width: 46px; height: 46px; margin: -23px 0 0 -23px;
  border-color: var(--ink-60);
  background: color-mix(in oklab, var(--ink) 6%, transparent);
}
html.fine .cursor.is-label {
  width: 74px; height: 74px; margin: -37px 0 0 -37px;
  border-color: transparent;
  background: var(--ink);
}
.cursor span {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bg);
  opacity: 0;
  transition: opacity 0.25s linear;
}
html.fine .cursor.is-label span { opacity: 1; }
html.rm .cursor { display: none !important; }

/* ── shared atoms ─────────────────────────────────────────────────────── */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-40);
}

.body { font-size: var(--t-body); color: var(--ink-60); max-width: 42ch; }
.body--sm { font-size: var(--t-sm); }
.body code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  color: var(--ink-80);
  border-bottom: 1px solid var(--line);
}

.h-mid {
  font-family: var(--font-display);
  font-size: var(--t-mid);
  font-weight: 500;
  font-stretch: 94%;
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.chips { display: flex; flex-wrap: wrap; gap: 0.45rem 1.15rem; }
.chips li {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: 0.06em;
  color: var(--ink-40);
  position: relative;
}
.chips li + li::before {
  content: '';
  position: absolute; left: -0.62rem; top: 0.42em;
  width: 3px; height: 3px;
  background: var(--line);
  border-radius: 50%;
}
.chips--lg li { font-size: var(--t-xs); color: var(--ink-60); letter-spacing: 0.04em; }

.tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid color-mix(in oklab, var(--accent) 34%, transparent);
  padding: 0.24em 0.55em;
  border-radius: 100px;
  white-space: nowrap;
}

/* numerals: one consistent treatment for every figure on the site */
.num, .stmt__num b, .growth__big b, .fig__n b, .gauge__val b,
.record__grid dt b, .scan__rate b, .tick__lat b, .pipe__out-n b, .modern__pct b {
  font-family: var(--font-display);
  font-weight: 600;
  font-stretch: 86%;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}

/* split text primitives */
[data-split] { display: inline-block; }
.ch { display: inline-block; will-change: transform; }
.ch--space { width: 0.3em; }
.ln { display: block; overflow: hidden; }
.ln > i { display: block; font-style: normal; will-change: transform; }

/* reveal defaults, only armed when JS is running */
html.js [data-reveal-lines] .ln > i { transform: translateY(105%); }
html.js.rm [data-reveal-lines] .ln > i { transform: none; }

@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__toggle { display: flex; }
  .nav__name { display: none; }
  .nav__right { order: 3; }
  .locator__label { display: none; }
  .body { max-width: none; }
}
