:root {
  --midnight: #08162B;
  --red: #FE3A1F;
  --blue: #80C1C7;
  --grey: #E0E1E5;
  --white: #FFFFFF;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
button { touch-action: manipulation; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--midnight); color: var(--white);
  overflow: hidden; height: 100vh;
  /* Subtle grid pattern */
  background-image: 
    linear-gradient(rgba(128,193,199,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(128,193,199,0.08) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ===== EDITOR ===== */
#editor-panel {
  position: fixed; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--midnight); z-index: 100; padding: 40px;
  transition: opacity 0.4s, transform 0.4s;
}
#editor-panel.hidden { opacity: 0; pointer-events: none; transform: scale(0.98); }
.editor-header { text-align: center; margin-bottom: 28px; }
.editor-header h1 { font-family: 'Oswald', sans-serif; font-weight: 500; font-size: 28px; text-transform: uppercase; letter-spacing: -0.01em; }
.editor-header h1 span { color: var(--red); }
.editor-header p { font-size: 13px; font-weight: 300; color: rgba(255,255,255,0.45); margin-top: 6px; }
.editor-actions { display: flex; gap: 12px; margin-bottom: 16px; }
.btn { padding: 10px 24px; border: none; border-radius: 6px; font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.2s; }
.btn-primary { background: var(--red); color: white; }
.btn-primary:hover { background: #e63219; transform: translateY(-1px); }
.btn-secondary { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.7); border: 1px solid rgba(255,255,255,0.1); }
.btn-secondary:hover { background: rgba(255,255,255,0.12); color: white; }
#file-input { display: none; }
textarea#md-input {
  width: 700px; max-width: 90vw; height: 420px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; padding: 20px; color: rgba(255,255,255,0.85);
  font-family: 'SF Mono', Monaco, 'Cascadia Code', Consolas, monospace;
  font-size: 13px; line-height: 1.6; resize: none; outline: none;
}
textarea#md-input:focus { border-color: var(--red); }
textarea#md-input::placeholder { color: rgba(255,255,255,0.2); }
.editor-help { margin-top: 16px; font-size: 11px; color: rgba(255,255,255,0.25); text-align: center; max-width: 640px; line-height: 1.8; }
.editor-help code { background: rgba(255,255,255,0.08); padding: 1px 5px; border-radius: 3px; font-size: 10px; }

/* ===== PRESENTATION ===== */
#presentation { display: none; width: 100vw; height: 100vh; align-items: center; justify-content: center; flex-direction: column; }
#presentation.active { display: flex; }

.deck-container {
  position: relative;
  width: 94vw; height: calc(94vw * 9 / 16);
  max-height: 82vh; max-width: calc(82vh * 16 / 9);
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,0.4);
}

/* ===== SLIDE BASE ===== */
.slide {
  position: absolute; inset: 0;
  opacity: 0; pointer-events: none; overflow: hidden;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.slide.active { opacity: 1; pointer-events: auto; }
.slide.theme-dark { background: var(--midnight); }
.slide.theme-light { background: var(--white); }

/* Stagger-in: children animate when slide becomes active */
.slide.active .stagger { animation: staggerIn 0.5s ease both; }
.slide.active .stagger:nth-child(1) { animation-delay: 0.1s; }
.slide.active .stagger:nth-child(2) { animation-delay: 0.2s; }
.slide.active .stagger:nth-child(3) { animation-delay: 0.3s; }
.slide.active .stagger:nth-child(4) { animation-delay: 0.4s; }
.slide.active .stagger:nth-child(5) { animation-delay: 0.5s; }
.slide.active .stagger:nth-child(6) { animation-delay: 0.55s; }
.slide.active .stagger:nth-child(7) { animation-delay: 0.6s; }
.slide.active .stagger:nth-child(8) { animation-delay: 0.65s; }

@keyframes staggerIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes countUp { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }
@keyframes growWidth { from { width: 0; } }
@keyframes pulse-node { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }
@keyframes dash-flow { 0% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -20; } }
@keyframes signal-pulse { 0%, 100% { opacity: 0.15; } 50% { opacity: 0.6; } }
@keyframes rotate-slow { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes glowPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(254,58,31,0); } 50% { box-shadow: 0 0 20px 4px rgba(254,58,31,0.15); } }

.anim-pulse { animation: pulse-node 2.5s ease-in-out infinite; }
.anim-pulse-d1 { animation: pulse-node 2.5s ease-in-out infinite 0.8s; }
.anim-pulse-d2 { animation: pulse-node 2.5s ease-in-out infinite 1.6s; }
.anim-dash { animation: dash-flow 3s linear infinite; }
.anim-signal { animation: signal-pulse 2s ease-in-out infinite; }
.anim-signal-d1 { animation: signal-pulse 2s ease-in-out infinite 0.5s; }
.anim-signal-d2 { animation: signal-pulse 2s ease-in-out infinite 1s; }
.anim-rotate { animation: rotate-slow 20s linear infinite; }

.slide .top-bar { position: absolute; top: 0; left: 0; width: 100%; height: 4px; background: var(--red); }
.slide .left-bar { position: absolute; top: 0; left: 0; width: 5px; height: 100%; background: var(--red); }

/* ===== LAYOUTS ===== */
.slide.layout-illust-right { display: flex; }
.slide.layout-illust-right .sl-content { flex: 0 0 56%; display: flex; flex-direction: column; justify-content: center; padding: 5% 3% 5% 5.5%; }
.slide.layout-illust-right .sl-illust { flex: 1; display: flex; align-items: center; justify-content: center; padding: 4%; }

.slide.layout-illust-left { display: flex; flex-direction: row-reverse; }
.slide.layout-illust-left .sl-content { flex: 0 0 56%; display: flex; flex-direction: column; justify-content: center; padding: 5% 5.5% 5% 3%; }
.slide.layout-illust-left .sl-illust { flex: 1; display: flex; align-items: center; justify-content: center; padding: 4%; }

.slide.layout-center { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.slide.layout-center .sl-content { padding: 5%; max-width: 78%; display: flex; flex-direction: column; align-items: center; }

.slide.layout-bg-illust { display: flex; position: relative; }
.slide.layout-bg-illust .sl-content { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 5% 5.5%; z-index: 2; position: relative; }
.slide.layout-bg-illust .sl-illust { position: absolute; right: -4%; top: 50%; transform: translateY(-50%); width: 55%; height: 80%; display: flex; align-items: center; justify-content: center; opacity: 0.07; z-index: 1; }
.slide.layout-bg-illust.theme-light .sl-illust { opacity: 0.04; }

.slide.layout-split { display: flex; }
.slide.layout-split .sl-accent-panel { flex: 0 0 38%; display: flex; align-items: center; justify-content: center; padding: 5%; position: relative; }
.slide.layout-split.theme-dark .sl-accent-panel { background: rgba(128,193,199,0.06); }
.slide.layout-split.theme-light .sl-accent-panel { background: #f4f5f7; }
.slide.layout-split .sl-content { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 5% 5.5%; }

.slide.layout-top-illust { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.slide.layout-top-illust .sl-illust { width: 18%; max-width: 160px; margin-bottom: 2%; display: flex; align-items: center; justify-content: center; }
.slide.layout-top-illust .sl-content { padding: 0 8%; max-width: 78%; display: flex; flex-direction: column; align-items: center; }

/* === LAYOUT: FULL-VISUAL (big SVG background, content overlay at bottom) === */
.slide.layout-full-visual { display: flex; flex-direction: column; justify-content: flex-end; position: relative; }
.slide.layout-full-visual .sl-illust { position: absolute; top: 5%; left: 50%; transform: translateX(-50%); width: 50%; height: 55%; display: flex; align-items: center; justify-content: center; opacity: 0.12; z-index: 1; }
.slide.layout-full-visual .sl-content { z-index: 2; padding: 0 5.5% 7%; }

/* === LAYOUT: HERO (title slide with giant text + animated particles) === */
.slide.layout-hero {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; position: relative;
}
.slide.layout-hero .sl-content {
  z-index: 2; padding: 5%; display: flex; flex-direction: column; align-items: center;
}
.slide.layout-hero .sl-overline {
  font-size: clamp(11px, 1.1vw, 18px); letter-spacing: 5px; margin-bottom: clamp(10px, 1.5vw, 24px);
}
.slide.layout-hero .sl-heading {
  font-size: clamp(48px, 6.5vw, 110px); line-height: 1.0; letter-spacing: -0.02em;
  margin-bottom: clamp(14px, 2vw, 32px);
}
.slide.layout-hero .sl-body {
  font-size: clamp(14px, 1.4vw, 24px); max-width: 600px; opacity: 0.6;
}
.slide.layout-hero .sl-date {
  position: absolute; bottom: clamp(40px, 5%, 64px); right: auto; left: 50%;
  transform: translateX(-50%);
}
/* Hero animated background - fuzzy dot particles */
.hero-particles {
  position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none;
}
.hero-particle {
  position: absolute; border-radius: 50%; opacity: 0;
}
.slide.active .hero-particle { animation: particleFade 5s ease-in-out infinite; }
@keyframes particleFade {
  0%, 100% { opacity: 0; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}
/* Geometric grid overlay for hero */
.hero-grid {
  position: absolute; inset: 0; z-index: 0; overflow: hidden;
}
.hero-grid svg { width: 100%; height: 100%; }

/* === LAYOUT: ROADMAP (horizontal timeline) === */
/* === LAYOUT: ROADMAP (horizontal timeline with spotlight) === */
.slide.layout-roadmap { display: flex; flex-direction: column; }
.slide.layout-roadmap .sl-content { padding: 4% 5.5% 0; }
.roadmap-track {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  padding: 0 5.5%; position: relative; overflow: hidden;
}

/* Horizontal rail */
.roadmap-rail {
  position: relative; width: 100%; height: 4px; border-radius: 2px;
  background: rgba(128,193,199,0.1); margin-bottom: clamp(24px, 3vw, 48px);
}
.theme-light .roadmap-rail { background: rgba(0,0,0,0.05); }
.roadmap-rail-fill {
  position: absolute; top: 0; left: 0; height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, var(--red) 0%, var(--red) 60%, var(--blue) 100%);
}
.slide.active .roadmap-rail-fill { animation: growWidth 1.4s cubic-bezier(0.4,0,0.2,1) both 0.2s; }

/* Items row */
.roadmap-items {
  display: flex; width: 100%; position: relative;
}
.roadmap-item {
  flex: 1; display: flex; flex-direction: column; position: relative;
  padding: 0 clamp(4px, 0.8vw, 16px);
}

/* Dot on the rail */
.rm-dot-wrap {
  position: absolute; top: calc(-4px - clamp(24px, 3vw, 48px) - clamp(7px, 0.9vw, 13px));
  left: 50%; transform: translateX(-50%);
}
.rm-dot {
  width: clamp(16px, 1.8vw, 28px); height: clamp(16px, 1.8vw, 28px);
  border-radius: 50%; border: 3px solid rgba(128,193,199,0.3);
  position: relative; transition: all 0.5s;
}
.theme-dark .rm-dot { background: var(--midnight); }
.theme-light .rm-dot { background: var(--white); }
.roadmap-item.rm-active .rm-dot {
  background: var(--red); border-color: var(--red);
  box-shadow: 0 0 0 6px rgba(254,58,31,0.12), 0 0 24px rgba(254,58,31,0.2);
}
.rm-dot-ping {
  position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid var(--red); opacity: 0;
}
.slide.active .roadmap-item.rm-active .rm-dot-ping { animation: dotPing 2s ease-out infinite 1s; }
@keyframes dotPing {
  0% { transform: scale(0.8); opacity: 0.6; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* Quarter label */
.rm-quarter {
  font-family: 'Oswald', sans-serif; font-weight: 700;
  font-size: clamp(22px, 2.8vw, 48px); text-transform: uppercase;
  letter-spacing: -0.01em; line-height: 1;
  margin-bottom: clamp(4px, 0.5vw, 10px);
  transition: all 0.4s;
}
.theme-dark .rm-quarter { color: rgba(255,255,255,0.2); }
.theme-light .rm-quarter { color: rgba(0,0,0,0.12); }
.roadmap-item.rm-active .rm-quarter { color: var(--red); }
.theme-dark .roadmap-item.rm-past .rm-quarter { color: rgba(255,255,255,0.5); }
.theme-light .roadmap-item.rm-past .rm-quarter { color: var(--midnight); }

/* Description */
.rm-desc {
  font-family: 'Inter', sans-serif; font-weight: 400;
  font-size: clamp(10px, 1.05vw, 17px); line-height: 1.55;
  transition: all 0.4s;
}
.theme-dark .rm-desc { color: rgba(255,255,255,0.2); }
.theme-light .rm-desc { color: rgba(0,0,0,0.15); }
.roadmap-item.rm-active .rm-desc { font-weight: 500; }
.theme-dark .roadmap-item.rm-active .rm-desc { color: rgba(255,255,255,0.7); }
.theme-light .roadmap-item.rm-active .rm-desc { color: #374151; }
.theme-dark .roadmap-item.rm-past .rm-desc { color: rgba(255,255,255,0.4); }
.theme-light .roadmap-item.rm-past .rm-desc { color: #6b7280; }

/* Badge */
.rm-badge {
  display: inline-block; margin-top: clamp(6px, 0.6vw, 12px);
  padding: clamp(2px, 0.3vw, 4px) clamp(8px, 0.9vw, 16px); border-radius: 4px;
  font-family: 'Inter', sans-serif; font-size: clamp(8px, 0.7vw, 12px);
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}
.rm-badge.badge-now { background: rgba(254,58,31,0.12); color: var(--red); }

/* Stagger entrance for roadmap items */
.slide.active .roadmap-item { animation: rmSlideIn 0.6s ease both; }
.slide.active .roadmap-item:nth-child(1) { animation-delay: 0.3s; }
.slide.active .roadmap-item:nth-child(2) { animation-delay: 0.5s; }
.slide.active .roadmap-item:nth-child(3) { animation-delay: 0.7s; }
.slide.active .roadmap-item:nth-child(4) { animation-delay: 0.9s; }
@keyframes rmSlideIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.sl-illust svg { width: 100%; height: 100%; max-width: 100%; max-height: 100%; }

/* ===== TYPOGRAPHY ===== */
.sl-overline {
  font-family: 'Inter', sans-serif; font-size: clamp(9px, 0.9vw, 14px);
  font-weight: 600; letter-spacing: 3px; text-transform: uppercase;
  margin-bottom: clamp(6px, 0.8vw, 14px);
}
.theme-dark .sl-overline { color: var(--blue); }
.theme-light .sl-overline { color: var(--red); }

.sl-heading {
  font-family: 'Oswald', sans-serif; font-weight: 500;
  text-transform: uppercase; letter-spacing: -0.01em; line-height: 1.1;
  margin-bottom: clamp(10px, 1.2vw, 22px);
}
.sl-heading.sz-lg { font-size: clamp(34px, 4.5vw, 76px); }
.sl-heading.sz-md { font-size: clamp(26px, 3vw, 52px); }
.sl-heading.sz-sm { font-size: clamp(20px, 2.2vw, 38px); }
.theme-dark .sl-heading { color: var(--white); }
.theme-light .sl-heading { color: var(--midnight); }
.sl-heading .accent { color: var(--red); }

.sl-body {
  font-family: 'Inter', sans-serif; font-weight: 300;
  font-size: clamp(12px, 1.2vw, 20px); line-height: 1.65; max-width: 560px;
}
.theme-dark .sl-body { color: rgba(255,255,255,0.55); }
.theme-light .sl-body { color: #6b7280; }
.sl-body strong { font-weight: 600; }
.theme-dark .sl-body strong { color: rgba(255,255,255,0.9); }
.theme-light .sl-body strong { color: var(--midnight); }

/* Bullet list styling */
.sl-body .sl-list {
  list-style: none; padding: 0; margin: 0;
}
.sl-body .sl-list li {
  position: relative; padding-left: 1.5em; margin-bottom: 0.6em;
}
.sl-body .sl-list li::before {
  content: ''; position: absolute; left: 0; top: 0.55em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--red);
}
.sl-body .sl-list li:last-child { margin-bottom: 0; }

.sl-divider { width: 48px; height: 3px; background: var(--red); border-radius: 2px; margin: clamp(6px, 0.8vw, 14px) 0; }

/* ===== STATS ===== */
.stats-grid { display: grid; gap: clamp(8px, 1.2vw, 20px); margin-top: clamp(4px, 0.6vw, 12px); }
.stats-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.stats-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.stats-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.stat-card { border-radius: 10px; padding: clamp(12px, 1.6vw, 26px) clamp(10px, 1.2vw, 22px); }
.theme-dark .stat-card { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); }
.theme-light .stat-card { background: #f8f9fa; border: 1px solid var(--grey); }
.stat-number { font-family: 'Oswald', sans-serif; font-weight: 600; font-size: clamp(24px, 2.8vw, 48px); color: var(--red); margin-bottom: 4px; }
.stat-label { font-family: 'Inter', sans-serif; font-size: clamp(10px, 0.85vw, 14px); font-weight: 400; line-height: 1.4; }
.theme-dark .stat-label { color: rgba(255,255,255,0.45); }
.theme-light .stat-label { color: #6b7280; }
.slide.active .stat-number { animation: countUp 0.6s ease both; }
.slide.active .stat-card:nth-child(1) .stat-number { animation-delay: 0.2s; }
.slide.active .stat-card:nth-child(2) .stat-number { animation-delay: 0.35s; }
.slide.active .stat-card:nth-child(3) .stat-number { animation-delay: 0.5s; }
.slide.active .stat-card:nth-child(4) .stat-number { animation-delay: 0.65s; }

/* ===== ICON CARDS (theme boxes with emoji/icon) ===== */
.icon-cards { display: grid; gap: clamp(8px, 1vw, 16px); margin-top: clamp(8px, 1vw, 16px); }
.icon-cards.cols-2 { grid-template-columns: repeat(2, 1fr); }
.icon-cards.cols-4 { grid-template-columns: repeat(4, 1fr); }
.icon-card {
  border-radius: 10px; padding: clamp(14px, 1.6vw, 28px) clamp(12px, 1.4vw, 22px);
  position: relative; overflow: hidden;
}
.theme-dark .icon-card { background: rgba(255,255,255,0.025); border: 1px solid rgba(255,255,255,0.06); }
.theme-light .icon-card { background: #f8f9fa; border: 1px solid rgba(0,0,0,0.06); }
.icon-card .ic-icon { font-size: clamp(20px, 2.2vw, 36px); margin-bottom: clamp(6px, 0.6vw, 12px); }
.icon-card .ic-title { font-family: 'Oswald', sans-serif; font-weight: 500; font-size: clamp(13px, 1.2vw, 20px); text-transform: uppercase; margin-bottom: 4px; }
.theme-dark .icon-card .ic-title { color: var(--white); }
.theme-light .icon-card .ic-title { color: var(--midnight); }
.icon-card .ic-desc { font-size: clamp(10px, 0.85vw, 14px); font-weight: 300; line-height: 1.5; }
.theme-dark .icon-card .ic-desc { color: rgba(255,255,255,0.4); }
.theme-light .icon-card .ic-desc { color: #6b7280; }
.icon-card .ic-accent-line { position: absolute; top: 0; left: 0; width: 100%; height: 3px; border-radius: 10px 10px 0 0; }

/* ===== TIMELINE ===== */
.timeline { position: relative; margin-top: clamp(8px, 1vw, 16px); padding-left: clamp(24px, 2.5vw, 42px); }
.timeline::before {
  content: ''; position: absolute; left: clamp(6px, 0.7vw, 10px); top: 4px; bottom: 4px;
  width: 2px; background: rgba(128,193,199,0.2); border-radius: 1px;
}
.tl-item { position: relative; margin-bottom: clamp(10px, 1.4vw, 22px); }
.tl-item::before {
  content: ''; position: absolute; left: calc(-1 * clamp(24px, 2.5vw, 42px) + clamp(3px, 0.4vw, 7px));
  top: 6px; width: clamp(8px, 0.8vw, 12px); height: clamp(8px, 0.8vw, 12px);
  border-radius: 50%; border: 2px solid var(--blue); background: var(--midnight);
}
.tl-item.tl-active::before { background: var(--red); border-color: var(--red); animation: glowPulse 2s infinite; }
.tl-item .tl-label {
  font-family: 'Oswald', sans-serif; font-weight: 500;
  font-size: clamp(13px, 1.3vw, 22px); text-transform: uppercase; color: var(--white);
}
.tl-item.tl-active .tl-label { color: var(--red); }
.theme-light .tl-item .tl-label { color: var(--midnight); }
.theme-light .tl-item.tl-active .tl-label { color: var(--red); }
.tl-item .tl-desc { font-size: clamp(10px, 0.85vw, 14px); font-weight: 300; line-height: 1.5; margin-top: 2px; }
.theme-dark .tl-item .tl-desc { color: rgba(255,255,255,0.4); }
.theme-light .tl-item .tl-desc { color: #6b7280; }
.theme-light .timeline::before { background: rgba(0,0,0,0.08); }
.theme-light .tl-item::before { background: var(--white); border-color: var(--grey); }
.theme-light .tl-item.tl-active::before { background: var(--red); border-color: var(--red); }

/* ===== PROGRESS BARS ===== */
.progress-list { margin-top: clamp(8px, 1vw, 16px); display: flex; flex-direction: column; gap: clamp(8px, 1vw, 14px); }
.progress-item { display: flex; align-items: center; gap: clamp(8px, 1vw, 16px); }
.progress-label { font-family: 'Oswald', sans-serif; font-weight: 500; font-size: clamp(11px, 1vw, 16px); text-transform: uppercase; min-width: clamp(80px, 10vw, 160px); }
.theme-dark .progress-label { color: rgba(255,255,255,0.7); }
.theme-light .progress-label { color: var(--midnight); }
.progress-bar-bg { flex: 1; height: clamp(6px, 0.6vw, 10px); border-radius: 5px; overflow: hidden; }
.theme-dark .progress-bar-bg { background: rgba(255,255,255,0.06); }
.theme-light .progress-bar-bg { background: var(--grey); }
.progress-bar-fill { height: 100%; border-radius: 5px; background: var(--red); }
.slide.active .progress-bar-fill { animation: growWidth 1s ease both; }
.slide.active .progress-item:nth-child(1) .progress-bar-fill { animation-delay: 0.2s; }
.slide.active .progress-item:nth-child(2) .progress-bar-fill { animation-delay: 0.35s; }
.slide.active .progress-item:nth-child(3) .progress-bar-fill { animation-delay: 0.5s; }
.slide.active .progress-item:nth-child(4) .progress-bar-fill { animation-delay: 0.65s; }
.progress-pct { font-family: 'Oswald', sans-serif; font-size: clamp(11px, 1vw, 16px); font-weight: 500; min-width: 36px; text-align: right; }
.theme-dark .progress-pct { color: rgba(255,255,255,0.4); }
.theme-light .progress-pct { color: #6b7280; }

/* ===== QUOTE / HIGHLIGHT BOX ===== */
.sl-quote {
  border-left: 3px solid var(--red); padding: clamp(10px, 1.2vw, 20px) clamp(14px, 1.6vw, 28px);
  margin-top: clamp(8px, 1vw, 16px); border-radius: 0 8px 8px 0;
  font-size: clamp(13px, 1.3vw, 22px); font-weight: 300; font-style: italic; line-height: 1.5;
}
.theme-dark .sl-quote { background: rgba(254,58,31,0.04); color: rgba(255,255,255,0.65); }
.theme-light .sl-quote { background: rgba(254,58,31,0.03); color: #4b5563; }

/* ===== CTA ===== */
.sl-cta {
  display: inline-block; margin-top: clamp(8px, 1vw, 18px);
  padding: clamp(8px, 1vw, 16px) clamp(18px, 2.5vw, 40px);
  background: var(--red); color: white;
  font-family: 'Oswald', sans-serif; font-size: clamp(12px, 1.1vw, 18px);
  font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px;
  border-radius: 8px; text-decoration: none;
}

/* ===== DATE ===== */
.sl-date {
  position: absolute; bottom: clamp(32px, 4%, 52px); right: 5.5%;
  font-size: clamp(10px, 0.8vw, 14px); font-weight: 400; padding: 6px 14px; border-radius: 5px;
}
.theme-dark .sl-date { color: rgba(255,255,255,0.3); border: 1px solid rgba(255,255,255,0.08); }
.theme-light .sl-date { color: rgba(0,0,0,0.25); border: 1px solid rgba(0,0,0,0.06); }

/* ===== FOOTER ===== */
.sl-footer {
  position: absolute; bottom: 0; left: 0; right: 0; height: 28px;
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
  font-size: clamp(6px, 0.5vw, 8px); font-weight: 300; text-transform: uppercase; letter-spacing: 0.5px;
}
.theme-dark .sl-footer { color: rgba(255,255,255,0.15); }
.theme-light .sl-footer { color: rgba(0,0,0,0.12); }

/* ===== NAV ===== */
.nav-bar { display: flex; align-items: center; gap: 16px; margin-top: 10px; }
.nav-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.03); color: rgba(255,255,255,0.4); font-size: 15px; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; }
.nav-btn:hover { border-color: var(--red); color: white; background: rgba(254,58,31,0.1); }
.slide-dots { display: flex; gap: 5px; max-width: 400px; flex-wrap: wrap; justify-content: center; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.15); cursor: pointer; transition: all 0.3s; }
.dot.active { background: var(--red); width: 18px; border-radius: 4px; }
.slide-counter { font-size: 11px; color: rgba(255,255,255,0.3); min-width: 44px; text-align: center; }
.nav-extra { display: flex; gap: 8px; margin-left: 10px; }
.nav-extra .btn { padding: 7px 14px; font-size: 11px; }
.key-hint { position: fixed; bottom: 8px; right: 16px; font-size: 9px; color: rgba(255,255,255,0.1); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .deck-container {
    width: 96vw; max-width: calc(84vh * 16 / 9);
  }
}
@media (max-width: 768px) {
  body { overflow: hidden; height: 100vh; height: 100dvh; }
  #editor-panel { padding: 16px; }
  textarea#md-input { width: 100%; height: 240px; font-size: 12px; padding: 12px; }
  .editor-help { font-size: 9px; }
  .editor-actions { flex-wrap: wrap; justify-content: center; }

  #presentation {
    height: 100vh; height: 100dvh;
    padding: 0; display: none; flex-direction: column;
  }
  #presentation.active { display: flex; }

  .deck-container {
    width: 100vw !important; height: calc(100dvh - 60px) !important;
    max-height: none !important; max-width: none !important;
    border-radius: 0; flex-shrink: 0;
  }
  /* Slides use inset:0 so they fill whatever the container is. 
     On mobile the container is full-width and nearly full-height.
     Content may be slightly letterboxed but everything stays proportional
     because all sizing uses vw-based clamp(). */

  .nav-bar {
    height: 60px; min-height: 60px;
    gap: 10px; margin-top: 0; padding: 0 16px;
    flex-wrap: nowrap; justify-content: center; align-items: center;
    background: var(--midnight);
  }
  .nav-btn {
    width: 44px !important; height: 44px !important; font-size: 18px !important;
    flex-shrink: 0;
  }
  .slide-dots { gap: 4px; max-width: 160px; flex-shrink: 1; }
  .dot { width: 7px; height: 7px; }
  .dot.active { width: 18px; }
  .slide-counter { font-size: 11px; min-width: 40px; }
  .nav-extra .btn { padding: 8px 14px; font-size: 11px; }
  .key-hint { display: none; }

  /* Slightly reduce font/spacing to fit portrait aspect ratio */
  .sl-heading.sz-lg { font-size: clamp(24px, 5vw, 52px); }
  .sl-heading.sz-md { font-size: clamp(20px, 4.2vw, 40px); }
  .sl-heading.sz-sm { font-size: clamp(16px, 3.5vw, 32px); }
  .sl-body { font-size: clamp(11px, 2.5vw, 16px); }
  .sl-overline { font-size: clamp(7px, 1.5vw, 11px); }
  .sl-quote { font-size: clamp(11px, 2.5vw, 16px); padding: 8px 14px; }

  /* Hero on mobile */
  .slide.layout-hero .sl-heading { font-size: clamp(28px, 7vw, 56px) !important; }
  .slide.layout-hero .sl-overline { font-size: clamp(9px, 2vw, 14px) !important; }
  .slide.layout-hero .sl-body { font-size: clamp(12px, 2.8vw, 18px) !important; }

  /* Stack side-by-side layouts */
  .slide.layout-illust-right,
  .slide.layout-illust-left { flex-direction: column !important; }
  .slide.layout-illust-right .sl-content,
  .slide.layout-illust-left .sl-content {
    flex: 1 !important; padding: 6% 6% 2% !important;
  }
  .slide.layout-illust-right .sl-illust,
  .slide.layout-illust-left .sl-illust {
    flex: 0 0 30% !important; padding: 0 25% !important;
  }

  .slide.layout-split { flex-direction: column !important; }
  .slide.layout-split .sl-accent-panel { flex: 0 0 30% !important; padding: 3% !important; }
  .slide.layout-split .sl-content { flex: 1 !important; padding: 3% 6% !important; }

  .slide.layout-center .sl-content { max-width: 92% !important; }
  .slide.layout-top-illust .sl-illust { width: 18% !important; }
  .slide.layout-top-illust .sl-content { max-width: 90% !important; }

  /* Icon cards 2-col on mobile */
  .icon-cards.cols-4 { grid-template-columns: repeat(2, 1fr) !important; }
  .icon-card { padding: 10px !important; }
  .icon-card .ic-icon { font-size: 18px !important; }
  .icon-card .ic-title { font-size: clamp(10px, 2.2vw, 14px) !important; }
  .icon-card .ic-desc { font-size: clamp(8px, 1.8vw, 11px) !important; }

  /* Stats 2-col */
  .stats-grid.cols-3, .stats-grid.cols-4 { grid-template-columns: repeat(2, 1fr) !important; }
  .stat-number { font-size: clamp(18px, 4.5vw, 32px) !important; }
  .stat-label { font-size: clamp(8px, 1.8vw, 11px) !important; }

  /* Progress bars */
  .progress-label { font-size: clamp(9px, 2vw, 13px) !important; min-width: 70px !important; }
  .progress-pct { font-size: clamp(9px, 2vw, 13px) !important; }

  /* Roadmap on mobile */
  .roadmap-track { padding: 0 3%; }
  .rm-quarter { font-size: clamp(14px, 3.8vw, 24px) !important; }
  .rm-desc { font-size: clamp(8px, 1.8vw, 12px) !important; }
  .rm-dot { width: 12px !important; height: 12px !important; }
  .rm-badge { font-size: 7px !important; }

  /* Footer */
  .sl-footer { height: 20px; font-size: 5px; }
  .sl-date { font-size: 8px; padding: 3px 8px; }
}

@media (max-width: 380px) {
  .sl-heading.sz-lg { font-size: clamp(20px, 5.5vw, 36px); }
  .icon-cards.cols-4, .icon-cards.cols-2 { grid-template-columns: 1fr !important; }
}
