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

:root {
  /* SPSM Brand Colors */
  --spsm-red: #80182f;
  --spsm-red-light: #a02040;
  --spsm-red-dark: #5c1022;
  --spsm-orange: #da6f43;
  --spsm-green: #a3ca60;

  /* Derived palette */
  --bg-primary: #faf8f6;
  --bg-slide: #ffffff;
  --bg-dark: #1a1118;
  --text-primary: #2a1520;
  --text-secondary: #5a4550;
  --text-light: #8a7580;
  --accent: var(--spsm-red);
  --accent-light: var(--spsm-orange);
  --accent-green: var(--spsm-green);
  --border: rgba(128, 24, 47, 0.12);
  --shadow: rgba(128, 24, 47, 0.08);

  --font-heading: 'Georgia', 'Times New Roman', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --header-h: 56px;
  --footer-h: 72px;
}

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

/* ─── Progress bar ─── */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--spsm-red), var(--spsm-orange), var(--spsm-green));
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
  border-radius: 0 2px 2px 0;
}

/* ─── Header ─── */
#header {
  position: fixed;
  top: 4px;
  left: 0;
  right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  background: rgba(250, 248, 246, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-light);
  z-index: 10;
}

#header-title {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--spsm-red);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

#slide-counter {
  font-variant-numeric: tabular-nums;
}

/* ─── Presentation area ─── */
#presentation {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  padding: calc(var(--header-h) + 20px) 48px calc(var(--footer-h) + 20px);
  position: relative;
}

/* Decorative background shapes */
#presentation::before,
#presentation::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  opacity: 0.04;
  pointer-events: none;
  z-index: 0;
}
#presentation::before {
  width: 600px;
  height: 600px;
  background: var(--spsm-red);
  top: -200px;
  right: -150px;
  animation: float 20s ease-in-out infinite;
}
#presentation::after {
  width: 400px;
  height: 400px;
  background: var(--spsm-orange);
  bottom: -100px;
  left: -100px;
  animation: float 25s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 15px) scale(0.95); }
}

#slide-container {
  width: 100%;
  max-width: 960px;
  position: relative;
  z-index: 1;
}

/* ─── Slide transition ─── */
#slide-container.transitioning {
  opacity: 0;
  transform: translateY(20px);
}

/* ─── Slide base styles ─── */
.slide {
  text-align: left;
  animation: slideIn 0.6s cubic-bezier(0.2, 0, 0.2, 1) forwards;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-title {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 16px;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.slide-subtitle {
  font-size: 1.25rem;
  color: var(--spsm-red);
  margin-bottom: 36px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.slide-content {
  font-size: 1.2rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 36px;
  max-width: 820px;
}

/* ─── Bullet points with staggered animation ─── */
.slide-bullets {
  list-style: none;
  padding: 0;
}

.slide-bullets li {
  font-size: 1.15rem;
  line-height: 1.6;
  padding: 14px 0 14px 36px;
  position: relative;
  color: var(--text-primary);
  opacity: 0;
  transform: translateX(-16px);
  animation: bulletIn 0.5s cubic-bezier(0.2, 0, 0.2, 1) forwards;
}

.slide-bullets li:nth-child(1) { animation-delay: 0.15s; }
.slide-bullets li:nth-child(2) { animation-delay: 0.3s; }
.slide-bullets li:nth-child(3) { animation-delay: 0.45s; }
.slide-bullets li:nth-child(4) { animation-delay: 0.6s; }
.slide-bullets li:nth-child(5) { animation-delay: 0.75s; }
.slide-bullets li:nth-child(6) { animation-delay: 0.9s; }

@keyframes bulletIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20px;
  width: 12px;
  height: 12px;
  background: var(--spsm-red);
  border-radius: 3px;
  transition: transform 0.3s;
}

.slide-bullets li:hover::before {
  transform: scale(1.3) rotate(45deg);
}

/* Alternating bullet colors */
.slide-bullets li:nth-child(3n+2)::before {
  background: var(--spsm-orange);
}
.slide-bullets li:nth-child(3n+3)::before {
  background: var(--spsm-green);
}

/* ─── Intro slide ─── */
.slide.slide-intro {
  text-align: center;
  padding: 40px 0;
}

.slide-intro .slide-title {
  font-size: 4.5rem;
  margin-bottom: 24px;
  background: linear-gradient(135deg, var(--spsm-red), var(--spsm-orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: titleReveal 1s cubic-bezier(0.2, 0, 0.2, 1) forwards;
}

@keyframes titleReveal {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.slide-intro .slide-subtitle {
  font-size: 1.6rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 40px;
  animation: fadeUp 0.8s 0.3s cubic-bezier(0.2, 0, 0.2, 1) forwards;
  opacity: 0;
}

.slide-intro .slide-content {
  font-size: 1.1rem;
  color: var(--text-light);
  animation: fadeUp 0.8s 0.5s cubic-bezier(0.2, 0, 0.2, 1) forwards;
  opacity: 0;
  margin: 0 auto;
}

.slide-intro .spsm-badge {
  display: inline-block;
  margin-top: 32px;
  padding: 12px 32px;
  background: var(--spsm-red);
  color: #fff;
  border-radius: 100px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  animation: fadeUp 0.8s 0.7s cubic-bezier(0.2, 0, 0.2, 1) forwards;
  opacity: 0;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Summary slide ─── */
.slide-summary {
  background: linear-gradient(135deg, var(--spsm-red-dark), var(--spsm-red));
  padding: 56px 48px;
  border-radius: 24px;
  color: #fff;
  box-shadow: 0 24px 80px rgba(128, 24, 47, 0.25);
}

.slide-summary .slide-title {
  color: #fff;
  font-size: 2.6rem;
}

.slide-summary .slide-subtitle {
  color: rgba(255, 255, 255, 0.7);
}

.slide-summary .slide-content {
  color: rgba(255, 255, 255, 0.8);
}

.slide-summary .slide-bullets li {
  color: #fff;
}

.slide-summary .slide-bullets li::before {
  background: var(--spsm-green);
  border-radius: 50%;
  width: 14px;
  height: 14px;
  top: 19px;
}

.slide-summary .slide-bullets li:nth-child(3n+2)::before {
  background: var(--spsm-orange);
}

.slide-summary .slide-bullets li:nth-child(3n+3)::before {
  background: #fff;
}

/* ─── Example links ─── */
.slide-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 12px;
}

.link-card {
  display: block;
  text-decoration: none;
  background: var(--bg-slide);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  transition: all 0.3s cubic-bezier(0.2, 0, 0.2, 1);
  box-shadow: 0 2px 12px var(--shadow);
  opacity: 0;
  animation: cardIn 0.6s cubic-bezier(0.2, 0, 0.2, 1) forwards;
}

.link-card:nth-child(1) { animation-delay: 0.2s; }
.link-card:nth-child(2) { animation-delay: 0.4s; }
.link-card:nth-child(3) { animation-delay: 0.6s; }

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.link-card:hover {
  border-color: var(--spsm-red);
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 12px 40px rgba(128, 24, 47, 0.15);
}

.link-card-icon {
  display: inline-flex;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 16px;
}

.link-card:nth-child(1) .link-card-icon {
  background: rgba(128, 24, 47, 0.1);
  color: var(--spsm-red);
}
.link-card:nth-child(2) .link-card-icon {
  background: rgba(218, 111, 67, 0.1);
  color: var(--spsm-orange);
}
.link-card:nth-child(3) .link-card-icon {
  background: rgba(163, 202, 96, 0.15);
  color: #6a8a30;
}

.link-card-title {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--text-primary);
  margin-bottom: 10px;
}

.link-card-desc {
  display: block;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.link-card-url {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--spsm-red);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.link-card-url::after {
  content: '\2192';
  transition: transform 0.2s;
}

.link-card:hover .link-card-url::after {
  transform: translateX(4px);
}

/* ─── Demo step indicators ─── */
.demo-steps {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
}

.demo-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 0.8rem;
  color: var(--text-light);
  background: rgba(128, 24, 47, 0.04);
  border: 1px solid transparent;
  transition: all 0.4s;
  flex: 1;
  justify-content: center;
}

.demo-step-num {
  display: inline-flex;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(128, 24, 47, 0.08);
  color: var(--text-light);
  transition: all 0.4s;
}

.demo-step.active {
  background: rgba(128, 24, 47, 0.08);
  border-color: var(--spsm-red);
  color: var(--spsm-red);
}

.demo-step.active .demo-step-num {
  background: var(--spsm-red);
  color: #fff;
}

.demo-step.done {
  color: var(--spsm-green);
}

.demo-step.done .demo-step-num {
  background: var(--spsm-green);
  color: #fff;
}

.demo-step-label {
  font-weight: 500;
}

/* ─── Scenario tabs ─── */
.demo-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.demo-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--bg-slide);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.2, 0, 0.2, 1);
  font-family: var(--font-body);
}

.demo-tab:hover {
  border-color: var(--spsm-red);
  color: var(--spsm-red);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--shadow);
}

.demo-tab.active {
  background: var(--spsm-red);
  border-color: var(--spsm-red);
  color: #fff;
  box-shadow: 0 4px 16px rgba(128, 24, 47, 0.3);
}

.demo-tab-icon {
  font-size: 1rem;
}

.demo-tab-label {
  font-weight: 600;
}

/* ─── Demo area ─── */
.demo-area {
  animation: fadeUp 0.3s forwards;
}

/* ─── Interactive demo slide ─── */
.slide-demo .slide-title {
  font-size: 2.2rem;
  margin-bottom: 8px;
}

.slide-demo .slide-subtitle {
  margin-bottom: 20px;
}

.demo-container {
  background: var(--bg-dark);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
  animation: cardIn 0.6s 0.2s cubic-bezier(0.2, 0, 0.2, 1) forwards;
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.2, 0, 0.2, 1);
}

.demo-container-shrink {
  max-height: 120px;
  opacity: 0.5;
  transform: scale(0.95);
}

.demo-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.demo-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.demo-dot:nth-child(1) { background: #ff5f57; }
.demo-dot:nth-child(2) { background: #febc2e; }
.demo-dot:nth-child(3) { background: #28c840; }

.demo-toolbar-title {
  margin-left: 12px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  font-family: monospace;
}

.demo-content {
  padding: 20px 24px;
  max-height: 280px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.demo-prompt {
  color: var(--spsm-green);
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.85rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

.demo-prompt .cursor {
  display: inline-block;
  width: 8px;
  height: 16px;
  background: var(--spsm-green);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
  margin-left: 1px;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ─── Thinking animation ─── */
.demo-thinking {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  animation: fadeUp 0.3s forwards;
}

.demo-thinking-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--spsm-orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.demo-thinking-text {
  color: var(--spsm-orange);
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.8rem;
}

/* ─── Build steps ─── */
.demo-build-list {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.demo-build-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  animation: buildStepIn 0.4s cubic-bezier(0.2, 0, 0.2, 1) forwards;
  opacity: 0;
  transform: translateX(-12px);
}

@keyframes buildStepIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.demo-build-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.demo-build-text {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.85rem;
  line-height: 1.4;
}

/* ─── Preview window ─── */
.demo-preview {
  margin-top: 20px;
  animation: previewIn 0.8s cubic-bezier(0.2, 0, 0.2, 1) forwards;
  opacity: 0;
}

@keyframes previewIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.preview-window {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 12px 40px var(--shadow);
  background: var(--bg-slide);
}

.preview-toolbar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  background: #f0ecea;
  border-bottom: 1px solid var(--border);
}

.preview-toolbar .demo-dot {
  width: 10px;
  height: 10px;
}

.preview-url {
  margin-left: 12px;
  font-size: 0.7rem;
  color: var(--text-light);
  background: rgba(255, 255, 255, 0.6);
  padding: 3px 14px;
  border-radius: 6px;
  flex: 1;
  text-align: center;
}

.preview-content {
  padding: 0;
  background: var(--bg-primary);
  position: relative;
  min-height: 140px;
  display: flex;
  flex-direction: column;
}

.preview-progress {
  height: 3px;
  background: linear-gradient(90deg, var(--spsm-red), var(--spsm-orange), var(--spsm-green));
  width: 12%;
}

.preview-header {
  font-size: 0.6rem;
  color: var(--spsm-red);
  padding: 8px 16px;
  font-weight: 600;
  font-family: var(--font-heading);
  border-bottom: 1px solid var(--border);
}

.preview-slide {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  text-align: center;
}

.preview-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--spsm-red), var(--spsm-orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}

.preview-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.preview-badge {
  display: inline-block;
  padding: 4px 14px;
  background: var(--spsm-red);
  color: #fff;
  border-radius: 100px;
  font-size: 0.6rem;
  font-weight: 600;
}

.preview-nav {
  display: flex;
  gap: 4px;
  justify-content: center;
  padding: 10px;
  border-top: 1px solid var(--border);
}

.preview-nav .preview-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(128, 24, 47, 0.15);
}

.preview-nav .preview-dot.active {
  background: var(--spsm-red);
  width: 16px;
  border-radius: 3px;
}

.preview-label {
  text-align: center;
  padding: 14px 16px;
  font-size: 0.85rem;
  color: var(--spsm-red);
  font-weight: 600;
  background: rgba(128, 24, 47, 0.04);
  border-top: 1px solid var(--border);
}

/* ─── Kursanmälan preview ─── */
.preview-form {
  padding: 12px 16px;
}

.preview-form-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.preview-input-group {
  flex: 1;
}

.preview-label-sm {
  display: block;
  font-size: 0.55rem;
  color: var(--text-light);
  margin-bottom: 3px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.preview-select {
  font-size: 0.7rem;
  padding: 6px 10px;
  background: var(--bg-slide);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.preview-chevron {
  color: var(--text-light);
  font-size: 0.6rem;
}

.preview-course-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.preview-course {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-slide);
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.65rem;
}

.preview-course-name {
  flex: 1;
  color: var(--text-primary);
  font-weight: 500;
}

.preview-course-date {
  color: var(--text-light);
  font-size: 0.6rem;
}

.preview-course-btn {
  padding: 3px 10px;
  background: var(--spsm-red);
  color: #fff;
  border-radius: 4px;
  font-size: 0.55rem;
  font-weight: 700;
}

/* ─── Tillgänglighet preview ─── */
.preview-a11y {
  padding: 12px 16px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.preview-a11y-score {
  text-align: center;
  flex-shrink: 0;
}

.preview-a11y-ring {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 4px solid var(--spsm-green);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 6px;
}

.preview-a11y-num {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--spsm-green);
}

.preview-a11y-grade {
  font-size: 0.55rem;
  color: var(--text-secondary);
  max-width: 80px;
}

.preview-a11y-issues {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.preview-a11y-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.65rem;
  color: var(--text-primary);
}

.preview-a11y-item.critical {
  background: rgba(218, 111, 67, 0.08);
  border-left: 3px solid var(--spsm-orange);
}

.preview-a11y-item.warning {
  background: rgba(218, 175, 67, 0.08);
  border-left: 3px solid #d4a843;
}

.preview-a11y-item.success {
  background: rgba(163, 202, 96, 0.08);
  border-left: 3px solid var(--spsm-green);
}

.preview-a11y-icon {
  font-size: 0.8rem;
}

/* ─── Läromedel preview ─── */
.preview-catalog {
  padding: 12px 16px;
}

.preview-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: var(--bg-slide);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.65rem;
  color: var(--text-light);
  margin-bottom: 10px;
}

.preview-filter-chips {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.preview-chip {
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 0.55rem;
  background: rgba(128, 24, 47, 0.06);
  color: var(--text-secondary);
  font-weight: 600;
}

.preview-chip.active {
  background: var(--spsm-red);
  color: #fff;
}

.preview-book-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.preview-book {
  background: var(--bg-slide);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.preview-book-cover {
  height: 40px;
}

.preview-book-cover.cover-1 {
  background: linear-gradient(135deg, var(--spsm-red), var(--spsm-orange));
}

.preview-book-cover.cover-2 {
  background: linear-gradient(135deg, var(--spsm-orange), #f0c040);
}

.preview-book-cover.cover-3 {
  background: linear-gradient(135deg, #4898d4, var(--spsm-green));
}

.preview-book-info {
  padding: 6px 8px;
}

.preview-book-title {
  display: block;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.preview-book-meta {
  display: block;
  font-size: 0.5rem;
  color: var(--text-light);
}

/* ─── Intro particles ─── */
.intro-particles {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  opacity: 0;
  animation: particleDrift 4s var(--delay, 0s) ease-out infinite;
}

.particle:nth-child(3n+1) { background: var(--spsm-red); }
.particle:nth-child(3n+2) { background: var(--spsm-orange); }
.particle:nth-child(3n+3) { background: var(--spsm-green); }

.particle:nth-child(2n) {
  width: 6px;
  height: 6px;
  border-radius: 2px;
}

@keyframes particleDrift {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0);
  }
  15% {
    opacity: 0.6;
    transform: translate(calc(var(--x) * 0.3), calc(var(--y) * 0.3)) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--x), var(--y)) scale(0.3);
  }
}

/* ─── Wow comparison slide ─── */
.slide-wow {
  text-align: center;
  padding: 20px 0;
}

.wow-title {
  font-size: 3.5rem !important;
  background: linear-gradient(135deg, var(--spsm-red), var(--spsm-orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 48px !important;
  animation: titleReveal 1s cubic-bezier(0.2, 0, 0.2, 1) forwards;
}

.wow-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 48px;
}

.wow-card {
  background: var(--bg-slide);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 32px;
  opacity: 0;
  animation: cardIn 0.6s cubic-bezier(0.2, 0, 0.2, 1) forwards;
  position: relative;
  overflow: hidden;
  transition: all 0.5s cubic-bezier(0.2, 0, 0.2, 1);
}

.wow-card:nth-child(1) { animation-delay: 0.2s; }
.wow-card:nth-child(2) { animation-delay: 0.5s; }

.wow-card-hero {
  border-color: var(--spsm-red);
  box-shadow: 0 8px 40px rgba(128, 24, 47, 0.15);
}

.wow-card-done {
  transform: scale(1.03);
  box-shadow: 0 16px 60px rgba(128, 24, 47, 0.25);
  border-color: var(--spsm-green);
}

.wow-label {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 24px;
  letter-spacing: 0.02em;
}

.wow-card-hero .wow-label {
  color: var(--spsm-red);
}

.wow-track {
  height: 28px;
  background: rgba(128, 24, 47, 0.06);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 20px;
  position: relative;
}

.wow-bar {
  height: 100%;
  border-radius: 14px;
  position: relative;
}

.wow-bar-slow {
  background: linear-gradient(90deg, #c0b0b5, #a09095);
}

.wow-bar-fast {
  background: linear-gradient(90deg, var(--spsm-red), var(--spsm-orange), var(--spsm-green));
  background-size: 200% 100%;
  animation: wowShimmer 1.5s ease-in-out infinite;
}

@keyframes wowShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.wow-bar-fast::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 60px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4));
  border-radius: 14px;
}

.wow-time {
  font-family: var(--font-heading);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--text-light);
  opacity: 0;
  animation: fadeUp 0.6s 2.8s cubic-bezier(0.2, 0, 0.2, 1) forwards;
}

.wow-card-hero .wow-time {
  color: var(--spsm-red);
  font-size: 3rem;
}

.wow-card-done .wow-time {
  color: var(--spsm-green);
}

/* Particle burst */
.wow-burst {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 10;
}

.wow-particle {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  opacity: 0;
  animation: wowBurst 1s var(--delay, 0s) cubic-bezier(0.2, 0, 0.2, 1) forwards;
}

.wow-particle:nth-child(3n+1) { background: var(--spsm-red); }
.wow-particle:nth-child(3n+2) { background: var(--spsm-orange); }
.wow-particle:nth-child(3n+3) { background: var(--spsm-green); }

.wow-particle:nth-child(2n) {
  width: 6px;
  height: 6px;
  border-radius: 2px;
}

@keyframes wowBurst {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  60% {
    opacity: 0.8;
    transform: translate(var(--tx), var(--ty)) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(calc(var(--tx) * 1.5), calc(var(--ty) * 1.5)) scale(0);
  }
}

/* Punchline */
.wow-punchline {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  opacity: 0;
  animation: wowPunchIn 0.8s 3s cubic-bezier(0.2, 0, 0.2, 1) forwards;
  letter-spacing: -0.01em;
}

@keyframes wowPunchIn {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.9);
    filter: blur(6px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

/* Responsive wow */
@media (max-width: 768px) {
  .wow-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .wow-title { font-size: 2.5rem !important; }
  .wow-punchline { font-size: 1.3rem; }
  .wow-time { font-size: 1.8rem; }
  .wow-card-hero .wow-time { font-size: 2.2rem; }
}

/* ─── "This presentation" meta slide ─── */
.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 12px;
}

.meta-card {
  background: var(--bg-slide);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px;
  text-align: center;
  opacity: 0;
  animation: cardIn 0.5s cubic-bezier(0.2, 0, 0.2, 1) forwards;
}

.meta-card:nth-child(1) { animation-delay: 0.2s; }
.meta-card:nth-child(2) { animation-delay: 0.35s; }
.meta-card:nth-child(3) { animation-delay: 0.5s; }

.meta-card-number {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 8px;
}

.meta-card:nth-child(1) .meta-card-number { color: var(--spsm-red); }
.meta-card:nth-child(2) .meta-card-number { color: var(--spsm-orange); }
.meta-card:nth-child(3) .meta-card-number { color: var(--spsm-green); }

.meta-card-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ─── Navigation controls ─── */
#controls {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--footer-h);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: rgba(250, 248, 246, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  z-index: 10;
}

#controls button {
  background: none;
  border: 2px solid var(--spsm-red);
  color: var(--spsm-red);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.2, 0, 0.2, 1);
}

#controls button:hover {
  background: var(--spsm-red);
  color: #fff;
  transform: scale(1.08);
}

#controls button:disabled {
  opacity: 0.2;
  cursor: default;
}

#controls button:disabled:hover {
  background: none;
  color: var(--spsm-red);
  transform: none;
}

/* ─── Slide indicators ─── */
#indicators {
  display: flex;
  gap: 6px;
  align-items: center;
}

.indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(128, 24, 47, 0.15);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.2, 0, 0.2, 1);
}

.indicator:hover {
  background: rgba(128, 24, 47, 0.4);
  transform: scale(1.2);
}

.indicator.active {
  background: var(--spsm-red);
  transform: scale(1.4);
  width: 24px;
  border-radius: 4px;
}

/* ─── Keyboard shortcut hint ─── */
#keyboard-hint {
  position: fixed;
  bottom: calc(var(--footer-h) + 12px);
  right: 24px;
  font-size: 0.7rem;
  color: var(--text-light);
  opacity: 0.4;
  z-index: 5;
  transition: opacity 0.3s;
}

#keyboard-hint:hover {
  opacity: 1;
}

kbd {
  display: inline-block;
  padding: 2px 6px;
  background: rgba(128, 24, 47, 0.06);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: inherit;
  font-size: inherit;
}

/* ─── Presenter timer ─── */
#presenter-timer {
  position: fixed;
  top: calc(4px + var(--header-h) + 12px);
  right: 24px;
  font-variant-numeric: tabular-nums;
  font-size: 0.75rem;
  color: var(--text-light);
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 5;
  cursor: pointer;
}

#presenter-timer.visible {
  opacity: 0.5;
}

#presenter-timer:hover {
  opacity: 1;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .slide-title { font-size: 2.2rem; }
  .slide-intro .slide-title { font-size: 3rem; }
  .slide-subtitle { font-size: 1.1rem; }
  .slide-content { font-size: 1rem; }
  .slide-bullets li { font-size: 1rem; padding: 10px 0 10px 32px; }
  #presentation { padding: calc(var(--header-h) + 12px) 24px calc(var(--footer-h) + 12px); }
  #header { padding: 0 20px; }

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

  .slide-summary {
    padding: 32px 24px;
    border-radius: 16px;
  }

  .slide-links {
    grid-template-columns: 1fr;
  }

  .demo-steps {
    flex-wrap: wrap;
    gap: 6px;
  }

  .demo-step {
    flex: unset;
    padding: 6px 12px;
    font-size: 0.7rem;
  }

  .demo-step-label { display: none; }

  .demo-tabs { gap: 6px; }
  .demo-tab { padding: 8px 14px; font-size: 0.75rem; }
  .demo-tab-icon { font-size: 0.85rem; }

  .preview-a11y { flex-direction: column; align-items: center; }
  .preview-book-grid { grid-template-columns: 1fr 1fr; }
  .preview-form-row { flex-direction: column; }

  .slide-demo .slide-title { font-size: 1.8rem; }

  #keyboard-hint { display: none; }
}

@media (max-width: 480px) {
  .slide-intro .slide-title { font-size: 2.4rem; }
  .slide-title { font-size: 1.8rem; }
}

/* ─── Print ─── */
@media print {
  #header, #controls, #progress-bar, #keyboard-hint, #presenter-timer { display: none; }
  #presentation { height: auto; padding: 20px; }
  .slide { page-break-after: always; animation: none; }
  .slide-bullets li { animation: none; opacity: 1; transform: none; }
  body { background: white; color: black; }
  .slide-title { color: var(--spsm-red); }
  .slide-subtitle { color: var(--spsm-orange); }
  .slide-content, .slide-bullets li { color: #333; }
  .slide-summary { background: var(--spsm-red); print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
