@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-2: #fbfbf8;
  --ink: #0b0f17;
  --muted: #5a6272;
  --muted-2: #7b8290;
  --stroke: rgba(10, 14, 22, 0.12);
  --stroke-2: rgba(10, 14, 22, 0.08);
  --shadow: 0 18px 55px rgba(15, 18, 28, 0.12);
  --shadow-2: 0 10px 28px rgba(15, 18, 28, 0.1);

  /* Ceramic-glaze accents (avoid purple). */
  --aqua: #00a4a6;
  --amber: #ff7a3d;
  --lime: #7bd88f;
  --navy: #0b0f17;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: 0.1px;
}

body {
  overflow-x: hidden;
  overflow-y: auto;
}

#deck {
  position: relative;
  width: min(96vw, 1240px);
  height: auto;
  margin: 86px auto 42px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.slide {
  position: relative;
  display: block;
  padding: 0;
}

.frame {
  width: 100%;
  height: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 18px;
  position: relative;
  z-index: 2;
  padding: 22px 22px 54px;
  border-radius: 28px;
  border: 1px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(135deg, rgba(0, 164, 166, 0.35), rgba(255, 122, 61, 0.32), rgba(123, 216, 143, 0.22)) border-box;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.frame::before {
  content: "";
  position: absolute;
  inset: -2px;
  background:
    radial-gradient(560px 420px at 10% 18%, rgba(0, 164, 166, 0.16), transparent 55%),
    radial-gradient(520px 380px at 96% 10%, rgba(255, 122, 61, 0.14), transparent 56%),
    radial-gradient(540px 420px at 86% 106%, rgba(123, 216, 143, 0.12), transparent 58%);
  pointer-events: none;
  filter: saturate(110%);
}

.frame.full {
  grid-template-columns: 1fr;
}

.frame > div:not(.slide-index) {
  min-width: 0;
  position: relative;
  z-index: 1;
}

.cover {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 14px;
  text-align: left;
  padding-right: min(44vw, 420px);
}

.cover-art {
  position: absolute;
  right: 8px;
  bottom: 10px;
  width: min(42vw, 430px);
  max-width: 430px;
  opacity: 0.98;
  pointer-events: none;
  z-index: 0;
  filter: drop-shadow(0 18px 35px rgba(15, 18, 28, 0.14));
}

.cover-art-frame {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(10, 14, 22, 0.12);
  background: #e8ecec;
  box-shadow: 0 14px 36px rgba(15, 18, 28, 0.14);
}

.cover-art-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(247, 246, 242, 0.02), rgba(247, 246, 242, 0.42)),
    radial-gradient(400px 220px at 80% 0%, rgba(0, 164, 166, 0.12), transparent 65%),
    radial-gradient(300px 180px at 8% 98%, rgba(255, 122, 61, 0.15), transparent 70%);
  z-index: 1;
}

.cover-art img {
  width: 100%;
  aspect-ratio: 1 / 1.02;
  object-fit: cover;
  object-position: 52% 58%;
  display: block;
  filter: saturate(0.85) contrast(1.05) brightness(0.95);
}

.eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 2px;
  background: linear-gradient(90deg, var(--aqua), var(--amber));
  border-radius: 999px;
  display: inline-block;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 650;
  line-height: 1.05;
  color: var(--ink);
}

h1 {
  font-size: clamp(34px, 4vw, 62px);
  letter-spacing: -0.9px;
}

h2 {
  font-size: clamp(24px, 2.7vw, 38px);
  letter-spacing: -0.5px;
}

h3 {
  font-size: clamp(16px, 1.9vw, 22px);
  letter-spacing: -0.25px;
}

p {
  margin: 0 0 10px 0;
  font-size: clamp(13px, 1.2vw, 15px);
  color: var(--muted);
  line-height: 1.52;
}

ul {
  margin: 0;
  padding-left: 18px;
}

li {
  margin-bottom: 7px;
  font-size: clamp(13px, 1.2vw, 15px);
  color: var(--muted);
  line-height: 1.46;
}

.sources-list {
  word-break: break-word;
}

.sources-list a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  margin-bottom: 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 164, 166, 0.25);
  color: #0a5f62;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  background: rgba(0, 164, 166, 0.08);
}

.panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(251, 251, 248, 0.98));
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow-2);
}

.panel h3 {
  margin-bottom: 10px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  color: var(--muted);
}

.mini-table th,
.mini-table td {
  border-bottom: 1px solid var(--stroke-2);
  padding: 8px 8px;
  vertical-align: top;
}

.mini-table th {
  text-align: left;
  color: var(--ink);
  font-weight: 650;
  font-size: 12px;
}

.mini-table td strong {
  color: var(--ink);
  font-weight: 650;
}

.kpi {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke-2);
  background:
    radial-gradient(160px 90px at 20% 10%, rgba(0, 164, 166, 0.11), transparent 65%),
    radial-gradient(160px 90px at 96% 85%, rgba(255, 122, 61, 0.1), transparent 62%),
    rgba(255, 255, 255, 0.78);
}

.kpi h3 {
  margin-bottom: 4px;
  color: var(--navy);
}

.kpi span {
  font-size: 12px;
  color: var(--muted-2);
  line-height: 1.34;
}

.highlight {
  color: var(--ink);
  font-weight: 650;
}

.rule {
  height: 1px;
  background: rgba(10, 14, 22, 0.1);
  margin: 12px 0 14px;
}

.callout {
  border-left: 4px solid transparent;
  border-image: linear-gradient(180deg, var(--aqua), var(--amber)) 1;
  background: linear-gradient(180deg, rgba(0, 164, 166, 0.06), rgba(255, 122, 61, 0.05));
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--muted);
  margin-top: 12px;
}

.chart {
  position: relative;
  height: 260px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(251, 251, 248, 0.92));
  overflow: hidden;
}

.chart::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(10, 14, 22, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(10, 14, 22, 0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.6;
  pointer-events: none;
}

.axis {
  position: absolute;
  left: 16px;
  bottom: 16px;
  width: calc(100% - 32px);
  height: calc(100% - 32px);
  border-left: 1px solid rgba(10, 14, 22, 0.22);
  border-bottom: 1px solid rgba(10, 14, 22, 0.22);
  z-index: 1;
}

.axis label {
  position: absolute;
  font-size: 11px;
  color: var(--muted-2);
  z-index: 2;
}

.axis .x {
  right: 0;
  bottom: -18px;
}

.axis .y {
  left: -12px;
  top: 0;
  transform: rotate(-90deg);
  transform-origin: left top;
}

.dot {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--aqua);
  box-shadow: 0 0 0 6px rgba(0, 164, 166, 0.12);
  z-index: 3;
}

.dot.secondary {
  background: var(--amber);
  box-shadow: 0 0 0 6px rgba(255, 122, 61, 0.12);
}

.dot.tertiary {
  background: #1b2333;
  box-shadow: 0 0 0 6px rgba(27, 35, 51, 0.09);
}

.dot-label {
  position: absolute;
  font-size: 12px;
  color: var(--muted);
  transform: translate(14px, -4px);
  max-width: 220px;
  z-index: 4;
}

.footer {
  width: 100%;
  margin-top: 10px;
  padding-right: 4px;
  text-align: right;
  font-size: 12px;
  color: rgba(10, 14, 22, 0.5);
}

.slide-index {
  position: static;
  display: block;
  grid-column: 1 / -1;
  margin-top: 10px;
  font-size: 12px;
  color: rgba(10, 14, 22, 0.5);
}

#progress {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 4px;
  background: rgba(10, 14, 22, 0.06);
}

#progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--aqua), var(--amber));
  transition: width 0.35s ease;
}

#hint {
  display: none;
}

.bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(18px);
  opacity: 0.42;
}

.glow.one {
  width: 620px;
  height: 620px;
  background: radial-gradient(circle, rgba(0, 164, 166, 0.32), transparent 64%);
  top: -260px;
  left: -210px;
}

.glow.two {
  width: 760px;
  height: 760px;
  background: radial-gradient(circle, rgba(255, 122, 61, 0.26), transparent 68%);
  bottom: -360px;
  right: -260px;
}

.glow.three {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(123, 216, 143, 0.22), transparent 70%);
  top: 24%;
  right: 18%;
}

.noise {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(120deg, rgba(10, 14, 22, 0.018), rgba(10, 14, 22, 0.018) 1px, transparent 1px, transparent 5px);
  mix-blend-mode: multiply;
  opacity: 0.33;
}

.slide.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 650ms ease, transform 650ms ease;
}

.slide.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

#lang-switch,
#author-tag {
  position: fixed;
  top: 12px;
  z-index: 5;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(10, 14, 22, 0.12);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 30px rgba(15, 18, 28, 0.12);
}

#lang-switch {
  right: 12px;
  left: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 196px;
}

#author-tag {
  left: 12px;
  right: auto;
  min-width: 310px;
}

#author-tag span {
  font-size: 12px;
  color: rgba(10, 14, 22, 0.72);
}

#lang-switch label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(10, 14, 22, 0.66);
}

#lang-select {
  width: 100%;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(10, 14, 22, 0.14);
  color: rgba(10, 14, 22, 0.85);
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#lang-select:focus,
#lang-select:hover {
  border-color: rgba(0, 164, 166, 0.42);
  box-shadow: 0 0 0 3px rgba(0, 164, 166, 0.12);
}

@media (max-width: 980px) {
  #deck {
    width: min(98vw, 1120px);
    margin-top: 92px;
    gap: 14px;
  }

  .frame {
    grid-template-columns: 1fr;
    padding: 18px 18px 54px;
    border-radius: 22px;
  }

  .cover {
    padding-right: 0;
  }

  .cover-art {
    position: relative;
    right: auto;
    bottom: auto;
    width: min(92vw, 520px);
    max-width: 520px;
    margin-top: 8px;
    opacity: 0.98;
  }
}

@media (max-width: 720px) {
  .frame {
    border-radius: 16px;
  }

  .grid-3,
  .grid-4,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .chart {
    height: 230px;
  }

  .dot-label {
    font-size: 11px;
    max-width: 170px;
  }

  #lang-switch {
    right: 8px;
    min-width: 0;
  }

  #author-tag {
    left: 8px;
    right: 164px;
    min-width: 0;
  }

  #author-tag span {
    font-size: 11px;
  }

  #lang-select {
    font-size: 12px;
    padding: 6px 8px;
  }
}

@media print {
  @page {
    /* Export as true 16:9 "slides". */
    size: 16in 9in;
    margin: 0;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  html,
  body {
    width: 16in;
    height: 9in;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: var(--bg) !important;
  }

  /* Hide interactive chrome; keep the visual background. */
  #lang-switch,
  #author-tag,
  #progress,
  #hint {
    display: none !important;
  }

  #deck {
    width: 16in;
    margin: 0;
    padding: 0;
    gap: 0;
  }

  .slide {
    width: 16in;
    height: 9in;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    break-after: page;
    page-break-after: always;
  }

  /* Slide 1 has an extra footer node; hide in print to prevent frame shrink. */
  .slide .footer {
    display: none !important;
  }

  /* Center the rounded "card" on each slide page, Gamma-like. */
  .frame {
    width: 15.2in;
    height: 8.55in;
    margin: 0 auto;
    box-shadow: none;
    border-radius: 28px;
    overflow: hidden;
  }

  /* Reduce print artifacts from filters/shadows; keep the look clean. */
  .frame::before {
    display: none !important;
  }

  .cover-art {
    filter: none !important;
  }

  .panel {
    box-shadow: none !important;
  }

  .bg {
    position: fixed;
    inset: 0;
    display: block !important;
  }
}
