:root {
  --blue-50:  #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-900: #1e3a8a;
  --ink:      #0f172a;
  --ink-soft: #475569;
  --line:     #e2e8f0;
  --white:    #ffffff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--white);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
    "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.deck {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5vh 8vw;
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.45s ease, transform 0.45s ease;
  pointer-events: none;
}

.slide.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.slide.prev {
  transform: translateX(-40px);
}

.slide-inner {
  max-width: 1000px;
  width: 100%;
}

/* Typography */
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--blue-600);
  margin: 0 0 1.2rem;
}

h1 {
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 1.05;
  margin: 0 0 1rem;
  color: var(--blue-900);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(2rem, 4.2vw, 3.2rem);
  line-height: 1.1;
  margin: 0 0 1.4rem;
  color: var(--blue-900);
  letter-spacing: -0.015em;
}

h3 {
  font-size: 1.25rem;
  margin: 0 0 0.4rem;
  color: var(--blue-700);
}

p { line-height: 1.6; color: var(--ink-soft); margin: 0 0 1rem; }
.lede { font-size: 1.25rem; color: var(--ink); margin-bottom: 1.8rem; }
.subtitle { font-size: 1.4rem; color: var(--ink-soft); margin-top: 0.5rem; }
strong { color: var(--ink); }
code {
  background: var(--blue-50);
  color: var(--blue-700);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-size: 0.95em;
}

kbd {
  background: var(--blue-50);
  border: 1px solid var(--blue-200);
  border-radius: 4px;
  padding: 0.1em 0.5em;
  font-family: inherit;
  font-size: 0.9em;
  color: var(--blue-700);
}

.hint {
  margin-top: 2.5rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* Title slide */
.title-slide {
  background: linear-gradient(135deg, var(--blue-50) 0%, var(--white) 100%);
}

.title-slide .slide-inner {
  text-align: center;
}

/* Cards */
.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
}

.cards.three {
  grid-template-columns: repeat(3, 1fr);
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.6rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--blue-200);
  box-shadow: 0 10px 30px -12px rgba(37, 99, 235, 0.25);
}

.card.highlight {
  background: var(--blue-50);
  border-color: var(--blue-200);
}

.card.highlight h3 { color: var(--blue-700); }
.card p { margin: 0; }
.card-sub {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue-500);
  margin: 0 0 0.6rem;
}

/* Steps */
.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1.2rem;
}

.steps li {
  display: flex;
  align-items: flex-start;
  gap: 1.2rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.2rem 1.4rem;
}

.step-num {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--blue-600);
  color: var(--white);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.1rem;
}

.steps h3 { margin-bottom: 0.2rem; }
.steps p { margin: 0; }

/* Bullets */
.bullets {
  padding: 0;
  margin: 0;
  list-style: none;
}

.bullets li {
  position: relative;
  padding: 0.5rem 0 0.5rem 1.6rem;
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.5;
}

.bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.05em;
  width: 8px;
  height: 8px;
  background: var(--blue-500);
  border-radius: 50%;
}

.bullets.two-col {
  columns: 2;
  column-gap: 2.5rem;
}

.bullets.two-col li { break-inside: avoid; }

/* Visuals */
.visual {
  display: flex;
  justify-content: center;
  margin: 1.5rem 0;
}

.slice-stack {
  display: flex;
  flex-direction: column-reverse;
  gap: 4px;
  width: 220px;
}

.slice-stack span {
  display: block;
  height: 14px;
  background: var(--blue-200);
  border-radius: 3px;
  opacity: 0;
  animation: sliceIn 0.4s forwards;
}

.slide.active .slice-stack span:nth-child(1)  { animation-delay: 0.15s; }
.slide.active .slice-stack span:nth-child(2)  { animation-delay: 0.25s; }
.slide.active .slice-stack span:nth-child(3)  { animation-delay: 0.35s; }
.slide.active .slice-stack span:nth-child(4)  { animation-delay: 0.45s; }
.slide.active .slice-stack span:nth-child(5)  { animation-delay: 0.55s; }
.slide.active .slice-stack span:nth-child(6)  { animation-delay: 0.65s; background: var(--blue-400); }
.slide.active .slice-stack span:nth-child(7)  { animation-delay: 0.75s; background: var(--blue-400); }
.slide.active .slice-stack span:nth-child(8)  { animation-delay: 0.85s; background: var(--blue-500); }
.slide.active .slice-stack span:nth-child(9)  { animation-delay: 0.95s; background: var(--blue-500); }
.slide.active .slice-stack span:nth-child(10) { animation-delay: 1.05s; background: var(--blue-600); }

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

.printer {
  position: relative;
  width: 280px;
  height: 200px;
}

.nozzle {
  position: absolute;
  top: 0;
  left: 50%;
  width: 30px;
  height: 60px;
  background: var(--blue-700);
  border-radius: 4px 4px 8px 8px;
  transform: translateX(-50%);
  animation: nozzleMove 2.2s ease-in-out infinite;
}

.nozzle::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  background: var(--blue-700);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.build-plate {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 14px;
  background: var(--blue-100);
  border-radius: 3px;
  border-bottom: 3px solid var(--blue-200);
}

.object {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 0;
  background: linear-gradient(180deg, var(--blue-400), var(--blue-600));
  border-radius: 4px 4px 0 0;
  animation: objectGrow 4s ease-in-out infinite;
}

@keyframes nozzleMove {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  25%      { transform: translateX(-130%) translateY(0); }
  75%      { transform: translateX(30%) translateY(0); }
}

@keyframes objectGrow {
  0%, 10%   { height: 0; }
  90%, 100% { height: 100px; }
}

/* Controls */
.controls {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  box-shadow: 0 10px 30px -12px rgba(15, 23, 42, 0.15);
  z-index: 10;
}

.controls button {
  background: var(--blue-50);
  color: var(--blue-700);
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.controls button:hover {
  background: var(--blue-100);
}

.controls button:active {
  transform: scale(0.94);
}

.controls button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.counter {
  font-size: 0.9rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  min-width: 50px;
  text-align: center;
}

/* Progress bar */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  z-index: 10;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--blue-400), var(--blue-600));
  transition: width 0.4s ease;
}

/* QR slide */
.qr-layout {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  align-items: center;
  margin-top: 1.5rem;
}

.qr-instructions { min-width: 0; }
.qr-instructions .lede { margin-bottom: 1.2rem; }

.steps.compact li { padding: 0.8rem 1rem; }
.steps.compact .step-num { width: 36px; height: 36px; font-size: 1rem; }
.steps.compact h3 { font-size: 1.05rem; }
.steps.compact p { font-size: 0.95rem; }

.qr-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.2rem;
  text-align: center;
  box-shadow: 0 12px 30px -16px rgba(37, 99, 235, 0.3);
}

.qr-image {
  display: block;
  width: 240px;
  height: 240px;
  border-radius: 8px;
  background: var(--blue-50);
  object-fit: contain;
}

.qr-caption {
  margin: 0.8rem 0 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--blue-700);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Responsive */
@media (max-width: 720px) {
  .slide { padding: 4vh 6vw; }
  .cards, .cards.three { grid-template-columns: 1fr; }
  .bullets.two-col { columns: 1; }
  .qr-layout { grid-template-columns: 1fr; gap: 1.5rem; }
  .qr-card { justify-self: center; }
  .qr-image { width: 200px; height: 200px; }
}
