*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: var(--line-base);
  color: var(--ink);
  background: var(--paper);
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
}
/* grain overlay — breaks digital flatness, never intercepts input */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: var(--z-overlay);
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}
::selection { background: var(--ink); color: var(--paper); }
h1, h2, h3, h4 { text-wrap: balance; margin: 0; }
h1 { font-family: var(--font-display); font-size: var(--text-2xl); letter-spacing: -0.015em; line-height: 1.05; }
h2 { font-family: var(--font-display); font-size: var(--text-xl); letter-spacing: -0.01em; }
h3 { font-size: var(--text-lg); }
h4 { font-size: var(--text-md); }
a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }
button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { display: inline-block; vertical-align: -0.15em; flex: none; }
.skip-link {
  position: absolute; top: -48px; left: 8px;
  background: var(--paper); color: var(--ink);
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm);
  text-decoration: none; z-index: var(--z-skip);
  font-weight: 600;
}
.skip-link:focus-visible { top: 8px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
@media (forced-colors: active) {
  .card, .list-row, .filter-bar { border: 1px solid CanvasText; }
  body::after { display: none; }
  :focus-visible { outline: 3px solid Highlight; }
}
