/* Inter — self-hosted variable font (GDPR: no request to Google, no visitor IP shared).
   Files are the variable woff2 Google serves for Inter v20; one file covers all weights. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/inter-latin.woff2') format('woff2');
  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: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/inter-latin-ext.woff2') format('woff2');
  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;
}

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

/* [hidden] must beat any author display rule (e.g. .states-grid's display: grid) */
[hidden] { display: none !important; }

:root {
  /* ── Bivio brand palette (official) ── */
  --bivio-primary: #7A9E7E;     /* sage green — primary, CTAs, interactive, nav accents */
  --bivio-secondary: #C16E4A;   /* terracotta — accents, hover, badges */
  --bivio-highlight: #E6A57E;   /* sand — soft shading / gradients only, never a flat standalone */
  --bivio-background: #FBF9F5;  /* off-white — page & card backgrounds */
  --bivio-text: #2C2B28;        /* charcoal — body text on light backgrounds */

  /* ── Derived shades — each is a color-mix() of the palette above, added only to hit WCAG AA
        (the raw sage/terracotta are mid-tones that fail with white text or as small text). ── */
  --bivio-primary-hover:  color-mix(in srgb, var(--bivio-primary) 85%, var(--bivio-background)); /* lighter sage lift; keeps charcoal text ≥4.5 */
  --bivio-primary-dark:   color-mix(in srgb, var(--bivio-primary) 45%, var(--bivio-text));       /* dark brand band; white text 6.8:1 */
  --bivio-primary-tint:   color-mix(in srgb, var(--bivio-primary) 16%, var(--bivio-background));  /* soft sage surface */
  --bivio-secondary-text: color-mix(in srgb, var(--bivio-secondary) 72%, var(--bivio-text));      /* AA terracotta for small accent text 5.1:1 */
  --bivio-secondary-tint: color-mix(in srgb, var(--bivio-secondary) 15%, var(--bivio-background)); /* warm badge surface */
  --bivio-surface:        color-mix(in srgb, var(--bivio-highlight) 12%, var(--bivio-background)); /* warm section surface (sand shading) */
  --bivio-surface-2:      color-mix(in srgb, var(--bivio-highlight) 20%, var(--bivio-background)); /* warm card surface (sand shading) */
  --bivio-border:         color-mix(in srgb, var(--bivio-text) 16%, var(--bivio-background));

  /* ── Legacy semantic tokens remapped onto the brand palette.
        The whole stylesheet references these, so remapping here recolors the site centrally
        and reversibly — revert this block and the old theme returns. ── */
  --bg: var(--bivio-background);
  --bg-warm: var(--bivio-surface);
  --bg-card: var(--bivio-surface-2);
  --text: var(--bivio-text);
  --text-muted: #5E5D5A;  /* neutral warm-grey — AA on off-white (6.3:1) & cards (5.5:1) */
  --text-light: #656460;  /* lighter caption grey — AA on light backgrounds */
  --accent: var(--bivio-primary);
  --accent-hover: var(--bivio-primary-hover);
  --accent-light: var(--bivio-primary-tint);
  --border: var(--bivio-border);
  --radius: 16px;
  --radius-sm: 10px;

  /* ── Motion tokens — one vocabulary for all micro-interactions ── */
  --t-color: 0.2s ease;        /* background / border-color / color changes */
  --t-lift: 0.2s ease;         /* transform lifts on hover */
  --t-reveal: 0.55s ease-out;  /* scroll-reveal only */
  --t-stagger: 90ms;           /* cascade step between staggered reveal children */
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  -webkit-tap-highlight-color: rgba(122, 158, 126, 0.2);
}

img, svg { max-width: 100%; }

/* FOCUS — one brand-styled ring for every interactive element (keyboard nav) */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--bivio-secondary-text); /* 5.14:1 vs light surfaces */
  outline-offset: 2px;
}

/* Dark surfaces: terracotta ring fails there — switch to off-white */
.cta-section :focus-visible,
footer :focus-visible {
  outline-color: var(--bivio-background);
}

/* NAV */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  background: rgba(251,249,245,0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.nav-logo span {
  color: var(--bivio-secondary-text);
}

nav a.cta-pill {
  background: var(--accent);
  color: var(--bivio-text);
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  transition: background var(--t-color);
}

nav a.cta-pill:hover { background: var(--accent-hover); }

/* HERO */
.hero {
  padding: 160px 40px 120px;
  max-width: 1100px;
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(52px, 8vw, 96px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -3px;
  color: var(--text);
  margin-bottom: 28px;
  max-width: 820px;
}

.hero h1 em {
  font-style: normal;
  color: var(--bivio-secondary);
}

.hero-sub {
  font-size: 20px;
  color: var(--text-muted);
  max-width: 520px;
  line-height: 1.6;
  margin-bottom: 48px;
  font-weight: 400;
}

.hero-cta-group {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: var(--bivio-text);
  text-decoration: none;
  padding: 16px 32px;
  border-radius: 100px;
  font-size: 16px;
  font-weight: 600;
  transition: background var(--t-color), transform var(--t-lift);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

.btn-primary svg { flex-shrink: 0; }

.hero-note {
  font-size: 14px;
  color: var(--text-light);
}

/* DIVIDER */
.divider {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 40px;
  border: none;
  border-top: 1px solid var(--border);
}

/* WHO IS THIS FOR */
.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 100px 40px;
}

.section-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin-bottom: 16px;
}

.section-sub {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 500px;
  margin-bottom: 64px;
  line-height: 1.6;
}

/* STATE CARDS */
.states-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.state-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform var(--t-lift);
}

.state-card:hover { transform: translateY(-3px); }

.state-icon {
  font-size: 28px;
  line-height: 1;
}

.state-tag {
  display: inline-block;
  background: var(--bg-warm);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 4px 10px;
  border-radius: 100px;
  border: 1px solid var(--border);
}

.state-card h3 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.3;
}

.state-card p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.65;
}

/* FULL-WIDTH WARM BG SECTION */
.section-warm {
  background: var(--bg-warm);
  padding: 100px 0;
}

.section-warm .inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 40px;
}

/* ABOUT */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.about-photo-placeholder {
  background: var(--bg-card);
  border-radius: var(--radius);
  aspect-ratio: 4/5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 14px;
  font-weight: 500;
  border: 2px dashed var(--border);
}

.about-content .section-label { margin-bottom: 24px; }

.about-content h2 {
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.15;
  margin-bottom: 24px;
}

.about-content p {
  font-size: 17px;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 20px;
}

.about-content p:last-of-type { margin-bottom: 36px; }

.credential-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.credential {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

/* WHAT BIVIO GIVES YOU */
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 64px;
}

.feature-card {
  padding: 40px 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color var(--t-color), transform var(--t-lift);
}

.feature-card:hover {
  border-color: var(--bivio-secondary);
  transform: translateY(-3px);
}

.feature-number {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--bivio-secondary-text);
  text-transform: uppercase;
}

.feature-card h3 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.3;
}

.feature-card p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* FINAL CTA */
.cta-section {
  background: var(--bivio-primary-dark);
  padding: 120px 40px;
  text-align: center;
}

.cta-section h2 {
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 800;
  letter-spacing: -2px;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 20px;
}

.cta-section p {
  font-size: 18px;
  color: rgba(255,255,255,0.85);
  margin-bottom: 48px;
}

.btn-white {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bivio-background);
  color: var(--bivio-text);
  text-decoration: none;
  padding: 18px 36px;
  border-radius: 100px;
  font-size: 16px;
  font-weight: 700;
  transition: transform var(--t-lift);
}

.btn-white:hover {
  transform: translateY(-2px);
}

/* ASK AI */
.ask-ai-section {
  background: var(--bg-warm);
  border-top: 1px solid var(--border);
  padding: 80px 40px;
}

.ask-ai-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 60px;
  flex-wrap: wrap;
}

.ask-ai-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 10px;
}

.ask-ai-text h2 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 10px;
}

.ask-ai-sub {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 360px;
  line-height: 1.6;
}

.ask-ai-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.ai-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform var(--t-lift);
  font-family: inherit;
}

.ai-btn:hover { transform: translateY(-2px); }

.ai-btn.chatgpt  { background: #0F0F0F; color: #fff; }
.ai-btn.claude   { background: #CC785C; color: #fff; }
.ai-btn.perplexity { background: #20194D; color: #fff; }
.ai-btn.gemini   { background: #4285F4; color: #fff; }

@media (max-width: 768px) {
  .ask-ai-section { padding: 60px 20px; }
  .ask-ai-inner { flex-direction: column; gap: 36px; }
  .ask-ai-buttons { width: 100%; }
  .ai-btn { flex: 1; justify-content: center; }
}

/* FOOTER */
footer {
  background: var(--text);
  color: rgba(255,255,255,0.5);
  padding: 48px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-logo {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.5px;
}

.footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.footer-links a {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  font-size: 14px;
  transition: color var(--t-color);
}

.footer-links a:hover { color: #fff; }

footer p { font-size: 13px; }

/* QUIZ — state cards as entry points */
button.state-card {
  font-family: inherit;
  text-align: left;
  border: 1.5px solid transparent;
  cursor: pointer;
}

button.state-card:hover { border-color: var(--bivio-secondary); }
/* focus-visible: covered by the global brand focus ring */

.state-start {
  font-size: 14px;
  font-weight: 600;
  color: var(--bivio-secondary-text);
  margin-top: auto;
}

/* QUIZ — panel */
.quiz-panel {
  max-width: 640px;
  margin: 0 auto;
  /* sage, not the cards' sand: the quiz reads as its own context, not a fourth card */
  background: var(--bivio-primary-tint);
  border: 1px solid color-mix(in srgb, var(--bivio-primary) 30%, var(--bivio-background));
  border-radius: var(--radius);
  padding: 40px 36px;
}

.quiz-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.quiz-progress {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
}

.quiz-question {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.3;
  margin-bottom: 20px;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.quiz-option {
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  cursor: pointer;
  transition: border-color var(--t-color), background var(--t-color);
}

.quiz-option:hover {
  border-color: var(--bivio-secondary-text);
  background: var(--bivio-secondary-tint);
}

.quiz-back,
.quiz-restart {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
}

.quiz-back:hover,
.quiz-restart:hover { color: var(--text); }

.quiz-note {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

/* QUIZ — deepen offer */
.quiz-deepen-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.quiz-deepen-yes {
  border: none;
  cursor: pointer;
  justify-content: center;
  font-family: inherit;
}

.quiz-deepen-count {
  font-weight: 400;
  opacity: 0.75;
}

.quiz-secondary {
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 100px;
  padding: 16px 32px;
  cursor: pointer;
  transition: border-color var(--t-color), background var(--t-color);
}

.quiz-secondary:hover {
  border-color: var(--bivio-secondary-text);
  background: var(--bivio-secondary-tint);
}

.quiz-error {
  font-size: 14px;
  font-weight: 600;
  color: #B3261E;
  margin-bottom: 16px;
}

.quiz-email-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.quiz-email-form input {
  font-family: inherit;
  font-size: 16px; /* 16px+ prevents iOS Safari zoom-on-focus */
  padding: 14px 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
}

.quiz-email-form input:focus {
  outline: none;
  border-color: var(--bivio-secondary-text);
}

.quiz-submit {
  border: none;
  cursor: pointer;
  justify-content: center;
  font-family: inherit;
}

.quiz-submit:disabled { opacity: 0.6; cursor: wait; }

.quiz-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  cursor: pointer;
}

.quiz-consent input {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--bivio-primary);
  cursor: pointer;
}

.quiz-consent a {
  color: var(--bivio-secondary-text);
  font-weight: 600;
}

.quiz-privacy {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 20px;
}

.quiz-thanks { text-align: center; }

.quiz-thanks-icon { font-size: 40px; margin-bottom: 16px; }

.quiz-thanks .quiz-note { max-width: 400px; margin-left: auto; margin-right: auto; }

.quiz-thanks .btn-primary { margin-bottom: 20px; }

.quiz-thanks .quiz-restart { display: block; margin: 0 auto; }

/* RESPONSIVE */

/* Tablet — avoid cramped 3-up grids between phone and desktop */
@media (max-width: 980px) {
  .hero { padding: 140px 32px 100px; }
  .hero h1 { letter-spacing: -2px; }
  .section { padding: 88px 32px; }
  .states-grid,
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { gap: 48px; }
}

@media (max-width: 768px) {
  nav { padding: 16px 20px; }
  .hero { padding: 120px 20px 80px; }
  .hero h1 { letter-spacing: -1.5px; }
  .hero-sub { font-size: 18px; }
  .hero-cta-group { gap: 16px; }
  .section { padding: 72px 20px; }
  .section-warm .inner { padding: 0 20px; }
  .states-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-photo-placeholder { aspect-ratio: 3/2; }
  .features-grid { grid-template-columns: 1fr; }
  .cta-section { padding: 80px 20px; }
  footer { padding: 40px 20px; flex-direction: column; align-items: flex-start; }
  .quiz-panel { padding: 32px 24px; }
}

/* Small phones */
@media (max-width: 480px) {
  nav { padding: 14px 16px; }
  .nav-logo { font-size: 18px; }
  nav a.cta-pill { padding: 8px 14px; font-size: 13px; }

  .hero { padding: 100px 16px 60px; }
  .hero h1 { letter-spacing: -1px; margin-bottom: 20px; }
  .hero-sub { font-size: 16px; margin-bottom: 32px; }
  .hero-cta-group { flex-direction: column; align-items: flex-start; gap: 14px; }
  .btn-primary { padding: 14px 26px; font-size: 15px; }

  .section { padding: 56px 16px; }
  .section-sub { margin-bottom: 40px; }
  .states-grid,
  .features-grid { gap: 12px; }
  .state-card { padding: 28px 24px; }
  .feature-card { padding: 32px 26px; }

  .section-warm { padding: 64px 0; }
  .section-warm .inner { padding: 0 16px; }

  .cta-section { padding: 64px 16px; }

  .quiz-panel { padding: 24px 20px; }
  .quiz-question { font-size: 21px; }

  footer { padding: 32px 16px; }
}

/* Respect users who prefer reduced motion */
/* SCROLL REVEAL — choreographed section entrances.
   .reveal (in markup) hides the section until animations.js upgrades it to
   .reveal-stagger: the container then shows instantly and its children carry
   the motion in a cascade (.reveal-item / .reveal-line, classes + stagger
   indices applied by JS — so disabled JS can never hide child content).
   A <noscript> override in index.html covers the section-level hide. */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--t-reveal), transform var(--t-reveal);
}

.reveal.reveal-visible {
  opacity: 1;
  transform: none;
}

/* Staggered mode: container yields the animation to its children */
.reveal.reveal-stagger {
  opacity: 1;
  transform: none;
  transition: none;
}

.reveal-item,
.reveal-line {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--t-reveal), transform var(--t-reveal);
  transition-delay: calc(var(--stagger-index, 0) * var(--t-stagger));
}

/* Headline lines: one span per authored <br> line, assembling upward */
.reveal-line {
  display: block;
  transform: translateY(24px);
}

/* Cards & images additionally scale in; large text stays scale-free */
.reveal-item-scale {
  transform: translateY(18px) scale(0.96);
}

.reveal-visible .reveal-item,
.reveal-visible .reveal-line {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  /* Accessibility: never hide/animate reveal content for reduced-motion users —
     neutralizes section fade, child stagger delays, scale-in, and line-split */
  .reveal,
  .reveal-item,
  .reveal-line {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
