/* Reset, layout primitives, type and shared controls */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  text-wrap: pretty;
  overflow-x: hidden;
}

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

h1, h2, h3, h4 {
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.06;
  text-wrap: balance;
}

/* Intended line breaks. On wide screens every .ln is exactly one line;
   on narrow screens the lines flow and wrap naturally. */
.ln { display: block; white-space: nowrap; }

@media (max-width: 640px) {
  .ln { display: inline; white-space: normal; }
}

/* Accent phrase: brand-blue Newsreader italic, kept as one unit */
.accent {
  display: inline-block;
  color: var(--blue-text);
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 450;
  letter-spacing: -0.02em;
}

.nw { white-space: nowrap; }

.container {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--space-section); }
.section--paper { background: var(--paper); }

/* Mono label above section titles */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: '';
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--blue);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  box-shadow: 0 1px 2px rgba(11, 21, 38, 0.05);
}

.pill b { padding: 2px 9px; border-radius: 999px; background: var(--blue-tint); color: var(--blue-text); font-weight: 600; }

.section-head {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: 20px;
  align-items: end;
  margin-bottom: clamp(2.5rem, 2rem + 2vw, 4rem);
}

.section-head__title { grid-column: 1 / span 7; display: grid; gap: 20px; }
.section-head__title h2 { font-size: var(--text-h2); }

.section-head__lede {
  grid-column: 8 / span 5;
  color: var(--ink-3);
  font-size: var(--text-lg);
  line-height: 1.55;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease, transform 200ms var(--ease-out), box-shadow 200ms ease;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary { background: var(--ink); color: var(--on-dark); box-shadow: 0 8px 20px -10px rgba(11, 21, 38, 0.6); }
.btn--primary:hover { background: var(--blue-deep); }

.btn--ghost { border-color: var(--line-strong); color: var(--ink); background: var(--surface); }
.btn--ghost:hover { border-color: var(--ink); }

.btn--light { background: var(--on-dark); color: var(--ink); }
.btn--light:hover { background: var(--blue-tint); }

.btn .arrow { transition: transform 200ms var(--ease-out); }
.btn:hover .arrow { transform: translateX(3px); }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--on-dark);
  text-decoration: none;
}

.skip-link:focus { top: 16px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Reveal on scroll — runs once per element */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--duration) var(--ease-out), transform var(--duration) var(--ease-out);
  transition-delay: var(--delay, 0ms);
}

.js .reveal.is-in { opacity: 1; transform: none; }

.d1 { --delay: 100ms; }
.d2 { --delay: 180ms; }
.d3 { --delay: 260ms; }
.d4 { --delay: 340ms; }

@media (max-width: 900px) {
  .section-head { grid-template-columns: 1fr; }
  .section-head__title,
  .section-head__lede { grid-column: 1 / -1; }
}

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