/* ==========================================================================
   base.css — reset, document defaults, type scale, focus, selection.
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, Arial, sans-serif;
  font-size: var(--t-body);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  font-feature-settings: "cv01", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color var(--dur-med) var(--ease-std),
    color var(--dur-med) var(--ease-std);
}

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

a {
  color: var(--accent-text);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-std);
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: none;
  border: none;
}

ul,
ol {
  list-style: none;
}

/* --- Headings ------------------------------------------------------------- */
h1,
h2,
h3,
h4 {
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: var(--text);
  text-wrap: balance;
}

h1 {
  font-size: var(--t-h1);
  font-weight: 700;
}
h2 {
  font-size: var(--t-h2);
  font-weight: 700;
}
h3 {
  font-size: var(--t-h3);
}

p {
  text-wrap: pretty;
}

/* --- Numeric / stat displays: tabular figures so digits don't reflow ------ */
.tnum,
.stat-num,
[data-countup] {
  font-feature-settings: "tnum" 1, "cv01" 1;
  font-variant-numeric: tabular-nums;
}

/* --- Focus ---------------------------------------------------------------- */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

::selection {
  background: var(--accent);
  color: var(--accent-on);
}

/* --- Skip link ------------------------------------------------------------ */
.skip-link {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -120%);
  z-index: 1000;
  padding: var(--s-12) var(--s-16);
  background: var(--accent);
  color: var(--accent-on);
  font-weight: 600;
  border-radius: 0 0 var(--r-md) var(--r-md);
  transition: transform var(--dur-med) var(--ease);
}

.skip-link:focus-visible {
  transform: translate(-50%, 0);
  text-decoration: none;
}

/* --- Utility -------------------------------------------------------------- */
.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;
}

/* --- Inline-sprite icons (stroke-based, sized via font-size / width) ------ */
.icon {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.icon--fill {
  fill: currentColor;
  stroke: none;
}

/* Disabled download link (until URLs are wired) */
.is-disabled {
  opacity: 0.55;
  pointer-events: none;
  cursor: not-allowed;
}

.accent-text {
  color: var(--accent-text);
}

.text-secondary {
  color: var(--text-secondary);
}
