/* Reset + document-level typography ---------------------------------------- */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@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;
  }
}

body {
  min-height: 100svh;
  background-color: var(--bg);
  /* Barely-there paper tooth. Two soft radial washes, no image request. */
  background-image:
    radial-gradient(58rem 32rem at 12% -8%, var(--bg-grain), transparent 70%),
    radial-gradient(48rem 30rem at 96% 4%, var(--bg-grain), transparent 65%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--t-md);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

h1 {
  font-size: var(--t-2xl);
}
h2 {
  font-size: var(--t-xl);
}
h3 {
  font-size: var(--t-lg);
}
h4 {
  font-size: var(--t-md);
}

p {
  text-wrap: pretty;
}

a {
  color: var(--brass-ink);
  text-underline-offset: 0.18em;
  text-decoration-thickness: from-font;
}

a:hover {
  color: var(--brass);
}

img,
svg {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

/* One consistent focus ring everywhere. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--brass);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* Utilities ---------------------------------------------------------------- */

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--surface);
  color: var(--ink);
  padding: var(--sp-3) var(--sp-4);
  border: 2px solid var(--brass);
  border-radius: 0 0 var(--r-md) 0;
}

.skip-link:focus {
  left: 0;
}

.stack > * + * {
  margin-block-start: var(--flow, var(--sp-4));
}

.stack-sm {
  --flow: var(--sp-2);
}
.stack-lg {
  --flow: var(--sp-5);
}

.muted {
  color: var(--ink-2);
}
.dim {
  color: var(--ink-3);
  font-size: var(--t-sm);
}
.center {
  text-align: center;
}
.nowrap {
  white-space: nowrap;
}

/* Wide content (tables, timelines) scrolls inside itself — never the page. */
.scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Shell -------------------------------------------------------------------- */

.shell {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
}

main {
  flex: 1;
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding: var(--sp-5) var(--sp-4) var(--sp-7);
}

main.wide {
  max-width: var(--measure-wide);
}

/* Sticky action bar for long interview screens. */
main.has-dock {
  padding-bottom: calc(var(--sp-7) + 4.5rem);
}
