/* ============================================================
   nokken base styles — reset, typography defaults, page shell,
   focus convention, view-transitions. Component CSS (chrome,
   section-card, etc.) lives in separate files that load after
   this one.
   ============================================================ */

/* Self-hosted font-face declarations. Files under /static/fonts/
   are vendored via scripts/vendor.sh. `display: swap` lets the
   fallback render first on slow networks instead of blocking. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/inter-latin-400.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/inter-latin-500.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/inter-latin-600.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/inter-latin-700.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/jetbrains-mono-latin-400.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/jetbrains-mono-latin-500.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/jetbrains-mono-latin-600.woff2") format("woff2");
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img, svg, video, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }

/* Page shell */
html { color-scheme: light dark; }
body {
  font-family: var(--font-sans);
  background: var(--surface-base);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01", "ss03";
  min-height: 100dvh;
}

/* Links. `a:focus-visible` uses the shared focus ring below. */
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

/* Focus ring convention — applies to anything focusable via keyboard.
   Design source: Round 3 § Component states. 3px ring in brand-500 at
   50% mix, 2px offset. `:focus-visible` avoids ringing on mouse clicks. */
:focus { outline: none; }
:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand-500) 50%, transparent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* View Transitions — browsers that support the API get cross-page
   animations; others degrade to an instant swap. Per-element
   `view-transition-name` hooks live in component CSS. */
@view-transition { navigation: auto; }

/* Monospace utility for numeric readings, timestamps, status numbers. */
.mono { font-family: var(--font-mono); }

/* Visually hidden but screen-reader accessible. */
.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;
}

/* Respect reduced-motion. The `*` universal selector does NOT match
   the `::view-transition-*` pseudo-element tree (they sit outside
   the document), so the cross-page morph from Phase 6 PR 6.3 needs
   its own rule to degrade to an instant swap. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
  }
}
