/* ==========================================================================
   BASE — reset, typography, accessibility floor
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--color-ink);
  background: var(--color-bg);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color var(--duration-base) var(--ease-standard),
              color var(--duration-base) var(--ease-standard);
}

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

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  line-height: var(--lh-tight);
  color: var(--color-ink);
  font-weight: 600;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 1.5rem + 2.2vw, var(--fs-4xl)); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, var(--fs-2xl)); margin-top: var(--space-8); }
h3 { font-size: var(--fs-lg); margin-top: var(--space-6); }
h4 { font-size: var(--fs-md); margin-top: var(--space-5); }

p { max-width: 72ch; }
p + p { margin-top: var(--space-4); }

ul, ol { padding-left: 1.25em; }
li + li { margin-top: var(--space-2); }

a {
  color: var(--color-brass-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover { color: var(--color-brass); }

/* All numeric / calculated output uses tabular monospace figures —
   this is the platform's typographic signature. */
.num, output, .readout-value, td.num, .stat-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
:focus:not(:focus-visible) { outline: none; }

.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;
  left: var(--space-4);
  top: -100px;
  background: var(--color-ink);
  color: var(--color-bg);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  z-index: var(--z-toast);
  transition: top var(--duration-base) var(--ease-standard);
}
.skip-link:focus { top: var(--space-4); }

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-5);
}
.container--narrow { max-width: var(--container-narrow); }

@media (min-width: 768px) {
  .container { padding-inline: var(--space-6); }
}

hr.rule {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-8) 0;
}

::selection { background: var(--color-brass-tint); color: var(--color-ink); }

table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--color-border); }
th { font-family: var(--font-display); font-weight: 600; }
