/* Apple / iPhone keynote aesthetic — 16:9 slides */
:root {
  --bg: #f5f5f7;
  --bg-elevated: #ffffff;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --accent: #0071e3;
  --accent-soft: rgba(0, 113, 227, 0.12);
  --brand: #e85d24;
  --brand-soft: rgba(232, 93, 36, 0.14);
  --green: #34c759;
  --purple: #af52de;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 24px 80px rgba(0, 0, 0, 0.1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --slide-w: min(96vw, 1280px);
  --slide-h: calc(var(--slide-w) * 9 / 16);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  background: #000;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ── Chrome UI ── */
.chrome {
  position: fixed;
  z-index: 100;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(29, 29, 31, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #f5f5f7;
  font-size: 13px;
}
.chrome-brand { font-weight: 600; letter-spacing: -0.02em; opacity: 0.9; }
.chrome-actions { display: flex; gap: 8px; align-items: center; }
.chrome button {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  padding: 7px 14px;
  border: none;
  border-radius: 980px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  transition: background 0.2s, transform 0.15s;
}
.chrome button:hover { background: rgba(255, 255, 255, 0.22); }
.chrome button.primary { background: var(--accent); }
.chrome button.primary:hover { background: #0077ed; }
.slide-counter { font-variant-numeric: tabular-nums; opacity: 0.7; min-width: 4em; text-align: center; }

/* ── Deck viewport ── */
.viewport {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 16px 72px;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, #2a2a2e 0%, #000 70%);
}

.deck { position: relative; width: var(--slide-w); height: var(--slide-h); }

.slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 48px 56px 44px;
  background: var(--bg);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: scale(0.96) translateY(12px);
  transition: opacity 0.45s cubic-bezier(0.25, 0.1, 0.25, 1),
    transform 0.45s cubic-bezier(0.25, 0.1, 0.25, 1),
    visibility 0.45s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.slide.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateY(0);
  z-index: 2;
}

.slide.prev { transform: scale(0.98) translateX(-24px); opacity: 0; }

/* Decorative blobs */
.slide::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--brand-soft) 0%, transparent 70%);
  top: -180px;
  right: -120px;
  pointer-events: none;
}

.slide.dark {
  background: linear-gradient(145deg, #1d1d1f 0%, #2c2c2e 50%, #1a1a1c 100%);
  color: #f5f5f7;
}
.slide.dark::before {
  background: radial-gradient(circle, rgba(0, 113, 227, 0.25) 0%, transparent 70%);
  top: auto;
  bottom: -200px;
  left: -100px;
  right: auto;
}
.slide.dark .text-secondary { color: #a1a1a6; }
.slide.dark .glass { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.12); }

/* ── Typography ── */
.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 8px;
}
.slide.dark .eyebrow { color: #64d2ff; }

h1.slide-title {
  font-size: clamp(28px, 3.2vw, 44px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 12px;
}

h2.slide-heading {
  font-size: clamp(22px, 2.4vw, 32px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 20px;
}

.subtitle {
  font-size: clamp(15px, 1.5vw, 20px);
  color: var(--text-secondary);
  line-height: 1.45;
  max-width: 85%;
}
.slide.dark .subtitle { color: #a1a1a6; }

.slide-body { flex: 1; display: flex; flex-direction: column; justify-content: center; min-height: 0; }
.slide-footer {
  font-size: 11px;
  color: var(--text-secondary);
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.slide.dark .slide-footer { color: #636366; border-color: rgba(255, 255, 255, 0.08); }

/* ── Layout helpers ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; flex: 1; align-content: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; flex: 1; align-content: center; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.split { display: grid; grid-template-columns: 1fr 1.1fr; gap: 32px; align-items: center; flex: 1; }

/* ── Glass cards ── */
.glass {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}

.card {
  background: var(--bg-elevated);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0, 0, 0, 0.04);
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.card-icon svg { width: 26px; height: 26px; }
.card-icon.blue { background: var(--accent-soft); color: var(--accent); }
.card-icon.orange { background: var(--brand-soft); color: var(--brand); }
.card-icon.green { background: rgba(52, 199, 89, 0.14); color: var(--green); }
.card-icon.purple { background: rgba(175, 82, 222, 0.14); color: var(--purple); }

.card h3 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.card p {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
  flex: 1;
}

/* ── Stat blocks ── */
.stat {
  text-align: center;
  padding: 18px 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.stat-value {
  font-size: clamp(24px, 2.8vw, 36px);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--accent);
  line-height: 1;
}
.stat-value.brand { color: var(--brand); }
.stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 6px;
  line-height: 1.35;
}

/* ── Big idea quote ── */
.hero-quote {
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.35;
  text-align: center;
  padding: 28px 36px;
  background: linear-gradient(135deg, var(--accent-soft), var(--brand-soft));
  border-radius: var(--radius);
  margin: 16px 0;
}

/* ── Lists ── */
.bullet-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.bullet-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  line-height: 1.45;
}
.bullet-list .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 6px;
  flex-shrink: 0;
}
.bullet-list .dot.brand { background: var(--brand); }

/* ── Agenda ── */
.agenda { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; }
.agenda-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.agenda-num {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Flow steps ── */
.flow {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex: 1;
}
.flow-step {
  flex: 1;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 14px 12px;
  text-align: center;
  box-shadow: var(--shadow);
  position: relative;
}
.flow-step::after {
  content: "›";
  position: absolute;
  right: -14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 18px;
  font-weight: 300;
}
.flow-step:last-child::after { display: none; }
.flow-step .num {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
}
.flow-step p { font-size: 11px; line-height: 1.4; color: var(--text-secondary); }

/* ── Visual / illustration ── */
.visual {
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  min-height: 200px;
  background: linear-gradient(160deg, #e8e8ed 0%, #d2d2d7 100%);
}
.visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.visual-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 50%);
  display: flex;
  align-items: flex-end;
  padding: 16px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

/* CSS house illustration */
.illus-home {
  width: 100%;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #87ceeb 0%, #e8f4fc 45%, #f5f5f7 100%);
  border-radius: var(--radius);
}
.illus-home svg { width: 70%; max-width: 280px; height: auto; filter: drop-shadow(0 8px 24px rgba(0,0,0,0.12)); }

/* APR diagram */
.apr-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 0;
}
.apr-node {
  width: 140px;
  padding: 16px;
  border-radius: var(--radius);
  text-align: center;
  font-size: 12px;
  font-weight: 600;
}
.apr-node.adv { background: var(--brand-soft); color: var(--brand); }
.apr-node.pub { background: var(--accent-soft); color: var(--accent); }
.apr-node.read { background: rgba(52, 199, 89, 0.14); color: var(--green); }
.apr-arrow { font-size: 24px; color: var(--text-secondary); font-weight: 300; }

/* Compare columns */
.vs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; flex: 1; }
.vs-col h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.vs-col.pro h3 { color: var(--green); }
.vs-col.con h3 { color: #ff3b30; }
.vs-col ul { list-style: none; font-size: 12px; line-height: 1.55; color: var(--text-secondary); }
.vs-col li { padding: 6px 0; border-bottom: 1px solid rgba(0,0,0,0.05); }
.vs-col li::before { margin-right: 8px; }
.vs-col.pro li::before { content: "✓"; color: var(--green); font-weight: 700; }
.vs-col.con li::before { content: "!"; color: #ff3b30; font-weight: 700; }

/* Title slide special */
.slide-title-hero {
  justify-content: center;
  align-items: center;
  text-align: center;
  background: linear-gradient(160deg, #f5f5f7 0%, #e8e8ed 40%, #f5f5f7 100%);
}
.slide-title-hero .logo-ring {
  width: 88px;
  height: 88px;
  margin: 0 auto 24px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--brand), #ff9f5a);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 40px rgba(232, 93, 36, 0.35);
}
.slide-title-hero .logo-ring svg { width: 44px; height: 44px; color: #fff; }
.slide-title-hero h1 { font-size: clamp(32px, 4vw, 52px); max-width: 90%; margin: 0 auto 16px; }
.slide-title-hero .meta { font-size: 15px; color: var(--text-secondary); }
.slide-title-hero .pill {
  display: inline-block;
  margin-top: 20px;
  padding: 8px 18px;
  background: rgba(0,0,0,0.06);
  border-radius: 980px;
  font-size: 12px;
  font-weight: 500;
}

/* Thank you */
.slide-thanks {
  justify-content: center;
  align-items: center;
  text-align: center;
}
.slide-thanks h1 { font-size: 48px; font-weight: 700; letter-spacing: -0.03em; }
.slide-thanks p { font-size: 18px; color: var(--text-secondary); margin-top: 12px; }

/* Nav dots */
.nav-dots {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 50;
  padding: 8px 12px;
  background: rgba(29, 29, 31, 0.65);
  backdrop-filter: blur(12px);
  border-radius: 980px;
}
.nav-dots button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.35);
  cursor: pointer;
  padding: 0;
  transition: transform 0.2s, background 0.2s;
}
.nav-dots button.active { background: #fff; transform: scale(1.25); }
.nav-dots button:hover { background: rgba(255,255,255,0.7); }

/* Table mini */
.mini-table {
  width: 100%;
  font-size: 11px;
  border-collapse: collapse;
  margin-top: 8px;
}
.mini-table th, .mini-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.mini-table th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Print / PDF export */
@media print {
  body { background: #fff; overflow: visible; }
  .chrome, .nav-dots { display: none !important; }
  .viewport { position: static; padding: 0; background: #fff; display: block; }
  .deck { width: 100%; height: auto; }
  .slide {
    position: relative;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    page-break-after: always;
    break-after: page;
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
  }
}

@media (max-width: 900px) {
  .slide { padding: 32px 28px; }
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; }
  .flow { flex-direction: column; }
  .flow-step::after { display: none; }
}
