/* Reset, typography, layout primitives, reveal utilities. */

*, *::before, *::after { box-sizing: border-box; }
/* the solid bar's height (.nav: offset + 54 px + its 10 px skirt), so a section lands flush under it at every width */
html { scroll-behavior: smooth; scroll-padding-top: calc(env(safe-area-inset-top, 0px) + var(--gut) + 64px);-webkit-text-size-adjust: 100%; scrollbar-color: var(--forest-mid) var(--paper-2); }
body {
  margin: 0; background: var(--paper); color: var(--text);
  font-family: var(--sans); font-size: var(--fs-body); line-height: 1.6; letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased; overflow-x: hidden; caret-color: var(--brand);
}
h1, h2, h3, h4 { margin: 0; font-variant-numeric: lining-nums; font-weight: 500; line-height: 1.05; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; text-wrap: pretty; }
dl, dd, figure { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
address { font-style: normal; }
abbr[aria-label] { text-decoration: none; }
::selection { background: var(--brand); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
[tabindex="-1"]:focus { outline: none; }  /* sections that only receive focus from in-page links (ui.js) */
[hidden] { display: none !important; }

/* sections inherit their theme from tokens */
section, .foot { position: relative; background: var(--bg); color: var(--fg); }

.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: var(--gut); top: -60px; z-index: 100; padding: 10px 16px; border-radius: var(--r-sm); background: var(--forest); color: var(--white); transition: top .3s; }
.skip:focus { top: var(--gut); }

.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gut); }
.pad { padding-block: var(--sec); }
.z { position: relative; z-index: 1; }

/* typography roles */
.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -.015em; }
.display { font-family: var(--serif); font-weight: 400; font-size: var(--fs-display); line-height: .98; letter-spacing: -.025em; }
.display-2 { font-size: var(--fs-display-2); line-height: .98; letter-spacing: -.025em; }
.h2 { font-size: var(--fs-h2); letter-spacing: -.02em; }
.h3 { font-size: var(--fs-h3); line-height: 1.08; }
.h4 { font-size: var(--fs-h4); line-height: 1.2; }
.lede { font-size: clamp(1.08rem, 1.35vw, 1.24rem); color: var(--fg-muted); max-width: 58ch; }
.muted { color: var(--fg-muted); }
.accent { color: var(--accent-text); }

.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: var(--fs-eyebrow); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-muted); }
/* the logo's silver slash as a section marker */
.eyebrow-slash::before { content: ""; width: 22px; height: 3px; border-radius: 2px; background: var(--chrome); transform: skewX(-30deg); }
.chrome-rule { height: 2px; width: 0; background: var(--chrome); transition: width 1.6s var(--ease) .2s; }
.in .chrome-rule, .chrome-rule.in { width: 100%; }

/* reveal */
.rv { opacity: 0; transform: translateY(32px); transition: opacity var(--dur) var(--ease), transform 1s var(--ease); }
.rv.in { opacity: 1; transform: none; }
.rv.d1 { transition-delay: .08s; } .rv.d2 { transition-delay: .16s; } .rv.d3 { transition-delay: .24s; }

/* procedural contour lines on dark chapters */
.topo { position: absolute; inset: 0; overflow: hidden; pointer-events: none; color: rgba(238, 242, 238, .055); }
.topo svg { position: absolute; inset: -6%; width: 112%; height: 112%; transform: translateY(calc(var(--p, .5) * -4%)); }
/* own layer: --p moves it every scroll frame; without it desktop Chrome repainted the SVG each frame and flashed the paper
   background. Not on touch screens: on a phone Applications is ~7000 device px tall, too big a layer for iOS */
@media (hover: hover) and (pointer: fine) { .topo svg { will-change: transform; } }

@keyframes spin-in { from { transform: rotate(-120deg) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes wiggle { 0%, 100% { transform: translateX(-3px) rotate(-8deg); } 50% { transform: translateX(3px) rotate(8deg); } }
@keyframes sweep { to { transform: translateX(100%); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .rv { opacity: 1; transform: none; }
  .chrome-rule { width: 100%; }
}
