/* ============================================================
   English Brief — Shared Product Polish Layer
   Cascade layer applied after colors_and_type.css on every page.
   Handles: nav unification · card surfaces · button normalization
            learning blocks · toolkit UI · section rhythm · mobile
   ============================================================ */

/* ─── LAYOUT TOKENS ───────────────────────────────────────────── */
:root {
  --eb-nav-h:    62px;
  --eb-content-max: 1240px;
  --eb-page-x:  clamp(16px, 4vw, 48px);
}

html { scroll-padding-top: calc(var(--eb-nav-h) + 18px); }

body {
  color: var(--fg-body);
  background: var(--grad-page) !important;
  text-rendering: optimizeLegibility;
}

/* ─── TYPOGRAPHY POLISH ───────────────────────────────────────── */
/* Intentional negative tracking preserved on display headings — do NOT force 0 */

p, li,
.lesson-body, .section-sub, .hero-sub, .intro-sub {
  text-wrap: pretty;
}

button, a, input, textarea, select { font-family: var(--font-body); }
button, a { touch-action: manipulation; }

/* ─── FOCUS STATES ────────────────────────────────────────────── */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--blue) !important;
  outline-offset: 3px !important;
  border-radius: 4px;
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.14) !important;
}

/* ─── UNIFIED NAVIGATION ──────────────────────────────────────── */
/* Targets all nav variants: .eb-nav (app/inner pages), #nav (landing), .top-bar (diagnostic) */
.eb-nav, #nav, .top-bar {
  height: var(--eb-nav-h) !important;
  padding-inline: var(--eb-page-x) !important;
  background: rgba(255, 255, 255, 0.82) !important;
  border-bottom: 1px solid rgba(37, 99, 235, 0.10) !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85),
    0 6px 28px rgba(37, 99, 235, 0.07) !important;
  backdrop-filter: blur(28px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(200%) !important;
}

/* Transparent hero nav variant (landing page only) */
#nav:not(.scrolled) {
  background: rgba(6, 14, 28, 0.08) !important;
  border-bottom-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: none !important;
}

/* Nav link styles — shared across all nav variants */
.eb-nav__link, .nav-links a, .top-link {
  min-height: 38px;
  display: inline-flex !important;
  align-items: center;
  padding: 7px 13px !important;
  border-radius: var(--radius-pill) !important;
  color: var(--fg-muted) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  text-decoration: none;
  transition: color 0.15s, background 0.15s !important;
}

.eb-nav__link:hover, .nav-links a:hover,
.top-link:hover,
.eb-nav__link.active, .top-link.active {
  background: rgba(37, 99, 235, 0.08) !important;
  color: var(--cobalt) !important;
}

/* Landing page: white links when hero is visible */
#nav:not(.scrolled) .nav-links a {
  color: rgba(255, 255, 255, 0.90) !important;
}
#nav:not(.scrolled) .nav-links a:hover {
  background: rgba(255, 255, 255, 0.14) !important;
  color: #fff !important;
}

/* Hub-nav overrides — clear state (transparent over dark hero) */
.hub-nav.clear .nav-link {
  color: #fff !important;
  text-shadow: 0 1px 6px rgba(0,0,0,.30) !important;
}
.hub-nav.clear .nav-link:hover,
.hub-nav.clear .nav-link.act {
  background: rgba(255,255,255,.20) !important;
  color: #fff !important;
  text-shadow: none !important;
}
/* Hub-nav — filled state (frosted glass, light bg) */
.hub-nav.filled .nav-link {
  color: var(--fg) !important;
  text-shadow: none !important;
}
.hub-nav.filled .nav-link:hover,
.hub-nav.filled .nav-link.act {
  background: rgba(37,99,235,.10) !important;
  color: var(--cobalt) !important;
}
#nav:not(.scrolled) .nav-logo img {
  filter: drop-shadow(0 2px 10px rgba(6, 14, 28, 0.28)) !important;
}

/* Nav CTA pill (warm gradient) */
.eb-nav__cta, .nav-primary, .back-link {
  min-height: 40px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: var(--radius-pill) !important;
  background: var(--grad-warm) !important;
  color: #451A03 !important;
  border: 0 !important;
  box-shadow: var(--shadow-warm) !important;
  font-weight: 800 !important;
  font-size: 13px !important;
  text-decoration: none !important;
  padding: 9px 22px !important;
  transition: transform 0.18s var(--ease-spring), box-shadow 0.18s !important;
}
.eb-nav__cta:hover, .nav-primary:hover, .back-link:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 28px rgba(251, 146, 60, 0.38) !important;
  color: #451A03 !important;
}

/* App-mode pill (secondary nav element) */
.eb-nav__pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px;
  font-size: 12px !important;
  font-weight: 700 !important;
  color: var(--fg-muted) !important;
  text-decoration: none !important;
  padding: 6px 13px !important;
  border-radius: var(--radius-pill) !important;
  background: rgba(37, 99, 235, 0.06) !important;
  border: 1px solid rgba(37, 99, 235, 0.14) !important;
  transition: color 0.15s, background 0.15s !important;
}
.eb-nav__pill:hover { color: var(--blue) !important; background: rgba(37, 99, 235, 0.10) !important; }

/* ─── SURFACE / CARD SYSTEM ───────────────────────────────────── */
/* Unified card surface radius */
.glass, .card, .progress-card, .question-card, .result-card,
.sidebar-card, .cta-card, .blog .card, .price-card,
.pm-card, .ket-card, .toolkit-card, .path-card,
.sky-card, .lesson-card, .content-card, .mod-card {
  border-radius: var(--radius-card) !important;
}

/* Light card surfaces */
.glass, .card, .progress-card, .question-card, .result-card,
.sidebar-card, .price-card, .pm-card, .ket-card, .lesson-card {
  background: var(--surface-strong) !important;
  border: 1px solid var(--border-subtle) !important;
  box-shadow: var(--shadow-card) !important;
}

.glass:hover, .card:hover,
.price-card:hover, .pm-card:hover, .ket-card:hover {
  box-shadow: var(--shadow-card-h) !important;
}

/* ─── HERO SECTIONS ───────────────────────────────────────────── */
.eb-hero-mesh, .mesh-hero, .tk-hero, .check-hero,
.m0-hero, .hero, #hero {
  background: var(--grad-hero) !important;
}

/* Section padding rhythm */
.section-pad { padding-block: clamp(72px, 8vw, 108px) !important; }

/* Content max-width containers */
.container, .hero-inner, .content, .main-wrap,
.m0-wrap, .m0-layout {
  max-width: var(--eb-content-max) !important;
}

/* Section tags / kickers */
.section-tag, .section-kicker, .hero-chip, .intro-chip,
.m0-chip, .tag, .result-badge, .eb-chip {
  border-radius: var(--radius-pill) !important;
  font-weight: 800 !important;
  letter-spacing: 0.04em !important;
}
.section-tag, .section-kicker, .tag,
.hero-chip:not(.chip-back):not(.chip-free):not(.chip-meta):not(.chip-live) {
  background: rgba(37, 99, 235, 0.09) !important;
  color: var(--cobalt) !important;
  border: 1px solid rgba(37, 99, 235, 0.18) !important;
}

/* ─── BUTTON SYSTEM ───────────────────────────────────────────── */
.btn, .btn-gold, .btn-blue, .btn-outline,
.cta-primary, .cta-secondary, .cta-btn,
.btn-soft, .btn-next, .btn-back, .mb-btn {
  min-height: 42px;
  border-radius: var(--radius-pill) !important;
  font-weight: 800 !important;
  font-family: var(--font-body) !important;
  transition: transform 0.18s var(--ease-spring), box-shadow 0.18s !important;
}

/* Primary warm CTA (gold/orange) */
.btn-gold, .cta-btn, .mb-primary {
  background: var(--grad-warm) !important;
  color: #451A03 !important;
  box-shadow: var(--shadow-warm) !important;
  border: 0 !important;
}
.btn-gold:hover, .cta-btn:hover, .mb-primary:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 10px 28px rgba(251, 146, 60, 0.40) !important;
}

/* Primary blue CTA */
.btn-blue, .btn-grad, .cta-primary, .btn-next {
  background: var(--grad) !important;
  color: #fff !important;
  box-shadow: var(--shadow-blue) !important;
  border: 0 !important;
}
.btn-blue:hover, .btn-grad:hover, .cta-primary:hover, .btn-next:hover {
  transform: translateY(-2px) !important;
  box-shadow: var(--shadow-blue-h) !important;
}

/* Secondary / ghost button */
.btn-outline, .cta-secondary, .btn-soft, .btn-back {
  background: rgba(255, 255, 255, 0.78) !important;
  border: 1px solid var(--border-strong) !important;
  color: var(--cobalt) !important;
}
.btn-outline:hover, .cta-secondary:hover,
.btn-soft:hover, .btn-back:hover {
  background: rgba(37, 99, 235, 0.07) !important;
  transform: translateY(-1px) !important;
}

/* ─── PAGE BACKGROUND ─────────────────────────────────────────── */
.page { background: var(--grad-page) !important; }

/* ─── DIAGNOSTIC PAGE ─────────────────────────────────────────── */
.center-wrap { padding-top: clamp(28px, 5vw, 54px) !important; }
.question-card, .result-card { padding: clamp(22px, 4vw, 36px) !important; }
.question-icon {
  background: rgba(37, 99, 235, 0.08) !important;
  border-color: rgba(37, 99, 235, 0.14) !important;
}
.opt-btn {
  min-height: 58px;
  border-color: rgba(37, 99, 235, 0.14) !important;
  background: rgba(255, 255, 255, 0.82) !important;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s !important;
}
.opt-btn:hover {
  border-color: rgba(37, 99, 235, 0.35) !important;
  box-shadow: 0 6px 22px rgba(37, 99, 235, 0.10) !important;
  transform: translateY(-1px) !important;
}
.opt-btn.selected {
  border-color: var(--blue) !important;
  background: rgba(37, 99, 235, 0.05) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
}
.logo-box {
  background: var(--grad) !important;
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.26) !important;
}
.progress-track, .score-bar-track {
  background: rgba(37, 99, 235, 0.10) !important;
  border-radius: var(--radius-pill) !important;
}
.progress-fill, .score-bar-fill {
  background: linear-gradient(90deg, var(--blue), var(--yellow)) !important;
  border-radius: var(--radius-pill) !important;
}

/* ─── LEARNING HUB + TOOLKIT SURFACES ────────────────────────── */
.soft-grid {
  background:
    linear-gradient(180deg, rgba(255, 248, 234, 0.65), rgba(239, 246, 255, 0.88) 28%, rgba(248, 251, 255, 0.96)),
    linear-gradient(rgba(37, 99, 235, 0.030) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.030) 1px, transparent 1px) !important;
  background-size: auto, 32px 32px, 32px 32px !important;
}

.view-pill-toggle {
  background: rgba(255, 255, 255, 0.78) !important;
  border: 1px solid var(--border-subtle) !important;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.06) !important;
  border-radius: var(--radius-pill) !important;
}
.view-pill-btn.active {
  background: var(--grad) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.24) !important;
}

/* Bottom mobile nav */
.bottom-nav {
  background: rgba(6, 14, 28, 0.94) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.10) !important;
  box-shadow: 0 -8px 28px rgba(6, 14, 28, 0.20) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
}

/* ─── LESSON READABILITY ──────────────────────────────────────── */
.lesson-body { max-width: 78ch; overflow-wrap: break-word; word-break: break-word; }
.lesson-body * { max-width: 100%; }

.lesson-body p, .lesson-body li {
  font-size: 15.5px !important;
  line-height: 1.82 !important;
  color: var(--fg-body) !important;
}

/* Learning block types — token-driven visual distinction */
.ped {
  border-radius: 18px !important;
  padding: 20px 22px !important;
  margin: 24px 0 !important;
}

/* Example block — light blue tint */
.ped-example {
  background: var(--block-example-bg) !important;
  border: 1px solid var(--block-example-border) !important;
  border-left: 3px solid var(--block-example-accent) !important;
}
.ped-example h4 { color: var(--cobalt) !important; }

/* Warning block — warm amber */
.ped-warning {
  background: var(--block-warning-bg) !important;
  border: 1px solid var(--block-warning-border) !important;
  border-left: 3px solid var(--block-warning-accent) !important;
}
.ped-warning h4 { color: #92400E !important; }

/* Tip / green block */
.ped-tip {
  background: var(--block-tip-bg) !important;
  border: 1px solid var(--block-tip-border) !important;
  border-left: 3px solid var(--block-tip-accent) !important;
}
.ped-tip h4 { color: #166534 !important; }

/* Avoid / bad example block */
.ped-avoid {
  background: var(--block-avoid-bg) !important;
  border: 1px solid var(--block-avoid-border) !important;
  border-left: 3px solid var(--block-avoid-accent) !important;
}
.ped-avoid h4 { color: #9F1239 !important; }

/* Senior / pro note block */
.ped-senior {
  background: rgba(99,102,241,0.06) !important;
  border: 1px solid rgba(99,102,241,0.20) !important;
  border-left: 3px solid var(--indigo) !important;
}
.ped-senior h4 { color: #4338CA !important; }

/* Template / copy-paste block */
.ped-template {
  background: rgba(37,99,235,0.04) !important;
  border: 1.5px dashed rgba(37,99,235,0.28) !important;
  border-radius: 16px !important;
}
.ped-template h4 { color: var(--cobalt) !important; }

/* Compare blocks */
.compare {
  border-radius: 16px !important;
  border: 1px solid rgba(37, 99, 235, 0.10) !important;
  overflow: hidden;
  margin: 18px 0 !important;
}
.compare .bad {
  background: var(--block-avoid-bg) !important;
  border-bottom: 1px solid var(--block-avoid-border) !important;
}
.compare .good { background: rgba(22, 163, 74, 0.07) !important; }
/* Ensure compare label text is readable */
.compare .bad .clabel { color: #9F1239 !important; font-weight: 800 !important; }
.compare .good .clabel { color: #166534 !important; font-weight: 800 !important; }
.compare pre { color: var(--fg-body) !important; }

/* Blockquote */
.lesson-body blockquote, blockquote {
  border-left: 4px solid var(--color-accent) !important;
  background: #FFFBEB !important;
  border-radius: 0 14px 14px 0 !important;
  padding: 14px 20px !important;
  margin: 22px 0 !important;
  color: #92400E !important;
  font-style: italic !important;
  font-weight: 600 !important;
  font-size: 14.5px !important;
  line-height: 1.72 !important;
}

/* Lesson body: all ped block body text */
.ped p, .ped ul, .ped li {
  color: var(--fg-body) !important;
  font-size: 13.5px !important;
  line-height: 1.72 !important;
}

/* Step / result row cards */
.step, .res-row, .err, .sky-card, .path-card {
  border-radius: 16px !important;
}
.ped-example h4 span, .ped-warning h4 span, .ped-tip h4 span {
  font-size: 16px;
}

/* Table overflow fix */
.tbl-wrap { overflow-x: auto; }
pre, .sky-inner { overflow-x: auto; }

/* Landing live viewer chip: match Learning Hub hero chips */
.hero-chip.chip-live {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  width: auto !important;
  max-width: 100% !important;
  padding: 5px 12px !important;
  border-radius: 9999px !important;
  background: rgba(255,255,255,.09) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  color: rgba(255,255,255,.84) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
}

/* ─── LEARNING HUB SECTION KICKER ─────────────────────────────── */
.section-kicker {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  border-radius: var(--radius-pill) !important;
  background: rgba(37, 99, 235, 0.09) !important;
  color: var(--cobalt) !important;
  font-weight: 800 !important;
  font-size: 11px !important;
  padding: 5px 13px !important;
  border: 1px solid rgba(37, 99, 235, 0.16) !important;
  margin-bottom: 10px;
}

/* ─── CTA / BANNER BLOCKS ─────────────────────────────────────── */
.cta-strip, .bottom-cta-inner, .cta-banner, .complete-card {
  background: var(--grad-hero) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 16px 48px rgba(37, 99, 235, 0.20) !important;
  border-radius: var(--radius-xl) !important;
}
/* Dark CTA text should meet minimum contrast */
.cta-strip *, .bottom-cta-inner *, .cta-banner *, .complete-card * {
  text-shadow: none;
}
.cta-banner .ct, .complete-card .pt {
  color: var(--on-dark) !important;
}
.cta-banner .cs, .cta-banner .cn,
.complete-card .ps {
  color: var(--on-dark-muted) !important;
}

/* ─── BLOG + ARTICLE PAGES ────────────────────────────────────── */
.cat-bar {
  background: rgba(255, 255, 255, 0.88) !important;
  border-bottom: 1px solid var(--border-subtle) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
}
.cat-pill {
  min-height: 34px;
  border-color: var(--border-subtle) !important;
  border-radius: var(--radius-pill) !important;
}
.cat-pill.active {
  background: rgba(37, 99, 235, 0.10) !important;
  border-color: rgba(37, 99, 235, 0.28) !important;
  color: var(--cobalt) !important;
}

/* Blog article cards — consistent with design system */
.blog-card, .article-card {
  border-radius: var(--radius-card) !important;
  background: var(--surface-strong) !important;
  border: 1px solid var(--border-subtle) !important;
  box-shadow: var(--shadow-card) !important;
}
.blog-card:hover, .article-card:hover {
  box-shadow: var(--shadow-card-h) !important;
  transform: translateY(-4px) !important;
}

/* Prose / article body */
.prose-body {
  border: 1px solid var(--border-subtle) !important;
  box-shadow: var(--shadow-card) !important;
  border-radius: var(--radius-card) !important;
  background: var(--surface-strong) !important;
}
.prose-body p, .prose-body li {
  font-size: 16px !important;
  line-height: 1.84 !important;
}
.callout {
  background: linear-gradient(135deg, rgba(255, 251, 235, 0.96), rgba(255, 255, 255, 0.88)) !important;
  border-color: rgba(251, 146, 60, 0.24) !important;
  border-radius: 16px !important;
}

/* ─── TOOLKIT CARDS ───────────────────────────────────────────── */
.toolkit-card {
  background: var(--surface-strong) !important;
  border: 1px solid var(--border-subtle) !important;
  box-shadow: var(--shadow-card) !important;
  border-radius: var(--radius-card) !important;
  transition: transform 0.22s var(--ease-smooth), box-shadow 0.22s !important;
}
.toolkit-card:hover {
  transform: translateY(-4px) !important;
  box-shadow: var(--shadow-card-h) !important;
}

/* Copy button polish */
.copy-btn {
  border-radius: var(--radius-sm) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  padding: 6px 14px !important;
  min-height: 32px !important;
  transition: all 0.15s !important;
  cursor: pointer !important;
  border: 1px solid var(--border-subtle) !important;
  background: rgba(255, 255, 255, 0.80) !important;
  color: var(--cobalt) !important;
}
.copy-btn:hover {
  background: rgba(37, 99, 235, 0.08) !important;
  border-color: rgba(37, 99, 235, 0.24) !important;
}
.copy-btn.copied {
  background: rgba(74, 222, 128, 0.12) !important;
  border-color: rgba(74, 222, 128, 0.30) !important;
  color: #15803D !important;
}

/* ─── SCROLL PROGRESS ─────────────────────────────────────────── */
.scroll-progress, #scrollProgress, #scroll-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  z-index: 9999;
  pointer-events: none;
  border-radius: 0 2px 2px 0;
}
#scroll-bar {
  background: var(--grad-warm);
  transition: width 0.10s linear;
}

/* ─── DARK SECTION TEXT CONTRAST ─────────────────────────────── */
/* Any element with a dark gradient/dark background should use
   --on-dark tokens instead of low-opacity rgba whites */
.eb-hero-mesh h1, .eb-hero-mesh h2, .eb-hero-mesh h3,
.mesh-hero h1, .mesh-hero h2, .mesh-hero h3,
#hero h1, #hero h2 {
  color: var(--on-dark) !important;
}
/* Subtext inside dark heroes — min 5:1 */
.eb-hero-mesh p, .mesh-hero p,
#hero p, #hero .hero-sub {
  color: var(--on-dark-muted) !important;
}
/* Tertiary labels inside dark sections — min 4.3:1 */
.eb-hero-mesh .section-sub, .mesh-hero .section-sub,
#pro-kit .section-sub, #urgency .section-sub,
#final-cta .section-sub {
  color: var(--on-dark-soft) !important;
}

/* ─── PRICING SECTION ─────────────────────────────────────────── */
.price-card {
  transition: transform 0.22s var(--ease-smooth), box-shadow 0.22s !important;
}
.price-card--featured, .price-pro-hero {
  border: 2px solid rgba(250, 204, 21, 0.45) !important;
  box-shadow:
    0 24px 72px rgba(250, 204, 21, 0.16),
    0 8px 28px rgba(37, 99, 235, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.98) !important;
}
.badge-free {
  background: rgba(74, 222, 128, 0.14) !important;
  color: #15803D !important;
  border: 1px solid rgba(74, 222, 128, 0.28) !important;
}
.badge-ess {
  background: rgba(37, 99, 235, 0.10) !important;
  color: var(--blue) !important;
  border: 1px solid rgba(37, 99, 235, 0.20) !important;
}
.badge-pro {
  background: rgba(250, 204, 21, 0.16) !important;
  color: #854D0E !important;
  border: 1px solid rgba(250, 204, 21, 0.30) !important;
}

/* ─── MOBILE STICKY CTA ───────────────────────────────────────── */
.sticky-cta-mobile {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 80;
  padding: 12px 16px max(12px, env(safe-area-inset-bottom));
  background: rgba(6, 14, 28, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: none;
}
@media (max-width: 640px) {
  .sticky-cta-mobile { display: block; }
}

/* ─── FORM INPUT READABILITY ──────────────────────────────────── */
input[type="text"],
input[type="email"],
input[type="search"],
textarea,
select {
  color: var(--fg-body);
  background: rgba(255,255,255,0.95);
  border: 1.5px solid var(--color-border-strong);
  border-radius: var(--radius-md);
}
input::placeholder,
textarea::placeholder {
  color: var(--fg-soft);
  opacity: 1; /* prevent browser dimming */
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--blue);
  outline: none;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.14);
}

/* ─── BOTTOM NAV ICON LABELS ──────────────────────────────────── */
.bottom-nav .bn-label {
  color: var(--on-dark-soft) !important;  /* 4.3:1 on dark bg — readable at 11px+ */
}
.bottom-nav .bn-item.active .bn-label {
  color: var(--on-dark) !important;
}

/* ─── HAMBURGER MENU ──────────────────────────────────────────── */
.eb-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  cursor: pointer;
  background: transparent;
  border: none;
  border-radius: 8px;
  transition: background .15s;
  flex-shrink: 0;
}
.eb-hamburger:hover { background: rgba(255,255,255,.12); }
.eb-hamburger span {
  display: block;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all .25s;
}
/* Dark nav state */
.eb-nav.scrolled .eb-hamburger span,
.eb-nav--app .eb-hamburger span,
#nav.scrolled .eb-hamburger span { background: var(--blue, #2563EB); }

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

.eb-mobile-menu {
  display: none;
  position: fixed;
  top: var(--eb-nav-h);
  left: 0;
  right: 0;
  z-index: 99;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px 16px;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(28px);
  border-bottom: 1px solid rgba(37,99,235,.10);
  box-shadow: 0 8px 24px rgba(37,99,235,.10);
  animation: ebMenuDrop .18s ease both;
}
.eb-mobile-menu.open { display: flex; }
.eb-mobile-menu a {
  font-size: 15px;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 12px;
  transition: background .15s, color .15s;
}
.eb-mobile-menu a:hover,
.eb-mobile-menu a.active { background: rgba(37,99,235,.08); color: #2563EB; }

@keyframes ebMenuDrop {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── RESPONSIVE BREAKPOINTS ──────────────────────────────────── */
@media (max-width: 960px) {
  /* Allow pages to set their own mobile nav height */
  .eb-nav, #nav, .top-bar { height: auto !important; min-height: var(--eb-nav-h); }

  /* Hide nav links, show hamburger */
  .eb-nav__links, .nav-links, .top-actions .top-link:not(.active):not(.nav-primary) {
    display: none !important;
  }
  .eb-hamburger { display: flex !important; }
  .eb-nav, #nav, .top-bar {
    padding-inline: 16px !important;
  }
  .eb-nav__actions, .nav-actions, .top-actions {
    gap: 8px !important;
  }
  .eb-nav__pill { display: none !important; }
  /* Hero padding */
  #hero { padding: 112px 20px 72px !important; }
  .hero-inner { grid-template-columns:minmax(0,1fr) !important; gap: 28px !important; }
  .section-pad { padding-block: 64px !important; }
  .m0-layout, .content, .main-wrap { padding-inline: 16px !important; }
  /* Pricing grids */
  .price-pro-layout { grid-template-columns:minmax(0,1fr) !important; gap: 24px !important; }
  .price-divider-v { display: none !important; }
}

@media (max-width: 640px) {
  :root { --radius-card: 18px; }

  /* Tighten lesson-card on small phones */
  .lesson-card { padding: 16px !important; }

  /* Smaller nav CTA */
  .eb-nav__cta, .nav-primary, .back-link {
    padding-inline: 14px !important;
    font-size: 12px !important;
  }

  /* Hero text scale */
  .hero h1, .hero-h, .intro-title {
    font-size: clamp(30px, 9vw, 44px) !important;
  }
  .hero-sub, .intro-sub {
    font-size: 15.5px !important;
    line-height: 1.70 !important;
  }

  /* Diagnostic layout */
  .question-head { grid-template-columns:minmax(0,1fr) !important; }
  .nav-row { align-items: stretch !important; }
  .btn-next, .btn-back { width: 100%; justify-content: center; }

  /* Pricing */
  .price-two-col { grid-template-columns:minmax(0,1fr) !important; }

  /* Card shadows — lighter on mobile for performance */
  .toolkit-card, .card, .question-card, .progress-card, .result-card {
    box-shadow: 0 4px 18px rgba(37, 99, 235, 0.08) !important;
  }

  /* Section spacing */
  .section-pad { padding-block: 48px !important; }

  /* Pain mirror — single column */
  .pm-grid { grid-template-columns:minmax(0,1fr) !important; }
  .pm-bubble-wide { grid-column: span 1 !important; }

  /* Module grid — single column */
  .module-grid { grid-template-columns:minmax(0,1fr) !important; }
  .kit-grid { grid-template-columns:minmax(0,1fr) minmax(0,1fr) !important; }
  .module-grid>*,.kit-grid>* { min-width: 0; }

  /* Testimonial grid */
  .testi-main-grid { grid-template-columns:minmax(0,1fr) !important; }
  .testi-main-grid>* { min-width: 0; }
  .testi-agg-item { padding: 0 16px !important; }
  .testi-aggregate { padding: 20px 16px !important; }

  /* Container padding */
  .container { padding-inline: 16px !important; }
  .m0-layout { padding-inline: 12px !important; }
}

/* ─── REDUCED MOTION ──────────────────────────────────────────── */
@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;
  }
}
