:root {
  --bg-dark: #0E1A15;
  --bg-cover: #141413;
  --bg-light: #F1EFE7;
  --accent-orange: #E8833A;
  --bar-orange: #E8833A;
  --bar-green: #7AB178;
  --text-dark: #14211C;
  --text-light: #F1EFE7;
  --text-muted: #B9C4BC;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #090f0c;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  user-select: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#viewport {
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* 16:9 Stage scaled dynamically to fit screen */
#stage {
  width: 1280px;
  height: 720px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.65);
  transform-origin: center center;
}

/* Individual Slides */
.slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 58px 85px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}

.slide.active {
  opacity: 1;
  pointer-events: auto;
  z-index: 2;
}

/* Themes matching original PPTX */
.theme-cover {
  background-color: #141413;
  color: var(--text-light);
}

.theme-light {
  background: linear-gradient(155deg, #F1EFE7 0%, #E3EBDB 55%, #C9DDBE 100%);
  color: var(--text-dark);
}

.theme-dark {
  background: linear-gradient(180deg, #0E1A15 0%, #1B3A2C 55%, #2F6140 100%);
  color: var(--text-light);
}

/* Persistent Corner Leaves (Anchored strictly at corners) */
.leaf-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  overflow: hidden;
}

.leaf-tr {
  position: absolute;
  top: 0;
  right: 0;
  width: 347px;
  height: 347px;
  transform-origin: 100% 0%;
  transition: transform 0.65s cubic-bezier(0.45, 0.05, 0.25, 1), width 0.65s ease, height 0.65s ease;
  will-change: transform;
}

.leaf-tr.cover-size {
  width: 520px;
  height: 520px;
}

.leaf-bl-anchor {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 240px;
  height: 240px;
  transform-origin: 0% 100%;
  transition: transform 0.65s cubic-bezier(0.45, 0.05, 0.25, 1);
  will-change: transform;
}

.leaf-bl-anchor img {
  width: 100%;
  height: 100%;
  display: block;
  transform: rotate(180deg);
}

.leaf-tr.expanded {
  transform: scale(2.85);
}

.leaf-tr.cover-size.expanded {
  transform: scale(1.92);
}

.leaf-bl-anchor.expanded {
  transform: scale(3.95);
}

/* Typography & Layout Components */
h1, h2, h3, .kpi-num, .card-title {
  font-family: 'Space Grotesk', sans-serif;
}

.slide-header {
  position: relative;
  z-index: 5;
}

.slide-footer {
  position: relative;
  z-index: 5;
}

.slide-title {
  font-size: 38px;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 36px;
  position: relative;
  z-index: 5;
}

.theme-light .slide-title {
  color: #14211C;
}

.theme-dark .slide-title {
  color: #F1EFE7;
}

/* Slide 1: Cover */
.cover-header {
  position: relative;
  z-index: 5;
}

.cover-kicker {
  font-size: 21px;
  font-weight: 500;
  color: var(--accent-orange);
  margin-top: 26px;
}

.cover-main {
  margin-top: 135px;
  position: relative;
  z-index: 5;
}

.cover-title {
  font-size: 76px;
  font-weight: 700;
  color: #F1EFE7;
  line-height: 1.05;
  margin-bottom: 18px;
}

.cover-sub {
  font-size: 23px;
  color: #F1EFE7;
  font-weight: 400;
  max-width: 820px;
}

.cover-footer {
  margin-top: auto;
  margin-bottom: 24px;
  font-size: 15px;
  line-height: 1.6;
  color: #B9C4BC;
  position: relative;
  z-index: 5;
}

.cover-authors {
  font-style: normal;
}

/* 3-Column Grid */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  position: relative;
  z-index: 5;
  list-style: none;
}

.card-light {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(78, 143, 95, 0.25);
  border-radius: 14px;
  padding: 26px;
  display: flex;
  flex-direction: column;
}

.card-dark {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(127, 183, 126, 0.3);
  border-radius: 14px;
  padding: 26px;
  display: flex;
  flex-direction: column;
}

.card-img-wrap {
  width: 100%;
  height: 200px;
  background: #FFFFFF;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-img-wrap.contain img {
  object-fit: contain;
  padding: 8px;
}

.card-title {
  font-size: 21px;
  font-weight: 700;
  color: var(--accent-orange);
  margin-bottom: 12px;
}

.card-text {
  font-size: 16.5px;
  line-height: 1.45;
}

.kpi-num {
  font-size: 50px;
  font-weight: 700;
  color: var(--accent-orange);
  line-height: 1.1;
  margin-bottom: 16px;
}

.bottom-note {
  margin-top: 32px;
  font-size: 17px;
  line-height: 1.45;
  position: relative;
  z-index: 5;
}

.bottom-note-spaced {
  margin-top: 44px;
}

/* Slide 4 Table */
.intro-lead {
  font-size: 17.5px;
  line-height: 1.45;
  margin-bottom: 28px;
  max-width: 1050px;
  position: relative;
  z-index: 5;
}

.intro-lead-compact {
  margin-bottom: 6px;
}

table.comp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15.5px;
  position: relative;
  z-index: 5;
  background: rgba(255, 255, 255, 0.65);
}

table.comp-table thead th {
  background-color: #14211C;
  color: #F1EFE7;
  text-align: left;
  padding: 15px 18px;
  font-weight: 700;
  border: 1px solid #141E1A;
}

table.comp-table .col-alt {
  width: 37%;
}

table.comp-table .col-cost {
  width: 36%;
}

table.comp-table .col-limit {
  width: 27%;
}

table.comp-table tbody th,
table.comp-table tbody td {
  padding: 14px 18px;
  border: 1px solid #C0BFB8;
  color: #14211C;
  text-align: left;
  font-weight: 400;
}

table.comp-table tr.highlight th,
table.comp-table tr.highlight td {
  background-color: #E8833A;
  color: #14211C;
  font-weight: 600;
  border-color: #B96B31;
}

/* Slide 6 Two Columns */
.grid-2-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  position: relative;
  z-index: 5;
}

.sub-heading {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 16px;
  color: #14211C;
}

ul.clean-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 17px;
  line-height: 1.45;
}

ul.clean-list li {
  position: relative;
  padding-left: 20px;
}

ul.clean-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent-orange);
  font-weight: 700;
}

/* Slide 7 Big Investment Number */
.hero-investment {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 76px;
  font-weight: 700;
  color: var(--accent-orange);
  line-height: 1.05;
  margin-bottom: 34px;
  position: relative;
  z-index: 5;
}

/* Slide 8 Interactive Animated Chart */
.chart-figure {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
}

.chart-wrapper {
  width: 100%;
  height: 275px;
  margin: 14px 0 26px 0;
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
  padding: 0 8px;
  list-style: none;
}

/* Zero baseline across the chart */
.chart-wrapper::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 192px;
  height: 1.5px;
  background: rgba(241, 239, 231, 0.35);
  pointer-events: none;
}

.chart-col {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

/* Column delays and heights */
.chart-col.col-1  { --delay: 0ms;   --h: 35.2px; }
.chart-col.col-2  { --delay: 75ms;  --h: 38.4px; }
.chart-col.col-3  { --delay: 150ms; --h: 42.0px; }
.chart-col.col-4  { --delay: 225ms; --h: 34.3px; }
.chart-col.col-5  { --delay: 300ms; --h: 25.5px; }
.chart-col.col-6  { --delay: 375ms; --h: 11.0px; }
.chart-col.col-7  { --delay: 450ms; --h: 10.3px; }
.chart-col.col-8  { --delay: 525ms; --h: 32.3px; }
.chart-col.col-9  { --delay: 600ms; --h: 61.8px; }
.chart-col.col-10 { --delay: 675ms; --h: 90.1px; }
.chart-col.col-11 { --delay: 750ms; --h: 118.5px; }
.chart-col.col-12 { --delay: 825ms; --h: 152.0px; }

.pos-half {
  height: 192px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 1px;
}

.neg-half {
  height: 83px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding-top: 1px;
}

.bar {
  width: 100%;
  max-width: 68px;
  height: 0px;
  transition: height 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--delay, 0ms);
  will-change: height;
}

.bar.pos {
  background: var(--bar-green);
  border-radius: 5px 5px 0 0;
}

.bar.neg {
  background: var(--bar-orange);
  border-radius: 0 0 5px 5px;
}

.slide.active.chart-animate .bar {
  height: var(--h);
}

.bar-val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #F1EFE7;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  transition-delay: calc(var(--delay, 0ms) + 280ms);
}

.bar-val.pos {
  margin-bottom: 6px;
}

.bar-val.neg {
  margin-top: 6px;
}

.slide.active.chart-animate .bar-val {
  opacity: 1;
  transform: translateY(0);
}

.bar-month {
  font-size: 15px;
  font-weight: 600;
  color: #B9C4BC;
}

.bar-month.pos {
  margin-bottom: 8px;
}

.bar-month.neg {
  margin-top: 8px;
}

.chart-col:hover .bar {
  filter: brightness(1.12);
}

.viability-footer {
  font-size: 21px;
  font-weight: 600;
  color: var(--accent-orange);
  position: relative;
  z-index: 5;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease 0.85s, transform 0.5s ease 0.85s;
}

.slide.active.chart-animate .viability-footer {
  opacity: 1;
  transform: translateY(0);
}

/* End-of-Presentation Banner on Last Slide */
.end-cta-wrap {
  margin-top: 18px;
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 14px;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.5s ease 1.15s, transform 0.5s ease 1.15s;
}

.slide.active.chart-animate .end-cta-wrap {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.btn-download-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--accent-orange);
  color: #14211C;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(232, 131, 58, 0.35);
  transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

.btn-download-inline:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 8px 25px rgba(232, 131, 58, 0.5);
}

.btn-download-inline:disabled {
  opacity: 0.7;
  cursor: wait;
}

/* End-of-Presentation Modal Overlay (shown when advancing past the last slide) */
.end-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: rgba(14, 26, 21, 0.88);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.end-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.end-card {
  background: linear-gradient(165deg, #162B22 0%, #0E1A15 100%);
  border: 1px solid rgba(122, 177, 120, 0.35);
  border-radius: 20px;
  padding: 44px 52px;
  max-width: 580px;
  width: 90%;
  text-align: center;
  color: var(--text-light);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65);
  transform: translateY(16px) scale(0.97);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.end-overlay.visible .end-card {
  transform: translateY(0) scale(1);
}

.end-badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--bar-green);
  background: rgba(122, 177, 120, 0.14);
  border: 1px solid rgba(122, 177, 120, 0.3);
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.end-title {
  font-size: 34px;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 12px;
}

.end-desc {
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.end-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.btn-primary-pdf {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background-color: var(--accent-orange);
  color: #14211C;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 17px;
  font-weight: 700;
  padding: 15px 26px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.btn-primary-pdf:hover {
  transform: translateY(-2px);
  filter: brightness(1.07);
}

.btn-primary-pdf:disabled {
  opacity: 0.7;
  cursor: wait;
}

.end-secondary-actions {
  display: flex;
  gap: 12px;
  width: 100%;
}

.btn-secondary-end {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-light);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 11px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-secondary-end:hover {
  background: rgba(255, 255, 255, 0.16);
}

/* Minimal subtle HUD controls at bottom-right */
.hud {
  position: fixed;
  bottom: 14px;
  right: 18px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(14, 26, 21, 0.72);
  backdrop-filter: blur(8px);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #F1EFE7;
  font-size: 13px;
  opacity: 0.35;
  transition: opacity 0.25s ease;
}

.hud:hover,
.hud.finished {
  opacity: 1;
}

.hud button {
  background: transparent;
  border: none;
  color: #F1EFE7;
  cursor: pointer;
  font-size: 15px;
  padding: 2px 6px;
  border-radius: 6px;
}

.hud button:hover {
  background: rgba(255, 255, 255, 0.15);
}

.hud .hud-pdf-btn {
  display: none;
  align-items: center;
  gap: 4px;
  background: var(--accent-orange);
  color: #14211C;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  margin-left: 4px;
}

.hud.finished .hud-pdf-btn {
  display: inline-flex;
}

.hud .hud-pdf-btn:hover {
  background: #f0924d;
}

/* Offscreen stage used for instant multi-slide PDF rendering */
.pdf-capture-stage {
  position: fixed !important;
  left: -99999px !important;
  top: 0 !important;
  width: 1280px !important;
  height: 720px !important;
  transform: none !important;
  box-shadow: none !important;
  z-index: -1 !important;
}

.pdf-capture-stage *,
.pdf-capture-stage *::before,
.pdf-capture-stage *::after {
  transition: none !important;
  animation: none !important;
}

/* Print / Native Save-as-PDF Stylesheet */
@media print {
  @page {
    size: 1280px 720px;
    margin: 0;
  }

  html, body {
    width: 1280px !important;
    height: auto !important;
    overflow: visible !important;
    background-color: #090f0c !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  #viewport {
    width: 1280px !important;
    height: auto !important;
    display: block !important;
    overflow: visible !important;
  }

  #stage {
    width: 1280px !important;
    height: auto !important;
    transform: none !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  #stage > .leaf-layer,
  .hud,
  .end-overlay,
  .end-cta-wrap {
    display: none !important;
  }

  .slide {
    position: relative !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    width: 1280px !important;
    height: 720px !important;
    page-break-after: always;
    break-after: page;
    overflow: hidden !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .slide:last-of-type {
    page-break-after: auto;
    break-after: auto;
  }

  .slide .bar {
    height: var(--h) !important;
    transition: none !important;
  }

  .slide .bar-val,
  .slide .viability-footer {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .print-leaf-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 20;
    overflow: hidden;
  }
}
