/* ============================================================
   Trooper Eric Workman Foundation — Base Layer
   Design tokens • reset • typography • global utilities
   ============================================================ */

:root {
  /* — Brand palette ———————————————————————————— */
  --ink:        #0e1f3a;        /* deep state-trooper navy */
  --ink-2:      #18305c;        /* lighter navy for surfaces */
  --ink-3:      #243e72;        /* hover/active navy */
  --brass:      #c99a48;        /* honor brass */
  --brass-dark: #a37a2f;
  --brass-soft: #e7c986;
  --sage:       #5c7a65;        /* WV forest */
  --brick:      #8a2e2e;        /* memorial accent — used sparingly */
  --parchment:  #f6f2ea;        /* primary surface */
  --parchment-2:#efe9dc;
  --paper:      #fbf9f4;
  --charcoal:   #1a1916;
  --slate:      #4a4d55;
  --slate-2:    #7a7d85;
  --hairline:   rgba(14, 31, 58, .12);
  --hairline-2: rgba(14, 31, 58, .18);
  --shadow-1:   0 1px 2px rgba(14, 31, 58, .04), 0 4px 16px rgba(14, 31, 58, .06);
  --shadow-2:   0 8px 40px rgba(14, 31, 58, .12);
  --shadow-3:   0 24px 60px rgba(14, 31, 58, .18);

  /* — Typography ———————————————————————————————— */
  --serif: "Fraunces", "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans:  "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* fluid type scale (clamp(min, fluid, max)) — tuned so small viewports stay compact */
  --fs-100: clamp(.75rem, .72rem + .08vw, .8125rem);
  --fs-200: clamp(.875rem, .85rem + .1vw, .9375rem);
  --fs-300: 1rem;
  --fs-400: clamp(1.0625rem, 1rem + .25vw, 1.125rem);
  --fs-500: clamp(1.15rem, 1.05rem + .5vw, 1.5rem);
  --fs-600: clamp(1.35rem, 1.15rem + 1vw, 2rem);
  --fs-700: clamp(1.65rem, 1.25rem + 2vw, 2.875rem);
  --fs-800: clamp(2rem, 1.4rem + 3vw, 4rem);
  --fs-900: clamp(2.25rem, 1.4rem + 4.5vw, 5.5rem);

  /* — Spacing — based on a 4px grid ———————————————— */
  --s-1:  .25rem;
  --s-2:  .5rem;
  --s-3:  .75rem;
  --s-4:  1rem;
  --s-5:  1.5rem;
  --s-6:  2rem;
  --s-7:  3rem;
  --s-8:  4rem;
  --s-9:  6rem;
  --s-10: 8rem;

  /* — Radii & motion ———————————————————————————— */
  --r-1: 4px;
  --r-2: 8px;
  --r-3: 12px;
  --r-4: 20px;
  --r-full: 999px;

  --ease-out:  cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --t-fast: 160ms;
  --t-med:  280ms;
  --t-slow: 520ms;

  /* — Container widths ———————————————————————————— */
  --w-prose: 65ch;
  --w-narrow: 56rem;
  --w-base:  72rem;
  --w-wide:  86rem;
}

/* — Modern reset ————————————————————————————————— */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: var(--fs-300);
  line-height: 1.6;
  color: var(--charcoal);
  background: var(--parchment);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: clip;
}
img, picture, svg, video { display: block; max-width: 100%; height: auto; }
img { font-style: italic; background-color: var(--parchment-2); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
  border-radius: 2px;
}

/* — Headings ————————————————————————————————————— */
h1, h2, h3, h4, h5 {
  font-family: var(--serif);
  font-weight: 500;
  font-variation-settings: "SOFT" 25, "opsz" 36;
  letter-spacing: -.012em;
  line-height: 1.08;
  color: var(--ink);
  text-wrap: balance;
  overflow-wrap: break-word;
  hyphens: auto;
}
h1 { font-size: var(--fs-800); }
h2 { font-size: var(--fs-700); }
h3 { font-size: var(--fs-600); }
h4 { font-size: var(--fs-500); }
h5 { font-size: var(--fs-400); }

p { text-wrap: pretty; max-width: var(--w-prose); overflow-wrap: break-word; }
.lead { font-size: var(--fs-400); color: var(--slate); }

/* — Reusable utilities ————————————————————————————— */
.container       { width: min(100% - 2rem, var(--w-base)); margin-inline: auto; }
.container-narrow{ width: min(100% - 2rem, var(--w-narrow)); margin-inline: auto; }
.container-wide  { width: min(100% - 1.5rem, var(--w-wide)); margin-inline: auto; }
@media (min-width: 600px) {
  .container       { width: min(100% - 2.5rem, var(--w-base)); }
  .container-narrow{ width: min(100% - 2.5rem, var(--w-narrow)); }
  .container-wide  { width: min(100% - 2rem, var(--w-wide)); }
}

.section { padding-block: clamp(3rem, 3vw + 2rem, 6rem); }
.section--tight { padding-block: clamp(2rem, 2vw + 1.5rem, 4rem); }
.section--hero  { padding-block: 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--sans);
  font-size: var(--fs-100);
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--brass-dark);
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1.5px;
  background: var(--brass);
}
.eyebrow--center { justify-content: center; }
.eyebrow--light { color: var(--brass-soft); }
.eyebrow--light::before { background: var(--brass-soft); }

.text-serif { font-family: var(--serif); }
.text-sans  { font-family: var(--sans); }
.text-center{ text-align: center; }
.text-muted { color: var(--slate); }
.text-brass { color: var(--brass-dark); }
.text-ink   { color: var(--ink); }
.uppercase  { text-transform: uppercase; letter-spacing: .08em; }

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--hairline-2) 20%, var(--hairline-2) 80%, transparent);
  margin-block: var(--s-6);
}
.divider--ornament {
  position: relative;
  background: transparent;
  text-align: center;
  height: 24px;
  margin-block: var(--s-7);
}
.divider--ornament::before {
  content: "";
  position: absolute;
  inset: 50% 0 auto 0;
  height: 1px;
  background: var(--hairline-2);
}
.divider--ornament::after {
  content: "✦";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  background: var(--parchment);
  padding-inline: 12px;
  color: var(--brass);
  font-size: 14px;
}

.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 */
.skip-link {
  position: absolute;
  left: 12px; top: -50px;
  z-index: 200;
  background: var(--ink);
  color: var(--parchment);
  padding: .5rem .85rem;
  border-radius: var(--r-2);
  transition: top var(--t-fast) var(--ease-out);
  text-decoration: none;
}
.skip-link:focus-visible { top: 12px; outline: 2px solid var(--brass); }

/* — Reveal on scroll ——————————————————————————————— */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
