/* Miles Brand Guide 2026 - Presentation Styles */

/* ── Gelica (self-hosted) ─────────────────────── */
@font-face {
  font-family: 'Gelica';
  src: url('../public/fonts/Gelica/Gelica-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Gelica';
  src: url('../public/fonts/Gelica/Gelica-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Gelica';
  src: url('../public/fonts/Gelica/Gelica-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Gelica';
  src: url('../public/fonts/Gelica/Gelica-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ── Brand Tokens ─────────────────────────────── */
:root {
  --miles-red: #ff303b;
  --deep-red: #b72318;
  --burgundy: #450d20;
  --cream: #fbf0e5;
  --yellow: #ffd9a1;
  --dark-purple: #3d1436;
  --dark-teal: #004047;
  --teal: #78e8db;

  --white: #ffffff;
  --black: #1a1a1a;

  --font-display: 'Gelica', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;

  --slide-width: 1280px;
  --slide-height: 720px;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--black);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease;
}

/* ── Slide Deck Container ─────────────────────── */
.deck {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* ── Individual Slide ─────────────────────────── */
.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s ease, visibility 0s linear 0.4s;
  contain: content;
}
/* Allow bleed slides to paint outside the contain box */
.slide:has(.photo-full),
.slide:has(.has-bg) {
  contain: layout style;
}

.slide.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.4s ease, visibility 0s linear 0s;
}

.slide-inner {
  position: absolute;
  left: 50%;
  top: 0;
  width: var(--slide-width);
  height: var(--slide-height);
  padding: 64px 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  /* Scale set by JS via --slide-scale custom property */
  transform: translateX(-50%) scale(var(--slide-scale, 1));
  transform-origin: top center;
}

/* ── Typography ───────────────────────────────── */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.15;
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.75rem; }

p, li {
  font-family: var(--font-body);
  font-size: 1.35rem;
  line-height: 1.6;
}

ul, ol {
  padding-left: 1.5em;
}

li + li {
  margin-top: 0.5em;
}

small {
  font-size: 0.95rem;
  opacity: 0.7;
}

code {
  font-family: 'DM Mono', 'SF Mono', monospace;
  background: rgba(0, 0, 0, 0.08);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

pre {
  background: var(--black);
  color: var(--cream);
  padding: 1.5em;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 1rem;
  line-height: 1.5;
}

pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* ── Slide Themes ─────────────────────────────── */

/* Default: cream background */
.slide-inner {
  background: var(--cream);
  color: var(--burgundy);
}

/* Title slide - burgundy bg */
.slide-inner.theme-title {
  background: var(--burgundy);
  color: var(--cream);
  justify-content: flex-start;
  padding-top: 48px;
}
.slide-inner.theme-title h1 {
  font-size: 2.5rem;
  font-weight: 400;
  line-height: 1.3;
  max-width: 55%;
}
.slide-inner.theme-title p {
  color: var(--miles-red);
}
.slide-inner.theme-title .title-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
}
.slide-inner.theme-title .title-meta {
  text-align: right;
  color: var(--miles-red);
  font-size: 1.5rem;
  line-height: 1.4;
}
.slide-inner.theme-title .title-logo {
  position: absolute;
  bottom: 48px;
  left: 80px;
  width: 60%;
  max-width: 620px;
}
.slide-inner.theme-title .title-logo img {
  width: 100%;
  height: auto;
}

/* Simple centered title (for closing slides, section breaks) */
.slide-inner.theme-title-center {
  background: var(--burgundy);
  color: var(--cream);
  justify-content: center;
  text-align: center;
}
.slide-inner.theme-title-center h1 {
  font-size: 4.5rem;
  margin-bottom: 0.3em;
}
.slide-inner.theme-title-center p {
  color: var(--miles-red);
}

/* Red accent */
.slide-inner.theme-red {
  background: var(--miles-red);
  color: var(--white);
}
.slide-inner.theme-red code {
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
}

/* Purple / tech (legacy) */
.slide-inner.theme-purple {
  background: var(--dark-purple);
  color: var(--cream);
}
.slide-inner.theme-purple code {
  background: rgba(255, 255, 255, 0.12);
  color: var(--yellow);
}

/* Teal / tech (2026) */
.slide-inner.theme-teal {
  background: var(--dark-teal);
  color: var(--cream);
}
.slide-inner.theme-teal code {
  background: rgba(255, 255, 255, 0.12);
  color: var(--teal);
}
.slide-inner.theme-teal .accent {
  color: var(--teal);
}

/* White */
.slide-inner.theme-white {
  background: var(--white);
  color: var(--burgundy);
}

/* Yellow accent */
.slide-inner.theme-yellow {
  background: var(--yellow);
  color: var(--burgundy);
}

/* ── Layout Helpers ───────────────────────────── */
.slide-inner .columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
  width: 100%;
}

.slide-inner .columns-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 36px;
  align-items: start;
  width: 100%;
}

.slide-inner .gap { margin-top: 1.5em; }
.slide-inner .gap-lg { margin-top: 2.5em; }

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

.slide-inner .accent {
  color: var(--miles-red);
}

.theme-title .accent,
.theme-red .accent,
.theme-purple .accent {
  color: var(--yellow);
}

.theme-teal .accent {
  color: var(--teal);
}

/* ── Logo ─────────────────────────────────────── */
.slide-logo {
  position: absolute;
  bottom: 32px;
  right: 40px;
  height: 28px;
  opacity: 0.5;
}

/* ── Progress Bar ─────────────────────────────── */
.progress {
  position: fixed;
  bottom: 0;
  left: 0;
  height: 4px;
  background: var(--miles-red);
  transition: width 0.35s ease;
  z-index: 100;
}

/* ── Slide Counter ────────────────────────────── */
.slide-counter {
  position: fixed;
  bottom: 12px;
  right: 20px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
  z-index: 100;
}

.present-btn {
  position: fixed;
  bottom: 10px;
  right: 100px;
  z-index: 100;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--cream);
  background: var(--miles-red);
  border: none;
  border-radius: 4px;
  padding: 6px 14px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.present-btn:hover {
  opacity: 1;
}
:fullscreen .present-btn {
  display: none;
}

/* ── Image helpers ────────────────────────────── */
.slide-inner img {
  max-width: 100%;
  border-radius: 8px;
}

.slide-inner img.full {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

/* ── Speaker Notes (hidden in presentation) ───── */
aside.notes {
  display: none;
}

/* ── Image Layouts ────────────────────────────── */

/* Background image with overlay for text readability */
.slide-inner.has-bg {
  padding: 64px 80px;
  overflow: visible;
  color: var(--cream);
  isolation: isolate; /* stacking context so pseudo-elements can use z-index:-1 */
}
.slide-inner.has-bg::before {
  content: '';
  position: absolute;
  z-index: -1;
  top: 0;
  left: calc(-1 * (100vw / var(--slide-scale, 1) - var(--slide-width)) / 2);
  width: calc(100vw / var(--slide-scale, 1));
  height: calc(100vh / var(--slide-scale, 1));
  background-image: var(--bg-url);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.slide-inner.has-bg::after {
  content: '';
  position: absolute;
  z-index: -1;
  top: 0;
  left: calc(-1 * (100vw / var(--slide-scale, 1) - var(--slide-width)) / 2);
  width: calc(100vw / var(--slide-scale, 1));
  height: calc(100vh / var(--slide-scale, 1));
  background: rgba(69, 13, 33, var(--bg-overlay-opacity, 0.7));
}

/* Image + text side by side */
.img-text {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  width: 100%;
}
.img-text.img-right {
  direction: rtl;
}
.img-text.img-right > * {
  direction: ltr;
}
.img-text img {
  width: 100%;
  border-radius: 8px;
  object-fit: cover;
}

/* Image with caption */
figure {
  margin: 0;
  width: 100%;
}
figure img {
  width: 100%;
  border-radius: 8px;
}
figure figcaption {
  margin-top: 0.5em;
  font-size: 0.95rem;
  opacity: 0.7;
  text-align: center;
}

/* Centered image (e.g. diagram, screenshot) */
.slide-inner .img-center {
  display: flex;
  justify-content: center;
  width: 100%;
}
.slide-inner .img-center img {
  max-height: 440px;
  width: auto;
}

/* ── Title with Illustration ─────────────────── */
/* Title slide variant with large image on right (PPTX: "Title Illustration 1") */
.slide-inner.theme-title.title-illustration {
  padding: 48px 0 48px 80px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  align-items: center;
}
.slide-inner.theme-title.title-illustration .title-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.slide-inner.theme-title.title-illustration .title-text .logo {
  width: 120px;
  margin-bottom: 1.5em;
}
.slide-inner.theme-title.title-illustration h1 {
  max-width: 100%;
}
.slide-inner.theme-title.title-illustration .title-image {
  height: 100%;
  overflow: hidden;
}
.slide-inner.theme-title.title-illustration .title-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

/* ── Section Header ──────────────────────────── */
/* Distinct from theme-title-center: has a small subtitle label + large heading (PPTX: "Section header 1-3") */
.slide-inner .section-header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
}
.slide-inner .section-header .section-label {
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.7;
  margin-bottom: 1em;
}
.slide-inner .section-header h1 {
  font-size: 3.5rem;
  margin-bottom: 0.5em;
}
.slide-inner .section-header p {
  font-size: 1.35rem;
  max-width: 70%;
}

/* Section header with photo on right (PPTX: "Section header 2") */
.slide-inner.section-photo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding-right: 0;
}
.slide-inner.section-photo .section-image {
  height: 100%;
  overflow: hidden;
}
.slide-inner.section-photo .section-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

/* ── Split Content ───────────────────────────── */
/* Title + text on left, edge-to-edge image/content on right (PPTX: "Content 6") */
.slide-inner.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding-right: 0;
}
.slide-inner.split .split-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-right: 48px;
}
.slide-inner.split .split-text h2 { margin-bottom: 0.5em; }
.slide-inner.split .split-media {
  height: 100%;
  overflow: hidden;
}
.slide-inner.split .split-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}
/* Reverse: image on left */
.slide-inner.split.split-reverse {
  grid-template-columns: 1fr 1fr;
  padding-right: 80px;
  padding-left: 0;
}
.slide-inner.split.split-reverse .split-media { order: -1; }
.slide-inner.split.split-reverse .split-text { padding-right: 0; padding-left: 48px; }

/* ── Full-bleed Photo ────────────────────────── */
/* Single image covering entire slide (PPTX: "Content Photo 1") */
.slide-inner.photo-full {
  padding: 0;
  overflow: visible;
}
.slide-inner.photo-full > img {
  position: absolute;
  top: 0;
  left: calc(-1 * (100vw / var(--slide-scale, 1) - var(--slide-width)) / 2);
  width: calc(100vw / var(--slide-scale, 1));
  height: calc(100vh / var(--slide-scale, 1));
  object-fit: cover;
  border-radius: 0;
}

/* ── Photo Grid ──────────────────────────────── */
/* Grid of photos (PPTX: "Content Photo 2/3") */
.photo-grid {
  display: grid;
  gap: 4px;
  width: 100%;
  height: 100%;
}
.slide-inner.photo-full > .photo-grid {
  position: absolute;
  top: 0;
  left: calc(-1 * (100vw / var(--slide-scale, 1) - var(--slide-width)) / 2);
  width: calc(100vw / var(--slide-scale, 1));
  height: calc(100vh / var(--slide-scale, 1));
}
.photo-grid.grid-2x2 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.photo-grid.grid-3x2 { grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 1fr 1fr; }
.photo-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}
/* Photo grid with text on left (PPTX: "Content Photo 3") */
.slide-inner.photo-grid-text {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding-right: 0;
}
.slide-inner.photo-grid-text .photo-grid {
  gap: 4px;
}

/* ── Team / People Cards ─────────────────────── */
/* Circular photos with names/roles (PPTX: "Custom Layout" team slides) */
.team-grid {
  display: flex;
  justify-content: center;
  gap: 48px;
  width: 100%;
  margin-top: 1.5em;
}
.team-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 0 1 200px;
}
.team-card img {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1em;
}
.team-card .team-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.25rem;
  margin-bottom: 0.2em;
}
.team-card .team-role {
  font-size: 1rem;
  opacity: 0.7;
}
/* 5-person variant: smaller photos */
.team-grid.team-5 { gap: 32px; }
.team-grid.team-5 .team-card img {
  width: 120px;
  height: 120px;
}

/* ── Logo Closing ────────────────────────────── */
/* Just the Miles logo centered (PPTX: "Conclusion 3/4/5") */
.slide-inner.logo-center {
  justify-content: center;
  align-items: center;
}
.slide-inner.logo-center img {
  width: 45%;
  max-width: 580px;
  height: auto;
}

/* ── Fragments (step-reveal) ──────────────────── */
.fragment {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.fragment.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Skip fragment animations on hidden slides — avoids compositing work */
.slide:not(.active) .fragment {
  transition: none;
}

/* ── Timeline ────────────────────────────────── */
.timeline {
  position: relative;
  padding-left: 24px;
  margin-top: 1em;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 0.5em;
  bottom: 0.5em;
  width: 3px;
  background: currentColor;
  opacity: 0.25;
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  padding-left: 32px;
  padding-bottom: 1.2em;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 0.5em;
  width: 15px;
  height: 15px;
  background: var(--miles-red);
  border-radius: 50%;
  box-shadow: 0 0 0 4px currentColor;
  opacity: 0.15;
}

.timeline-item.fragment.visible::before {
  opacity: 1;
  animation: timeline-pulse 0.4s ease-out;
}

@keyframes timeline-pulse {
  0% { transform: scale(0.5); opacity: 0; }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); opacity: 1; }
}

.timeline-item .timeline-date {
  font-weight: 600;
  color: var(--miles-red);
  display: block;
  margin-bottom: 0.2em;
}

.theme-teal .timeline-item::before {
  background: var(--teal);
}

.theme-teal .timeline-item .timeline-date {
  color: var(--teal);
}

.theme-purple .timeline-item::before {
  background: var(--yellow);
}

.theme-purple .timeline-item .timeline-date {
  color: var(--yellow);
}

/* ── X-Post Card ─────────────────────────────── */
.x-post {
  background: var(--white);
  border: 1px solid #cfd9de;
  border-radius: 16px;
  padding: 20px 24px;
  max-width: 600px;
  margin: 0 auto;
  color: var(--black);
  text-align: left;
  display: flex;
  flex-direction: column;
  position: relative;
}

.x-post-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.x-post-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.2rem;
}

.x-post-author {
  display: flex;
  flex-direction: column;
}

.x-post-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--black);
  display: flex;
  align-items: center;
  gap: 4px;
}

.x-post-verified {
  display: inline-block;
  width: 18px;
  height: 18px;
  background: #1d9bf0;
  border-radius: 50%;
  position: relative;
}

.x-post-verified::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 11px;
  font-weight: 700;
}

.x-post-handle {
  color: #536471;
  font-size: 0.95rem;
  text-decoration: none;
  &:hover {
    font-weight: 900;
    text-decoration: underline;
  }
}

.x-post-content {
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--black);
  margin-bottom: 12px;
}

.x-post-content em {
  font-style: normal;
}

.x-post-date {
  color: #536471;
  font-size: 0.9rem;
  text-align: right;
  margin-top: auto;
}

.x-post-engagement {
  display: flex;
  gap: 24px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #eff3f4;
  color: #536471;
  font-size: 0.9rem;
}

/* Side-by-side x-posts */
.x-posts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.x-posts-row .x-post {
  max-width: none;
}

/* Large centered x-post for emphasis */
.x-post-large {
  max-width: 700px;
}

.x-post-large .x-post-content {
  font-size: 1.25rem;
  line-height: 1.5;
}

.x-posts-row .x-post-large {
  max-width: none;
}

/* Animated x-posts - slide in from sides */
.x-posts-animated .x-post {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.x-posts-animated .x-post:nth-child(1) {
  transition-delay: 0.2s;
}

.x-posts-animated .x-post:nth-child(2) {
  transition-delay: 0.4s;
}

.slide.active .x-posts-animated .x-post {
  opacity: 1;
  transform: translateY(0);
}

/* ── Emoji/Icon helpers ──────────────────────── */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 1em;
}

.icon-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 16px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.icon-card .icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-card .icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.icon-card p {
  font-size: 1.1rem;
  margin: 0;
}

/* Theme adjustments for icon cards */
.theme-white .icon-card {
  background: rgba(0, 0, 0, 0.04);
}

.slide-inner:not([class*="theme-"]) .icon-card {
  background: rgba(69, 13, 32, 0.06);
}

/* ── Bar Chart ────────────────────────────────── */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 1.5em;
  height: 320px;
  margin-top: 1em;
}

.bar-chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  opacity: 0;
  transform: translateY(24px);
}

.slide.active .bar-chart-col {
  animation: bar-slide-up 0.5s ease forwards;
}

@keyframes bar-slide-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bar-chart-value {
  font-family: 'Gelica', serif;
  font-weight: 500;
  font-size: 1.1em;
  margin-bottom: 0.4em;
  white-space: nowrap;
}

.bar-chart-bar {
  width: 100%;
  max-width: 120px;
  border-radius: 6px 6px 0 0;
  transition: height 0.6s ease;
  position: relative;
}

.bar-chart-label {
  font-size: 0.85em;
  font-weight: 600;
  margin-top: 0.6em;
  text-align: center;
}

.bar-chart-sub {
  font-size: 0.65em;
  opacity: 0.7;
  margin-top: 0.25em;
  text-align: center;
  max-width: 160px;
  line-height: 1.3;
}

/* Theme: teal */
.theme-teal .bar-chart-bar { background: var(--teal); }
.theme-teal .bar-chart-value { color: var(--teal); }

/* Theme: red */
.theme-red .bar-chart-bar { background: #fff; }
.theme-red .bar-chart-value { color: #fff; }

/* Theme: default / cream */
.slide-inner:not([class*="theme-"]) .bar-chart-bar { background: var(--miles-red); }
.slide-inner:not([class*="theme-"]) .bar-chart-value { color: var(--miles-red); }

/* Theme: white */
.theme-white .bar-chart-bar { background: var(--burgundy); }
.theme-white .bar-chart-value { color: var(--burgundy); }

/* ── Sticker slap animation ──────────────────── */
.sticker-slap {
  transform: rotate(var(--sticker-rotate, 8deg)) scale(0);
  opacity: 0;
  filter: drop-shadow(3px 6px 12px rgba(0,0,0,0.4));
  transition: none;
}
.sticker-slap.visible {
  animation: sticker-slap 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}
@keyframes sticker-slap {
  0%   { opacity: 0; transform: rotate(var(--sticker-rotate, 8deg)) scale(0); }
  60%  { opacity: 1; transform: rotate(var(--sticker-rotate, 8deg)) scale(1.15); }
  80%  { transform: rotate(var(--sticker-rotate, 8deg)) scale(0.95); }
  100% { opacity: 1; transform: rotate(var(--sticker-rotate, 8deg)) scale(1); }
}

/* ── Poll Widget ──────────────────────────────── */

/* The widget floats at the bottom of the slide inner */
.poll-widget {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 260px;
  display: flex;
  gap: 0;
  padding: 0 80px 32px;
  align-items: flex-end;
}

/* QR code column */
.poll-qr-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-right: 48px;
}

.poll-qr-box {
  background: var(--dark-teal);
  border: 3px solid var(--teal);
  border-radius: 12px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* qrcodejs injects a canvas or img — ensure it fits */
.poll-qr-box canvas,
.poll-qr-box img {
  display: block;
  border-radius: 4px;
}

.poll-qr-url {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: var(--teal);
  opacity: 0.9;
  letter-spacing: 0.02em;
}

/* Results column */
.poll-results-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
}

.poll-results-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--teal);
  margin-bottom: 2px;
}

.poll-loading {
  font-size: 0.9rem;
  opacity: 0.5;
}

/* Individual bar rows */
.poll-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 36px;
}

.poll-bar-label {
  font-size: 1.05rem;
  font-weight: 600;
  min-width: 50px;
  color: var(--cream);
}

.poll-bar-track {
  flex: 1;
  height: 14px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  overflow: hidden;
}

.poll-bar-fill {
  height: 100%;
  background: var(--teal);
  border-radius: 7px;
  transition: width 0.6s ease;
  min-width: 0;
}

/* On non-teal themes, use Miles red for bars */
.theme-red .poll-bar-fill { background: var(--yellow); }
.slide-inner:not(.theme-teal):not(.theme-red):not(.theme-purple) .poll-bar-fill {
  background: var(--miles-red);
}

.poll-bar-pct {
  font-size: 0.9rem;
  font-weight: 600;
  min-width: 38px;
  text-align: right;
  color: var(--teal);
}

.theme-red .poll-bar-pct { color: var(--yellow); }
.slide-inner:not(.theme-teal):not(.theme-red):not(.theme-purple) .poll-bar-pct {
  color: var(--miles-red);
}

.poll-bar-count {
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  opacity: 0.55;
  min-width: 28px;
  text-align: right;
}

.poll-total {
  font-size: 0.75rem;
  opacity: 0.5;
  margin-top: 4px;
  font-family: 'DM Mono', monospace;
}

/* ── Quote Attribution ────────────────────────── */
.quote-attribution {
  font-size: 0.85em;
  opacity: 0.8;
  margin-top: 0.5em;
}

/* ── Stat Big ─────────────────────────────────── */
.stat-big {
  font-family: 'Gelica', serif;
  font-size: 4em;
  font-weight: 500;
  line-height: 1.1;
  color: var(--miles-red);
}
.theme-teal .stat-big { color: var(--teal); }
.theme-red .stat-big { color: #fff; }

/* ── Inline Icon ──────────────────────────────── */
.icon-inline {
  height: 1.4em;
  vertical-align: middle;
  margin-right: 0.3em;
}

/* ── LinkedIn Embed ───────────────────────────── */
.linkedin-embed-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
}

/* ── Hover Tooltip ("THIS_IS_A_LIE") ─────────── */
.THIS_IS_A_LIE {
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 4px;
  padding: 0 2px;
}
.THIS_IS_A_LIE:hover {
  background: var(--miles-red);
  color: #fff;
}
.THIS_IS_A_LIE::before {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 0;
  background: var(--miles-red);
  color: #fff;
  padding: 0.5em 0.75em;
  border-radius: 8px;
  font-size: 0.55em;
  font-weight: 600;
  white-space: normal;
  max-width: 400px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateY(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.THIS_IS_A_LIE:hover::before {
  opacity: 1;
  transform: translateY(-8px);
}

/* ── Highlighter (hand-drawn marker effect) ──── */
.highlighter {
  position: relative;
  display: inline;
  padding: 0.05em 0.15em;
  z-index: 0;
}
.highlighter::before {
  content: '';
  position: absolute;
  inset: -2px -4px;
  z-index: -1;
  background: var(--yellow);
  opacity: 0.85;
  border-radius: 3px 5px 4px 6px;
  transform: rotate(-0.6deg) skewX(-1.5deg);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='40'%3E%3Cpath d='M2 8 Q20 2 50 6 T100 5 T150 8 T198 4 V36 Q180 32 150 35 T100 33 T50 36 T2 32Z' fill='black'/%3E%3C/svg%3E");
  mask-size: 100% 100%;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='40'%3E%3Cpath d='M2 8 Q20 2 50 6 T100 5 T150 8 T198 4 V36 Q180 32 150 35 T100 33 T50 36 T2 32Z' fill='black'/%3E%3C/svg%3E");
  -webkit-mask-size: 100% 100%;
}

/* ── Timeline with Images ────────────────────── */
.timeline-split {
  display: flex;
  gap: 3em;
  flex: 1;
  min-height: 0;
}
.timeline-split .timeline {
  flex: 1;
  margin-top: 0;
}
.timeline-visual {
  flex: 0 0 380px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.timeline-visual img {
  position: absolute;
  max-width: 100%;
  max-height: 420px;
  border-radius: 12px;
  object-fit: contain;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}
.slide:not(.active) .timeline-visual img {
  transition: none;
}
.timeline-visual img.tl-visible {
  opacity: 1;
  transform: scale(1);
}

/* ── Agile Manifesto Slide ───────────────────── */
.manifesto-content {
  padding: 64px 80px;
  color: var(--cream);
  display: flex;
  flex-direction: column;
}
.manifesto-content h1 {
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(18vh);
}
.manifesto-content:has(.manifesto-text.visible) h1 {
  transform: translateY(0);
}
.manifesto-text {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease 0.4s, transform 0.55s ease 0.4s;
  max-width: 620px;
  line-height: 1.6;
}
.manifesto-text.visible {
  opacity: 1;
  transform: translateY(0);
}
.manifesto-intro,
.manifesto-outro {
  font-size: 0.9em;
  opacity: 0.75;
  margin: 0 0 0.75em;
}
.manifesto-outro { margin: 0.75em 0 0; }
.manifesto-values {
  list-style: none;
  padding: 0;
  margin: 0;
}
.manifesto-values li {
  font-size: 1.05em;
  padding: 0.2em 0.5em;
  margin-left: -0.5em;
  border-radius: 6px;
  transition: font-size 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.2s ease, padding 0.25s ease;
}
.manifesto-values li:hover {
  font-size: 1.365em;
  background: rgba(255, 255, 255, 0.9);
  color: var(--burgundy);
}
.manifesto-values li:hover .over { opacity: 0.4; }
.manifesto-left {
  list-style: none;
  padding: 0;
  margin: 1em 0 0;
}
.manifesto-left li {
  font-size: 1.1em;
  padding: 0.2em 0;
  opacity: 0.85;
}
.manifesto-left li::before {
  content: '\2192  ';
  opacity: 0.5;
}
.manifesto-values .over {
  opacity: 0.45;
  font-style: italic;
}

/* ── Code Production Chart (CPC) ─────────────── */
.cpc {
  --cpc-bg: #0a0c10;
  --cpc-surface: #111318;
  --cpc-border: #1e2230;
  --cpc-human: #4a9eff;
  --cpc-ai: #ff6b35;
  --cpc-ai-glow: rgba(255, 107, 53, 0.3);
  --cpc-text: #ffffff;
  --cpc-muted: #ffffff;
  --cpc-accent: #ffe066;
  background: var(--cpc-bg);
  color: var(--cpc-text);
  font-family: 'DM Mono', monospace;
  display: flex;
  flex-direction: column;
  padding: 32px 40px;
  overflow: hidden;
}
.cpc .grain {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}
.cpc .cpc-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.cpc header { margin-bottom: 20px; text-align: left; }
.cpc .eyebrow {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cpc-muted);
  margin-bottom: 8px;
}
.cpc header h1 {
  font-family: 'Gelica', serif;
  font-size: clamp(22px, 3vw, 36px);
  font-weight: 500;
  line-height: 1.1;
  color: #ffffff;
  margin-bottom: 8px;
}
.cpc header h1 em {
  font-style: italic;
  font-weight: 500;
  color: var(--cpc-accent);
}
.cpc .subtitle {
  font-size: 11px;
  color: var(--cpc-muted);
  line-height: 1.5;
  max-width: 500px;
}
.cpc .legend {
  display: flex;
  gap: 24px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.cpc .legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--cpc-muted);
}
.cpc .legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.cpc .legend-line {
  width: 20px;
  height: 2px;
  border-top: 2px dashed;
  opacity: 0.5;
}
.cpc .chart-wrapper {
  background: var(--cpc-surface);
  border: 1px solid var(--cpc-border);
  border-radius: 4px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  flex: 1;
  min-height: 0;
}
.cpc .chart-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, var(--cpc-ai-glow) 0%, transparent 70%);
  pointer-events: none;
}
.cpc canvas {
  display: block;
  width: 100% !important;
}
.cpc .forecast-badge {
  position: absolute;
  top: 24px;
  right: 24px;
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--cpc-accent);
  border: 1px solid rgba(255, 230, 102, 0.3);
  padding: 4px 8px;
  background: rgba(255, 230, 102, 0.05);
}
.cpc .stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-top: 1px;
  background: var(--cpc-border);
}
.cpc .stat-card {
  background: var(--cpc-surface);
  padding: 16px 20px;
  position: relative;
  overflow: hidden;
}
.cpc .stat-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--cpc-human);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s ease;
}
.cpc .stat-card.ai-card::after { background: var(--cpc-ai); }
.cpc .stat-card.accent-card::after { background: var(--cpc-accent); }
.cpc .stat-card.reveal::after { transform: scaleX(1); }
.cpc .stat-label {
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--cpc-muted);
  margin-bottom: 4px;
}
.cpc .stat-value {
  font-family: 'Gelica', serif;
  font-size: 24px;
  font-weight: 500;
  color: #ffffff;
  line-height: 1;
}
.cpc .stat-sub {
  font-size: 10px;
  color: var(--cpc-muted);
  margin-top: 4px;
}
.cpc .cpc-tooltip {
  position: fixed;
  background: #1a1e28;
  border: 1px solid var(--cpc-border);
  padding: 12px 16px;
  font-size: 11px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 100;
  min-width: 180px;
  font-family: 'DM Mono', monospace;
}
.cpc .cpc-tooltip.visible { opacity: 1; }
.cpc .cpc-tooltip .tooltip-year {
  color: var(--cpc-accent);
  font-size: 13px;
  margin-bottom: 8px;
}
.cpc .cpc-tooltip .tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--cpc-muted);
}
.cpc .cpc-tooltip .tooltip-row span:last-child {
  color: var(--cpc-text);
  font-weight: 500;
}
.cpc .cpc-tooltip .tooltip-forecast {
  margin-top: 8px;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cpc-accent);
  opacity: 0.7;
}

/* ── Slide-up animation ──────────────────────── */
@keyframes slideUpIn {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.slide[data-title="Learning Organization"].active .slide-inner > h1 {
  animation: slideUpIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* ── BS Sticker ──────────────────────────────── */
.bs-sticker {
  position: absolute;
  bottom: 30px;
  right: 30px;
  width: 280px;
  z-index: 10;
  pointer-events: none;
  --sticker-rotate: -12deg;
}

/* ── Agile Team Cards ────────────────────────── */
.agile-cards {
  display: flex;
  gap: 2em;
  flex: 1;
  align-items: stretch;
}
.agile-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2em 1.5em;
  border-radius: 16px;
  text-align: center;
  background: transparent;
  transition: flex 0.45s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.35s ease, color 0.35s ease, opacity 0.35s ease;
}
.agile-card.fragment {
  opacity: 1 !important;
  transform: none !important;
}
.agile-icons {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin-bottom: 0.75em;
}
.agile-icon {
  height: 80px;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), filter 0.35s ease;
}
.agile-icon-robot {
  height: 72px;
  opacity: 0;
  width: 0;
  overflow: hidden;
  transition: opacity 0.35s ease, width 0.35s ease, filter 0.35s ease;
}
.agile-card.agile-active .agile-icon-robot {
  opacity: 1;
  width: 72px;
}
.agile-plus {
  font-family: 'Gelica', serif;
  font-size: 2.4em;
  font-weight: 500;
  opacity: 0;
  width: 0;
  margin-right: 0.4em;
  overflow: hidden;
  transition: opacity 0.35s ease, width 0.35s ease;
}
.agile-card.agile-active .agile-plus {
  opacity: 0.7;
  width: 1em;
}
.agile-card h3 { margin: 0; }
.agile-heading { display: none; }
.agile-card.agile-active h3:not(.agile-heading) { display: none; }
.agile-card.agile-active .agile-heading {
  display: block;
  margin-bottom: 0.5em;
}
.agile-bullets {
  list-style: none;
  padding: 0;
  margin: 1em auto 0;
  text-align: left;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  width: fit-content;
  transition: max-height 0.5s ease 0.1s, opacity 0.4s ease 0.2s;
}
.agile-bullets li {
  padding: 0.3em 0;
  font-size: 0.92em;
  line-height: 1.5;
}
.agile-bullets li::before {
  content: '\2192  ';
  opacity: 0.5;
}
.agile-card.agile-active {
  background: var(--burgundy);
  color: var(--cream);
  flex: 2;
  justify-content: flex-start;
  padding-top: 3em;
}
.agile-card.agile-active .agile-icons .agile-icon {
  transform: translateY(-8px) scale(1.15);
  filter: brightness(0) invert(1);
}
.agile-card.agile-active .agile-bullets {
  max-height: 400px;
  opacity: 1;
}
.agile-cards:has(.agile-active) .agile-card:not(.agile-active) {
  opacity: 0.3;
}

/* ── Print ────────────────────────────────────── */
/* ── Mind map ─────────────────────────────────── */

.mind-map {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6em;
  flex: 1;
  min-height: 0;
  padding: 1em 0;
  position: relative;
}
.mind-map-source {
  font-family: "Gelica", serif;
  font-weight: 500;
  font-size: 2.4em;
  text-align: center;
  padding: 0.6em 1em;
  border: 2px solid currentColor;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  opacity: 0.9;
  flex-shrink: 0;
  z-index: 1;
}
.mind-map-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.mind-map-lines path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.mind-map-lines path.mind-map-visible { opacity: 0.45; }
.mind-map-targets {
  display: flex;
  flex-direction: column;
  gap: 1.2em;
  z-index: 1;
}
.mind-map-node {
  font-size: 1.5em;
  padding: 0.5em 1.4em;
  border-radius: 8px;
  border: 1px solid currentColor;
  background-color: rgba(255, 255, 255, 0.2);
  opacity: 0;
  white-space: nowrap;
  transition: opacity 0.4s ease, border-color 0.4s ease;
}
.mind-map-node.visible {
  opacity: 1;
  border-color: var(--teal);
}

@media print {
  .deck { position: static; }
  .slide {
    position: relative;
    opacity: 1;
    pointer-events: auto;
    page-break-after: always;
  }
  .progress, .slide-counter, .present-btn { display: none; }
}
