/* ═══════════════════════════════════════════════════════════════════════════
   Yggdrasil CX v2 · Deck styles
   Full-bleed 16:9 slides that share tokens, type, and color with the site.
   Keyboard navigable. Print-to-PDF ready (one slide per page).
   ═══════════════════════════════════════════════════════════════════════════ */

html, body { height: 100%; overflow: hidden; background: var(--bg-dark); }
body {
  font-family: var(--f-sans);
  color: var(--ink-1);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

/* ── Stage ───────────────────────────────────────────────────────────── */
.stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: linear-gradient(180deg, #0f0d0b 0%, #1a1712 100%);
}

.slide-frame {
  position: relative;
  width: min(calc(100vh * 16 / 9 - 80px), calc(100vw - 80px));
  aspect-ratio: 16 / 9;
  background: var(--bg);
  border-radius: 12px;
  box-shadow: 0 60px 160px rgba(0,0,0,0.5), 0 16px 48px rgba(0,0,0,0.3);
  overflow: hidden;
}

.slides {
  position: absolute;
  inset: 0;
}

.slide {
  position: absolute;
  inset: 0;
  padding: 64px 72px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translate3d(40px, 0, 0) scale(0.98);
  pointer-events: none;
  background: var(--bg);
}
.slide.active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.slide.dark { background: var(--bg-dark); color: #ece8e2; }
.slide.dark h1, .slide.dark h2, .slide.dark h3 { color: #f7f2ec; }
.slide.dark em { color: #e0b0e0; }
.slide.dark .slide-index { color: #c7b8c9; }
.slide.dark .slide-index::before { background: var(--purple-300); }
.slide.tint { background: var(--bg-tint); }

/* ── Slide building blocks ─────────────────────────────────────────── */
.slide-index {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-4);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
.slide-index::before {
  content: "";
  width: 12px; height: 10px;
  background: var(--accent);
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
}
.slide h1, .slide h2 {
  font-family: var(--f-display);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.018em;
  color: var(--ink-0);
  margin: 0 0 24px;
  text-wrap: balance;
}
.slide h1 { font-size: clamp(48px, 5vw, 84px); line-height: 1.0; }
.slide h2 { font-size: clamp(32px, 3vw, 52px); }
.slide h1 em, .slide h2 em { font-style: italic; color: var(--accent); }
.slide .lead {
  font-family: var(--f-sans);
  font-size: clamp(18px, 1.4vw, 24px);
  color: var(--ink-2);
  line-height: 1.4;
  max-width: 40em;
  font-weight: 300;
}
.slide.dark .lead { color: #d7cec5; }
.slide .body-text { font-size: 16px; color: var(--ink-3); line-height: 1.55; }
.slide.dark .body-text { color: #d7cec5; }
.slide .body-text strong { color: var(--ink-0); }
.slide.dark .body-text strong { color: #f7f2ec; }

/* ── Page chrome (top bar with brand + progress) ─────────────────── */
.slide-top {
  position: absolute;
  top: 32px; left: 72px; right: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.slide.dark .slide-top { color: #a29c96; }
.slide-brand {
  display: inline-flex; align-items: center; gap: 8px;
}
.slide-brand img { height: 18px; }
.slide-count { font-variant-numeric: tabular-nums; }

/* ── Cover ───────────────────────────────────────────────────────── */
.slide.cover {
  background: linear-gradient(180deg, #0f0d0b 0%, #1a1712 60%, #2d1430 100%);
  color: #f7f2ec;
  justify-content: center;
  align-items: flex-start;
  padding: 80px 96px;
  position: relative;
  overflow: hidden;
}
.slide.cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1000px 500px at 70% 20%, rgba(152,19,156,0.35), transparent 55%),
    radial-gradient(800px 400px at 20% 90%, rgba(10,110,120,0.22), transparent 55%);
  pointer-events: none;
}
.slide.cover .slide-eyebrow {
  font-family: var(--f-mono);
  font-size: 13px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #d087d0;
  margin-bottom: 32px;
  position: relative;
  z-index: 2;
}
.slide.cover h1 {
  font-size: clamp(72px, 10vw, 160px);
  color: #f7f2ec;
  line-height: 0.98;
  max-width: 14ch;
  position: relative;
  z-index: 2;
}
.slide.cover h1 em { color: #e0b0e0; font-style: italic; }
.slide.cover .cover-sub {
  margin-top: 40px;
  font-family: var(--f-display);
  font-style: italic;
  font-size: clamp(22px, 2vw, 36px);
  color: #d7cec5;
  max-width: 30ch;
  position: relative;
  z-index: 2;
}
.slide.cover .cover-foot {
  position: absolute;
  bottom: 72px; left: 96px; right: 96px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #a29c96;
  z-index: 2;
}

/* ── Grids ────────────────────────────────────────────────────────── */
.slide-two {
  flex: 1;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 56px;
  align-items: center;
}
.slide-two.gap-sm { gap: 32px; }
.slide-three {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  align-content: center;
}
.slide-four {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 24px;
  align-content: center;
}
.slide-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.slide.dark .card {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
  color: #ece8e2;
}
.slide.tint .card { background: var(--bg); }
.card .num {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.12em;
}
.card h3 {
  font-family: var(--f-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--ink-0);
  margin: 0;
}
.slide.dark .card h3 { color: #f7f2ec; }
.card p { font-size: 15px; color: var(--ink-3); line-height: 1.55; margin: 0; }
.slide.dark .card p { color: #d7cec5; }

/* Huge stat display */
.big-stat {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.big-stat .number {
  font-family: var(--f-display);
  font-size: clamp(80px, 10vw, 180px);
  font-weight: 500;
  line-height: 0.9;
  color: var(--accent);
  letter-spacing: -0.03em;
}
.big-stat .caption {
  font-size: 20px;
  color: var(--ink-2);
  max-width: 22ch;
  line-height: 1.3;
}
.slide.dark .big-stat .caption { color: #d7cec5; }

/* Pillar tile (rich) */
.pillar-tile {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.pillar-tile .pillar-chrome {
  aspect-ratio: 5/3;
  background: linear-gradient(135deg, var(--accent-wash), var(--bg-soft));
  border-radius: 8px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50,5 90,27.5 90,72.5 50,95 10,72.5 10,27.5' fill='none' stroke='%2398139C' stroke-width='1' opacity='0.35'/></svg>");
  background-size: 44px 44px;
  background-repeat: repeat;
}
.pillar-tile h3 { font-size: 22px; margin: 0; }
.pillar-tile p { font-size: 14px; color: var(--ink-3); margin: 0; line-height: 1.55; }

/* Tier table */
.slide .tier-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.slide .tier-table th, .slide .tier-table td { padding: 14px 18px; border-bottom: 1px solid rgba(255,255,255,0.08); text-align: left; }
.slide.dark .tier-table { color: #ece8e2; }
.slide.dark .tier-table th { color: #a29c96; font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 500; }

/* Capability hex grid */
.cap-hex-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;
}
.cap-hex-cell {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  text-align: center;
}
.cap-hex-cell .hex {
  width: 84px; height: 84px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  font-family: var(--f-mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.cap-hex-cell.star .hex::after {
  content: "★";
  position: absolute;
}
.cap-hex-cell .cap-label {
  font-size: 13px;
  color: var(--ink-1);
  font-weight: 500;
}
.slide.dark .cap-hex-cell .cap-label { color: #ece8e2; }

/* Steps (timeline feel) */
.timeline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  align-content: center;
}
.timeline-step {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}
.timeline-step .num {
  font-family: var(--f-display);
  font-size: 72px;
  font-weight: 500;
  color: var(--accent);
  line-height: 1;
}
.timeline-step .dur {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.timeline-step h3 { font-size: 20px; margin: 0; }
.timeline-step p { font-size: 14px; color: var(--ink-3); margin: 0; line-height: 1.5; }

/* CTA */
.cta-slide {
  background:
    radial-gradient(1200px 600px at 70% 30%, rgba(152,19,156,0.24), transparent 55%),
    linear-gradient(180deg, #0f0d0b 0%, #1a1712 100%);
  color: #f7f2ec;
  justify-content: center;
}
.cta-inner {
  max-width: 52ch;
  display: flex; flex-direction: column; gap: 28px;
}
.cta-inner h1 { color: #f7f2ec; }
.cta-inner p { color: #d7cec5; font-size: 20px; line-height: 1.4; }
.cta-buttons { display: flex; gap: 16px; flex-wrap: wrap; }
.cta-buttons a {
  display: inline-flex;
  padding: 14px 24px;
  border-radius: 999px;
  font-family: var(--f-sans);
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  font-size: 16px;
}
.cta-buttons .primary { background: var(--accent); color: #fff; }
.cta-buttons .ghost { border: 1px solid rgba(255,255,255,0.3); color: #ece8e2; }
.cta-people { display: flex; gap: 16px; margin-top: 20px; flex-wrap: wrap; }
.cta-person {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,0.05);
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
}
.cta-person .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.cta-person .info { font-size: 13px; }
.cta-person .name { color: #f7f2ec; font-weight: 500; }
.cta-person .role { color: #a29c96; font-size: 11px; }

/* ── Chrome: progress rail + controls ────────────────────────────── */
.deck-chrome {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 50;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: space-between;
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
  color: #d7cec5;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.deck-chrome .hint { opacity: 0.6; }
.deck-chrome .ctrl {
  display: inline-flex; gap: 8px; align-items: center;
}
.deck-chrome button {
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: #ece8e2;
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 180ms;
}
.deck-chrome button:hover { background: rgba(255,255,255,0.14); }

.progress-rail {
  position: fixed;
  left: 0; right: 0; top: 0;
  height: 2px;
  background: rgba(255,255,255,0.06);
  z-index: 55;
}
.progress-rail > div {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--cyan-500));
  width: 0;
  transition: width 360ms var(--ease-out);
}

/* ── Overview grid (press Esc) ───────────────────────────────────── */
.overview {
  position: fixed;
  inset: 0;
  background: rgba(15,13,11,0.96);
  z-index: 90;
  padding: 40px;
  overflow: auto;
  display: none;
}
.overview.open { display: block; }
.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.overview-card {
  aspect-ratio: 16/9;
  background: var(--bg);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 200ms, box-shadow 200ms;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  border: 2px solid transparent;
}
.overview-card:hover { transform: scale(1.02); box-shadow: 0 12px 32px rgba(152,19,156,0.25); }
.overview-card.current { border-color: var(--accent); }
.overview-card .ov-num {
  position: absolute;
  top: 6px; left: 8px;
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--ink-4);
}
.overview-card .ov-title {
  font-family: var(--f-display);
  font-size: 14px;
  color: var(--ink-1);
  text-align: center;
}

/* ── Export mode (body[data-mode="export"]) — used to capture slides as PNG ── */
body[data-mode="export"] { background: #000; }
body[data-mode="export"] .stage { padding: 0; background: #000; }
body[data-mode="export"] .slide-frame {
  width: 100vw;
  height: 100vh;
  border-radius: 0;
  box-shadow: none;
  aspect-ratio: auto;
}
body[data-mode="export"] .progress-rail,
body[data-mode="export"] .deck-chrome,
body[data-mode="export"] .overview { display: none !important; }
body[data-mode="export"] .slides { position: absolute; inset: 0; }
body[data-mode="export"] .slide {
  position: absolute !important;
  top: 0; left: 0; right: 0; bottom: 0;
  height: auto;
}
body[data-mode="export"] .slide.cover { padding: 80px 96px; }

/* ── Print (PDF export) ──────────────────────────────────────────── */
@media print {
  @page { size: 16in 9in; margin: 0; }
  html, body { overflow: visible; background: #fff; height: auto; }
  .stage, .slide-frame, .slides { all: unset; display: block; }
  .deck-chrome, .progress-rail, .overview { display: none !important; }
  .slide {
    position: relative;
    width: 16in;
    height: 9in;
    page-break-after: always;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto;
    display: flex;
  }
}
