/* Reset, fonts, typography, focus, motion guard. Reads tokens only. */

@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces-latin.woff2") format("woff2");
  font-weight: 300 900;
  font-optical-sizing: auto;
  font-display: swap;
}
@font-face {
  font-family: "Work Sans";
  src: url("/fonts/worksans-latin.woff2") format("woff2");
  font-weight: 300 800;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/plexmono-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/plexmono-medium-latin.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  hanging-punctuation: first last;
}

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-m);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  font-optical-sizing: auto;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
p, h1, h2, h3, h4 { overflow-wrap: break-word; }
p { max-width: var(--measure); }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: "SOFT" 0, "WONK" 0;
  line-height: var(--leading-tight);
  letter-spacing: -0.005em;
  text-wrap: balance;
}
h1 { font-size: var(--text-3xl); font-weight: 560; }
h2 { font-size: var(--text-2xl); font-weight: 520; }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-l); font-weight: 600; }

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: .18em;
}
a:hover { text-decoration-color: currentColor; }

code, kbd, samp, .mono {
  font-family: var(--font-mono);
  font-size: .92em;
  font-variant-numeric: tabular-nums;
}

hr { border: 0; border-top: var(--hairline); }

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

:is(a, button, input, select, textarea, summary, [tabindex]:not([tabindex="-1"])):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-s);
}
/* Headings receive programmatic focus after navigation; no ring there. */
h1:focus, h2:focus { outline: none; }

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

/* Icons follow text size and colour. One family (Lucide), inline sprite. */
.ico {
  inline-size: 1.15em;
  block-size: 1.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* Motion guard: also silences view transitions, which browsers do not do on their own. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

@view-transition { navigation: auto; }
