/* ===================================================================
   THE CRYPTO MARKET CYCLE - INTERACTIVE VISUAL ENGINE
   Design System: Clean Editorial Fintech / Dark Minimalist
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Theme Tokens: Dark (Default) */
  --bg: #090a0f;
  --bg-subtle: #0f1118;
  --card-bg: rgba(17, 20, 30, 0.7);
  --card-hover: rgba(23, 27, 40, 0.85);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-border-glow: rgba(56, 189, 248, 0.25);
  
  --text: #f3f4f6;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --line: rgba(255, 255, 255, 0.07);
  --line-grid: rgba(255, 255, 255, 0.035);

  /* Semantic CT Accent Colors */
  --smart-money: #10b981;
  --kols: #a855f7;
  --retail: #f97316;
  --dump: #ef4444;
  --moonshot: #fbbf24;
  --cyan: #06b6d4;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.55);

  --chart-bg: #0c0e16;
  --chart-grid: #151824;
}

[data-theme="light"] {
  --bg: #f8fafc;
  --bg-subtle: #f1f5f9;
  --card-bg: rgba(255, 255, 255, 0.9);
  --card-hover: rgba(255, 255, 255, 0.98);
  --card-border: rgba(15, 23, 42, 0.08);
  --card-border-glow: rgba(14, 165, 233, 0.3);
  
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --line: rgba(15, 23, 42, 0.08);
  --line-grid: rgba(15, 23, 42, 0.04);

  --smart-money: #059669;
  --kols: #9333ea;
  --retail: #ea580c;
  --dump: #dc2626;
  --moonshot: #d97706;
  --cyan: #0284c7;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.08);

  --chart-bg: #ffffff;
  --chart-grid: #f1f5f9;
}

/* ===================================================================
   Reset & Base Styles
   =================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg);
  background-image: 
    radial-gradient(ellipse 70% 40% at 50% -15%, rgba(56, 189, 248, 0.08), transparent),
    radial-gradient(circle at 10% 50%, rgba(16, 185, 129, 0.03), transparent 40%),
    radial-gradient(circle at 90% 60%, rgba(249, 115, 22, 0.03), transparent 40%);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* ===================================================================
   Top Navigation Bar
   =================================================================== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(9, 10, 15, 0.85);
  border-bottom: 1px solid var(--card-border);
  padding: 10px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

[data-theme="light"] .top-nav {
  background: rgba(248, 250, 252, 0.88);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.brand-symbol {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: #111420;
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--smart-money);
}

.brand-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-live {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--smart-money);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge-live::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--smart-money);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-btn {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  background: var(--card-hover);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
}

.nav-btn.active {
  color: var(--smart-money);
  border-color: var(--smart-money);
  background: rgba(16, 185, 129, 0.08);
}

/* ===================================================================
   Main Container Layout
   =================================================================== */
.container {
  max-width: 1020px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

/* ===================================================================
   Hero Header
   =================================================================== */
.hero {
  text-align: center;
  margin-bottom: 24px;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 12px;
  border-radius: var(--radius-full);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin-bottom: 10px;
  color: var(--text);
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: clamp(14px, 1.8vw, 15.5px);
  max-width: 640px;
  margin: 0 auto 14px;
}

.hero-tip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.kbd {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10.5px;
  color: var(--text-secondary);
}

/* ===================================================================
   Live Telemetry HUD
   =================================================================== */
.hud-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

@media (max-width: 768px) {
  .hud-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.hud-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  position: relative;
  overflow: hidden;
}

.hud-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--hud-color, var(--card-border));
  opacity: 0.6;
}

.hud-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hud-value {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.hud-sub {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-tag {
  display: inline-block;
  font-size: 9.5px;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
}

.tag-green { background: rgba(16, 185, 129, 0.15); color: var(--smart-money); }
.tag-red { background: rgba(239, 68, 68, 0.15); color: var(--dump); }
.tag-orange { background: rgba(249, 115, 22, 0.15); color: var(--retail); }
.tag-purple { background: rgba(168, 85, 247, 0.15); color: var(--kols); }
.tag-gold { background: rgba(251, 191, 36, 0.15); color: var(--moonshot); }

/* ===================================================================
   The Chart Container & Canvas
   =================================================================== */
.chart-wrapper {
  background: var(--chart-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
}

.chart-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: rgba(255, 255, 255, 0.01);
}

.chart-pair {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.svg-container {
  position: relative;
  width: 100%;
  padding: 10px 10px 16px;
  overflow-x: auto;
}

svg#cycleChart {
  display: block;
  width: 100%;
  min-width: 760px;
  height: auto;
  user-select: none;
}

/* SVG Typography & Classes */
.axis-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  fill: var(--text-muted);
}

.axis-grid {
  stroke: var(--line-grid);
  stroke-width: 1;
}

.axis-line {
  stroke: var(--card-border);
  stroke-width: 1;
}

.curve-seg {
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.3));
}

.curve-glow {
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.35;
  filter: blur(4px);
}

.ref-line {
  stroke-dasharray: 4 4;
  opacity: 0.7;
}

.annotation {
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  transform-box: fill-box;
}

.ann-title {
  font-family: var(--font-heading);
  font-size: 12.5px;
  font-weight: 700;
  fill: var(--text);
}

.ann-sub {
  font-family: var(--font-body);
  font-size: 11px;
  fill: var(--text-secondary);
}

.ann-badge-rect {
  fill: var(--chart-bg);
  stroke-width: 1;
}

/* Pulse animation */
@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(2.8); opacity: 0; }
}

.pulse-circle {
  animation: pulse-ring 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
  transform-box: fill-box;
  transform-origin: center;
}

/* ===================================================================
   Playback Control Bar
   =================================================================== */
.control-bar {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.btn-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn:hover {
  background: var(--card-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-primary {
  background: var(--smart-money);
  border-color: var(--smart-money);
  color: #061811;
  font-weight: 700;
}

.btn-primary:hover {
  background: #34d399;
}

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

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

.speed-selector {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.speed-opt {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.speed-opt.active {
  background: var(--card-hover);
  color: var(--text);
}

/* ===================================================================
   Timeline Stepper Navigation
   =================================================================== */
.stepper-nav {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 18px;
  scrollbar-width: thin;
}

.step-pill {
  flex: 1;
  min-width: 64px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 7px 5px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: all 0.2s ease;
}

.step-pill:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: var(--card-hover);
}

.step-num {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
}

.step-bar {
  width: 100%;
  height: 2px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.3s ease;
}

.step-name {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 58px;
}

.step-pill.active {
  border-color: var(--pill-color, var(--smart-money));
  background: rgba(255, 255, 255, 0.04);
}

.step-pill.active .step-num {
  color: var(--pill-color, var(--smart-money));
}

.step-pill.active .step-bar {
  background: var(--pill-color, var(--smart-money));
}

.step-pill.completed .step-bar {
  background: var(--smart-money);
}

/* ===================================================================
   Active Narrative Drawer
   =================================================================== */
.narrative-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: border-color 0.3s ease;
}

.narrative-num {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  color: var(--text);
}

.narrative-content {
  flex: 1;
}

.narrative-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--smart-money);
  margin-bottom: 3px;
}

.narrative-title {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.narrative-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ===================================================================
   The Masterclass Finale: How To Not Be The Exit Liquidity
   =================================================================== */
.lessons-section {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.6s ease, max-height 0.6s ease;
  margin-top: 10px;
}

.lessons-section.revealed {
  opacity: 1;
  max-height: 3500px;
  margin-top: 32px;
}

.section-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: var(--moonshot);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.section-heading {
  font-family: var(--font-heading);
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.section-sub {
  color: var(--text-secondary);
  font-size: 14.5px;
  margin-bottom: 22px;
  max-width: 660px;
}

/* 3 Core Rules Bento Grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

@media (max-width: 860px) {
  .bento-grid {
    grid-template-columns: 1fr;
  }
}

.bento-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.bento-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.bento-card.card-dyor { border-top: 2px solid var(--cyan); }
.bento-card.card-fundamentals { border-top: 2px solid var(--smart-money); }
.bento-card.card-target { border-top: 2px solid var(--retail); }

.bento-rule-number {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.bento-title {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.bento-quote {
  font-size: 13.5px;
  color: var(--text);
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 12px;
}

.bento-details {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.55;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: auto;
}

/* Golden Rule Hero Card */
.golden-rule-card {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.06) 0%, rgba(16, 185, 129, 0.06) 100%);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 20px;
}

.golden-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--moonshot);
  margin-bottom: 6px;
}

.golden-quote {
  font-family: var(--font-heading);
  font-size: clamp(16px, 2.2vw, 19px);
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 8px;
}

.golden-sub {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ===================================================================
   Dedicated X / Twitter Share Card Studio
   =================================================================== */
.x-card-studio {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
}

.x-studio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.x-studio-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.x-preview-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: center;
}

@media (max-width: 768px) {
  .x-preview-container {
    grid-template-columns: 1fr;
  }
}

.x-image-mockup {
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  overflow: hidden;
  background: #000;
}

.x-image-mockup img {
  display: block;
  width: 100%;
  height: auto;
}

.x-post-preview {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.x-post-text {
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.6;
  white-space: pre-line;
  background: transparent;
  border: none;
  resize: none;
  width: 100%;
  outline: none;
}

.x-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ===================================================================
   Footer
   =================================================================== */
footer {
  margin-top: 36px;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-muted);
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

footer a {
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ===================================================================
   Toast Notification
   =================================================================== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  background: #111420;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: all 0.25s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ===================================================================
   Responsive Media Queries — Full Mobile-First System
   =================================================================== */

/* Tablet: 768px */
@media (max-width: 768px) {
  .hud-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .bento-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .x-preview-container {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .x-studio-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .x-actions-row {
    width: 100%;
    justify-content: stretch;
  }

  .x-actions-row .btn,
  .x-actions-row a.btn {
    flex: 1;
    justify-content: center;
    text-align: center;
  }

  .chart-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .chart-legend {
    gap: 10px;
  }

  .svg-container {
    overflow-x: hidden;
  }

  svg#cycleChart {
    min-width: 0;
    width: 100%;
    height: auto;
  }

  .control-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .btn-group {
    width: 100%;
    justify-content: stretch;
  }

  .btn-group .btn {
    flex: 1;
    justify-content: center;
  }

  .speed-selector {
    justify-content: center;
    width: 100%;
  }

  .speed-opt {
    flex: 1;
    text-align: center;
  }

  .narrative-card {
    flex-direction: column;
    gap: 10px;
    padding: 14px;
  }

  .section-sub {
    font-size: 13.5px;
  }

  .share-banner {
    flex-direction: column;
  }
}

/* Mobile: 640px */
@media (max-width: 640px) {
  .top-nav {
    padding: 8px 12px;
    gap: 8px;
  }

  .brand-title {
    font-size: 14px;
  }

  .badge-live {
    display: none;
  }

  .nav-actions {
    gap: 5px;
  }

  .nav-btn {
    padding: 5px 9px;
    font-size: 11.5px;
  }

  .container {
    padding: 12px 10px 60px;
  }

  .hero {
    margin-bottom: 16px;
  }

  .hero-tip {
    display: none;
  }

  .hud-grid {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .hud-card {
    padding: 10px 11px;
  }

  .hud-value {
    font-size: 14px;
  }

  .hud-sub {
    display: none;
  }

  .chart-wrapper {
    border-radius: var(--radius-md);
    overflow: hidden;
  }

  .chart-header {
    padding: 10px 12px;
    gap: 8px;
  }

  .chart-title {
    font-size: 16px;
  }

  .chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
  }

  .legend-item {
    font-size: 10.5px;
    gap: 4px;
  }

  .legend-dot {
    width: 6px;
    height: 6px;
  }

  /* Full responsive mobile chart - fits screen perfectly with zero horizontal scroll */
  .svg-container {
    padding: 4px 4px 10px;
    overflow-x: hidden !important;
    width: 100%;
  }

  svg#cycleChart {
    min-width: 0 !important;
    width: 100% !important;
    height: auto !important;
  }

  /* Make curve lines punchy and legible on mobile displays */
  .curve-seg {
    stroke-width: 3.5px !important;
  }

  .curve-glow {
    stroke-width: 8px !important;
    opacity: 0.45 !important;
  }

  .ref-line {
    stroke-width: 1.5px !important;
  }

  /* Scale SVG typography for readability without overlapping */
  .axis-label {
    font-size: 11.5px !important;
    font-weight: 600;
  }

  .ann-title {
    font-size: 13.5px !important;
    font-weight: 700 !important;
  }

  /* Hide the tiny redundant subtitle lines on mobile so titles don't collide */
  .ann-sub {
    display: none !important;
  }

  /* Make circles on points easy to distinguish */
  .annotation circle:not(.pulse-circle) {
    r: 5.5 !important;
  }

  .control-bar {
    padding: 8px 10px;
    border-radius: var(--radius-sm);
  }

  .btn {
    font-size: 12px;
    padding: 7px 10px;
  }

  .stepper-nav {
    gap: 3px;
    padding: 4px 0 6px;
  }

  .step-pill {
    min-width: 0 !important;
    flex: 1;
    padding: 6px 2px;
  }

  .step-num {
    font-size: 9.5px;
  }

  .step-name {
    display: none;
  }

  .narrative-card {
    flex-direction: column;
    padding: 12px;
    gap: 8px;
  }

  .narrative-title {
    font-size: 15px;
  }

  .narrative-desc {
    font-size: 12.5px;
  }

  .section-heading {
    font-size: 20px;
  }

  .bento-card {
    padding: 14px;
  }

  .golden-rule-card {
    padding: 16px 18px;
  }

  .golden-quote {
    font-size: 15px;
  }

  .x-card-studio {
    padding: 14px;
  }

  .x-image-mockup img {
    border-radius: var(--radius-sm);
  }

  .x-post-text {
    font-size: 12px;
  }

  .toast {
    bottom: 12px;
    right: 12px;
    left: 12px;
    text-align: center;
  }
}

/* Small mobile: 480px */
@media (max-width: 480px) {
  .hud-grid {
    grid-template-columns: 1fr 1fr;
  }

  .nav-actions .nav-btn:nth-child(1),
  .nav-actions .nav-btn:nth-child(2) {
    display: none;
  }

  .hero-title {
    font-size: 24px;
  }

  .hero-subtitle {
    font-size: 13px;
  }

  .btn-group {
    flex-wrap: wrap;
  }

  .btn-group .btn {
    min-width: calc(50% - 3px);
  }

  .x-post-text {
    rows: 8;
  }
}
