/* ============================================================
   Fable Active — Site Styles
   ------------------------------------------------------------
   DESIGN TOKENS: change a value below and the whole site updates.
   Palette is LOCKED (brand decision, June 2026):
     warm navy  #14233D
     gold       #C9A227
     off-white  #F7F4EE
   Brand type (mapped to the Fable Active brand fonts):
     ACTIVE  (heavy display sans)     -> Archivo Black
     SPOTLIGHT (condensed sport italic)-> Saira Condensed italic
     body                              -> DM Sans
   ============================================================ */

:root {
  /* Brand colours */
  --navy: #14233D;
  --navy-deep: #0E1A2F;        /* darker navy for footer / hero depth */
  --navy-soft: #1D3050;        /* lighter navy for cards on dark */
  --gold: #C9A227;
  --gold-soft: #D9B84A;        /* hover state for gold elements */
  --cream: #F7F4EE;
  --cream-deep: #EFEAE0;       /* section alternation on light */
  --ink: #1A2638;              /* body text on light backgrounds */
  --ink-soft: #4A5568;         /* secondary text on light */
  --on-dark: #F2EFE8;          /* body text on navy */
  --on-dark-soft: #B9C2D0;     /* secondary text on navy */

  /* Typography */
  --font-display: "Archivo Black", "Segoe UI", Tahoma, sans-serif;   /* ACTIVE */
  --font-accent: "Saira Condensed", "Segoe UI", sans-serif;          /* SPOTLIGHT */
  --font-body: "DM Sans", -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Type scale */
  --text-xs: 0.8125rem;   /* 13px */
  --text-sm: 0.9375rem;   /* 15px */
  --text-base: 1.0625rem; /* 17px */
  --text-lg: 1.25rem;     /* 20px */
  --text-xl: 1.5rem;      /* 24px */
  --text-2xl: 2rem;       /* 32px */
  --text-3xl: 2.75rem;    /* 44px */
  --text-4xl: 3.5rem;     /* 56px */

  /* Spacing rhythm (8px system) */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-6: 3rem;
  --space-8: 4rem;
  --space-12: 6rem;

  /* Misc */
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-card: 0 2px 24px rgba(20, 35, 61, 0.08);
  --shadow-card-hover: 0 8px 32px rgba(20, 35, 61, 0.14);
  --container: 72rem;       /* 1152px */
  --container-narrow: 46rem; /* 736px — reading width */
  --transition: 200ms ease-out;
}

/* ---------- Reset & base ---------- */

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

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2 {
  font-family: var(--font-display);
  font-weight: 400;            /* Archivo Black is intrinsically heavy */
  line-height: 1.12;
  margin: 0 0 var(--space-2);
  color: var(--navy);
  letter-spacing: -0.02em;
}

h3, h4 {
  font-family: var(--font-body);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 var(--space-2);
  color: var(--navy);
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.25rem, 5.5vw, var(--text-4xl)); }
h2 { font-size: clamp(1.75rem, 4vw, var(--text-3xl)); }
h3 { font-size: var(--text-xl); }

p { margin: 0 0 var(--space-2); }

a { color: var(--navy); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--gold);
  color: var(--navy);
  padding: var(--space-1) var(--space-2);
  z-index: 1000;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* ---------- Layout helpers ---------- */

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-3);
}

.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: clamp(var(--space-8), 9vw, var(--space-12)); }

.section--cream-deep { background: var(--cream-deep); }

.section--navy {
  background: var(--navy);
  color: var(--on-dark);
}
.section--navy h2, .section--navy h3 { color: var(--on-dark); }
.section--navy p { color: var(--on-dark-soft); }
.section--navy .lead { color: var(--on-dark); }

/* Inline links on dark surfaces: the base `a { color: var(--navy) }` renders
   them invisible against navy. Classed links (.btn, .cite-ref) keep their own. */
.section--navy a:not([class]),
.hero a:not([class]),
.page-header a:not([class]) {
  color: var(--gold-soft);
  text-decoration: underline;
}
.section--navy a:not([class]):hover,
.hero a:not([class]):hover,
.page-header a:not([class]):hover { color: var(--on-dark); }

.eyebrow {
  display: block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--space-2);
}
/* Gold fails contrast on cream — darken eyebrows on light backgrounds */
.section:not(.section--navy) .eyebrow,
.page-header .eyebrow { color: #8A6F14; }

.lead {
  font-size: var(--text-lg);
  color: var(--ink-soft);
  max-width: 38em;
}

.center { text-align: center; }
.center .lead { margin-inline: auto; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.875rem 2rem;
  min-height: 44px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), transform var(--transition);
}
.btn:active { transform: scale(0.98); }

.btn--gold {
  background: var(--gold);
  color: var(--navy);
}
.btn--gold:hover { background: var(--gold-soft); }

.btn--outline {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}
.btn--outline:hover { background: var(--navy); color: var(--on-dark); }

.section--navy .btn--outline {
  color: var(--on-dark);
  border-color: var(--on-dark-soft);
}
.section--navy .btn--outline:hover {
  background: var(--on-dark);
  color: var(--navy);
}

/* Outline buttons sitting on the dark hero need light text + border */
.hero .btn--outline {
  color: var(--on-dark);
  border-color: var(--on-dark-soft);
}
.hero .btn--outline:hover {
  background: var(--on-dark);
  color: var(--navy);
}

.btn--lg { padding: 1.05rem 2.5rem; font-size: var(--text-lg); }

/* ---------- Header / nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 244, 238, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(20, 35, 61, 0.08);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: 4.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--navy);
  line-height: 1;
}
.brand-mark { height: 2rem; width: auto; display: block; }
.brand-word { display: inline-block; }

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink);
  padding: 0.5rem 0.25rem;
  /* Six items + CTA: never let a label compress and wrap onto two lines.
     If the row can't fit, the hamburger breakpoint below takes over instead. */
  white-space: nowrap;
}
.nav-links a:hover { color: var(--navy); text-decoration: underline; text-underline-offset: 4px; }

.nav-links a[aria-current="page"] {
  font-weight: 700;
  color: var(--navy);
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.nav-links .btn {
  padding: 0.6rem 1.4rem;
  font-size: var(--text-sm);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.6rem;
  min-width: 44px;
  min-height: 44px;
  color: var(--navy);
}

/* Raised from 820px when Methodology became the sixth nav item: below this the
   full row can no longer fit without compressing labels or wrapping the CTA
   pill into a large gold block (which the brand forbids). */
@media (max-width: 1100px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--cream);
    border-bottom: 1px solid rgba(20, 35, 61, 0.1);
    padding: var(--space-2) var(--space-3) var(--space-3);
    box-shadow: var(--shadow-card);
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { display: block; padding: 0.85rem 0.25rem; font-size: var(--text-base); }
  .nav-links .btn { margin-top: var(--space-2); text-align: center; }
}

/* ---------- Hero ---------- */

.hero {
  background:
    radial-gradient(ellipse 80% 60% at 75% 20%, rgba(201, 162, 39, 0.14), transparent 60%),
    linear-gradient(165deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: var(--on-dark);
  padding-block: clamp(var(--space-8), 12vw, 8rem);
}

.hero h1 { color: var(--on-dark); max-width: 15em; }
.hero h1 em {
  font-family: var(--font-accent);
  font-weight: 600;
  font-style: italic;
  color: var(--gold-soft);
}

.hero .lead {
  color: var(--on-dark-soft);
  font-size: clamp(var(--text-base), 2.2vw, var(--text-lg));
  margin-bottom: var(--space-4);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.hero-note {
  font-size: var(--text-sm);
  color: var(--on-dark-soft);
  margin-top: var(--space-2);
}

/* ---------- Page header (inner pages) ---------- */

.page-header {
  background: linear-gradient(165deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: var(--on-dark);
  padding-block: clamp(var(--space-6), 8vw, var(--space-8));
}
.page-header h1 { color: var(--on-dark); }
.page-header .lead { color: var(--on-dark-soft); }
.page-header .eyebrow { color: var(--gold-soft); }

/* ---------- Cards ---------- */

.card-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  margin-top: var(--space-6);
}

.card {
  background: #FFFFFF;
  border-radius: var(--radius);
  padding: var(--space-4);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }

.card h3 { margin-bottom: var(--space-1); }
.card .tag {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy);
  background: rgba(201, 162, 39, 0.18);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  margin-bottom: var(--space-2);
}
.card p:last-child { margin-bottom: 0; }

.section--navy .card {
  background: var(--navy-soft);
  box-shadow: none;
  border: 1px solid rgba(247, 244, 238, 0.08);
}
.section--navy .card h3 { color: var(--on-dark); }
.section--navy .card p { color: var(--on-dark-soft); }

/* Numbered steps */
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy);
  font-weight: 700;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}

/* ---------- Prose (long-form reading, About page) ---------- */

.prose {
  max-width: var(--container-narrow);
  margin-inline: auto;
}
.prose p { margin-bottom: var(--space-3); }
.prose h2 { margin-top: var(--space-6); }

.pullquote {
  font-family: var(--font-accent);
  font-weight: 600;
  font-size: clamp(var(--text-2xl), 3.4vw, var(--text-3xl));
  font-style: italic;
  line-height: 1.3;
  color: var(--navy);
  border-left: 4px solid var(--gold);
  padding-left: var(--space-3);
  margin: var(--space-6) 0;
}

/* ---------- FAQ ---------- */

.faq-list {
  max-width: var(--container-narrow);
  margin: var(--space-6) auto 0;
  display: grid;
  gap: var(--space-2);
}

.faq-list details {
  background: #FFFFFF;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  padding: var(--space-2) var(--space-3);
}

.faq-list summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+";
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--gold);
  flex-shrink: 0;
  transition: transform var(--transition);
}
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list details p { margin: var(--space-2) 0 var(--space-1); color: var(--ink-soft); }

/* ---------- Forms ---------- */

.form {
  display: grid;
  gap: var(--space-3);
  max-width: var(--container-narrow);
}

.form-field { display: grid; gap: 0.4rem; }

.form-field label {
  font-weight: 600;
  font-size: var(--text-sm);
}

.form-field .hint {
  font-size: var(--text-xs);
  color: var(--ink-soft);
}

.form-field input,
.form-field textarea,
.form-field select {
  font: inherit;
  color: var(--ink);
  background: #FFFFFF;
  border: 1.5px solid rgba(20, 35, 61, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
  min-height: 44px;
  width: 100%;
}
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: 3px solid var(--gold);
  outline-offset: 1px;
  border-color: var(--navy);
}

.form-field .error {
  display: none;
  font-size: var(--text-xs);
  font-weight: 600;
  color: #B3261E;
}
.form-field.has-error input,
.form-field.has-error textarea,
.form-field.has-error select { border-color: #B3261E; }
.form-field.has-error .error { display: block; }

.form-status {
  display: none;
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  font-weight: 600;
}
.form-status.is-success {
  display: block;
  background: rgba(201, 162, 39, 0.16);
  color: var(--navy);
  border: 1.5px solid var(--gold);
}

/* Inline signup (email capture row) */
.signup-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  max-width: 34rem;
}
.signup-row input {
  flex: 1 1 14rem;
  font: inherit;
  border: 1.5px solid rgba(247, 244, 238, 0.35);
  background: rgba(247, 244, 238, 0.08);
  color: var(--on-dark);
  border-radius: 999px;
  padding: 0.8rem 1.4rem;
  min-height: 44px;
}
.signup-row input::placeholder { color: var(--on-dark-soft); }
.signup-row input:focus {
  outline: 3px solid var(--gold);
  outline-offset: 1px;
}

/* ---------- Quiz ---------- */

.quiz-shell {
  background: #FFFFFF;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: clamp(var(--space-3), 5vw, var(--space-6));
  max-width: var(--container-narrow);
  margin: var(--space-6) auto 0;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--navy-deep);
  color: var(--on-dark-soft);
  padding-block: var(--space-8) var(--space-4);
  font-size: var(--text-sm);
}

.footer-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  margin-bottom: var(--space-6);
}

.site-footer h4 {
  color: var(--on-dark);
  font-size: var(--text-base);
  margin-bottom: var(--space-2);
}

.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.site-footer a { color: var(--on-dark-soft); text-decoration: none; }
.site-footer a:hover { color: var(--on-dark); text-decoration: underline; }

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  text-transform: uppercase;
  color: var(--on-dark);
  line-height: 1;
  margin: 0 0 var(--space-2);
}
.footer-brand img { height: 1.9rem; width: auto; display: block; }

.footer-note {
  font-size: 0.78rem;
  opacity: 0.75;
  margin-bottom: var(--space-3);
}

.footer-bottom {
  border-top: 1px solid rgba(247, 244, 238, 0.12);
  padding-top: var(--space-3);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2);
}

/* ---------- Utility ---------- */

.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }

.divider-gold {
  width: 4rem;
  height: 3px;
  background: var(--gold);
  border: none;
  margin: var(--space-3) 0;
}
.center .divider-gold { margin-inline: auto; }

/* ---------- Modal (thank-you popup) ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-3);
  background: rgba(11, 21, 38, 0.62);
  backdrop-filter: blur(4px);
}
.modal-overlay.is-open { display: flex; }

.modal {
  position: relative;
  width: 100%;
  max-width: 30rem;
  background: var(--cream);
  border-radius: var(--radius);
  padding: var(--space-6) var(--space-4) var(--space-4);
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  animation: modalPop 0.3s ease-out both;
}
@keyframes modalPop {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
.modal-mark { height: 3rem; width: auto; margin: 0 auto var(--space-3); display: block; }
.modal h2 { font-size: var(--text-2xl); margin-bottom: var(--space-2); }
.modal p { color: var(--ink-soft); margin-bottom: var(--space-3); }

.modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--ink-soft);
  border-radius: 50%;
}
.modal-close:hover { background: rgba(20, 35, 61, 0.06); color: var(--navy); }
