/* ============================================================
   BASE — reset, document, links, selection, focus, a11y.
   All tone comes from the ink ramp (color-mix); never rgba/opacity.
   ============================================================ */

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

* { margin: 0; }

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

body {
  background: var(--surface-page);
  color: var(--text-body);
  font-family: var(--font-serif);
  font-size: var(--step-0);
  font-weight: var(--wt-book);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

img, canvas, svg, video { display: block; max-width: 100%; }
img { height: auto; border-radius: var(--radius); }

a { color: inherit; text-underline-offset: 0.15em; text-decoration-thickness: var(--hair); }
/* --accent-text, not --accent: a hover state is a word being read, and the raw
   pigment falls under the small-text floor on bistre and verdigris. Same
   substitution everywhere the accent lands on a glyph rather than a ground. */
a:hover { color: var(--accent-text); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: var(--wt-semi);
  line-height: var(--leading-snug);
  letter-spacing: var(--track-tight);
  text-wrap: balance;
}

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

::selection { background: var(--select-bg); color: var(--select-fg); }

:focus-visible {
  outline: var(--line) solid var(--rule-strong);
  outline-offset: 2px;
}

/* Screen-reader-only text — for structure the design carries visually without
   type (e.g. the home page's h1 when the fold prints no masthead) */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

/* Skip link — visible on focus only */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: var(--space-2xs) var(--space-sm);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: var(--track-label);
  font-size: var(--step--2);
  z-index: 100;
}
.skip:focus { left: var(--space-sm); top: var(--space-sm); }

/* Print-only material — the link register and colophon theme.js builds into
   the DOM at load (print.css styles them). Media-gated rather than a bare
   display:none so print needs no un-hiding rule: on paper these elements
   simply are what they are. Screenshots (make shots) render screen media,
   so the screen theme stays untouched. */
@media screen {
  .print-only { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
