/* ==========================================================================
   Base — reset + typographic foundation
   ========================================================================== */

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--t-body-size);
  font-weight: var(--t-body-weight);
  line-height: 1.5;
  color: var(--text-main);
  background: var(--surface-app);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
p,
figure,
blockquote {
  margin: 0;
}

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

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

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

a {
  color: var(--link);
  text-decoration: none;
}

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

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

table {
  border-collapse: collapse;
  width: 100%;
}

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

::selection {
  background: var(--brand-200);
  color: var(--ink-900);
}

/* Thin, quiet scrollbars — the same in every scrolling box. */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }
::-webkit-scrollbar-corner { background: transparent; }

/* ------------------------------------------------------------ type helpers */

.t-display {
  font-size: var(--t-display-size);
  line-height: var(--t-display-lh);
  font-weight: var(--t-display-weight);
  letter-spacing: var(--t-display-track);
  color: var(--ink-900);
}

.t-hero {
  font-size: var(--t-hero-size);
  line-height: var(--t-hero-lh);
  font-weight: var(--t-hero-weight);
  letter-spacing: var(--t-hero-track);
  color: var(--ink-900);
}

.t-figure {
  font-size: var(--t-figure-size);
  font-weight: var(--t-figure-weight);
  letter-spacing: var(--t-figure-track);
  color: var(--ink-900);
  line-height: 1.15;
}

.t-stat {
  font-size: var(--t-stat-size);
  font-weight: var(--t-stat-weight);
  letter-spacing: var(--t-stat-track);
  color: var(--ink-900);
  line-height: 1.2;
}

.t-card-title {
  font-size: var(--t-card-title-size);
  font-weight: var(--t-card-title-weight);
  letter-spacing: var(--t-card-title-track);
  color: var(--ink-900);
}

.t-label {
  font-size: var(--t-label-size);
  font-weight: var(--t-label-weight);
  letter-spacing: var(--t-label-track);
  color: var(--ink-500);
}

.t-micro {
  font-size: var(--t-micro-size);
  font-weight: var(--t-micro-weight);
  letter-spacing: var(--t-micro-track);
  text-transform: uppercase;
  color: var(--ink-400);
}

.t-muted {
  color: var(--ink-400);
}

.u-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;
}

.u-row {
  display: flex;
  align-items: center;
}

.u-gap-1 { gap: var(--s-1); }
.u-gap-2 { gap: var(--s-2); }
.u-gap-3 { gap: var(--s-3); }
.u-gap-4 { gap: var(--s-4); }

.u-spacer {
  flex: 1 1 auto;
}

/* Wide content never scrolls the page body — it scrolls inside its own box. */
.u-scroll-x {
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
