/* ==========================================================================
   Routio — Base / reset / typography / layout primitives
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--dur-slow) var(--ease-standard), color var(--dur-slow) var(--ease-standard);
  /* Second line of defence against horizontal overflow (see .mobile-sheet /
     .mobile-cta-bar's own 100vw fix for the specific cause found on
     device) — never lets a stray element's edge open a scrollable strip. */
  overflow-x: clip;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p { margin: 0; }

/* Visible focus ring everywhere — never outline:none without replacement */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 6px;
}

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

.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  background: var(--surface);
  color: var(--text-primary);
  padding: 10px 16px;
  border-radius: var(--r-tile);
  z-index: 1000;
  box-shadow: var(--shadow-sm);
  transition: top var(--dur-fast) var(--ease-standard);
}
.skip-link:focus { top: 12px; }

/* ---- Typography ---- */
.h-display {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: clamp(38px, 5.4vw, 64px);
  line-height: 1.05;
}
.h2 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: clamp(30px, 3.6vw, 44px);
  line-height: 1.12;
}
.h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: clamp(22px, 2.2vw, 28px);
  line-height: 1.25;
}
.lead {
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.55;
  color: var(--text-secondary);
}
.caption {
  font-size: clamp(13px, 1vw, 14px);
  line-height: 1.45;
  color: var(--text-tertiary);
}
/* Nothing below 14px on mobile except the stat labels, which are their own
   deliberately-smaller case (see .stat-cell .label). */
@media (max-width: 767px) {
  .caption { font-size: 14px; }
}
.metric {
  font-family: var(--font-body);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: clamp(36px, 4.4vw, 56px);
  line-height: 1;
}
.label {
  font-size: 12px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  font-weight: 600;
}

/* ---- Layout primitives ---- */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section {
  padding-block: 28px;
}
@media (min-width: 768px) { .section { padding-block: 52px; } }
@media (min-width: 1024px) { .section { padding-block: 72px; } }

/* Heading -> its immediate body/lead paragraph */
.mt-head { margin-top: 12px; }
@media (min-width: 768px) { .mt-head { margin-top: 14px; } }

/* Heading block (heading + lead) -> the content below it */
.mt-block { margin-top: 24px; }
@media (min-width: 768px) { .mt-block { margin-top: 28px; } }
@media (min-width: 1024px) { .mt-block { margin-top: 36px; } }

/* Remove trailing margins on the last child of a card */
.card > *:last-child { margin-bottom: 0; }

.section--deep { background: var(--canvas-deep); }
.section--dark { background: var(--canvas-deep); }

.grid-12 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (min-width: 768px) { .grid-12 { gap: 18px; } }
@media (min-width: 1024px) { .grid-12 { gap: 20px; } }
@media (min-width: 640px) {
  .grid-12 { grid-template-columns: repeat(8, 1fr); }
}
@media (min-width: 1024px) {
  .grid-12 { grid-template-columns: repeat(12, 1fr); }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* reveal-on-scroll */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--dur-slow) var(--ease-standard), transform var(--dur-slow) var(--ease-standard);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { transform: none; transition: opacity var(--dur-slow) linear; }
}
