/* base.css — reset, base typography, focus ring, reduced-motion guard.
   Consumes tokens from tokens.css. Motion rules follow design-spec 5.3:
   global smooth scrolling in no-preference media; hard stop in reduce media. */

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

* {
  margin: 0;
}

html {
  color-scheme: dark;
}

body {
  min-height: 100vh;
  background-color: var(--gs-color-bg);
  color: var(--gs-color-text-primary);
  font-family: var(--gs-font-body);
  font-size: 1rem;
  line-height: var(--gs-line-height-body);
}

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

/* Author `display` rules (e.g. `svg { display: block }` above) would otherwise
   defeat the UA `[hidden] { display: none }` rule: author origin beats UA
   origin regardless of specificity. Re-assert the hidden contract. */
[hidden] {
  display: none !important;
}

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

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

a {
  color: var(--gs-color-accent-blue);
  text-decoration: none;
}

/* ---- Typography scale (design-spec 2.2, fluid sizes via tokens) ---- */

h1,
h2,
h3,
h4 {
  font-family: var(--gs-font-display);
  overflow-wrap: break-word;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
}

.hero-title {
  font-size: var(--gs-font-size-display);
  font-weight: 700;
  line-height: 1.1;
}

.section-title {
  font-size: var(--gs-font-size-h2);
  font-weight: 600;
  line-height: 1.25;
}

.section-intro {
  max-width: 72ch;
  margin-top: var(--gs-space-4);
  color: var(--gs-color-text-secondary);
  font-size: var(--gs-font-size-body-lg);
}

.text-small {
  font-size: 0.875rem;
  line-height: 1.5;
}

.caption {
  font-size: 0.8125rem;
  line-height: 1.5;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* ---- Focus ring (design-spec 7.2: visible, never removed) ---- */

:focus-visible {
  outline: 2px solid var(--gs-color-focus);
  outline-offset: 2px;
}

/* ---- Reduced-motion guard skeleton (design-spec 5.3 / 5.2 last column) ----
   All component animations/transitions additionally live inside
   no-preference media in layout.css / components.css. */

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
