/* ==========================================================================
   Base — reset, typography, layout primitives, theming plumbing.
   No components (buttons, cards, tables, nav, carousel) live here.
   ========================================================================== */

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

* {
  margin: 0;
}

/* [hidden] must always win. The UA stylesheet's implicit [hidden]{display:none}
   is easily defeated by any component rule that sets display (eg. .stat-tile{
   display:flex}, .plate-grid{display:grid}), because those are author rules
   with equal or higher precedence. gates.js relies on the hidden attribute as
   a fail-closed compliance guarantee — an unverifiable claim must stay off
   screen even if JS never runs. This is a correctness guarantee, not a
   styling preference, so no component-level display rule may override it. */
[hidden] {
  display: none !important;
}

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  font-family: var(--type-body-font);
  font-size: var(--type-body-size);
  line-height: var(--type-body-line);
  background: var(--surface-page);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

img,
svg,
picture,
video,
canvas {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

ul,
ol {
  list-style: none;
  padding: 0;
}

::selection {
  background: var(--accent-muted);
}

a {
  color: var(--text-accent);
  text-underline-offset: 3px;
}

/* digits that need to align — tables, stats, dates */
.tabular,
[class*="stat"],
[class*="table"],
[class*="data"] {
  font-variant-numeric: tabular-nums;
}

/* Focus
   ========================================================================== */
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  box-shadow: none;
  border-radius: var(--radius-sm);
}

/* Heading scale
   ========================================================================== */
.h1 {
  font-family: var(--type-heading-font);
  font-size: clamp(var(--size-xl), 5vw, var(--size-3xl));
  line-height: var(--type-heading-line);
  font-weight: 700;
  letter-spacing: var(--type-heading-tracking);
}

.h2 {
  font-family: var(--type-heading-font);
  font-size: var(--type-heading-size);
  line-height: var(--type-heading-line);
  font-weight: 700;
  letter-spacing: var(--type-heading-tracking);
}

.h3 {
  font-family: var(--type-heading-font);
  font-size: var(--size-lg);
  line-height: var(--type-heading-line);
  font-weight: 700;
  letter-spacing: var(--type-heading-tracking);
}

/* Type utilities
   ========================================================================== */
.eyebrow {
  font-family: var(--type-label-font);
  font-size: var(--type-label-size);
  letter-spacing: var(--type-label-tracking);
  text-transform: uppercase;
  font-weight: 500;
  color: var(--text-secondary);
}

.mono {
  font-family: var(--font-mono);
}

/* Layout primitives
   ========================================================================== */
.section {
  padding-block: var(--space-10);
}

@media (max-width: 768px) {
  .section {
    padding-block: var(--space-9);
  }
}

/* Accessibility utilities
   ========================================================================== */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.skip-link:focus {
  top: var(--space-3);
  left: var(--space-3);
  width: auto;
  height: auto;
  margin: 0;
  padding: var(--space-2) var(--space-4);
  clip: auto;
  overflow: visible;
  white-space: normal;
  position: fixed;
  z-index: 100;
  background: var(--surface-raised);
  color: var(--text-primary);
}

/* Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
