/* Base: reset, self-hosted fonts, base typography, and a tiny utility set
   (skip-link, visually-hidden, global focus-visible, reduced-motion). */

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

/* @font-face for self-hosted Outfit lands when the WOFF2 binaries ship
   under /assets/fonts/. Until then, --font-body falls through 'Outfit'
   (no @font-face declared) to system-ui — no 404s, no FOUT. */

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: var(--weight-light);
  line-height: var(--leading-loose);
  min-block-size: 100vh;
  overflow-x: hidden;
  transition: background var(--motion-duration-slow), color var(--motion-duration-slow);
}

/* Skip-to-content link — first focusable element on every page.
   Hidden until focused; logical positioning for RTL friendliness. */
.skip-link {
  position: absolute;
  inset-block-start: var(--space-2);
  inset-inline-start: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--bg-raised);
  color: var(--text-primary);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform var(--motion-duration-fast) var(--motion-ease-out);
  z-index: var(--z-fixed-chrome);
}

.skip-link:focus {
  transform: translateY(0);
}

.visually-hidden {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Global focus indicator. Every focusable element either gets this default
   outline-based ring or replaces it with an equivalent visible style.
   Never `outline: none` without an alternative. */
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Reduced motion: zero out non-essential animation. The one place where
   !important is acceptable in this codebase, per css.md. */
@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;
  }
}
