﻿*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
[hidden] { display: none !important; }
/* paper grain: a tiny inline SVG noise, so the flat ivory feels like stock */
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0.035; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
main, footer { position: relative; z-index: 1; }
h1, h2 { font-family: var(--font-display); font-weight: 400; line-height: 1.02; margin: 0; letter-spacing: -0.015em; }
h3 { font: 600 1.3rem/1.25 var(--font-head); margin: 0; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.8rem, 7vw, 5.4rem); }
h2 { font-size: clamp(2rem, 4.2vw, 3rem); }
h4, .h4 { font: 500 0.72rem/1.2 var(--font-mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin: 0 0 var(--s2); }
p { margin: 0 0 var(--s4); }
a { color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
a:hover { color: var(--accent-hover); }
::selection { background: var(--accent); color: var(--on-accent); }
code, pre, kbd { font-family: var(--font-mono); font-size: 0.9em; }
code { background: var(--code-bg); border-radius: 6px; padding: 0.1em 0.4em; }
pre { background: var(--dark); color: var(--on-dark); border-radius: var(--radius); padding: var(--s5); overflow: auto; margin: 0; line-height: 1.6; }
pre code { background: none; padding: 0; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.page { width: min(100% - 2 * var(--s5), var(--page)); margin-inline: auto; }
.narrow { max-width: 46rem; margin-inline: auto; }
.eyebrow { display: inline-flex; align-items: center; gap: var(--s2); font: 500 0.74rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); margin: 0 0 var(--s4); }
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 40rem; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--s3); top: -4rem; background: var(--accent); color: var(--on-accent); padding: var(--s2) var(--s4); border-radius: var(--radius); z-index: 100; }
.skip:focus { top: var(--s3); }

/* Scroll reveal: only hides content once JS has marked the page, so nothing is lost without JS. */
.js .reveal { opacity: 0; transform: translateY(20px); transition: opacity 700ms cubic-bezier(0.2, 0.7, 0.2, 1), transform 700ms cubic-bezier(0.2, 0.7, 0.2, 1); transition-delay: calc(var(--d, 0) * 80ms); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
