/* ==========================================================================
   PATHWAY — BASE: reset, typography, layout primitives
   ========================================================================== */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---- Headings ----------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: var(--t-hero);    line-height: var(--lh-tight); letter-spacing: var(--tr-display); }
h2 { font-size: var(--t-display); line-height: var(--lh-snug);  letter-spacing: var(--tr-display); }
h3 { font-size: var(--t-h2);      line-height: var(--lh-snug);  letter-spacing: var(--tr-h2); }
h4 { font-size: var(--t-h3);      line-height: 1.3;             letter-spacing: -0.01em; }

p { margin: 0 0 var(--s-4); max-width: var(--measure); }
p:last-child { margin-bottom: 0; }

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

/* ---- Focus: always visible, never removed ------------------------------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
.on-dark :focus-visible, .panel :focus-visible { outline-color: var(--sky); }

/* ---- Layout primitives -------------------------------------------------- */
.wrap      { width: 100%; max-width: var(--container);   margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2.5rem); }
.wrap-wide { width: 100%; max-width: var(--container-w); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2.5rem); }

.section    { padding-block: var(--section-y); }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }
.section--flush-top { padding-top: 0; }

.stack > * + * { margin-top: var(--s-4); }
.stack-lg > * + * { margin-top: var(--s-6); }

.lead { font-size: var(--t-lead); line-height: 1.5; color: var(--text-muted); max-width: 56ch; }
.on-dark .lead, .panel .lead { color: var(--text-on-dark-mut); }

.muted { color: var(--text-muted); }
.on-dark .muted, .panel .muted { color: var(--text-on-dark-mut); }

/* ---- Mono utility voice: sheet codes, jurisdiction codes, day counts ---- */
.mono {
  font-family: var(--font-mono);
  font-size: var(--t-label);
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  font-weight: 500;
}
.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* Wordmark treatment — matches the logo lockup spec exactly. */
.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: var(--tr-word);
  text-transform: uppercase;
}

/* ---- Accessibility helpers --------------------------------------------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip-link {
  position: absolute; left: var(--s-4); top: -100%;
  z-index: 200; background: var(--graphite); color: var(--offwhite);
  padding: var(--s-3) var(--s-4); border-radius: var(--r-card); text-decoration: none;
}
.skip-link:focus { top: var(--s-4); }

/* ---- Scroll reveal — content is visible if JS never runs --------------- */
.reveal { opacity: 1; }
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--d-slow) var(--ease-out), transform var(--d-slow) var(--ease-out);
}
.js .reveal.is-in { opacity: 1; transform: none; }
.js .reveal-d1 { transition-delay: 80ms; }
.js .reveal-d2 { transition-delay: 160ms; }
.js .reveal-d3 { transition-delay: 240ms; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
}
