/* Structure: resets, grain, focus, motion guard, and the type scale. Brand-free by design —
   every colour and face is read from the theme contract in theme.css. */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 400; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; max-width: var(--measure); }
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; height: auto; }

.serif { font-family: var(--serif); letter-spacing: -0.015em; }

/* Grain. The logo artwork carries a travertine texture; on screen it becomes this rather than
   an image request. Pure CSS, so it costs nothing on the network. */
.grain { position: relative; isolation: isolate; }
.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.4;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Every interactive target clears 44px (FR-013). */
a[data-action], button, .target { min-height: 44px; display: inline-flex; align-items: center; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* FR-012 — not a courtesy. Someone who asks their device for less motion gets none, and no
   content anywhere depends on movement to become visible. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
