/* ============================================================
   SMART TOPO — base
   Tokens, reset, typography, motion primitives, utilities.
   ============================================================ */

:root {
  /* --- brand (traced from the SMART TOPO identity) -------- */
  --blue:       #38559D;   /* logo blue  */
  --blue-deep:  #2B4279;
  --brass:      #A18437;   /* logo brass */
  --brass-lite: #C4A24A;
  --brass-deep: #7A6529;

  /* --- palette ------------------------------------------- */
  --ink:        #0E1726;
  --ink-2:      #142034;
  --ink-3:      #1E2E48;
  --navy:       #1B2C4E;
  --navy-2:     #2A4270;
  --paper:      #F4F2EC;
  --paper-2:    #E9E6DC;
  --paper-3:    #DBD6C6;
  --slate:      #565D66;
  --slate-2:    #98A2B0;

  --accent:        var(--brass);        /* rules, marks, large display */
  --accent-2:      var(--brass-lite);
  --accent-strong: var(--blue);         /* filled buttons and badges */
  --accent-text:   var(--brass-deep);   /* small accent text on a light band */

  /* --- semantic ------------------------------------------ */
  --bg:         var(--paper);
  --fg:         var(--ink);
  --fg-muted:   var(--slate);
  --rule:       rgba(14, 23, 38, .14);
  --rule-soft:  rgba(14, 23, 38, .07);
  --field:      rgba(14, 23, 38, .04);
  --sel-bg:     var(--accent);
  --sel-fg:     var(--paper);

  /* --- type ---------------------------------------------- */
  --f-display: "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --f-sans:    "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --f-mono:    "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --t-xs:   clamp(.75rem, .72rem + .12vw, .80rem);
  --t-sm:   clamp(.82rem, .79rem + .14vw, .90rem);
  --t-base: clamp(.97rem, .93rem + .2vw,  1.06rem);
  --t-md:   clamp(1.06rem, 1.0rem + .3vw, 1.22rem);
  --t-lg:   clamp(1.25rem, 1.12rem + .62vw, 1.62rem);
  --t-xl:   clamp(1.6rem, 1.32rem + 1.35vw, 2.6rem);
  --t-2xl:  clamp(2.1rem, 1.55rem + 2.65vw, 4.1rem);
  --t-3xl:  clamp(2.7rem, 1.7rem + 4.8vw, 6.4rem);

  /* --- space --------------------------------------------- */
  --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;
  --band:   clamp(4.5rem, 3rem + 7vw, 9.5rem);
  --band-s: clamp(3rem, 2rem + 4.5vw, 6rem);

  /* --- measure ------------------------------------------- */
  --wrap: 82.5rem;      /* 1320px */
  --wrap-wide: 96rem;
  --wrap-text: 40rem;
  --gutter: clamp(1.25rem, .6rem + 2.6vw, 4rem);

  /* --- motion -------------------------------------------- */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --dur: .6s;

  --header-h: 5.25rem;
  color-scheme: light;
}

/* Sections that flip to the dark palette re-declare semantics
   so every nested component inherits without extra classes. */
.band--dark,
.band--ink {
  --bg: var(--ink);
  --fg: var(--paper);
  --fg-muted: var(--slate-2);
  --rule: rgba(244, 242, 236, .16);
  --rule-soft: rgba(244, 242, 236, .08);
  --field: rgba(244, 242, 236, .05);
  --epic-outline: rgba(244, 242, 236, .3);
  --accent-text: var(--brass-lite);
  color-scheme: dark;
}
.band--navy {
  --bg: var(--navy);
  --fg: var(--paper);
  --fg-muted: var(--slate-2);
  --rule: rgba(244, 242, 236, .18);
  --rule-soft: rgba(244, 242, 236, .09);
  --field: rgba(244, 242, 236, .06);
  --epic-outline: rgba(244, 242, 236, .3);
  --accent-text: var(--brass-lite);
  color-scheme: dark;
}
.band--paper2 { --bg: var(--paper-2); }

/* ============================================================
   reset
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  overflow-x: clip;
}

body {
  font-family: var(--f-sans);
  font-size: var(--t-base);
  line-height: 1.62;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }
table { border-collapse: collapse; width: 100%; }
::selection { background: var(--sel-bg); color: var(--sel-fg); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 1px;
}

/* ============================================================
   typography
   ============================================================ */

h1, h2, h3, h4, h5 { font-weight: 500; line-height: 1.1; text-wrap: balance; }

.display {
  font-family: var(--f-display);
  font-weight: 500;
  letter-spacing: -.022em;
  line-height: 1.02;
}
.display em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

.t-3xl { font-size: var(--t-3xl); }
.t-2xl { font-size: var(--t-2xl); }
.t-xl  { font-size: var(--t-xl); }
.t-lg  { font-size: var(--t-lg); }
.t-md  { font-size: var(--t-md); }
.t-sm  { font-size: var(--t-sm); }

p { text-wrap: pretty; }

.lede {
  font-size: var(--t-md);
  line-height: 1.6;
  color: var(--fg);
}

.prose { max-width: 42rem; }
.prose p + p { margin-top: 1.1em; }
.prose a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .22em;
  text-decoration-color: var(--brass-deep);
  transition: text-decoration-color .25s;
}
.prose a:hover { text-decoration-color: var(--accent); }

/* mono label — the site's connective tissue */
.eyebrow {
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--fg-muted);
  display: inline-flex;
  align-items: center;
  gap: .7em;
}
.eyebrow::before {
  content: "";
  width: 1.9em;
  height: 1px;
  background: var(--accent);
  flex: none;
}
.eyebrow--bare::before { display: none; }

.num {
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}

.mono {
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  letter-spacing: .14em;
  text-transform: uppercase;
}

.muted { color: var(--fg-muted); }
.accent { color: var(--accent-text); }

/* ============================================================
   layout primitives
   ============================================================ */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--wide { max-width: var(--wrap-wide); }
.wrap--narrow { max-width: 62rem; }

.band {
  background: var(--bg);
  color: var(--fg);
  padding-block: var(--band);
  position: relative;
}
.band--tight { padding-block: var(--band-s); }
.band--flush-top { padding-top: 0; }
.band--flush-bottom { padding-bottom: 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gutter);
}

.rule { height: 1px; background: var(--rule); border: 0; }

.stack > * + * { margin-top: var(--s-4); }
.stack-lg > * + * { margin-top: var(--s-6); }

/* section header: eyebrow + title + optional aside */
.sec-head {
  display: grid;
  gap: var(--s-5) var(--gutter);
  align-items: end;
  margin-bottom: clamp(2.5rem, 1.5rem + 3vw, 5rem);
}
@media (min-width: 62rem) {
  .sec-head { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
  .sec-head__aside { padding-bottom: .4rem; }
}
.sec-head__title { font-size: var(--t-2xl); margin-top: var(--s-4); }

/* ============================================================
   reveal / motion
   ============================================================ */

[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 1.6rem, 0);
  transition:
    opacity .85s var(--ease-out) var(--rd, 0ms),
    transform .95s var(--ease-out) var(--rd, 0ms);
  will-change: opacity, transform;
}
[data-reveal="mask"] {
  transform: none;
  clip-path: inset(0 0 100% 0);
  transition:
    opacity .5s linear var(--rd, 0ms),
    clip-path 1.15s var(--ease-out) var(--rd, 0ms);
}
[data-reveal="fade"] { transform: none; }
[data-reveal="left"]  { transform: translate3d(-2rem, 0, 0); }
[data-reveal="right"] { transform: translate3d(2rem, 0, 0); }
[data-reveal="scale"] { transform: scale(1.06); transform-origin: center; }

.is-in[data-reveal] {
  opacity: 1;
  transform: none;
  clip-path: inset(0 0 0 0);
  will-change: auto;
}

/* line-by-line headline reveal */
.lines { display: block; }
/* Descenders need headroom, or `overflow: hidden` shaves them off.
   The padding is pulled back out with a matching negative margin. */
.lines .line {
  display: block;
  overflow: hidden;
  padding-bottom: .16em;
  margin-bottom: -.16em;
}
.lines .line > span {
  display: block;
  transform: translate3d(0, 118%, 0);
  transition: transform 1.05s var(--ease-out) var(--ld, 0ms);
}
.is-in .lines .line > span,
.lines.is-in .line > span { transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; clip-path: none !important; }
  .lines .line > span { transform: none !important; }
  [data-parallax] { transform: none !important; }
}

/* ============================================================
   utilities
   ============================================================ */

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip {
  position: fixed; top: .6rem; left: .6rem; z-index: 999;
  padding: .75rem 1.25rem;
  background: var(--ink); color: var(--paper);
  font-family: var(--f-mono); font-size: var(--t-xs);
  letter-spacing: .16em; text-transform: uppercase;
  transform: translateY(-160%);
  transition: transform .3s var(--ease);
}
.skip:focus { transform: none; }

.no-scroll { overflow: hidden; }

[hidden] { display: none !important; }

@media (max-width: 48rem) { .hide-sm { display: none !important; } }
