/* ============================================================
   HORQUESTA — Home page styles
   Built on the August Health design tokens (Design.md)
   ============================================================ */

:root {
  /* Colors */
  --color-midnight-ink: #080331;
  --color-regal-violet: #1b1463;
  --color-forest-fern: #328a3b;
  --color-sky-blue: #4865ff;
  --color-deep-moss: #0d5238;
  --color-sunset-orange: #ff6d39;
  --color-blush-pink: #f098d7;
  --color-vivid-green: #114e0b;
  --color-lavender-bloom: #ffaefe;
  --color-outline-blue: #a2baff;
  --color-hint-of-blue: #dce4fb;
  --color-vibrant-orange: #f65300;
  --color-pitch-black: #000000;
  --color-pure-canvas: #ffffff;
  --color-light-gray: #cccccc;
  --color-warm-sand: #f8f3eb;
  --color-dark-charcoal: #333333;
  --color-muted-stone: #eae4d9;
  --color-gradient-aura: #c87ab5;
  --gradient-aura: linear-gradient(121deg, rgb(204, 122, 181) -80.58%, rgb(72, 101, 255) 36.36%, rgb(27, 20, 99) 102.7%);

  /* Type */
  --font-saans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-reckless: "Lora", "Reckless Neue", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Spacing */
  --section-gap: 64px;
  --card-padding: 32px;
  --element-gap: 16px;

  /* Radii */
  --r-card: 28px;
  --r-link: 24px;
  --r-pill: 1600px;
  --r-nav: 100px;
  --r-misc: 48px;
  --r-blob: 3200px;

  /* Shadows */
  --shadow-lg: rgba(75, 68, 57, 0.1) 0px 12px 24px 0px, rgba(75, 68, 57, 0.1) 0px 48px 48px 0px;
  --shadow-sm: rgba(75, 68, 57, 0.05) 0px 4px 4px 0px, rgba(75, 68, 57, 0.08) 0px 32px 16px 0px;
  --shadow-md: rgba(99, 91, 79, 0.08) 0px 8px 16px 0px, rgba(99, 91, 79, 0.04) 0px 32px 32px 0px;
  --shadow-xl: rgba(75, 68, 57, 0.1) 0px 48px 48px 0px;

  --maxw: 1280px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; max-width: 100%; }
body {
  font-family: var(--font-saans);
  font-size: 16px;
  line-height: 1.3;
  color: var(--color-midnight-ink);
  background: var(--color-pure-canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ============================================================
   Typography utilities
   ============================================================ */
.t-display, .t-h-lg, .t-h, .t-h-sm {
  font-family: var(--font-reckless);
  font-weight: 400;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0;
}
.t-display   { font-size: clamp(44px, 5.6vw, 72px); line-height: 1.02; letter-spacing: -0.02em; }
.t-h-lg      { font-size: clamp(36px, 3.6vw, 48px); line-height: 1.04; }
.t-h         { font-size: clamp(28px, 2.4vw, 32px); line-height: 1.1; }
.t-h-sm      { font-size: 24px; line-height: 1.1; }
.t-sub       { font-size: 20px; line-height: 1.3; font-weight: 400; }
.t-body      { font-size: 16px; line-height: 1.55; }
.t-body-sm   { font-size: 14px; line-height: 1.5; }
.t-caption   { font-size: 12px; line-height: 1.4; letter-spacing: 0.04em; text-transform: uppercase; }
.t-mono      { font-family: var(--font-mono); font-size: 13px; line-height: 1.5; letter-spacing: -0.01em; }
.t-mono-sm   { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.02em; }

.muted { color: color-mix(in oklch, var(--color-midnight-ink) 65%, transparent); }
.ink   { color: var(--color-midnight-ink); }
.white { color: var(--color-pure-canvas); }

.italic-touch em {
  font-style: italic;
  font-family: var(--font-reckless);
  font-weight: 400;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-saans);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  border-radius: var(--r-pill);
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .2s ease, background .15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--color-sky-blue);
  color: var(--color-pure-canvas);
  padding: 16px 28px;
  box-shadow: var(--shadow-lg);
}
.btn-primary:hover { background: color-mix(in oklch, var(--color-sky-blue) 88%, black); }

.btn-ghost {
  background: transparent;
  color: var(--color-midnight-ink);
  border: 1px solid var(--color-midnight-ink);
  padding: 14px 22px;
}
.btn-ghost:hover { background: var(--color-midnight-ink); color: var(--color-pure-canvas); }

.btn-orange {
  background: var(--color-sunset-orange);
  color: var(--color-midnight-ink);
  padding: 16px 28px;
  box-shadow: var(--shadow-lg);
}
.btn-orange:hover { background: color-mix(in oklch, var(--color-sunset-orange) 88%, black); }

.btn-ghost-light {
  background: transparent;
  color: var(--color-pure-canvas);
  border: 1px solid var(--color-outline-blue);
  padding: 14px 22px;
}
.btn-ghost-light:hover { background: rgba(255,255,255,.1); }

.btn-sm { padding: 10px 16px; font-size: 14px; }

/* Compact badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
  border: 1px solid currentColor;
  background: transparent;
}
.badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-forest-fern);
}

/* ============================================================
   Layout helpers
   ============================================================ */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
}
section { padding: var(--section-gap) 0; scroll-margin-top: 16px; }
.sand { background: var(--color-warm-sand); }

.row { display: flex; }
.col { display: flex; flex-direction: column; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }
.gap-40 { gap: 40px; }

/* ============================================================
   Nav
   ============================================================ */
.nav-wrap {
  position: sticky;
  top: 16px;
  z-index: 50;
  padding: 0 24px;
  margin-top: 16px;
}
.nav {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 10px 22px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--color-muted-stone);
  border-radius: var(--r-nav);
  box-shadow: var(--shadow-sm);
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-reckless);
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--color-midnight-ink);
  text-decoration: none;
}
.nav-mark {
  width: 28px; height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-midnight-ink);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  transition: background .15s ease;
}
.nav-links a:hover { background: var(--color-muted-stone); }
.nav-cta { display: flex; align-items: center; gap: 8px; }

@media (max-width: 880px) {
  .nav-links { display: none; }
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  padding: 24px 0 80px;
  overflow: hidden;
}
.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: center;
}
.hero h1 { margin-top: 20px; }
.hero .lede {
  margin-top: 24px;
  font-size: 20px;
  line-height: 1.45;
  color: var(--color-dark-charcoal);
  max-width: 58ch;
}
.hero .support {
  margin-top: 20px;
  font-size: 15px;
  line-height: 1.55;
  color: color-mix(in oklch, var(--color-midnight-ink) 70%, transparent);
  max-width: 56ch;
}
.hero-ctas { display: flex; gap: 12px; margin-top: 32px; flex-wrap: wrap; }

.hero-trust {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px dashed var(--color-muted-stone);
}
.hero-trust-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-dark-charcoal);
  margin-bottom: 14px;
}
.hero-trust-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}
.trust-chip {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 6px 12px;
  border: 1px solid var(--color-muted-stone);
  border-radius: var(--r-pill);
  background: var(--color-pure-canvas);
  color: var(--color-midnight-ink);
}

/* Hero visual — masked photo + decorative blobs + system diagram */
.hero-visual {
  position: relative;
  aspect-ratio: 1 / 1.05;
  min-height: 460px;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: saturate(1.05);
}
.blob-a {
  width: 78%; height: 78%;
  left: 0; top: 0;
  background: var(--color-sky-blue);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}
.blob-b {
  width: 42%; height: 42%;
  right: 0; bottom: 12%;
  background: var(--color-sunset-orange);
}
.blob-c {
  width: 28%; height: 28%;
  right: 16%; top: 4%;
  background: var(--color-lavender-bloom);
}

/* Geometric shape variant: pink → vertical stick, orange → triangle */
.hero-visual.shapes-geo .blob-b {
  width: 52%;
  height: 41%;
  right: 15%;
  bottom: 22%;
  border-radius: 0;
  background: var(--color-sunset-orange);
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}
.hero-visual.shapes-geo .blob-c {
  width: 6%;
  height: 44%;
  right: 30%;
  top: -10%;
  border-radius: 999px;
  background: var(--color-lavender-bloom);
}

.photo-mask {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-mask::after {
  content: none;
}
.photo-tag {
  position: relative;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.85);
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 100px;
  background: rgba(0,0,0,.18);
}

/* Floating system card on hero */
.hero-syscard {
  position: absolute;
  left: -8%;
  bottom: -2%;
  width: 62%;
  background: var(--color-pure-canvas);
  border-radius: 20px;
  padding: 18px 20px;
  box-shadow: var(--shadow-lg);
  z-index: 3;
  border: 1px solid var(--color-muted-stone);
}
.hero-syscard h4 {
  margin: 0 0 10px;
  font-family: var(--font-saans);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-dark-charcoal);
  font-weight: 500;
}
.flowline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--color-midnight-ink);
  flex-wrap: wrap;
}
.flowline .node {
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--color-warm-sand);
  white-space: nowrap;
}
.flowline .arrow { color: var(--color-sky-blue); font-weight: 600; }
.flowline + .flowline { margin-top: 8px; }

@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { min-height: 380px; }
}

/* ============================================================
   Section header
   ============================================================ */
.section-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: end;
  margin-bottom: 24px;
}
.section-head .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--color-dark-charcoal);
  margin-bottom: 14px;
}
.section-head .eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--color-midnight-ink);
}
.section-head .lede {
  font-size: 17px;
  line-height: 1.55;
  color: var(--color-dark-charcoal);
  max-width: 52ch;
}

@media (max-width: 880px) {
  .section-head { grid-template-columns: 1fr; gap: 16px; align-items: start; }
}

/* ============================================================
   Diagnostic section — stats + narrative
   ============================================================ */
.diag-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.stat-card {
  border-radius: var(--r-card);
  padding: 36px 32px 32px;
  position: relative;
  overflow: hidden;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.stat-card.blush { background: var(--color-blush-pink); color: var(--color-midnight-ink); }
.stat-card.orange { background: var(--color-sunset-orange); color: var(--color-midnight-ink); }
.stat-card .stat-number {
  font-family: var(--font-reckless);
  font-size: clamp(64px, 7vw, 96px);
  line-height: 0.95;
  letter-spacing: -0.03em;
}
.stat-card .stat-label {
  font-size: 16px;
  line-height: 1.45;
  max-width: 38ch;
}
.stat-card .stat-source {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  margin-top: 18px;
  opacity: 0.75;
}
.diag-narrative {
  margin-top: 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}
.diag-narrative p {
  font-size: 17px;
  line-height: 1.6;
  color: var(--color-dark-charcoal);
  margin: 0 0 16px;
}
.diag-narrative .callout {
  background: var(--color-pure-canvas);
  border: 1px solid var(--color-muted-stone);
  border-radius: var(--r-card);
  padding: 28px;
}
.diag-narrative .callout h4 {
  margin: 0 0 12px;
  font-family: var(--font-reckless);
  font-size: 22px;
}
.diag-narrative ul {
  margin: 0; padding: 0; list-style: none;
}
.diag-narrative li {
  display: flex; gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--color-muted-stone);
  font-size: 15px;
}
.diag-narrative li:first-child { border-top: 0; padding-top: 0; }
.diag-narrative .pct {
  font-family: var(--font-reckless);
  font-size: 28px;
  line-height: 1;
  min-width: 90px;
  color: var(--color-midnight-ink);
}

@media (max-width: 880px) {
  .diag-grid { grid-template-columns: 1fr; }
  .diag-narrative { grid-template-columns: 1fr; gap: 32px; }
}

/* ============================================================
   Solutions
   ============================================================ */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.module-card {
  background: var(--color-pure-canvas);
  border-radius: var(--r-card);
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-muted-stone);
  position: relative;
  overflow: hidden;
}

.module-card .copy {
  flex: 1;
}
.module-letter {
  font-family: var(--font-reckless);
  font-size: 44px;
  line-height: 1;
  color: var(--color-sky-blue);
}
.module-card h3 {
  margin: 0;
  font-family: var(--font-reckless);
  font-size: 24px;
  line-height: 1.15;
}
.module-card .copy {
  font-size: 15px;
  line-height: 1.55;
  color: var(--color-dark-charcoal);
}
.module-flow {
  margin-top: auto;
  padding: 18px;
  border-radius: 12px;
  background: var(--color-warm-sand);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--color-midnight-ink);
}
.module-flow .row {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
}
.module-flow .arrow { color: var(--color-sky-blue); }
.module-flow .tag {
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--color-pure-canvas);
  white-space: nowrap;
  border: 1px solid var(--color-muted-stone);
}
.module-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  background: var(--color-hint-of-blue);
  color: var(--color-midnight-ink);
  font-size: 13px;
  font-weight: 500;
  align-self: flex-start;
}
.module-stat strong {
  font-family: var(--font-reckless);
  font-size: 18px;
  font-weight: 400;
}

@media (max-width: 980px) {
  .modules-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Methodology timeline
   ============================================================ */
.timeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  top: 32px;
  left: 8%;
  right: 8%;
  height: 1px;
  background: var(--color-muted-stone);
  z-index: 0;
}
.tl-step {
  position: relative;
  background: var(--color-pure-canvas);
  border-radius: var(--r-card);
  padding: 28px 24px 28px;
  border: 1px solid var(--color-muted-stone);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.tl-num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-dark-charcoal);
}
.tl-bullet {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--color-pure-canvas);
  border: 1px solid var(--color-midnight-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-saans);
  font-size: 12px;
  font-weight: 500;
  position: relative;
  z-index: 1;
}
.tl-step.active .tl-bullet {
  background: var(--color-forest-fern);
  color: var(--color-pure-canvas);
  border-color: var(--color-forest-fern);
}
.tl-step h4 {
  margin: 0;
  font-family: var(--font-reckless);
  font-size: 22px;
  line-height: 1.15;
}
.tl-step p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--color-dark-charcoal);
}
.tl-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}
.tl-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--color-warm-sand);
  color: var(--color-midnight-ink);
}

@media (max-width: 980px) {
  .timeline { grid-template-columns: 1fr 1fr; }
  .timeline::before { display: none; }
}
@media (max-width: 600px) {
  .timeline { grid-template-columns: 1fr; }
}

/* ============================================================
   Governance section — dark surface
   ============================================================ */
.governance {
  background: var(--color-midnight-ink);
  color: var(--color-pure-canvas);
  border-radius: 32px;
  margin: 32px;
  padding: 80px 64px;
  position: relative;
  overflow: hidden;
}
.governance .eyebrow { color: var(--color-outline-blue); }
.governance .eyebrow::before { background: var(--color-outline-blue); }
.gov-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 32px;
}
.gov-card {
  border-radius: var(--r-card);
  padding: 32px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
}
.gov-card .gc-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--color-sky-blue);
  color: var(--color-pure-canvas);
  margin-bottom: 18px;
}
.gov-card h3 {
  margin: 0 0 12px;
  font-family: var(--font-reckless);
  font-size: 26px;
  line-height: 1.2;
}
.gov-card p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255,255,255,0.78);
}

@media (max-width: 980px) {
  .governance { padding: 56px 28px; margin: 16px; }
  .gov-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Form
   ============================================================ */
.form-wrap {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 56px;
  align-items: start;
}
.form-aside h2 {
  margin: 0 0 18px;
}
.form-aside p {
  font-size: 16px;
  line-height: 1.55;
  color: var(--color-dark-charcoal);
  margin: 0 0 18px;
}
.form-aside .form-banner {
  margin-top: 24px;
  padding: 22px;
  border-radius: var(--r-card);
  background: var(--color-forest-fern);
  color: var(--color-pure-canvas);
  display: none;
}
.form-aside .form-banner.show { display: block; }
.form-banner .fb-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 8px;
}
.form-banner h4 {
  margin: 0 0 6px;
  font-family: var(--font-reckless);
  font-size: 20px;
}
.form-banner p {
  color: rgba(255,255,255,0.85);
  font-size: 14px;
  margin: 0;
}
.form-aside .form-banner-edu {
  margin-top: 12px;
  padding: 22px;
  border-radius: var(--r-card);
  background: var(--color-lavender-bloom);
  color: var(--color-midnight-ink);
  display: none;
}
.form-aside .form-banner-edu.show { display: block; }
.form-banner-edu h4 { margin: 0 0 6px; font-family: var(--font-reckless); font-size: 20px; }
.form-banner-edu p { margin: 0 0 12px; font-size: 14px; line-height: 1.5; }
.form-banner-edu .download-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-midnight-ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.form-card {
  background: var(--color-pure-canvas);
  border-radius: 24px;
  padding: 40px;
  border: 1px solid var(--color-muted-stone);
  box-shadow: var(--shadow-md);
}
.form-card h3 {
  margin: 0 0 6px;
  font-family: var(--font-reckless);
  font-size: 26px;
}
.form-card .form-sub {
  margin: 0 0 28px;
  font-size: 14px;
  color: var(--color-dark-charcoal);
}
.field { margin-bottom: 22px; }
.field-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--color-midnight-ink);
}
.field-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-dark-charcoal);
  margin-right: 8px;
}
.input, .select, textarea.input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--color-muted-stone);
  background: var(--color-pure-canvas);
  font-family: var(--font-saans);
  font-size: 14px;
  color: var(--color-midnight-ink);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .select:focus {
  border-color: var(--color-sky-blue);
  box-shadow: 0 0 0 3px var(--color-hint-of-blue);
}
.radio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.radio-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--color-muted-stone);
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  transition: all .15s ease;
  background: var(--color-pure-canvas);
}
.radio-tile:hover { border-color: var(--color-midnight-ink); }
.radio-tile.selected {
  border-color: var(--color-sky-blue);
  background: var(--color-hint-of-blue);
}
.radio-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--color-light-gray);
  flex-shrink: 0;
  position: relative;
}
.radio-tile.selected .radio-dot { border-color: var(--color-sky-blue); }
.radio-tile.selected .radio-dot::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--color-sky-blue);
}
.form-submit {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.form-foot {
  font-size: 12px;
  color: var(--color-dark-charcoal);
  margin: 0;
  max-width: 30ch;
}

@media (max-width: 980px) {
  .form-wrap { grid-template-columns: 1fr; gap: 32px; }
  .form-card { padding: 28px; }
  .radio-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Footer — redesigned
   ============================================================ */
.footer {
  background: var(--color-midnight-ink);
  color: var(--color-pure-canvas);
  padding: 40px 0 32px;
}
.footer-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 32px;
}
.footer-logo {
  color: var(--color-pure-canvas) !important;
  text-decoration: none;
  font-family: var(--font-reckless);
  font-size: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.footer-nav {
  display: flex;
  gap: 32px;
}
.footer-nav a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: color .15s;
}
.footer-nav a:hover { color: var(--color-pure-canvas); }
.footer-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.12);
  margin: 0 0 32px;
}
.footer-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-left {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.footer-tag {
  font-size: 14px;
  color: rgba(255,255,255,0.55);
  max-width: 42ch;
  line-height: 1.55;
  margin: 0;
  font-family: var(--font-reckless);
}
.footer-email {
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  text-decoration: none;
  font-weight: 500;
}
.footer-email:hover { color: var(--color-pure-canvas); }
.footer-copy {
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  white-space: nowrap;
}

@media (max-width: 880px) {
  .footer-top-row { flex-wrap: wrap; gap: 16px; }
}

/* ============================================================
   MOBILE — comprehensive responsive fixes
   ============================================================ */
@media (max-width: 640px) {

  /* Container */
  .container { padding: 0 18px; }

  /* Global overflow fix */
  * { max-width: 100%; box-sizing: border-box; }
  img, svg, video { max-width: 100%; }
  .section-head, .modules-grid, .timeline, .diag-grid,
  .module-card, .tl-step, .stat-card, .form-wrap, .form-card {
    max-width: 100%;
    overflow: hidden;
  }

  /* Nav */
  .nav-wrap { padding: 0 12px; top: 10px; margin-top: 10px; }
  .nav { padding: 10px 12px; }
  .nav-logo { font-size: 18px; }
  .nav-cta .btn-sm { padding: 8px 14px; font-size: 13px; }

  /* Hero */
  .hero { padding: 32px 0 48px; }
  .hero h1 { margin-top: 12px; }
  .hero h1 span,
  .hero h1 em { width: auto !important; font-size: clamp(28px, 8vw, 40px) !important; }
  .hero .lede { font-size: 17px; max-width: 100%; }
  .hero .support { width: auto !important; max-width: 100% !important; font-size: 14px !important; }
  .hero-ctas { flex-direction: column; gap: 10px; }
  .hero-ctas .btn { width: 100%; justify-content: center; }
  .hero-visual { display: none; }
  .hero-inner { max-width: 100%; }

  /* Badge */
  .badge { font-size: 11px; }

  /* Section headings */
  .section-head { gap: 16px; }
  .t-display { font-size: clamp(32px, 9vw, 48px); }
  .t-h-lg { font-size: clamp(22px, 6vw, 32px); }
  .t-h-lg em { font-size: inherit !important; }
  .section-head h2 { max-width: 100%; overflow-wrap: break-word; word-break: break-word; }
  .lede, .support, p { max-width: 100%; overflow-wrap: break-word; }

  /* Stat cards */
  .diag-grid { grid-template-columns: 1fr; gap: 16px; }
  .diag-grid .stat-card:nth-child(3) { width: 100% !important; margin: 0 !important; }
  .stat-number { font-size: 52px !important; }
  .diag-narrative { margin-top: 8px; }
  .diag-narrative p { font-size: 20px !important; white-space: normal !important; }
  .section-head .lede { width: auto !important; height: auto !important; }

  /* Modules */
  .modules-grid { grid-template-columns: 1fr; gap: 16px; }
  .module-card { padding: 24px; }

  /* Timeline */
  .timeline { grid-template-columns: 1fr; gap: 16px; }
  .timeline::before { display: none; }
  .tl-step { padding: 20px; }

  /* Governance */
  .governance { margin: 12px; padding: 40px 20px; border-radius: 20px; }
  .gov-grid { grid-template-columns: 1fr; gap: 16px; }

  /* Form */
  .form-wrap { grid-template-columns: 1fr; gap: 24px; }
  .form-card { padding: 24px 18px; }
  .radio-grid { grid-template-columns: 1fr !important; }
  .form-aside h2 { font-size: clamp(28px, 8vw, 38px); }

  /* Footer */
  .footer-top-row { flex-direction: column; align-items: flex-start; gap: 20px; }
  .footer-nav { flex-wrap: wrap; gap: 16px; }
  .footer-bottom-row { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .hero h1 span,
  .hero h1 em { font-size: clamp(30px, 9vw, 42px) !important; }
  .nav-logo span:last-child { display: inline; }
}

/* ============================================================
   Small util
   ============================================================ */
.divider-soft {
  height: 1px;
  background: var(--color-muted-stone);
  border: 0;
  margin: 0;
}

a.text-link {
  color: var(--color-sky-blue);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
a.text-link:hover { color: var(--color-midnight-ink); }
