/* ==========================================================================
   SMA Estimating — base.css
   Design tokens, reset, typography, shared primitives.
   Load order: base.css → header.css → home.css → footer.css
   ========================================================================== */

/* --- Fonts (self-hosted, subset, variable) -------------------------------- */
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-subset.woff2") format("woff2-variations");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-subset.woff2") format("woff2-variations");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

/* --- Tokens --------------------------------------------------------------- */
:root {
  /* Brand */
  --blue: #013cae;
  --blue-800: #012e88;
  --blue-900: #061638;
  --gold: #faaa17;
  --gold-700: #c07f05;

  /* Surfaces */
  --paper: #f2f5fa;
  --paper-2: #e8edf6;
  --white: #ffffff;

  /* Text */
  --ink: #0b1a35;
  --muted: #4c5b78;
  --muted-2: #6b7893;
  --on-dark: #dde5f4;
  --on-dark-dim: #9fb0d0;

  /* Lines */
  --line: #d7dfec;
  --line-strong: #b9c6dd;
  --line-dark: rgba(255, 255, 255, 0.16);

  /* Type */
  --sans: "Archivo", "Helvetica Neue", Arial, system-ui, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;

  --fs-hero: clamp(2.15rem, 1.4rem + 2.9vw, 3.4rem);
  --fs-h2: clamp(1.75rem, 1.25rem + 2vw, 2.6rem);
  --fs-h3: clamp(1.15rem, 1.05rem + 0.4vw, 1.35rem);
  --fs-lede: clamp(1.05rem, 1rem + 0.3vw, 1.2rem);
  --fs-body: 1.0625rem;
  --fs-sm: 0.9375rem;
  --fs-xs: 0.8125rem;

  /* Space */
  --gutter: clamp(1.15rem, 4vw, 2.5rem);
  --section-y: clamp(3.5rem, 6vw, 6.5rem);
  --max: 1200px;
  --max-narrow: 68ch;

  --radius: 6px;
  --radius-lg: 12px;

  --shadow-panel: 0 24px 60px -28px rgba(7, 26, 60, 0.45);
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

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

html {
  /* `clip` rather than `hidden`: it stops the off-canvas drawer from
     creating horizontal scroll without breaking position: sticky. */
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--fs-body);
  line-height: 1.68;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

img, svg, video { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }

h1, h2, h3, h4 {
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: -0.021em;
  line-height: 1.1;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: var(--fs-hero); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); line-height: 1.25; letter-spacing: -0.012em; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--gold-700); }

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

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --- Layout primitives ---------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); }
.section--paper { background: var(--paper); }
.section--tight { padding-block: clamp(2.5rem, 4vw, 4rem); }

.skip-link {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -120%);
  background: var(--blue);
  color: #fff;
  padding: 0.7rem 1.2rem;
  font-family: var(--sans);
  font-size: var(--fs-sm);
  z-index: 999;
}
.skip-link:focus { transform: translate(-50%, 0); color: #fff; }

/* --- Section heading block ------------------------------------------------ */
.s-head { max-width: 62ch; margin-bottom: clamp(2rem, 3.5vw, 3rem); }
.s-head__rule {
  width: 54px;
  height: 3px;
  background: var(--gold);
  margin-bottom: 1.35rem;
}
.s-head p {
  color: var(--muted);
  font-size: var(--fs-lede);
  margin-top: 1rem;
  line-height: 1.6;
}
.s-head--center { margin-inline: auto; text-align: center; }
.s-head--center .s-head__rule { margin-inline: auto; }

/* --- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-family: var(--sans);
  font-weight: 600;
  font-size: var(--fs-sm);
  letter-spacing: 0.005em;
  line-height: 1;
  padding: 1rem 1.6rem;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease),
              border-color 0.18s var(--ease);
}
.btn--gold { background: var(--gold); color: var(--blue-900); }
.btn--gold:hover { background: #ffbe44; color: var(--blue-900); }
.btn--blue { background: var(--blue); color: #fff; }
.btn--blue:hover { background: var(--blue-800); color: #fff; }
.btn--ghost {
  border-color: var(--line-strong);
  color: var(--ink);
  background: var(--white);
}
.btn--ghost:hover { border-color: var(--blue); color: var(--blue); }
.btn--ghost-light {
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}
.btn--ghost-light:hover { border-color: #fff; background: rgba(255, 255, 255, 0.08); color: #fff; }
.btn--sm { padding: 0.7rem 1.1rem; font-size: var(--fs-xs); }

/* --- Data / dimension type ------------------------------------------------ */
.num {
  font-family: var(--sans);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}
.tag {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted-2);
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Blueprint grid overlay used on dark bands */
.grid-field {
  position: relative;
  isolation: isolate;
}
.grid-field::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: radial-gradient(120% 90% at 70% 25%, #000 20%, transparent 78%);
}

/* --------------------------------------------------------------------------
   CTA band — shared by every page
   -------------------------------------------------------------------------- */
.band {
  background: linear-gradient(140deg, var(--blue-900), var(--blue));
  color: #fff;
  padding-block: clamp(3rem, 5vw, 4.5rem);
}
.band__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(1.75rem, 4vw, 3rem);
  align-items: center;
}
.band h2 { color: #fff; max-width: 20ch; }
.band p { color: var(--on-dark); margin-top: 0.9rem; max-width: 54ch; }
.band__actions { display: flex; flex-wrap: wrap; gap: 0.85rem; }
.band__fine {
  margin-top: 1.4rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--on-dark-dim);
}
@media (max-width: 860px) {
  .band__inner { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   Byline / last-reviewed line — shared by every page
   -------------------------------------------------------------------------- */
.reviewed {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  align-items: center;
  padding: 1.1rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--muted-2);
}
.reviewed strong { color: var(--ink); font-weight: 600; }


/* --------------------------------------------------------------------------
   Scroll reveal

   Gated on `.js`, which an inline snippet in <head> sets before first paint.
   Without JavaScript the class never lands and content is simply visible —
   nothing can end up permanently hidden. The hero is excluded because it
   holds the LCP element and must not be delayed.
   -------------------------------------------------------------------------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  will-change: opacity, transform;
}
.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
  will-change: auto;
}

/* Children of a staggered container arrive in sequence. */
.js [data-reveal-stagger] > * {
  opacity: 0;
  transform: translateY(18px);
}
.js [data-reveal-stagger].is-in > * {
  opacity: 1;
  transform: none;
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.js [data-reveal-stagger].is-in > *:nth-child(1) { transition-delay: 0.04s; }
.js [data-reveal-stagger].is-in > *:nth-child(2) { transition-delay: 0.09s; }
.js [data-reveal-stagger].is-in > *:nth-child(3) { transition-delay: 0.14s; }
.js [data-reveal-stagger].is-in > *:nth-child(4) { transition-delay: 0.19s; }
.js [data-reveal-stagger].is-in > *:nth-child(5) { transition-delay: 0.24s; }
.js [data-reveal-stagger].is-in > *:nth-child(6) { transition-delay: 0.28s; }
.js [data-reveal-stagger].is-in > *:nth-child(n+7) { transition-delay: 0.32s; }

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal],
  .js [data-reveal].is-in,
  .js [data-reveal-stagger] > *,
  .js [data-reveal-stagger].is-in > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

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