/* Reset, typography, focus and scrollbars. Nothing here knows about the app's layout. */

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

/* `hidden` is a UA rule of `display: none`, so any component rule that sets `display`
   silently outranks it — a hidden `.pill` (inline-flex) stayed on screen as an empty
   capsule. Restated here at author level so the attribute means what it says everywhere. */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--fg);
  font: 400 15px/1.5 var(--sans);
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { margin: 0; font-weight: 620; letter-spacing: -.011em; line-height: 1.25; }
h1 { font-size: 1.375rem; }
h2 { font-size: 1.0625rem; }
h3 { font-size: .9375rem; }
p  { margin: 0; }
a  { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }

code, .mono, kbd {
  font-family: var(--mono);
  font-size: .8125em;
  font-variant-ligatures: none;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-s);
}

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

/* Utilities shared by every view. */
.muted    { color: var(--fg-muted); }
.faint    { color: var(--fg-faint); }
.small    { font-size: .8125rem; }
.tabnums  { font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.stack > * + * { margin-top: .875rem; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: .5rem; top: .5rem; z-index: 60;
  padding: .5rem .75rem;
  background: var(--accent); color: var(--accent-fg);
  border-radius: var(--radius-s);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--fg-faint); background-clip: content-box; }
