/* =========================================================================
   Base element + layout styles
   ========================================================================= */
html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  /* Fluid root size — the master dial for the whole rem-based UI:
       • small monitors (<~1410px) scale DOWN toward a 14px floor (~1175px),
       • ~1410px lands at the familiar 16px,
       • large monitors scale UP, capped at 23px (~2560px+).
     So content shrinks on small screens and grows on big ones, proportionally. */
  font-size: clamp(14px, 4px + 0.85vw, 23px);
}

body {
  background: var(--bg-yellow);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--navy);
  line-height: var(--lh-tight);
  font-weight: 600;
}

h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }

p { color: var(--ink); }

a {
  color: var(--red);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--red-dark); }

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

/* ---- Layout helpers ----
   .container / .container--narrow and the .section / .section__head /
   .section__eyebrow / .section__title / .section__lead system are owned by
   css/components/section.css (single source of truth). Don't redefine here. */
.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: hidden until focused, then slides into the top-left corner so
   keyboard users can jump straight to <main id="main">. */
.skip-link:focus {
  position: fixed;
  top: var(--space-3);
  left: var(--space-3);
  z-index: var(--z-transition);
  width: auto; height: auto;
  margin: 0;
  padding: var(--space-3) var(--space-5);
  clip: auto;
  border-radius: var(--radius-pill);
  background: var(--red);
  color: var(--on-red);
  font-family: var(--font-display);
  font-weight: 600;
  box-shadow: var(--shadow-md);
}

/* Don't paint a focus ring on the programmatically-focused main wrapper
   (tabindex=-1); the skip link is the visible affordance. */
#main:focus { outline: none; }

/* ---- Reveal base state (reveals.js animates these) ---- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  will-change: opacity, transform;
}

/* If JS/ScrollTrigger never runs or reduced-motion is on, show content */
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}
