/* ================================================================
   VIVID SELLING OS — Design System v2
   "The Living Framework"

   A methodology platform that converts like a funnel
   but feels like a trusted knowledge system.
   ================================================================ */

/* ─── FONTS ─── */
/* Fonts preloaded in HTML head for faster first paint — @import removed to prevent render-blocking */

/* ─── DESIGN TOKENS ─── */
:root {
  /* Typography */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

  /* Backgrounds — Dark Primary */
  --bg-page: #111318;
  --bg-surface: #1A1D24;
  --bg-surface-hover: #20242C;
  --bg-subtle: #242830;
  --bg-elevated: #2D323B;

  /* Backgrounds — Light (for contrast sections) */
  --bg-light: #FAF8F5;
  --bg-light-surface: #FFFFFF;
  --bg-light-subtle: #F2EFEB;

  /* The Accent — Gold (earned mastery) */
  --accent: #C9A84C;
  --accent-hover: #DFC06A;
  --accent-dim: #B89740;
  --accent-subtle: rgba(201, 168, 76, 0.10);
  --accent-glow: rgba(201, 168, 76, 0.25);

  /* The Brand — Navy */
  --navy: #3B8EBF;
  --navy-dim: #1B4F72;

  /* Text — Primary (on dark) */
  --text-primary: #E2E2E6;
  --text-body: #B0B3BA;
  --text-secondary: #9CA3AF;
  --text-muted: #6B7280;

  /* Text — On Light sections */
  --text-dark: #1C2024;
  --text-dark-body: #3D4044;
  --text-dark-secondary: #6B7075;

  /* Borders */
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.16);
  --border-accent: rgba(201, 168, 76, 0.25);
  --border-light: #E8E4DF;

  /* Score Colors */
  --score-strong: #34D399;
  --score-developing: #C9A84C;
  --score-gap: #F87171;

  /* Semantic */
  --info: #60A5FA;
  --success: #34D399;
  --warning: #FBBF24;
  --danger: #F87171;

  /* Spacing Scale (8px base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --space-9: 48px;
  --space-10: 64px;
  --space-11: 80px;
  --space-12: 100px;
  --space-13: 120px;

  /* Widths — expanded for dynamic layouts */
  --w-narrow: 540px;
  --w-reading: 680px;
  --w-standard: 800px;
  --w-content: 960px;
  --w-wide: 1200px;
  --w-full: 1400px;
  --w-bleed: 100%;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 12px;
  --radius-xl: 20px;
  --radius-full: 100px;

  /* Shadows — tuned for dark backgrounds */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 30px rgba(201, 168, 76, 0.1);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 0.15s;
  --duration-normal: 0.25s;
  --duration-slow: 0.5s;

  /* Layer Colors (brighter for dark bg) */
  --layer-1: #3B8EBF;
  --layer-2: #4AA3D4;
  --layer-3: #5BB8E0;
  --layer-4: #6DC8E8;
  --layer-5: #8BD4C0;
  --layer-6: #B5A86A;
  --layer-7: #C9A84C;
}


/* ─── RESET & BASE ─── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  /* Mobile horizontal-overflow guard: html is the real scroll container on
     mobile, so the body-only overflow-x:hidden wasn't enough — a 100vw full-bleed
     element could push the page ~1 scrollbar-width wide and shift content left.
     `clip` clips the overflow WITHOUT creating a scroll container, so it does not
     break the sticky .nav (unlike `hidden`, which makes html a scroller). `hidden`
     is kept first as a fallback for Safari < 16, which doesn't support `clip`. */
  overflow-x: hidden;
  overflow-x: clip;
  max-width: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-body);
  background: var(--bg-page);
  overflow-x: hidden;
  overflow-x: clip;
  max-width: 100%;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--accent); }

/* Default text colors for dark background page */
h1, h2, h3, h4 { color: var(--text-primary); }
p { color: var(--text-body); }


/* ─── TYPOGRAPHY ─── */
h1, h2, h3, h4 {
  color: var(--text-primary);
  line-height: 1.2;
}

h1 {
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

h2 {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
}

h3 {
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 600;
}

h4 {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 600;
}

p {
  margin-bottom: var(--space-4);
  line-height: 1.7;
}

/* Reading body — for long-form content */
.prose {
  font-size: 18px;
  line-height: 1.8;
  max-width: var(--w-reading);
}

.prose p { margin-bottom: var(--space-6); }
.prose h2 { margin-top: var(--space-10); margin-bottom: var(--space-6); }
.prose h3 { margin-top: var(--space-8); margin-bottom: var(--space-4); }

/* Labels & Tags */
.label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.label-accent { color: var(--accent); }
.label-navy { color: var(--navy); }
.label-muted { color: var(--text-secondary); }

/* Score display */
.score-number {
  font-family: var(--font-mono);
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
}

.price-number {
  font-family: var(--font-mono);
  font-size: 40px;
  font-weight: 700;
}

/* On-light overrides (for light contrast sections within the dark page) */
.on-light { color: var(--text-dark-body); }
.on-light h1, .on-light h2, .on-light h3, .on-light h4 { color: var(--text-dark); }
.on-light p { color: var(--text-dark-body); }
.on-light a { color: var(--navy-dim); }
.on-light .label-muted { color: var(--text-dark-secondary); }
.on-dark .label-muted { color: var(--text-light-muted); }
.on-dark a { color: var(--accent-light); }


/* ─── LAYOUT ─── */
.wrap { max-width: var(--w-standard); margin: 0 auto; padding: 0 var(--space-6); }
.wrap-narrow { max-width: var(--w-narrow); margin: 0 auto; padding: 0 var(--space-6); }
.wrap-reading { max-width: var(--w-reading); margin: 0 auto; padding: 0 var(--space-6); }
.wrap-content { max-width: var(--w-content); margin: 0 auto; padding: 0 var(--space-6); }
.wrap-wide { max-width: var(--w-wide); margin: 0 auto; padding: 0 var(--space-6); }
.wrap-full { max-width: var(--w-full); margin: 0 auto; padding: 0 var(--space-6); }

/* Full-bleed sections — edge to edge */
.bleed { width: 100vw; margin-left: calc(-50vw + 50%); }

/* Section rhythm */
.section { padding: var(--space-12) 0; }
.section-tight { padding: var(--space-8) 0; }
.section-spacious { padding: var(--space-13) 0; }

/* Section backgrounds */
.section-surface { background: var(--bg-surface); }
.section-elevated { background: var(--bg-subtle); }

/* Light contrast sections (break the dark rhythm) */
.section-light {
  background: var(--bg-light);
  color: var(--text-dark);
}
.section-light h1, .section-light h2, .section-light h3, .section-light h4 { color: var(--text-dark); }
.section-light p { color: var(--text-dark-body); }
.section-light .label-muted { color: var(--text-dark-secondary); }
.section-light a { color: var(--navy-dim); }

/* Subtle surface section */
.section-dark { background: var(--bg-surface); }

/* Grid utilities — equal column */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-7); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-7); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-7); }

/* Asymmetric grids — visual tension */
.grid-60-40 { display: grid; grid-template-columns: 3fr 2fr; gap: var(--space-8); align-items: center; }
.grid-40-60 { display: grid; grid-template-columns: 2fr 3fr; gap: var(--space-8); align-items: center; }
.grid-70-30 { display: grid; grid-template-columns: 7fr 3fr; gap: var(--space-8); align-items: start; }
.grid-30-70 { display: grid; grid-template-columns: 3fr 7fr; gap: var(--space-8); align-items: start; }

/* Offset content — break the center */
.offset-left { margin-right: auto; margin-left: 0; text-align: left; }
.offset-right { margin-left: auto; margin-right: 0; text-align: left; }

/* Visual dividers */
.divider { height: 1px; background: var(--border); margin: var(--space-10) 0; }
.divider-accent { height: 2px; background: linear-gradient(90deg, var(--accent), transparent); max-width: 120px; }
.divider-accent-center { height: 2px; background: linear-gradient(90deg, transparent, var(--accent), transparent); max-width: 200px; margin: 0 auto; }

/* Decorative gradient border top */
.glow-top { position: relative; }
.glow-top::before {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.text-center { text-align: center; }
.text-left { text-align: left; }

/* Spacing utilities */
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mt-10 { margin-top: var(--space-10); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-10 { margin-bottom: var(--space-10); }
.gap-4 { height: var(--space-4); }
.gap-6 { height: var(--space-6); }
.gap-8 { height: var(--space-8); }
.gap-10 { height: var(--space-10); }


/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--duration-normal) ease;
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: var(--accent);
  color: #111318;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #111318;
  transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(201,168,76,0.2), 0 6px 20px rgba(201,168,76,0.15);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid var(--border-hover);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-text {
  background: none;
  border: none;
  color: var(--navy);
  padding: 0;
  font-weight: 500;
}

.btn-text:hover {
  color: var(--accent);
}

.btn-lg {
  padding: 16px 36px;
  font-size: 16px;
}

.btn-full {
  width: 100%;
}


/* ─── CARDS ─── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-7);
  transition: all var(--duration-normal) ease;
}

.card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
}

/* Elevated card (brighter surface) */
.card-elevated {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}

.card-elevated:hover {
  border-color: var(--border-accent);
}

/* Featured/highlighted card */
.card-featured {
  border: 2px solid var(--accent);
  position: relative;
}

.card-featured::before {
  content: attr(data-badge);
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #111318;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: var(--radius-full);
}


/* ─── LAYER CARD ─── */
.layer-card {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-5);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--navy);
  background: var(--bg-surface);
  transition: all var(--duration-normal) ease;
}

.layer-card:hover {
  box-shadow: var(--shadow-md);
}

.layer-card[data-layer="1"] { border-left-color: var(--layer-1); }
.layer-card[data-layer="2"] { border-left-color: var(--layer-2); }
.layer-card[data-layer="3"] { border-left-color: var(--layer-3); }
.layer-card[data-layer="4"] { border-left-color: var(--layer-4); }
.layer-card[data-layer="5"] { border-left-color: var(--layer-5); }
.layer-card[data-layer="6"] { border-left-color: var(--layer-6); }
.layer-card[data-layer="7"] { border-left-color: var(--layer-7); }

.layer-number {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  min-width: 24px;
}

.layer-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.layer-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
}


/* ─── FORMS ─── */
.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  padding: 14px 16px;
  background: var(--bg-subtle);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}


/* ─── CUSTOM RANGE SLIDER ─── */
.vivid-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
  transition: background var(--duration-normal) ease;
}

.vivid-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2.5px solid var(--accent);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.vivid-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 10px rgba(201, 168, 76, 0.3);
}

.vivid-slider::-webkit-slider-thumb:active {
  transform: scale(1.2);
  border-width: 3px;
}

.vivid-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2.5px solid var(--accent);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  cursor: pointer;
}


/* ─── SCORE VISUALIZATIONS ─── */

/* Score bar */
.score-bar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.score-bar-label {
  min-width: 140px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.score-bar-track {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1s var(--ease-out);
  width: 0;
}

.score-bar-fill[data-level="strong"] { background: var(--score-strong); }
.score-bar-fill[data-level="developing"] { background: var(--score-developing); }
.score-bar-fill[data-level="gap"] { background: var(--score-gap); }

.score-bar-value {
  min-width: 40px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* State badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.badge-strong { background: rgba(45, 138, 78, 0.12); color: var(--score-strong); }
.badge-developing { background: var(--accent-subtle); color: var(--accent); }
.badge-gap { background: rgba(192, 57, 43, 0.1); color: var(--score-gap); }
.badge-accent { background: var(--accent-subtle); color: var(--accent); }
.badge-navy { background: rgba(27, 79, 114, 0.08); color: var(--navy); }


/* ─── EMAIL CAPTURE ─── */
.email-capture-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-xl);
  padding: var(--space-9);
  text-align: center;
}

.email-capture-box h3 {
  font-family: var(--font-display);
  font-size: 22px;
  margin-bottom: var(--space-2);
}

.email-capture-box .subtitle {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: var(--space-6);
}

.email-form-row {
  display: flex;
  gap: var(--space-3);
  max-width: 520px;
  margin: 0 auto;
}

.email-form-row .form-input {
  flex: 1;
}


/* ─── UPSELL / CTA BOX ─── */
.cta-box {
  background: var(--bg-dark);
  color: var(--text-light);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  text-align: center;
}

.cta-box h3 {
  font-family: var(--font-display);
  color: var(--text-light);
  margin-bottom: var(--space-3);
}

.cta-box p {
  color: var(--text-light-secondary);
  max-width: 540px;
  margin: 0 auto var(--space-6);
}


/* ─── DEPTH PRICING ─── */
.depth-step {
  display: flex;
  gap: var(--space-5);
  padding: var(--space-6);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--duration-normal) ease;
}

.depth-step:hover {
  border-color: rgba(201, 168, 76, 0.3);
  box-shadow: var(--shadow-md);
}

.depth-step-featured {
  border: 2px solid var(--accent);
  box-shadow: var(--shadow-md);
}

.depth-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  min-width: 60px;
}

.depth-price {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.depth-connector {
  width: 2px;
  flex: 1;
  background: var(--border);
  min-height: 20px;
}

.depth-content h4 {
  margin-bottom: var(--space-1);
}

.depth-content p {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: var(--space-3);
}


/* ─── TESTIMONIALS ─── */
.testimonial-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.testimonial-quote {
  font-family: var(--font-display);
  font-size: 18px;
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: var(--space-4);
}

.testimonial-attribution {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}


/* ─── NAVIGATION ─── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(17, 19, 24, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: var(--space-4) 0;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--w-full);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--duration-fast) ease;
  background: transparent;
  border: none;
  padding: 0;
  font-family: inherit;
  cursor: pointer;
}

.nav-link:hover { color: var(--text-primary); }
.nav-link.active { color: var(--accent); }

/* Dropdown ("Learn" menu) */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle { display: inline-flex; align-items: center; gap: 5px; }
.nav-caret { font-size: 10px; transition: transform var(--duration-fast) ease; display: inline-block; }
.nav-dropdown[aria-expanded="true"] .nav-caret { transform: rotate(180deg); }
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  min-width: 240px;
  background: #1A1D24;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 101;
}
.nav-dropdown[aria-expanded="true"] .nav-dropdown-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.nav-dropdown-link {
  display: block;
  padding: 10px 14px;
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease;
}
.nav-dropdown-link:hover { background: rgba(201,168,76,0.08); color: var(--accent); }
.nav-dropdown-link-desc { display: block; font-size: 12px; color: var(--text-tertiary, #6B7280); margin-top: 2px; font-weight: 400; }

/* Hamburger toggle (hidden on desktop) */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  width: 42px;
  height: 42px;
  cursor: pointer;
  padding: 0;
  position: relative;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  transition: border-color var(--duration-fast) ease;
}
.nav-toggle:hover { border-color: rgba(201,168,76,0.35); }
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-primary, #E2E2E6);
  border-radius: 1px;
  transition: transform 200ms ease, opacity 200ms ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Tablet + mobile nav: hamburger becomes visible, links panel drops down */
@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    display: none;
    position: fixed;
    top: 66px;
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 16px 20px 32px;
    background: rgba(17, 19, 24, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255,255,255,0.06);
    overflow-y: auto;
    z-index: 99;
  }
  .nav-links.is-open { display: flex; }
  .nav-links .nav-link {
    display: block;
    padding: 14px 12px;
    border-radius: 8px;
    font-size: 16px;
    color: var(--text-primary, #E2E2E6);
  }
  .nav-links .nav-link:hover { background: rgba(255,255,255,0.04); }
  .nav-dropdown { width: 100%; }
  .nav-dropdown-toggle { display: none; } /* flatten dropdown on mobile */
  .nav-dropdown-menu {
    position: static;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    min-width: 0;
  }
  .nav-dropdown-menu::before {
    content: "Learn";
    display: block;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-tertiary, #6B7280);
    padding: 18px 12px 8px;
  }
  .nav-dropdown-link {
    padding: 12px 12px;
    font-size: 15px;
    color: var(--text-primary, #E2E2E6);
  }
  .nav-cta {
    margin-top: 20px;
    width: 100%;
    text-align: center;
    padding: 14px 20px !important;
    font-size: 14px;
  }
  /* prevent background scroll when open */
  body.nav-open { overflow: hidden; }
}

/* Narrow desktop — tighten gaps so 6 items fit without wrapping */
@media (min-width: 961px) and (max-width: 1160px) {
  .nav-links { gap: 22px; }
  .nav-link { font-size: 13.5px; }
}

.nav-cta {
  font-size: 14px;
}


/* ─── FOOTER ─── */
.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  padding: var(--space-10) 0;
}

.footer a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--duration-fast) ease;
}

.footer a:hover { color: var(--accent); }

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-7);
  margin-bottom: var(--space-6);
}

.footer-copy {
  font-size: 13px;
  color: var(--text-light-muted);
}


/* ─── TOAST NOTIFICATIONS ─── */
.toast {
  position: fixed;
  top: var(--space-6);
  right: var(--space-6);
  z-index: 9999;
  background: var(--bg-dark);
  color: var(--text-light);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-dark-lg);
  font-size: 14px;
  max-width: 380px;
  transform: translateX(120%);
  transition: transform 0.3s var(--ease-out);
}

.toast.show {
  transform: translateX(0);
}


/* ─── ANIMATIONS ─── */

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Fade in from left */
.reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.7s ease, transform 0.7s var(--ease-out);
}
.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Fade in from right */
.reveal-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.7s ease, transform 0.7s var(--ease-out);
}
.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Scale in */
.reveal-scale {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.6s ease, transform 0.6s var(--ease-out);
}
.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* Glow on hover — add to any element */
.glow-hover {
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}
.glow-hover:hover {
  box-shadow: 0 0 20px rgba(201,168,76,0.08);
  border-color: rgba(201,168,76,0.3);
}

/* Stagger children */
.stagger > .reveal:nth-child(1) { transition-delay: 0ms; }
.stagger > .reveal:nth-child(2) { transition-delay: 60ms; }
.stagger > .reveal:nth-child(3) { transition-delay: 120ms; }
.stagger > .reveal:nth-child(4) { transition-delay: 180ms; }
.stagger > .reveal:nth-child(5) { transition-delay: 240ms; }
.stagger > .reveal:nth-child(6) { transition-delay: 300ms; }
.stagger > .reveal:nth-child(7) { transition-delay: 360ms; }

/* Count-up number animation handled via JS */


/* ─── MOBILE STICKY CTA ─── */
.sticky-cta {
  display: none;
}

@media (max-width: 768px) {
  .sticky-cta {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 90;
    background: rgba(26, 29, 35, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: var(--space-3) var(--space-4);
    padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border-dark);
    justify-content: center;
    transform: translateY(100%);
    transition: transform 0.3s ease;
  }

  .sticky-cta.visible {
    transform: translateY(0);
  }

  .sticky-cta .btn {
    flex: 1;
    max-width: 320px;
  }
}


/* ─── ACCESS GATE (Book Reader Code) ─── */
.access-gate {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, var(--bg-dark) 0%, #1B2838 60%, #243447 100%);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
}

.access-gate.hidden { display: none; }

.gate-card {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-9) var(--space-8);
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-xl);
}

.gate-card h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.gate-card .gate-sub {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: var(--space-7);
  line-height: 1.5;
}

.gate-card input {
  width: 100%;
  padding: 14px 16px;
  font-size: 1.1em;
  font-family: var(--font-mono);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  text-align: center;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
  outline: none;
  transition: border-color var(--duration-fast) ease;
}

.gate-card input:focus {
  border-color: var(--accent);
}

.gate-card button {
  width: 100%;
}

.gate-error {
  color: var(--danger);
  font-size: 14px;
  margin-top: var(--space-3);
  display: none;
}

.gate-footer {
  margin-top: var(--space-6);
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.gate-footer a {
  color: var(--accent);
}


/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  h1 { font-size: 34px; }
  h2 { font-size: 26px; }
  h3 { font-size: 19px; }

  .section { padding: var(--space-10) 0; }

  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }

  /* .nav-links handled by nav section rules (960px breakpoint + hamburger) */

  .email-form-row {
    flex-direction: column;
  }

  .depth-step {
    flex-direction: column;
  }

  .score-number { font-size: 32px; }
  .price-number { font-size: 32px; }

  .btn {
    min-height: 44px;
    width: 100%;
  }

  .form-input, .form-select, .form-textarea {
    min-height: 44px;
    font-size: 16px; /* prevents iOS zoom */
  }

  body { padding-bottom: 60px; } /* space for sticky CTA */
}

@media (max-width: 480px) {
  .wrap, .wrap-reading, .wrap-wide, .wrap-full {
    padding: 0 var(--space-4);
  }

  .footer-nav {
    gap: var(--space-4);
    row-gap: var(--space-3);
  }

  .section { padding: var(--space-9) 0; }

  .card { padding: var(--space-5); }
  .email-capture-box { padding: var(--space-6); }

  h1 { font-size: 28px; }
}


/* ─── SCROLL REVEAL JS HELPER ─── */
/*
  Add this script to any page using the design system:

  <script>
  // Scroll reveal
  const observer = new IntersectionObserver((entries) => {
    entries.forEach(entry => {
      if (entry.isIntersecting) {
        entry.target.classList.add('visible');
        observer.unobserve(entry.target);
      }
    });
  }, { threshold: 0.15 });

  document.querySelectorAll('.reveal').forEach(el => observer.observe(el));

  // Sticky mobile CTA (show on scroll up, hide on scroll down)
  let lastScroll = 0;
  const stickyCta = document.querySelector('.sticky-cta');
  if (stickyCta) {
    window.addEventListener('scroll', () => {
      const current = window.scrollY;
      if (current > 300 && current < lastScroll) {
        stickyCta.classList.add('visible');
      } else {
        stickyCta.classList.remove('visible');
      }
      lastScroll = current;
    });
  }

  // Toast notification
  function showToast(message) {
    let toast = document.getElementById('vivid-toast');
    if (!toast) {
      toast = document.createElement('div');
      toast.id = 'vivid-toast';
      toast.className = 'toast';
      document.body.appendChild(toast);
    }
    toast.textContent = message;
    toast.classList.add('show');
    setTimeout(() => toast.classList.remove('show'), 4000);
  }

  // Animated number count-up
  function animateCount(el, target, duration = 1500) {
    const start = performance.now();
    const update = (now) => {
      const progress = Math.min((now - start) / duration, 1);
      const eased = 1 - Math.pow(1 - progress, 3);
      el.textContent = Math.round(target * eased);
      if (progress < 1) requestAnimationFrame(update);
    };
    requestAnimationFrame(update);
  }

  // Animate score bars on scroll
  const barObserver = new IntersectionObserver((entries) => {
    entries.forEach(entry => {
      if (entry.isIntersecting) {
        const fill = entry.target;
        fill.style.width = fill.dataset.width;
        barObserver.unobserve(fill);
      }
    });
  }, { threshold: 0.3 });

  document.querySelectorAll('.score-bar-fill').forEach(el => barObserver.observe(el));
  </script>
*/


/* ─── PREMIUM INTERACTIVE ENHANCEMENTS ─── */

/* Smooth results transition (replaces display:none/block jump) */
.results-smooth {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.5s ease, max-height 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.results-smooth.show {
  opacity: 1;
  max-height: 5000px; /* large enough for any content */
}

/* Input focus glow — premium feel */
input:focus, select:focus, textarea:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15) !important;
  outline: none;
}

/* Keyboard focus rings — accessibility (only shows on keyboard navigation, not click) */
button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible,
input[type="submit"]:focus-visible,
input[type="button"]:focus-visible {
  outline: 2px solid #C9A84C;
  outline-offset: 3px;
  border-radius: 4px;
}

/* Custom select dropdown arrow */
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7075' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* Active/selected option styling in quizzes */
.option-selected {
  border-color: var(--accent) !important;
  background: rgba(201, 168, 76, 0.06) !important;
}

/* Score state badges — enhanced */
.state-ferrari, .state-operator {
  background: linear-gradient(135deg, #C9A84C, #DFC06A) !important;
  color: #1C2024 !important;
}

/* Guarantee box — premium treatment */
.guarantee-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  text-align: center;
  position: relative;
}

.guarantee-box::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 20%;
  right: 20%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

/* Link hover underline animation */
a.animated-link {
  position: relative;
  text-decoration: none;
}

a.animated-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--accent);
  transition: width 0.3s ease;
}

a.animated-link:hover::after {
  width: 100%;
}

/* Loading spinner for score calculation */
@keyframes vivid-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.vivid-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: vivid-spin 0.8s linear infinite;
  margin: 0 auto;
}

/* Pulse animation for live course badges */
@keyframes vivid-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.pulse-live {
  animation: vivid-pulse 2s ease-in-out infinite;
}

/* Tool page results section — dark treatment for reveal impact */
.results-dark {
  background: var(--bg-dark);
  color: var(--text-light);
  border-left: 4px solid var(--accent);
  padding: var(--space-7);
  border-radius: var(--radius-lg);
}

.results-dark h3 {
  color: var(--text-light);
  font-family: var(--font-display);
}

.results-dark .score-value {
  color: var(--accent);
  font-family: var(--font-mono);
}

/* Number highlight — for stats that should pop */
.number-highlight {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent);
}

/* Progress bar for multi-step processes */
.progress-track {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light, #DFC06A));
  border-radius: 2px;
  transition: width 0.4s var(--ease-out);
}

/* Tooltip */
.vivid-tooltip {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted var(--text-muted);
}

.vivid-tooltip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: var(--bg-dark);
  color: var(--text-light);
  font-size: 13px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 10;
}

.vivid-tooltip:hover::after {
  opacity: 1;
}

/* Print styles — clean output for PDF-like experience */
@media print {
  .nav, .sticky-cta, .email-capture, .upsell, .back-note, .toast,
  .vivid-featured-bar, .vivid-footer-newsletter, .vivid-skip-link,
  .vivid-exit-overlay {
    display: none !important;
  }

  body { background: white; color: black; }

  a { color: #000; text-decoration: underline; }
  h1, h2, h3 { color: #000; page-break-after: avoid; }
  img { max-width: 100% !important; page-break-inside: avoid; }

  .results, .results-dark {
    background: white !important;
    color: black !important;
    border-left-color: #333 !important;
  }
}

/* Reduced motion — respect user OS preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
