/* ==========================================================================
   Base — reset, typography, layout primitives, motion
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 400 var(--fs-body)/1.6 var(--font-body);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.04;
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); letter-spacing: -0.035em; line-height: 0.98; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); line-height: 1.12; }
p { max-width: 62ch; text-wrap: pretty; }

a { color: var(--accent-text); text-decoration: none; }
.prose a, .link {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 280ms var(--ease);
}
.prose a:hover, .link:hover { background-size: 100% 1px; }

:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 3px;
  border-radius: 2px;
}
.on-dark :focus-visible { outline-color: #fff; }

::selection { background: var(--accent); color: var(--on-accent); }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: fixed; left: 16px; top: -80px; z-index: 100;
  background: var(--ink); color: var(--canvas);
  padding: 12px 18px; font: 500 var(--fs-mono)/1 var(--font-mono);
  letter-spacing: .08em; text-transform: uppercase;
  transition: top 160ms var(--ease);
}
.skip:focus { top: 16px; }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
  row-gap: clamp(24px, 3vw, 48px);
}
.grid > * { grid-column: 1 / -1; min-width: 0; }

.section { padding-block: var(--space-section); position: relative; }
.section + .section { border-top: 1px solid var(--rule); }
.section--tight { padding-block: calc(var(--space-section) * .6); }

/* Asymmetric two-column composition: head left / body right (flip = mirrored) */
@media (min-width: 900px) {
  .split > .split__head { grid-column: 1 / span 5; }
  .split > .split__body { grid-column: 7 / -1; }
  .split--flip > .split__head { grid-column: 8 / -1; grid-row: 1; text-align: right; }
  .split--flip > .split__head p { margin-left: auto; }
  .split--flip > .split__body { grid-column: 1 / span 6; grid-row: 1; }
}

/* ---------- Type helpers ---------- */
.eyebrow, .mono {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.eyebrow { color: var(--accent-text); margin-bottom: clamp(20px, 2.4vw, 36px); }
.muted { color: var(--muted); }
.lede { font-size: var(--fs-lede); line-height: 1.45; letter-spacing: -0.01em; max-width: 34ch; }
.lede--wide { max-width: 52ch; }
.think {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 20px;
  border-top: 1px solid var(--rule); padding-top: 20px; margin-top: clamp(32px, 4vw, 56px);
}
.think .mono { color: var(--muted); }
.think p { font-size: clamp(20px, 2vw, 26px); font-weight: 500; letter-spacing: -0.015em; }

/* ---------- Placeholder chips ---------- */
.fill {
  display: inline-block;
  font: 500 11px/1.3 var(--font-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 3px 8px;
  margin: 0 2px;
  color: var(--fill-ink);
  background: var(--fill-bg);
  border: 1px dashed currentColor;
  border-radius: 2px;
  vertical-align: middle;
  white-space: normal;
}

/* ---------- Motion ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  transition-delay: var(--d, 0ms);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

.draw {
  display: block; height: 1px; background: var(--rule); border: 0; width: 100%;
}
.js .draw { transform: scaleX(0); transform-origin: left; transition: transform 900ms var(--ease); }
.js .draw.is-in { transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .js [data-reveal], .js .draw { opacity: 1 !important; transform: none !important; }
}
