:root {
  --color-coral: #D94F3D;
  --color-coral-light: #FFEAE6;
  --color-coral-dark: #B23A2A;
  --color-navy: #1A1A2E;
  --color-slate: #4A5568;
  --color-green: #2D8A56;
  --color-green-light: #E6F5EC;
  --color-amber: #D4880F;
  --color-amber-light: #FFF8E6;

  --font-display: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --text-xs: clamp(0.7rem, 0.9vw, 0.8rem);
  --text-sm: clamp(0.85rem, 1.1vw, 0.95rem);
  --text-base: clamp(1rem, 1.4vw, 1.2rem);
  --text-lg: clamp(1.2rem, 1.7vw, 1.45rem);
  --text-xl: clamp(1.45rem, 2.1vw, 1.85rem);
  --text-2xl: clamp(1.85rem, 2.8vw, 2.5rem);
  --text-3xl: clamp(2.3rem, 3.5vw, 3.2rem);
  --text-4xl: clamp(2.8rem, 4.5vw, 4rem);

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --content-padding: clamp(2rem, 5vw, 5rem);
  --content-max: 1100px;

  --bg-base: #FAFAF8;
  --bg-surface: #FFFFFF;
  --bg-card: #F7F7F4;
  --bg-elevated: #EFEFE8;
  --bg-code: #F3F2EE;

  --text-primary: #1A1A2E;
  --text-secondary: #52526E;
  --text-tertiary: #8A8A9E;
  --text-accent: var(--color-coral);

  --border-subtle: rgba(0,0,0,0.06);
  --border-default: rgba(0,0,0,0.10);
  --border-strong: rgba(0,0,0,0.18);

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.07);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.09);

  --nav-bg: rgba(255,255,255,0.8);
  --nav-border: rgba(0,0,0,0.08);
  --nav-shadow: 0 2px 16px rgba(0,0,0,0.08);
  --nav-text: rgba(0,0,0,0.35);
  --nav-text-hover: rgba(0,0,0,0.8);
  --nav-btn-hover: rgba(0,0,0,0.06);
  --dot-bg: rgba(0,0,0,0.18);
  --dot-hover: rgba(0,0,0,0.35);
  --dot-active: var(--color-coral);
  --dot-glow: rgba(217,79,61,0.25);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 150ms;
  --dur-normal: 300ms;
  --dur-slow: 600ms;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text-primary);
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--text-accent); text-decoration: none; }

/* ============ Slide Layout ============ */

.slides-container {
  position: relative;
  width: 100%; height: 100%;
  z-index: 1;
}

.slide {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  padding: var(--content-padding);
  opacity: 0; visibility: hidden;
  pointer-events: none;
  z-index: 0;
}

.slide.active,
.slide.fade-out {
  visibility: visible;
  z-index: 1;
  transition: opacity var(--dur-slow) var(--ease-out);
}
.slide.active { opacity: 1; pointer-events: auto; }
.slide.fade-out { opacity: 0; pointer-events: none; }

.slide-inner {
  width: 100%; max-width: var(--content-max);
  position: relative;
}

.slide--center .slide-inner {
  display: flex; flex-direction: column;
  align-items: center; text-align: center;
  gap: var(--space-md);
}

.slide--top .slide-inner {
  display: flex; flex-direction: column;
  justify-content: flex-start;
  padding-top: var(--space-lg);
  gap: var(--space-md);
}

/* ============ Typography ============ */

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--text-primary);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.025em;
}
h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }

p, li {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--text-secondary);
}

.subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  font-weight: 400;
  max-width: 700px;
}

.label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-accent);
  font-weight: 500;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 0.1em 0.4em;
  background: var(--bg-code);
  border-radius: var(--radius-sm);
}

.text-accent { color: var(--color-coral); }
.text-dim { color: var(--text-tertiary); font-weight: 400; }
.text-green { color: var(--color-green); }

.text-coral-glow {
  color: var(--color-coral);
  text-shadow: 0 0 30px rgba(217,79,61,0.15);
}

.crossed {
  color: var(--text-tertiary);
  text-decoration: line-through;
  text-decoration-color: rgba(0,0,0,0.2);
}

.big-question {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  max-width: 800px;
}

.big-emoji {
  font-size: clamp(3rem, 6vw, 5rem);
  line-height: 1;
}

/* ============ Components ============ */

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--dur-normal), box-shadow var(--dur-normal);
}
.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.card--coral {
  border-color: rgba(217,79,61,0.2);
  background: linear-gradient(135deg, #FFFBFA, #FFF5F3);
}
.card--coral:hover { border-color: rgba(217,79,61,0.35); }

.card--alarm {
  border-left: 3px solid var(--color-coral);
}

.card--signal {
  border-left: 3px solid var(--color-green);
}

.card-icon {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  margin-bottom: var(--space-xs);
  line-height: 1;
}

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

.callout {
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--text-primary);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border-left: 3px solid var(--color-coral);
}

.quote-block {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  font-style: italic;
  font-size: var(--text-lg);
  line-height: 1.6;
  color: var(--text-secondary);
  position: relative;
}
.quote-block::before {
  content: '\201C';
  position: absolute;
  top: -0.15em; left: 0.2em;
  font-size: 3em;
  color: var(--border-default);
  font-style: normal;
  line-height: 1;
}

.step-list {
  display: flex; flex-direction: column;
  gap: var(--space-sm);
  counter-reset: step;
}
.step-item {
  display: flex; align-items: flex-start; gap: var(--space-sm);
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: 1.6;
  counter-increment: step;
}
.step-num {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}
.step-item--alert .step-num {
  background: var(--color-coral-light);
  color: var(--color-coral);
  border-color: rgba(217,79,61,0.2);
}

.check-list {
  display: flex; flex-direction: column;
  gap: var(--space-sm);
}
.check-item {
  display: flex; align-items: center; gap: var(--space-sm);
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: 1.5;
}
.check-icon {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}
.check-icon--yes {
  background: var(--color-green-light);
  color: var(--color-green);
}
.check-icon--no {
  background: var(--color-coral-light);
  color: var(--color-coral);
}

.pill-row {
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center;
}
.pill {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  padding: 0.25em 0.75em;
  border-radius: 100px;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.arrow-down {
  font-size: var(--text-xl);
  color: var(--text-tertiary);
  text-align: center;
}

.versus-row {
  display: flex; align-items: stretch; gap: var(--space-md);
  width: 100%;
}
.versus-row > .card { flex: 1; }
.versus-divider {
  display: flex; align-items: center;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.evolution-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--space-md);
  align-items: center;
  width: 100%;
}
.evolution-arrow {
  font-size: var(--text-2xl);
  color: var(--color-coral);
}

/* ============ Demo Slide ============ */

.demo-visual {
  display: flex; align-items: center; justify-content: center;
  gap: var(--space-lg);
  padding: var(--space-lg) 0;
}
.demo-node {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-xs);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: 500;
}
.demo-node-icon {
  width: 64px; height: 64px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  box-shadow: var(--shadow-sm);
}
.demo-connector {
  font-size: var(--text-xl);
  color: var(--text-tertiary);
}

/* ============ Navigation ============ */

.slide-nav {
  position: fixed; bottom: 1.5rem;
  left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  z-index: 50;
  padding: 8px 16px;
  border-radius: 100px;
  background: var(--nav-bg);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border: 1px solid var(--nav-border);
  box-shadow: var(--nav-shadow);
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
  pointer-events: none;
}
body.nav-visible .slide-nav {
  opacity: 1;
  pointer-events: auto;
}

.nav-arrow {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--nav-text);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--dur-normal) var(--ease-out);
  outline: none;
  flex-shrink: 0;
  font-size: 0.85rem;
}
.nav-arrow:hover {
  background: var(--nav-btn-hover);
  color: var(--nav-text-hover);
}
.nav-arrow:active { transform: scale(0.9); }
.nav-arrow.disabled { opacity: 0.2; pointer-events: none; }

.nav-divider {
  width: 1px; height: 16px;
  background: var(--nav-btn-hover);
  flex-shrink: 0;
}

.nav-dots { display: flex; gap: 7px; align-items: center; }
.nav-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--dot-bg);
  border: none; cursor: pointer;
  transition: all var(--dur-normal) var(--ease-out);
  padding: 0;
  position: relative;
  outline: none;
}
.nav-dot::before {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
}
.nav-dot:hover {
  background: var(--dot-hover);
  transform: scale(1.4);
}
.nav-dot.active {
  background: var(--dot-active);
  transform: scale(1.5);
  box-shadow: 0 0 6px var(--dot-glow);
}

.slide-counter {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--nav-text);
  margin-left: 4px;
  letter-spacing: 0.04em;
  min-width: 3em;
  text-align: center;
}

.corner-btn {
  position: fixed;
  bottom: 1.5rem; right: 1.5rem;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  color: var(--nav-text);
  cursor: pointer;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-out), background var(--dur-normal), color var(--dur-normal);
  border: none;
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--nav-border);
}
body.nav-visible .corner-btn { opacity: 1; pointer-events: auto; }
.corner-btn:hover {
  background: var(--nav-btn-hover);
  color: var(--text-primary);
}

/* ============ Fade-Content Stagger ============ */

.fade-content {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 420ms var(--ease-out), transform 420ms var(--ease-out);
}
.fade-content.fc-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============ Responsive ============ */

@media (max-width: 900px) {
  .card-grid--3 { grid-template-columns: 1fr; }
  .card-grid--2 { grid-template-columns: 1fr; }
  .versus-row { flex-direction: column; }
  .versus-divider { transform: rotate(90deg); }
  .evolution-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .evolution-arrow { transform: rotate(90deg); }
  .demo-visual { flex-direction: column; }
  .demo-connector { transform: rotate(90deg); }
}

/* ============ Utility ============ */

.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.text-center { text-align: center; }
.w-full { width: 100%; }
