/* ============================================================
   ADHDFLOW — "Chart Your Own Course" Redesign
   styles.css
   ============================================================ */

@import url('../fonts/fonts.css');

/* ============================================================
   1. DESIGN TOKENS / CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
  /* --- Base Font Size (for accessibility scaling) --- */
  --base-font: 16px;
  --text-scale: 1;

  /* --- Colors: Light mode (default) --- */
  --primary:          #3730a3;
  --primary-light:    #6366f1;
  --accent:           #f59e0b;
  --accent-secondary: #f87171;
  --bg:               #fafafa;
  --surface:          #ffffff;
  --surface-elevated: #ffffff;
  --text-primary:     #0f172a;
  --text-secondary:   #64748b;
  --border:           #e2e8f0;
  --success:          #10b981;
  --warning:          #f59e0b;
  --error:            #f43f5e;
  --info:             #0ea5e9;

  /* --- Spacing --- */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  24px;
  --space-6:  32px;
  --space-7:  48px;
  --space-8:  64px;
  --space-9:  96px;
  --space-10: 128px;

  /* --- Border radius --- */
  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   20px;
  --radius-xl:   28px;
  --radius-full: 9999px;

  /* --- Shadows --- */
  --shadow-sm:  0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  --shadow-md:  0 4px 16px rgba(15,23,42,.08), 0 2px 6px rgba(15,23,42,.05);
  --shadow-lg:  0 12px 40px rgba(15,23,42,.12), 0 4px 12px rgba(15,23,42,.06);
  --shadow-glow: 0 0 0 3px rgba(99,102,241,.25);

  /* --- Layout --- */
  --container-max:    1200px;
  --header-height:    72px;
  --section-pad-v:    clamp(64px, 8vw, 112px);
  --section-gap:      clamp(48px, 6vw, 80px);
}

/* Dark mode tokens — applied when html[data-theme="dark"] */
[data-theme="dark"] {
  --bg:               #0f172a;
  --surface:          #1e293b;
  --surface-elevated: #334155;
  --text-primary:     #f8fafc;
  --text-secondary:   #94a3b8;
  --border:           #334155;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.3),  0 1px 2px rgba(0,0,0,.2);
  --shadow-md:  0 4px 16px rgba(0,0,0,.35), 0 2px 6px rgba(0,0,0,.2);
  --shadow-lg:  0 12px 40px rgba(0,0,0,.45), 0 4px 12px rgba(0,0,0,.25);
}

/* System-level dark preference (before JS runs) */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --bg:               #0f172a;
    --surface:          #1e293b;
    --surface-elevated: #334155;
    --text-primary:     #f8fafc;
    --text-secondary:   #94a3b8;
    --border:           #334155;
    --shadow-sm:  0 1px 3px rgba(0,0,0,.3),  0 1px 2px rgba(0,0,0,.2);
    --shadow-md:  0 4px 16px rgba(0,0,0,.35), 0 2px 6px rgba(0,0,0,.2);
    --shadow-lg:  0 12px 40px rgba(0,0,0,.45), 0 4px 12px rgba(0,0,0,.25);
  }
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 100%;
}

/* Scale base font when accessibility text resize is active */
html[data-text-size] {
  --base-font: calc(16px * var(--text-scale));
}

body {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: clamp(var(--base-font), 1.2vw, calc(var(--base-font) * 1.125));
  line-height: 1.65;
  color: var(--text-primary);
  background-color: var(--bg);
  transition: background-color 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary);
}

ul {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input {
  font-family: inherit;
}

/* ============================================================
   3. TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Plus Jakarta Sans', ui-sans-serif, system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.display-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(calc(var(--base-font) * 2.375), 5.5vw, calc(var(--base-font) * 4.5));
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.h1 {
  font-size: clamp(calc(var(--base-font) * 2), 4.5vw, calc(var(--base-font) * 3.5));
  font-weight: 700;
}

.h2 {
  font-size: clamp(calc(var(--base-font) * 1.625), 3vw, calc(var(--base-font) * 2.5));
  font-weight: 700;
  letter-spacing: -0.02em;
}

.h3 {
  font-size: clamp(calc(var(--base-font) * 1.125), 2vw, calc(var(--base-font) * 1.5));
  font-weight: 700;
}

p {
  max-width: 70ch;
  color: var(--text-secondary);
}

/* ============================================================
   4. UTILITIES
   ============================================================ */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 48px);
}

.section {
  padding-block: var(--section-pad-v);
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 9999;
  padding: var(--space-3) var(--space-5);
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: top 0.2s;
}

.skip-link:focus {
  top: var(--space-4);
}

/* ============================================================
   5. BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: calc(var(--base-font) * 0.9375);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  border: 2px solid transparent;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 3px solid var(--primary-light);
  outline-offset: 3px;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: #2f2a8a;
  border-color: #2f2a8a;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-ghost {
  background: transparent;
  color: var(--primary-light);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--surface);
  border-color: var(--primary-light);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.btn-large {
  padding: 18px 36px;
  font-size: calc(var(--base-font) * 1);
}

.btn-subscribe {
  background: var(--accent);
  color: #0f172a;
  border-color: var(--accent);
  font-weight: 700;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: calc(var(--base-font) * 0.9375);
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  transition: all 0.2s ease;
  border: 2px solid var(--accent);
  cursor: pointer;
}

.btn-subscribe:hover {
  background: #e08c00;
  border-color: #e08c00;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(245,158,11,.35);
}

.btn-subscribe:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
}

/* ============================================================
   6. HEADER / NAVIGATION
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.site-header.is-scrolled {
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: var(--space-5);
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  flex-shrink: 0;
}

.logo-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: calc(var(--base-font) * 1.25);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  transition: color 0.2s ease;
}

.logo:hover .logo-text {
  color: var(--primary);
}

/* Primary nav */
.primary-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: auto;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: calc(var(--base-font) * 0.875);
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(99,102,241,.08);
}

.nav-link:focus-visible {
  outline: 3px solid var(--primary-light);
  outline-offset: 2px;
}

.nav-cta {
  margin-left: var(--space-3);
  padding: 10px 20px;
  background: var(--primary);
  color: #ffffff !important;
  border-radius: var(--radius-md);
  font-weight: 700;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-cta:hover {
  background: #2f2a8a;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* Header controls */
.header-controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

/* Theme toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  transition: all 0.2s ease;
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: var(--primary-light);
  color: var(--primary-light);
  background: rgba(99,102,241,.06);
}

.theme-toggle:focus-visible {
  outline: 3px solid var(--primary-light);
  outline-offset: 2px;
}

/* Show/hide sun vs moon based on theme */
.theme-icon--moon { display: none; }
[data-theme="dark"] .theme-icon--sun  { display: none; }
[data-theme="dark"] .theme-icon--moon { display: block; }

/* Hamburger button */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.2s ease;
  padding: 0;
}

.hamburger:hover {
  border-color: var(--primary-light);
}

.hamburger:focus-visible {
  outline: 3px solid var(--primary-light);
  outline-offset: 2px;
}

.hamburger-bar {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.25s ease;
  transform-origin: center;
}

.hamburger.is-open .hamburger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.is-open .hamburger-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger.is-open .hamburger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============================================================
   7. HERO SECTION
   ============================================================ */
.hero-section {
  position: relative;
  padding-block: clamp(64px, 9vw, 120px);
  overflow: hidden;
  background: var(--bg);
}

/* Topographic SVG background */
.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.topo-svg {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

.topo-path {
  fill: none;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.topo-path--1 {
  stroke: rgba(55, 48, 163, 0.12);
  stroke-dasharray: 1800;
  stroke-dashoffset: 1800;
  animation: draw-path 6s ease-out forwards;
}

.topo-path--2 {
  stroke: rgba(99, 102, 241, 0.09);
  stroke-dasharray: 1900;
  stroke-dashoffset: 1900;
  animation: draw-path 7s 0.4s ease-out forwards;
}

.topo-path--3 {
  stroke: rgba(55, 48, 163, 0.07);
  stroke-dasharray: 1700;
  stroke-dashoffset: 1700;
  animation: draw-path 8s 0.8s ease-out forwards;
}

.topo-path--4 {
  stroke: rgba(99, 102, 241, 0.06);
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
  animation: draw-path 9s 0.2s ease-out forwards;
}

.topo-path--5 {
  stroke: rgba(55, 48, 163, 0.05);
  stroke-dasharray: 1700;
  stroke-dashoffset: 1700;
  animation: draw-path 10s 1.2s ease-out forwards;
}

.topo-path--6 {
  stroke: rgba(99, 102, 241, 0.04);
  stroke-dasharray: 2100;
  stroke-dashoffset: 2100;
  animation: draw-path 11s 0.6s ease-out forwards;
}

@keyframes draw-path {
  to { stroke-dashoffset: 0; }
}

/* Dot grid overlay */
.hero-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(99,102,241,.15) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 70% 70% at 60% 50%, black 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 60% 50%, black 40%, transparent 100%);
  opacity: 0.5;
}

[data-theme="dark"] .hero-dots {
  opacity: 0.2;
}

[data-theme="dark"] .topo-path--1 { stroke: rgba(99, 102, 241, 0.18); }
[data-theme="dark"] .topo-path--2 { stroke: rgba(99, 102, 241, 0.13); }
[data-theme="dark"] .topo-path--3 { stroke: rgba(99, 102, 241, 0.10); }
[data-theme="dark"] .topo-path--4 { stroke: rgba(99, 102, 241, 0.08); }
[data-theme="dark"] .topo-path--5 { stroke: rgba(99, 102, 241, 0.07); }
[data-theme="dark"] .topo-path--6 { stroke: rgba(99, 102, 241, 0.06); }

/* Hero content layout */
.hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: clamp(40px, 6vw, 80px);
  align-items: center;
}

.hero-text {
  max-width: 640px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  background: rgba(99,102,241,.1);
  border: 1px solid rgba(99,102,241,.2);
  font-family: 'Inter', sans-serif;
  font-size: calc(var(--base-font) * 0.75);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-light);
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary-light);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.7); }
}

.headline-accent {
  color: var(--primary-light);
  position: relative;
  display: inline-block;
  padding-bottom: 0.3em;
}

.headline-accent::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0.1em;
  background: linear-gradient(90deg, var(--primary-light), var(--accent));
  border-radius: 0.1em;
  animation: underline-grow 1s 1s ease-out both;
  transform-origin: left;
}

@keyframes underline-grow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

.display-text {
  margin-bottom: var(--space-5);
}

.hero-sub {
  font-size: clamp(calc(var(--base-font) * 1.0625), 1.4vw, calc(var(--base-font) * 1.25));
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: var(--space-7);
  max-width: 52ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

/* Social proof */
.hero-proof {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.proof-avatars {
  display: flex;
  align-items: center;
}

.proof-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--base-font) * 0.75);
  font-weight: 700;
  color: #fff;
  margin-right: -8px;
}

.proof-text {
  font-size: calc(var(--base-font) * 0.8125);
  color: var(--text-secondary);
  max-width: none;
  margin: 0;
}

.proof-text strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* Hero visual: compass card */
.hero-visual {
  flex-shrink: 0;
}

.compass-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-7) var(--space-6);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
  width: 280px;
  animation: float-card 6s ease-in-out infinite;
}

@keyframes float-card {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-12px); }
}

.compass-rose {
  animation: rotate-rose 30s linear infinite;
}

@keyframes rotate-rose {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.compass-flowtypes {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
}

.compass-ft-pill {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: rgba(99,102,241,.1);
  border: 1px solid rgba(99,102,241,.2);
  font-size: calc(var(--base-font) * 0.75);
  font-weight: 600;
  color: var(--primary-light);
}

.compass-label {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: calc(var(--base-font) * 0.8125);
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  max-width: none;
  margin: 0;
}

/* ============================================================
   8. SECTION HEADER PATTERN
   ============================================================ */
.section-header {
  text-align: center;
  max-width: 640px;
  margin-inline: auto;
  margin-bottom: var(--space-8);
}

.section-eyebrow {
  display: inline-block;
  margin-bottom: var(--space-3);
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-full);
  background: rgba(99,102,241,.08);
  border: 1px solid rgba(99,102,241,.15);
  font-size: calc(var(--base-font) * 0.75);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary-light);
}

.section-header .h2 {
  margin-bottom: var(--space-4);
}

.section-intro {
  font-size: clamp(calc(var(--base-font) * 1), 1.3vw, calc(var(--base-font) * 1.125));
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: 52ch;
  margin-inline: auto;
}

.section-cta-wrap {
  text-align: center;
  margin-top: var(--space-8);
}

/* ============================================================
   9. FLOWTYPES SECTION
   ============================================================ */
.flowtypes-section {
  background: var(--bg);
}

.flowtypes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: var(--space-5);
}

.flowtype-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  cursor: default;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.flowtype-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.flowtype-icon {
  font-size: calc(var(--base-font) * 2.25);
  line-height: 1;
}

.flowtype-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex: 1;
}

.flowtype-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: calc(var(--base-font) * 1.25);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.flowtype-hook {
  font-size: calc(var(--base-font) * 0.875);
  font-style: italic;
  color: var(--primary-light);
  max-width: none;
  margin: 0;
}

.flowtype-detail {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

.detail-group {
  background: rgba(99,102,241,.04);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  border: 1px solid rgba(99,102,241,.1);
}

.detail-label {
  font-size: calc(var(--base-font) * 0.6875);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-light);
  margin-bottom: var(--space-2);
}

.detail-label--watch {
  color: var(--accent);
}

.detail-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.detail-list li {
  font-size: calc(var(--base-font) * 0.8125);
  color: var(--text-secondary);
  padding-left: var(--space-3);
  position: relative;
}

.detail-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary-light);
}

.detail-list--watch li::before {
  background: var(--accent);
}

/* ============================================================
   FLOWTYPES SECTION - 2-COLUMN LAYOUT (New)
   ============================================================ */

/* Main layout container */
.flowtypes-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-6);
  align-items: start;
}

/* -------------------------
   LEFT: Navigation Menu
   ------------------------- */
.flowtypes-menu {
  position: sticky;
  top: calc(72px + var(--space-4));
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.flowtypes-menu__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.flowtypes-menu__item:hover {
  background: var(--bg);
  color: var(--text-primary);
}

.flowtypes-menu__item:focus-visible {
  outline: 3px solid var(--primary-light);
  outline-offset: 2px;
}

.flowtypes-menu__item.active {
  background: var(--primary);
  color: white;
}

.flowtypes-menu__item.active:hover {
  background: var(--primary);
}

.flowtypes-menu__icon {
  font-size: 20px;
  flex-shrink: 0;
}

.flowtypes-menu__label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* -------------------------
   RIGHT: Vertical Carousel
   ------------------------- */
.flowtypes-carousel {
  height: 600px;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  border-radius: var(--radius-lg);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.flowtypes-carousel::-webkit-scrollbar {
  width: 8px;
}

.flowtypes-carousel::-webkit-scrollbar-track {
  background: transparent;
}

.flowtypes-carousel::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.flowtypes-carousel::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

.flowtypes-carousel__track {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding: var(--space-2);
}

/* Cards inside carousel */
.flowtypes-carousel .flowtype-card {
  scroll-snap-align: start;
  scroll-margin-top: var(--space-4);
  min-height: 520px;
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  .flowtypes-carousel {
    scroll-behavior: auto;
  }

  .flowtypes-menu__item {
    transition: none;
  }
}

/* -------------------------
   Responsive: Tablet
   ------------------------- */
@media (max-width: 1024px) {
  .flowtypes-layout {
    grid-template-columns: 240px 1fr;
    gap: var(--space-4);
  }

  .flowtypes-menu__item {
    padding: var(--space-2) var(--space-3);
    font-size: 14px;
  }

  .flowtypes-menu__icon {
    font-size: 18px;
  }

  .flowtypes-carousel {
    height: 500px;
  }

  .flowtypes-carousel .flowtype-card {
    min-height: 450px;
  }
}

/* -------------------------
   Responsive: Mobile
   ------------------------- */
@media (max-width: 768px) {
  .flowtypes-layout {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }

  .flowtypes-menu {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    padding: var(--space-3);
    gap: var(--space-2);
  }

  .flowtypes-menu__item {
    padding: var(--space-2) var(--space-3);
    font-size: 13px;
  }

  .flowtypes-menu__label {
    display: none;
  }

  .flowtypes-menu__icon {
    font-size: 24px;
  }

  .flowtypes-carousel {
    height: 480px;
  }

  .flowtypes-carousel .flowtype-card {
    min-height: auto;
  }
}

/* ============================================================
   10. TOOLS SECTION
   ============================================================ */
.tools-section {
  background: var(--surface);
}

[data-theme="dark"] .tools-section {
  background: var(--bg);
}

/* Filter tabs */
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-7);
  justify-content: center;
}

.filter-tab {
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-full);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: calc(var(--base-font) * 0.875);
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

[data-theme="dark"] .filter-tab {
  background: var(--surface);
}

.filter-tab:hover {
  border-color: var(--primary-light);
  color: var(--primary-light);
}

.filter-tab.active,
.filter-tab[aria-selected="true"] {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.filter-tab:focus-visible {
  outline: 3px solid var(--primary-light);
  outline-offset: 2px;
}

/* ============================================================
   TOOLS CAROUSEL
   ============================================================ */
.tools-carousel {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.carousel-viewport {
  flex: 1;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.carousel-track {
  display: flex;
  gap: var(--space-5);
  transition: transform 0.4s ease;
  padding: var(--space-2);
}

@media (prefers-reduced-motion: reduce) {
  .carousel-track {
    transition: none;
  }
}

.carousel-slide {
  flex: 0 0 calc(25% - var(--space-5) * 3 / 4);
  min-width: 280px;
  transition: filter 0.4s ease, opacity 0.4s ease, transform 0.25s ease;
}

@media (prefers-reduced-motion: reduce) {
  .carousel-slide {
    transition: none;
  }
}

.carousel-slide.is-blurred {
  filter: blur(4px);
  opacity: 0.4;
  pointer-events: none;
}

.carousel-slide.is-blurred:hover {
  transform: none;
}

.carousel-btn {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.carousel-btn:hover:not(:disabled) {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.carousel-btn:focus-visible {
  outline: 3px solid var(--primary-light);
  outline-offset: 2px;
}

.carousel-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Pagination dots */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--border);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease, transform 0.2s ease;
}

.carousel-dot:hover {
  background: var(--primary-light);
  transform: scale(1.2);
}

.carousel-dot.active {
  background: var(--primary);
  transform: scale(1.2);
}

.carousel-dot:focus-visible {
  outline: 3px solid var(--primary-light);
  outline-offset: 2px;
}

/* Screen reader only class */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Responsive carousel */
@media (max-width: 1024px) {
  .carousel-slide {
    flex: 0 0 calc(50% - var(--space-5) / 2);
    min-width: 260px;
  }
}

@media (max-width: 640px) {
  .tools-carousel {
    gap: var(--space-2);
  }

  .carousel-btn {
    width: 40px;
    height: 40px;
  }

  .carousel-slide {
    flex: 0 0 85%;
    min-width: 0;
  }

  .carousel-track {
    padding-inline: 7.5%;
  }
}

/* Tool cards (updated for carousel) */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: var(--space-5);
}

.tool-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

[data-theme="dark"] .tool-card {
  background: var(--surface);
}

.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.tool-card[hidden] {
  display: none;
}

.tool-emoji {
  font-size: calc(var(--base-font) * 2);
  line-height: 1;
}

.tool-category-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: calc(var(--base-font) * 0.6875);
  font-weight: 700;
  letter-spacing: 0.05em;
  background: rgba(99,102,241,.08);
  color: var(--primary-light);
  border: 1px solid rgba(99,102,241,.15);
  width: fit-content;
}

.tool-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: calc(var(--base-font) * 1.125);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.tool-desc {
  font-size: calc(var(--base-font) * 0.875);
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: none;
  margin: 0;
  flex: 1;
}

.tool-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: calc(var(--base-font) * 0.8125);
  font-weight: 600;
  color: var(--primary-light);
  text-decoration: none;
  transition: gap 0.2s ease, color 0.2s ease;
  margin-top: auto;
}

.tool-link:hover {
  gap: 10px;
  color: var(--primary);
}

.tools-empty {
  text-align: center;
  padding: var(--space-8) 0;
  color: var(--text-secondary);
}

/* ============================================================
   11. TRAIL GUIDES SECTION
   ============================================================ */
.guides-section {
  background: var(--bg);
}

.guides-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}

/* Featured guide card */
.guide-card--featured {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: box-shadow 0.25s ease;
}

.guide-card--featured:hover {
  box-shadow: var(--shadow-lg);
}

.guide-card-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.guide-visual {
  background: linear-gradient(135deg, rgba(55,48,163,.06), rgba(99,102,241,.04));
  border-bottom: 1px solid var(--border);
  height: 220px;
  overflow: hidden;
}

.guide-illustration {
  width: 100%;
  height: 100%;
}

.guide-illustration svg {
  width: 100%;
  height: 100%;
}

.guide-content {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  flex: 1;
}

/* Side guide cards */
.guides-side {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.guide-card--side {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.guide-card--side:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

/* Guide shared */
.guide-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.guide-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: calc(var(--base-font) * 0.6875);
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.guide-tag--focus {
  background: rgba(14,165,233,.1);
  color: var(--info);
  border: 1px solid rgba(14,165,233,.2);
}

.guide-tag--emotional {
  background: rgba(248,113,113,.1);
  color: var(--accent-secondary);
  border: 1px solid rgba(248,113,113,.2);
}

.guide-tag--productivity {
  background: rgba(16,185,129,.1);
  color: var(--success);
  border: 1px solid rgba(16,185,129,.2);
}

.guide-read-time {
  font-size: calc(var(--base-font) * 0.75);
  color: var(--text-secondary);
}

.guide-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(calc(var(--base-font) * 1), 1.5vw, calc(var(--base-font) * 1.25));
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  margin: 0;
}

.guide-excerpt {
  font-size: calc(var(--base-font) * 0.875);
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: none;
  margin: 0;
  flex: 1;
}

.guide-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: calc(var(--base-font) * 0.8125);
  font-weight: 600;
  color: var(--primary-light);
  text-decoration: none;
  transition: gap 0.2s ease, color 0.2s ease;
  margin-top: auto;
}

.guide-link:hover {
  gap: 10px;
  color: var(--primary);
}

/* ============================================================
   12. FELLOW TRAVELERS / TESTIMONIALS
   ============================================================ */
.travelers-section {
  position: relative;
  background: var(--surface);
  overflow: hidden;
}

[data-theme="dark"] .travelers-section {
  background: var(--surface);
}

/* Topographic CSS texture */
.topo-texture {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 28px,
      var(--primary) 28px,
      var(--primary) 29px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 28px,
      var(--primary) 28px,
      var(--primary) 29px
    );
}

[data-theme="dark"] .topo-texture {
  opacity: 0.06;
}

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

.testimonial-card {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

[data-theme="dark"] .testimonial-card {
  background: var(--surface-elevated);
}

.testimonial-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.testimonial-quote-mark {
  color: var(--primary-light);
}

.testimonial-text {
  font-size: clamp(calc(var(--base-font) * 0.9375), 1.3vw, calc(var(--base-font) * 1.0625));
  line-height: 1.65;
  color: var(--text-primary);
  font-style: normal;
  flex: 1;
  border: none;
}

.testimonial-footer {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border-top: 1px solid var(--border);
  padding-top: var(--space-4);
}

.testimonial-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  font-size: calc(var(--base-font) * 0.875);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.testimonial-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.testimonial-name {
  font-style: normal;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: calc(var(--base-font) * 0.875);
  font-weight: 700;
  color: var(--text-primary);
}

.testimonial-role {
  font-size: calc(var(--base-font) * 0.75);
  color: var(--text-secondary);
}

.flowtype-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(99,102,241,.08);
  border: 1px solid rgba(99,102,241,.15);
  font-size: calc(var(--base-font) * 0.75);
  font-weight: 600;
  color: var(--primary-light);
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-dot {
  font-size: calc(var(--base-font) * 0.875);
}

/* ============================================================
   13. SUBSCRIBE SECTION
   ============================================================ */
.subscribe-section {
  background: var(--bg);
}

[data-theme="dark"] .subscribe-section {
  background: #0a1020;
}

.subscribe-card {
  position: relative;
  background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 50%, #6366f1 100%);
  border-radius: var(--radius-xl);
  overflow: hidden;
  padding: clamp(48px, 6vw, 80px);
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.subscribe-bg-path {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.subscribe-bg-path svg {
  width: 100%;
  height: 100%;
}

.subscribe-content {
  position: relative;
  z-index: 1;
  max-width: 540px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
}

.subscribe-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.subscribe-title {
  color: #ffffff;
  text-align: center;
  max-width: 16ch;
  margin-inline: auto;
}

.subscribe-sub {
  color: rgba(255,255,255,.75);
  font-size: clamp(calc(var(--base-font) * 0.9375), 1.3vw, calc(var(--base-font) * 1.0625));
  line-height: 1.65;
  text-align: center;
  max-width: 42ch;
  margin: 0;
}

/* Subscribe form */
.subscribe-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  align-items: center;
}

.form-row {
  display: flex;
  gap: var(--space-3);
  width: 100%;
  max-width: 480px;
}

.form-input {
  flex: 1;
  min-width: 0;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1.5px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.12);
  color: #ffffff;
  font-size: calc(var(--base-font) * 0.9375);
  font-family: 'Inter', sans-serif;
  transition: border-color 0.2s ease, background 0.2s ease;
  backdrop-filter: blur(4px);
}

.form-input::placeholder {
  color: rgba(255,255,255,.5);
}

.form-input:focus {
  outline: none;
  border-color: rgba(255,255,255,.7);
  background: rgba(255,255,255,.18);
}

.form-input:focus-visible {
  outline: 3px solid rgba(255,255,255,.6);
  outline-offset: 2px;
}

/* Checkbox */
.form-checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  text-align: left;
}

.form-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(255,255,255,.4);
  background: rgba(255,255,255,.1);
  flex-shrink: 0;
  position: relative;
  transition: all 0.2s ease;
}

.form-checkbox input:checked + .checkbox-custom {
  background: rgba(255,255,255,.9);
  border-color: transparent;
}

.form-checkbox input:checked + .checkbox-custom::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 5.5px;
  width: 5px;
  height: 9px;
  border: 2px solid var(--primary);
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.form-checkbox input:focus-visible + .checkbox-custom {
  outline: 3px solid rgba(255,255,255,.6);
  outline-offset: 2px;
}

.checkbox-label {
  font-size: calc(var(--base-font) * 0.875);
  color: rgba(255,255,255,.8);
}

.form-privacy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: calc(var(--base-font) * 0.75);
  color: rgba(255,255,255,.5);
  max-width: none;
  margin: 0;
}

/* Success state */
.subscribe-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-6);
  background: rgba(255,255,255,.12);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,.2);
  backdrop-filter: blur(4px);
}

.subscribe-success[hidden] {
  display: none;
}

.success-icon {
  font-size: calc(var(--base-font) * 2.5);
  animation: success-bounce 0.5s ease-out both;
}

@keyframes success-bounce {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

.subscribe-success p {
  font-size: calc(var(--base-font) * 1.0625);
  font-weight: 600;
  color: #ffffff;
  text-align: center;
  max-width: none;
  margin: 0;
}

/* ============================================================
   14. FOOTER
   ============================================================ */
.site-footer {
  background: var(--text-primary);
  color: rgba(248,250,252,.7);
}

[data-theme="dark"] .site-footer {
  background: #020617;
}

.footer-inner {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--space-10);
  padding-block: clamp(48px, 6vw, 80px);
  align-items: start;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-logo .logo-text {
  color: #f8fafc;
}

.footer-tagline {
  font-size: calc(var(--base-font) * 0.875);
  color: rgba(248,250,252,.5);
  max-width: none;
  margin: 0;
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
}

.footer-col-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: calc(var(--base-font) * 0.8125);
  font-weight: 700;
  color: #f8fafc;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-4);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-links a {
  font-size: calc(var(--base-font) * 0.875);
  color: rgba(248,250,252,.55);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

.footer-links a:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
  border-radius: 2px;
}

.footer-bottom {
  border-top: 1px solid rgba(248,250,252,.08);
  padding-block: var(--space-5);
}

.footer-bottom .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-5);
}

/* ============================================================
   18. FLOWTYPE QUIZ MODAL
   ============================================================ */
.quiz-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.quiz-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.quiz-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
}

.quiz-modal__content {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95) translateY(20px);
  transition: transform 0.3s ease;
}

.quiz-modal.is-open .quiz-modal__content {
  transform: scale(1) translateY(0);
}

.quiz-modal__close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--surface-elevated);
  color: var(--text-secondary);
  font-size: calc(var(--base-font) * 1.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
  z-index: 10;
}

.quiz-modal__close:hover {
  background: var(--border);
  color: var(--text-primary);
}

/* Quiz Intro Step */
.quiz-intro {
  padding: var(--space-8) var(--space-6);
  text-align: center;
}

.quiz-intro__icon {
  font-size: calc(var(--base-font) * 4);
  margin-bottom: var(--space-4);
  line-height: 1;
}

.quiz-intro h2 {
  font-family: var(--font-heading);
  font-size: calc(var(--base-font) * 2);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

.quiz-intro p {
  color: var(--text-secondary);
  font-size: calc(var(--base-font) * 1.1);
  max-width: 480px;
  margin-inline: auto;
  line-height: 1.6;
}

.quiz-intro p:last-of-type {
  margin-bottom: var(--space-6);
}

.quiz-intro .btn {
  min-width: 200px;
}

/* Quiz Questions Step */
.quiz-questions {
  padding: var(--space-6);
}

.quiz-progress {
  margin-bottom: var(--space-6);
}

.quiz-progress__bar {
  height: 8px;
  background: var(--border);
  border-radius: var(--radius-full);
  position: relative;
  overflow: visible;
}

.quiz-progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: var(--radius-full);
  width: 0%;
  transition: width 0.4s ease;
}

.quiz-progress__marker {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  background: var(--primary);
  border: 3px solid var(--surface);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  transition: left 0.4s ease;
}

.quiz-progress__label {
  display: block;
  text-align: center;
  font-size: calc(var(--base-font) * 0.85);
  color: var(--text-secondary);
  margin-top: var(--space-3);
}

.quiz-question {
  text-align: center;
  margin-bottom: var(--space-6);
}

.quiz-question__text {
  font-size: calc(var(--base-font) * 1.25);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.5;
  max-width: 520px;
  margin-inline: auto;
}

/* Likert Scale Answers */
.quiz-answers {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.quiz-answer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 80px;
}

.quiz-answer:hover {
  border-color: var(--primary-light);
  background: var(--surface-elevated);
}

.quiz-answer.selected {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.quiz-answer__value {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: calc(var(--base-font) * 0.85);
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.quiz-answer.selected .quiz-answer__value {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.quiz-answer__label {
  font-size: calc(var(--base-font) * 0.75);
  color: var(--text-secondary);
  text-align: center;
  max-width: 60px;
}

/* Quiz Navigation */
.quiz-nav {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
}

.quiz-nav .btn {
  flex: 1;
  max-width: 180px;
}

.quiz-nav .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Quiz Results Step */
.quiz-results {
  padding: var(--space-6);
}

.quiz-result__header {
  text-align: center;
  margin-bottom: var(--space-6);
}

.quiz-result__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 100px;
  border-radius: var(--radius-full);
  font-size: calc(var(--base-font) * 3.5);
  margin-bottom: var(--space-4);
}

.quiz-result__title {
  font-family: var(--font-heading);
  font-size: calc(var(--base-font) * 2);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.quiz-result__hook {
  font-size: calc(var(--base-font) * 1.1);
  font-style: italic;
  color: var(--text-secondary);
  max-width: 480px;
  margin-inline: auto;
}

.quiz-result__section {
  margin-bottom: var(--space-5);
}

.quiz-result__section h4 {
  font-size: calc(var(--base-font) * 1);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.quiz-result__section h4::before {
  content: '';
  width: 4px;
  height: 20px;
  background: var(--primary);
  border-radius: var(--radius-full);
}

.quiz-result__section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.quiz-result__section li {
  position: relative;
  padding-left: var(--space-5);
  margin-bottom: var(--space-2);
  color: var(--text-secondary);
  line-height: 1.5;
}

.quiz-result__section li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 700;
}

.quiz-result__challenges li::before {
  content: '⚡';
  color: var(--accent);
}

.quiz-result__wellbeing {
  background: var(--surface-elevated);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  border-left: 4px solid var(--primary);
}

.quiz-result__wellbeing p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-3);
}

.quiz-result__wellbeing p:last-child {
  margin-bottom: 0;
}

.quiz-result__secondary {
  background: rgba(99, 102, 241, 0.05);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  text-align: center;
  margin-bottom: var(--space-5);
}

.quiz-result__secondary p {
  color: var(--text-secondary);
  margin: 0;
}

.quiz-result__secondary strong {
  color: var(--primary);
}

.quiz-result__actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
}

.quiz-result__actions .btn {
  min-width: 160px;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .quiz-modal__content {
    width: 95%;
    max-height: 95vh;
    border-radius: var(--radius-md);
  }

  .quiz-intro,
  .quiz-questions,
  .quiz-results {
    padding: var(--space-5) var(--space-4);
  }

  .quiz-intro h2 {
    font-size: calc(var(--base-font) * 1.5);
  }

  .quiz-question__text {
    font-size: calc(var(--base-font) * 1.1);
  }

  .quiz-answers {
    gap: var(--space-1);
  }

  .quiz-answer {
    padding: var(--space-2) var(--space-3);
    min-width: 56px;
  }

  .quiz-answer__label {
    font-size: calc(var(--base-font) * 0.65);
  }

  .quiz-result__badge {
    width: 80px;
    height: 80px;
    font-size: calc(var(--base-font) * 2.5);
  }

  .quiz-result__title {
    font-size: calc(var(--base-font) * 1.5);
  }
}

.footer-copy {
  font-size: calc(var(--base-font) * 0.8125);
  color: rgba(248,250,252,.4);
  max-width: none;
  margin: 0;
}

.footer-legal {
  display: flex;
  gap: var(--space-5);
}

.footer-legal a {
  font-size: calc(var(--base-font) * 0.8125);
  color: rgba(248,250,252,.4);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-legal a:hover {
  color: #f8fafc;
}

/* ============================================================
   15. SCROLL REVEAL ANIMATION
   ============================================================ */
.reveal-card {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

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

/* Stagger delay for siblings */
.reveal-card:nth-child(2) { transition-delay: 0.08s; }
.reveal-card:nth-child(3) { transition-delay: 0.16s; }
.reveal-card:nth-child(4) { transition-delay: 0.24s; }
.reveal-card:nth-child(5) { transition-delay: 0.32s; }
.reveal-card:nth-child(6) { transition-delay: 0.40s; }

/* ============================================================
   16. RESPONSIVE — TABLET (max 960px)
   ============================================================ */
@media (max-width: 960px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-visual {
    display: none;
  }

  .hero-text {
    max-width: 100%;
  }

  .hero-sub {
    margin-inline: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-proof {
    justify-content: center;
  }

  .guides-grid {
    grid-template-columns: 1fr;
  }

  .guides-side {
    flex-direction: row;
  }

  .testimonials-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .footer-nav {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================================
   17. RESPONSIVE — MOBILE (max 640px)
   ============================================================ */
@media (max-width: 640px) {
  /* Header */
  .primary-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-4);
    gap: var(--space-2);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
    box-shadow: var(--shadow-md);
    z-index: 999;
  }

  .primary-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-link {
    padding: var(--space-3) var(--space-4);
    font-size: calc(var(--base-font) * 1);
    border-radius: var(--radius-md);
  }

  .nav-cta {
    margin-left: 0;
    text-align: center;
    justify-content: center;
  }

  .hamburger {
    display: flex;
  }

  /* Flowtypes */
  .flowtypes-grid {
    grid-template-columns: 1fr;
  }

  /* Tools */
  .tools-grid {
    grid-template-columns: 1fr;
  }

  .filter-tabs {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: var(--space-2);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: var(--space-2);
  }

  .filter-tabs::-webkit-scrollbar {
    display: none;
  }

  /* Guides */
  .guides-side {
    flex-direction: column;
  }

  /* Testimonials */
  .testimonials-grid {
    grid-template-columns: 1fr;
  }

  /* Subscribe */
  .form-row {
    flex-direction: column;
  }

  .btn-subscribe {
    width: 100%;
    justify-content: center;
  }

  /* Footer */
  .footer-nav {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
  }

  .footer-bottom .container {
    flex-direction: column;
    text-align: center;
  }

  /* Hero */
  .hero-eyebrow {
    margin-inline: auto;
  }
}

/* ============================================================
   18. REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .topo-path--1,
  .topo-path--2,
  .topo-path--3,
  .topo-path--4,
  .topo-path--5,
  .topo-path--6 {
    stroke-dashoffset: 0 !important;
    animation: none !important;
  }

  .compass-rose {
    animation: none !important;
  }

  .compass-card {
    animation: none !important;
  }

  .reveal-card {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .eyebrow-dot {
    animation: none !important;
    opacity: 1;
  }

  .headline-accent::after {
    animation: none !important;
    transform: scaleX(1);
  }
}

/* ============================================================
   18b. TEXT SIZE SCALING (user preference)
   ============================================================ */
/* Note: --text-scale variable is set by JavaScript in initAccessibilityPanel()
   The scaling is now handled via --base-font in :root and html[data-text-size] */


/* ============================================================
   18c. HIGH CONTRAST MODE (user preference)
   ============================================================ */

/* Higher Contrast - Enhanced visibility */
[data-contrast="high"] {
  --text-primary:     #000000;
  --text-secondary:   #1a1a1a;
  --bg:               #ffffff;
  --surface:          #f8f8f8;
  --surface-elevated: #ffffff;
  --border:           #000000;
  --primary:          #1a0099;
  --primary-light:    #2a00dd;
  --accent:           #b36b00;
}

[data-contrast="high"][data-theme="dark"] {
  --text-primary:     #ffffff;
  --text-secondary:   #e5e5e5;
  --bg:               #000000;
  --surface:          #0a0a0a;
  --surface-elevated: #1a1a1a;
  --border:           #ffffff;
  --primary:          #9999ff;
  --primary-light:    #b3b3ff;
  --accent:           #ffcc66;
}

/* Inverted - Full color inversion */
[data-contrast="inverted"] {
  filter: invert(1) hue-rotate(180deg);
}

[data-contrast="inverted"] img,
[data-contrast="inverted"] video,
[data-contrast="inverted"] svg,
[data-contrast="inverted"] .logo-icon,
[data-contrast="inverted"] picture {
  filter: invert(1) hue-rotate(180deg);
}

/* ============================================================
   18d. MANUAL REDUCED MOTION (user override)
   ============================================================ */
[data-reduced-motion="true"] {
  scroll-behavior: auto !important;
}

[data-reduced-motion="true"] *,
[data-reduced-motion="true"] *::before,
[data-reduced-motion="true"] *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

[data-reduced-motion="true"] .topo-path--1,
[data-reduced-motion="true"] .topo-path--2,
[data-reduced-motion="true"] .topo-path--3,
[data-reduced-motion="true"] .topo-path--4,
[data-reduced-motion="true"] .topo-path--5,
[data-reduced-motion="true"] .topo-path--6 {
  stroke-dashoffset: 0 !important;
  animation: none !important;
}

[data-reduced-motion="true"] .compass-rose,
[data-reduced-motion="true"] .compass-card,
[data-reduced-motion="true"] .eyebrow-dot {
  animation: none !important;
}

[data-reduced-motion="true"] .reveal-card {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

[data-reduced-motion="true"] .headline-accent::after {
  animation: none !important;
  transform: scaleX(1);
}

/* ============================================================
   18e. ACCESSIBILITY PANEL
   ============================================================ */
.a11y-panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.a11y-panel-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.a11y-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(380px, 90vw);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.a11y-panel.is-open {
  transform: translateX(0);
}

/* Respect reduced motion for panel animation */
@media (prefers-reduced-motion: reduce) {
  .a11y-panel-backdrop,
  .a11y-panel {
    transition: none;
  }
}

[data-reduced-motion="true"] .a11y-panel-backdrop,
[data-reduced-motion="true"] .a11y-panel {
  transition: none;
}

.a11y-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.a11y-panel-title {
  font-size: calc(var(--base-font) * 1.25);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.a11y-panel-title svg {
  width: 24px;
  height: 24px;
  color: var(--primary-light);
}

.a11y-panel-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.a11y-panel-close:hover,
.a11y-panel-close:focus-visible {
  background: var(--surface-elevated);
  color: var(--text-primary);
}

.a11y-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-6);
}

.a11y-section {
  margin-bottom: var(--space-7);
}

.a11y-section:last-child {
  margin-bottom: 0;
}

.a11y-section-title {
  font-size: calc(var(--base-font) * 0.85);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

.a11y-section-desc {
  font-size: calc(var(--base-font) * 0.9);
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
  line-height: 1.5;
}

/* --- Text Size Slider --- */
.a11y-slider-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.a11y-slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.a11y-slider-label {
  font-weight: 500;
  color: var(--text-primary);
}

.a11y-slider-value {
  font-size: calc(var(--base-font) * 0.9);
  font-weight: 600;
  color: var(--primary-light);
  min-width: 48px;
  text-align: right;
}

.a11y-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
}

.a11y-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  background: var(--primary-light);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.a11y-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  background: var(--primary-light);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.a11y-slider::-webkit-slider-thumb:hover,
.a11y-slider:focus-visible::-webkit-slider-thumb {
  transform: scale(1.15);
  box-shadow: var(--shadow-glow);
}

.a11y-slider::-moz-range-thumb:hover,
.a11y-slider:focus-visible::-moz-range-thumb {
  transform: scale(1.15);
  box-shadow: var(--shadow-glow);
}

.a11y-slider-ticks {
  display: flex;
  justify-content: space-between;
  padding-inline: 2px;
  font-size: calc(var(--base-font) * 0.75);
  color: var(--text-secondary);
}

/* --- Contrast Radio Buttons --- */
.a11y-radio-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.a11y-radio-option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-elevated);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.a11y-radio-option:hover {
  border-color: var(--primary-light);
}

.a11y-radio-option.is-selected {
  border-color: var(--primary-light);
  background: rgba(99, 102, 241, 0.08);
}

.a11y-radio-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.a11y-radio-indicator {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.2s ease;
}

.a11y-radio-option.is-selected .a11y-radio-indicator {
  border-color: var(--primary-light);
}

.a11y-radio-indicator::after {
  content: '';
  width: 10px;
  height: 10px;
  background: var(--primary-light);
  border-radius: 50%;
  transform: scale(0);
  transition: transform 0.15s ease;
}

.a11y-radio-option.is-selected .a11y-radio-indicator::after {
  transform: scale(1);
}

.a11y-radio-label {
  font-weight: 500;
  color: var(--text-primary);
}

/* --- Motion Toggle --- */
.a11y-toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.a11y-toggle-label {
  font-weight: 500;
  color: var(--text-primary);
}

.a11y-toggle {
  position: relative;
  width: 52px;
  height: 28px;
  background: var(--border);
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
  padding: 0;
}

.a11y-toggle[aria-pressed="true"] {
  background: var(--primary-light);
}

.a11y-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  background: white;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.a11y-toggle[aria-pressed="true"] .a11y-toggle-thumb {
  transform: translateX(24px);
}

.a11y-system-hint {
  margin-top: var(--space-3);
  font-size: calc(var(--base-font) * 0.85);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.a11y-system-hint svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* --- Reset Button --- */
.a11y-panel-footer {
  padding: var(--space-5) var(--space-6);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.a11y-reset-btn {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: transparent;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.a11y-reset-btn:hover,
.a11y-reset-btn:focus-visible {
  border-color: var(--error);
  color: var(--error);
  background: rgba(244, 63, 94, 0.05);
}

/* --- Header A11y Button --- */
.a11y-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  margin-right: var(--space-2);
}

.a11y-toggle-btn:hover,
.a11y-toggle-btn:focus-visible {
  background: var(--surface-elevated);
  color: var(--text-primary);
}

.a11y-toggle-btn svg {
  width: 22px;
  height: 22px;
}

/* Live region for screen readers */
.a11y-live-region {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   19. FOCUS INDICATORS (global)
   ============================================================ */
:focus-visible {
  outline: 3px solid var(--primary-light);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ============================================================
   20. LEARN PAGE — Knowledge Base
   ============================================================ */

/* Active nav state (learn.html) */
.nav-link--active {
  color: var(--primary-light) !important;
  background: rgba(99,102,241,.08);
}

/* ------ Hero ------ */
.learn-hero-section {
  position: relative;
  padding-block: clamp(64px, 9vw, 120px);
  overflow: hidden;
  background: var(--bg);
}

.learn-hero-content {
  position: relative;
  z-index: 1;
  max-width: 780px;
}

.learn-hero-title {
  margin-bottom: var(--space-5);
}

.learn-hero-sub {
  font-size: clamp(calc(var(--base-font) * 1.0625), 1.4vw, calc(var(--base-font) * 1.25));
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 58ch;
  margin-bottom: var(--space-7);
}

.learn-stats {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.learn-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.learn-stat__number {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(calc(var(--base-font) * 1.75), 3vw, calc(var(--base-font) * 2.5));
  font-weight: 800;
  color: var(--primary-light);
  line-height: 1;
  letter-spacing: -0.02em;
}

.learn-stat__label {
  font-size: calc(var(--base-font) * 0.8125);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.learn-stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
  flex-shrink: 0;
}

/* ------ Featured Course Card ------ */
.learn-featured-section {
  background: var(--surface);
}

[data-theme="dark"] .learn-featured-section {
  background: var(--bg);
}

.learn-course-card {
  display: grid;
  grid-template-columns: 360px 1fr;
  align-items: stretch;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

[data-theme="dark"] .learn-course-card {
  background: var(--surface);
}

.learn-course-card:hover {
  box-shadow: var(--shadow-lg);
}

.learn-course-visual {
  position: relative;
  background: linear-gradient(135deg, rgba(55,48,163,.1) 0%, rgba(99,102,241,.05) 100%);
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  min-height: 340px;
}

.learn-course-ribbon {
  position: absolute;
  top: var(--space-5);
  left: var(--space-5);
  padding: 5px 14px;
  background: var(--accent);
  color: #0f172a;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: calc(var(--base-font) * 0.6875);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
}

.learn-course-content {
  padding: clamp(32px, 4vw, 56px);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.learn-course-tag {
  background: rgba(55,48,163,.1) !important;
  color: var(--primary) !important;
  border: 1px solid rgba(55,48,163,.2) !important;
}

.learn-course-coming-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px;
  border-radius: var(--radius-full);
  background: rgba(245,158,11,.12);
  border: 1px solid rgba(245,158,11,.25);
  font-size: calc(var(--base-font) * 0.75);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.learn-course-desc {
  font-size: clamp(calc(var(--base-font) * 0.9375), 1.2vw, calc(var(--base-font) * 1.0625));
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: none;
  margin: 0;
}

.learn-course-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
  padding: var(--space-4) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.learn-course-meta-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: calc(var(--base-font) * 0.875);
  font-weight: 600;
  color: var(--text-secondary);
}

.learn-course-meta-item svg {
  color: var(--primary-light);
  flex-shrink: 0;
}

.learn-course-modules {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.learn-module-pill {
  padding: 5px 14px;
  border-radius: var(--radius-full);
  background: rgba(99,102,241,.08);
  border: 1px solid rgba(99,102,241,.15);
  font-size: calc(var(--base-font) * 0.8125);
  font-weight: 600;
  color: var(--primary-light);
  counter-increment: module;
}

.learn-course-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.learn-course-spots {
  font-size: calc(var(--base-font) * 0.8125);
  color: var(--text-secondary);
  font-style: italic;
}

/* ------ Resource Library ------ */
.learn-library-section {
  background: var(--bg);
}

[data-theme="dark"] .learn-library-section {
  background: var(--surface);
}

.learn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: var(--space-5);
  margin-top: var(--space-7);
}

/* ------ Base Learn Card (all types) ------ */
.learn-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.learn-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.learn-card-body {
  padding: var(--space-5) var(--space-6) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex: 1;
}

/* ------ Article card ------ */
.learn-card--article .learn-card-icon {
  font-size: calc(var(--base-font) * 1.875);
  padding: var(--space-5) var(--space-6) 0;
  line-height: 1;
  display: block;
}

/* ------ Video card ------ */
.learn-video-thumb {
  position: relative;
  height: 180px;
  background: linear-gradient(135deg, rgba(55,48,163,.12) 0%, rgba(99,102,241,.06) 50%, rgba(245,158,11,.04) 100%);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.learn-play-btn {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 20px rgba(55,48,163,.35);
}

.learn-card:hover .learn-play-btn {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(55,48,163,.5);
}

.learn-play-btn svg {
  color: #ffffff;
  margin-left: 3px; /* optical centering */
}

.learn-duration-badge {
  position: absolute;
  bottom: var(--space-3);
  right: var(--space-3);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: rgba(15,23,42,.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  font-size: calc(var(--base-font) * 0.75);
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.learn-video-topo {
  position: absolute;
  inset: 0;
  opacity: 0.25;
}

/* ------ Music card ------ */
.learn-music-visual {
  height: 110px;
  background: linear-gradient(135deg, rgba(16,185,129,.08) 0%, rgba(99,102,241,.06) 100%);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

.learn-music-icon {
  font-size: calc(var(--base-font) * 2.25);
  position: relative;
  z-index: 1;
  line-height: 1;
}

.learn-waveform {
  position: absolute;
  inset: 0;
  opacity: 0.18;
}

.learn-mood-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.learn-mood-tag {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: rgba(16,185,129,.1);
  border: 1px solid rgba(16,185,129,.2);
  font-size: calc(var(--base-font) * 0.6875);
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--success);
  text-transform: uppercase;
}

/* ------ Tool card ------ */
.learn-tool-icon {
  font-size: calc(var(--base-font) * 1.75);
  line-height: 1;
  padding: var(--space-5) var(--space-6) 0;
  display: block;
}

/* ------ Tag color variants ------ */
.learn-tag--research {
  background: rgba(167,139,250,.12);
  color: #a78bfa;
  border: 1px solid rgba(167,139,250,.2);
}

.learn-tag--video {
  background: rgba(248,113,113,.1);
  color: var(--accent-secondary);
  border: 1px solid rgba(248,113,113,.2);
}

.learn-tag--music {
  background: rgba(16,185,129,.1);
  color: var(--success);
  border: 1px solid rgba(16,185,129,.2);
}

.learn-tag--tool {
  background: rgba(245,158,11,.1);
  color: var(--accent);
  border: 1px solid rgba(245,158,11,.2);
}

/* ------ Responsive ------ */
@media (max-width: 960px) {
  .learn-course-card {
    grid-template-columns: 1fr;
  }

  .learn-course-visual {
    min-height: 220px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 640px) {
  .learn-stats {
    gap: var(--space-4);
  }

  .learn-stat-divider {
    display: none;
  }

  .learn-grid {
    grid-template-columns: 1fr;
  }

  .learn-course-content {
    padding: var(--space-6);
  }
}
