/* ==========================================================================
   Reset, typography, and the shared primitives (buttons, forms, media).
   ========================================================================== */

@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-latin-ext.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --- reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 1rem);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: var(--lh-normal);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; }
img, video, svg, picture { display: block; max-width: 100%; }
img, video { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }

/* --- headings ------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-weight: 700;
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-tight);
  color: var(--text);
  text-wrap: balance;
}
h1 { font-size: var(--step-5); line-height: var(--lh-tight); }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); letter-spacing: var(--tracking-flat); }
h4 { font-size: var(--step-1); letter-spacing: var(--tracking-flat); }

p { text-wrap: pretty; }

a {
  color: var(--brand-700);
  text-decoration-color: color-mix(in srgb, var(--brand-700) 35%, transparent);
  text-underline-offset: 0.18em;
  transition: color var(--dur-fast) var(--ease-out),
              text-decoration-color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--brand-500); text-decoration-color: currentColor; }

strong, b { font-weight: 600; color: var(--text); }

/* --- focus: one visible ring everywhere, keyboard only -------------------- */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}
:focus:not(:focus-visible) { outline: none; }

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100%;
  z-index: 200;
  padding: var(--space-3) var(--space-5);
  background: var(--brand-solid);
  color: #fff;
  border-radius: var(--r-sm);
  font-weight: 600;
  text-decoration: none;
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: var(--space-4); color: #fff; }

/* --- layout primitives ---------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--narrow { max-width: var(--max-w-narrow); }

.section { padding-block: var(--section-y); }

.prose { max-width: var(--measure); }
.prose p + p { margin-top: var(--space-4); }
.prose p { color: var(--text-muted); line-height: var(--lh-relaxed); }

.lede {
  font-size: var(--step-1);
  line-height: var(--lh-relaxed);
  color: var(--text-muted);
  max-width: 58ch;
}

/* Section heading block. Stacked, never a left-headline right-paragraph split. */
.section-head { margin-bottom: var(--space-8); max-width: 62ch; }
.section-head p {
  margin-top: var(--space-4);
  color: var(--text-muted);
  font-size: var(--step-1);
  line-height: var(--lh-relaxed);
}

.eyebrow {
  display: block;
  font-size: var(--step--2);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: var(--space-3);
}

.rule { border: 0; border-top: 1px solid var(--border); margin: 0; }

/* --- buttons: one pill system -------------------------------------------- */
.btn {
  --btn-bg: var(--brand-solid);
  --btn-fg: #FFFFFF;
  --btn-bd: var(--brand-700);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.8rem 1.6rem;
  min-height: 48px;
  border: 1.5px solid var(--btn-bd);
  border-radius: var(--r-full);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.005em;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.btn:hover {
  color: var(--btn-fg);
  background: var(--brand-solid-hover);
  border-color: var(--brand-solid-hover);
  box-shadow: var(--shadow-md);
}
.btn:active { transform: translateY(1px); box-shadow: var(--shadow-sm); }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn--accent {
  --btn-bg: var(--gold-500);
  --btn-fg: #24160A;
  --btn-bd: var(--gold-500);
}
.btn--accent:hover {
  color: #24160A;
  background: var(--gold-400);
  border-color: var(--gold-400);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--brand-700);
  --btn-bd: var(--border);
}
.btn--ghost:hover {
  color: var(--brand-700);
  background: var(--brand-50);
  border-color: var(--brand-200);
}

/* On dark bands a ghost button needs its own stroke to stay readable. */
.on-dark .btn--ghost {
  --btn-fg: var(--text-on-dark);
  --btn-bd: rgba(255, 255, 255, 0.35);
}
.on-dark .btn--ghost:hover {
  color: var(--text-on-dark);
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.55);
}

.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* --- dark band ------------------------------------------------------------ */
.on-dark { background: var(--brand-950); color: var(--text-on-dark); }
.on-dark h1, .on-dark h2, .on-dark h3, .on-dark h4 { color: var(--text-on-dark); }
.on-dark p { color: var(--text-on-dark-muted); }
.on-dark .eyebrow { color: var(--gold-400); }
.on-dark .rule { border-top-color: rgba(255, 255, 255, 0.14); }

/* --- forms ---------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: var(--space-2); }
.field + .field { margin-top: var(--space-5); }

.field label {
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--text);
}
.field .hint { font-size: var(--step--2); color: var(--text-muted); }

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 0.75rem 0.9rem;
  min-height: 48px;
  background: var(--bg-elevated);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.field textarea { min-height: 150px; resize: vertical; line-height: var(--lh-normal); }

.field input::placeholder,
.field textarea::placeholder { color: var(--ink-400); opacity: 1; }

.field input:hover,
.field textarea:hover { border-color: var(--ink-400); }

.field input:focus-visible,
.field textarea:focus-visible {
  outline: none;
  border-color: var(--brand-600);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-600) 22%, transparent);
}

.field[data-invalid="true"] input,
.field[data-invalid="true"] textarea { border-color: #B4231F; }

.field .error {
  font-size: var(--step--2);
  font-weight: 600;
  color: #B4231F;
  display: none;
}
.field[data-invalid="true"] .error { display: block; }

@media (prefers-color-scheme: dark) {
  .field .error { color: #FF8A80; }
  .field[data-invalid="true"] input,
  .field[data-invalid="true"] textarea { border-color: #FF8A80; }
}

/* honeypot: present for bots, gone for people and screen readers */
.hp,
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* --- scroll reveal (IntersectionObserver driven, opacity + transform only) - */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur-slow) var(--ease),
              transform var(--dur-slow) var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}

/* --- spacing utilities ---------------------------------------------------- */
.section--flush-top { padding-top: 0; }
.section--flush-bottom { padding-bottom: 0; }
