/* ============================================================
   FalgunX — Reveal.js theme
   Layered on top of reveal.css. Pulls every value from tokens.css.
   ============================================================ */

@import url("tokens.css");
@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,300;9..144,400;9..144,500;9..144,600&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap");

/* --- Base ----------------------------------------------------- */
.reveal {
  font-family: var(--fx-font-body);
  font-size: var(--fx-body);
  color: var(--fx-fg);
  font-feature-settings: "ss01", "cv11";
}

.reveal .slides {
  text-align: left;
}

.reveal .slides > section,
.reveal .slides > section > section {
  padding: var(--fx-pad-slide);
  height: 100%;
  box-sizing: border-box;
}

/* --- Headings ------------------------------------------------- */
.reveal h1, .reveal h2, .reveal h3, .reveal h4 {
  font-family: var(--fx-font-display);
  font-weight: 500;
  color: var(--fx-fg);
  text-transform: none;
  letter-spacing: -0.01em;
  line-height: 1.08;
  margin: 0 0 0.4em;
}
.reveal h1 { font-size: var(--fx-h1); letter-spacing: -0.02em; }
.reveal h2 { font-size: var(--fx-h2); }
.reveal h3 { font-size: var(--fx-h3); font-weight: 600; }

.reveal p, .reveal li { font-size: var(--fx-body); line-height: 1.5; }
.reveal small { font-size: var(--fx-small); color: var(--fx-fg-muted); }

.reveal a { color: var(--fx-brand); text-decoration: none; border-bottom: 1px solid var(--fx-rule); }
.reveal a:hover { color: var(--fx-accent); }

.reveal strong { color: var(--fx-fg); font-weight: 600; }
.reveal em { color: var(--fx-emphasis); font-style: normal; font-weight: 500; }

/* --- Slide variants ------------------------------------------ */
/* Default: light "paper" content slide */
.reveal .slides section {
  background-color: var(--fx-bg);
  background-image: url("../assets/backgrounds/content-paper.svg");
  background-size: cover;
  background-position: center;
}

/* Title slide */
.reveal .slides section.fx-title {
  background-image: url("../assets/backgrounds/title-pattern.svg");
  color: var(--fx-fg-on-dark);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.reveal section.fx-title h1 { color: var(--fx-fg-on-dark); font-size: 88px; max-width: 16ch; }
.reveal section.fx-title h2 { color: var(--fx-marigold-500); font-size: 32px; font-weight: 400; margin-top: 24px; }
.reveal section.fx-title .fx-meta { color: var(--fx-cyan-200); margin-top: auto; font-family: var(--fx-font-mono); font-size: var(--fx-small); }
.reveal section.fx-title .fx-logo-block {
  display: flex; align-items: center; gap: 24px;
  margin-bottom: 48px; flex: 0 0 auto;
}
.reveal section.fx-title .fx-logo-block img {
  height: 80px; width: auto; flex-shrink: 0; display: block;
}
.reveal section.fx-title .fx-wordmark {
  font-family: var(--fx-font-display);
  font-size: 48px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
}
.reveal section.fx-title .fx-wordmark-falgun { color: var(--fx-paper); }
.reveal section.fx-title .fx-wordmark-x      { color: var(--fx-red-500); margin-left: 0.06em; }

/* Section divider */
.reveal .slides section.fx-section {
  background-image: url("../assets/backgrounds/section-pattern.svg");
  color: var(--fx-fg-on-dark);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.reveal section.fx-section .fx-section-num {
  font-family: var(--fx-font-mono);
  font-size: var(--fx-small);
  color: var(--fx-marigold-500);
  letter-spacing: 0.15em;
  margin-bottom: 16px;
}
.reveal section.fx-section h1 { color: var(--fx-fg-on-dark); font-size: 96px; max-width: 16ch; }
.reveal section.fx-section p { color: var(--fx-cyan-200); font-size: 26px; max-width: 60ch; margin-top: 24px; }

/* Content slide — header rule */
.reveal section.fx-content > h2:first-child,
.reveal section.fx-content > h1:first-child {
  position: relative;
  padding-bottom: 18px;
  margin-bottom: 28px;
}
.reveal section.fx-content > h2:first-child::after,
.reveal section.fx-content > h1:first-child::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 64px; height: 4px;
  background: var(--fx-accent);
}

/* Two-column layout */
.reveal .fx-cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--fx-gutter); align-items: start; }
.reveal .fx-cols--3 { grid-template-columns: repeat(3, 1fr); }
.reveal .fx-cols--asym { grid-template-columns: 5fr 7fr; }

/* Stat card */
.reveal .fx-stat {
  background: var(--fx-paper-2);
  border-left: 4px solid var(--fx-brand);
  padding: 24px 28px;
  border-radius: var(--fx-radius);
}
.reveal .fx-stat .fx-stat-value {
  font-family: var(--fx-font-display);
  font-size: 56px;
  color: var(--fx-brand);
  line-height: 1;
  display: block;
}
.reveal .fx-stat .fx-stat-label {
  font-size: var(--fx-small);
  color: var(--fx-fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 8px;
  display: block;
}

/* Pill / tag */
.reveal .fx-pill {
  display: inline-block;
  font-family: var(--fx-font-mono);
  font-size: var(--fx-caption);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--fx-green-200);
  color: var(--fx-brand);
  padding: 6px 14px;
  border-radius: 100px;
}
.reveal .fx-pill--accent { background: var(--fx-marigold-200); color: var(--fx-marigold-600); }
.reveal .fx-pill--data   { background: var(--fx-cyan-200);     color: var(--fx-brand); }

/* Caption under figures */
.reveal figure { margin: 0; }
.reveal figure img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 720px;
  object-fit: contain;
  border-radius: var(--fx-radius);
  background: var(--fx-paper-2);
}
.reveal figure img.fx-fig--compact { max-height: 540px; }
.reveal figcaption {
  font-size: var(--fx-caption);
  color: var(--fx-fg-muted);
  margin-top: 10px;
  font-family: var(--fx-font-mono);
  letter-spacing: 0.04em;
}

/* Figure placeholder — empty box marking where a chart will live.
   Default 16:9; capped at 720px tall so the caption stays in-frame on a
   1080-tall slide after the heading + pill row. Modifier classes for other
   aspect ratios. */
.reveal .fx-fig-placeholder {
  aspect-ratio: 16 / 9;
  max-height: 720px;
  margin: 0 auto;
  background: var(--fx-paper-2);
  border: 1px dashed var(--fx-rule);
  border-radius: var(--fx-radius);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  color: var(--fx-fg-muted);
  font-family: var(--fx-font-mono);
  font-size: var(--fx-caption);
  letter-spacing: 0.06em;
}
.reveal .fx-fig-placeholder--4-3 { aspect-ratio: 4 / 3; max-height: 760px; }
.reveal .fx-fig-placeholder--square { aspect-ratio: 1 / 1; max-height: 760px; }
/* For slides that share vertical space with bullets / a stat row. */
.reveal .fx-fig-placeholder--compact { max-height: 540px; }

/* Quote */
.reveal blockquote {
  background: transparent;
  box-shadow: none;
  border-left: 4px solid var(--fx-accent);
  padding: 4px 24px;
  font-family: var(--fx-font-display);
  font-size: 32px;
  font-weight: 400;
  color: var(--fx-fg);
  font-style: normal;
  width: auto;
}

/* Lists */
.reveal ul, .reveal ol { margin: 0 0 0 1.1em; }
.reveal ul li::marker { color: var(--fx-accent); }
.reveal ol li::marker { color: var(--fx-brand); font-family: var(--fx-font-mono); }
.reveal li + li { margin-top: 0.4em; }

/* Code */
.reveal pre, .reveal code {
  font-family: var(--fx-font-mono);
  background: var(--fx-paper-2);
  color: var(--fx-fg);
  border-radius: var(--fx-radius);
}
.reveal pre { padding: 16px 20px; box-shadow: none; font-size: 18px; }

/* Tables */
.reveal table { border-collapse: collapse; font-size: var(--fx-small); width: 100%; }
.reveal table th, .reveal table td { padding: 10px 14px; border-bottom: 1px solid var(--fx-rule); text-align: left; }
.reveal table th { color: var(--fx-fg-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; font-size: var(--fx-caption); }
.reveal table tr:hover td { background: var(--fx-paper-2); }

/* References slide */
.reveal section.fx-references ol { font-size: var(--fx-small); columns: 2; column-gap: 56px; }
.reveal section.fx-references li { break-inside: avoid; padding-bottom: 12px; }
.reveal section.fx-references .fx-ref-key {
  font-family: var(--fx-font-mono);
  color: var(--fx-fg-muted);
  font-size: var(--fx-caption);
}

/* Inline citation */
.reveal sup.fx-cite {
  font-family: var(--fx-font-mono);
  font-size: 0.55em;
  color: var(--fx-brand);
  font-weight: 600;
  padding: 0 2px;
  vertical-align: super;
}

/* ============================================================
   Layout templates — primitives the slides compose from.
   Each block is a self-contained design archetype; mix and match
   inside an .fx-content section.
   ============================================================ */

/* 4-column grid (extends fx-cols family) */
.reveal .fx-cols--4 { grid-template-columns: repeat(4, 1fr); }
.reveal .fx-cols--5 { grid-template-columns: repeat(5, 1fr); }

/* Stat-card size variants */
.reveal .fx-stat--lg .fx-stat-value { font-size: 96px; }
.reveal .fx-stat--xl .fx-stat-value { font-size: 128px; }
.reveal .fx-stat--sm { padding: 16px 20px; }
.reveal .fx-stat--sm .fx-stat-value { font-size: 36px; }

/* Callout — boxed sidebar / takeaway */
.reveal .fx-callout {
  background: var(--fx-paper-2);
  border-left: 4px solid var(--fx-brand);
  padding: 24px 28px;
  border-radius: var(--fx-radius);
}
.reveal .fx-callout--accent   { border-left-color: var(--fx-accent); }
.reveal .fx-callout--data     { border-left-color: var(--fx-data); }
.reveal .fx-callout--emphasis { border-left-color: var(--fx-emphasis); }
.reveal .fx-callout > h3:first-child,
.reveal .fx-callout > h4:first-child { margin-top: 0; }
.reveal .fx-callout-eyebrow {
  font-family: var(--fx-font-mono);
  font-size: var(--fx-caption);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fx-fg-muted);
  display: block;
  margin-bottom: 8px;
}

/* Quadrant — 2×2 grid with internal dividers */
.reveal .fx-quad {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--fx-rule);
  border-radius: var(--fx-radius);
  overflow: hidden;
}
.reveal .fx-quad > div {
  padding: 28px 32px;
  border-bottom: 1px solid var(--fx-rule);
  border-right: 1px solid var(--fx-rule);
  background: var(--fx-paper);
}
.reveal .fx-quad > div:nth-child(2n) { border-right: none; }
.reveal .fx-quad > div:nth-last-child(-n+2) { border-bottom: none; }
.reveal .fx-quad h3 {
  font-size: var(--fx-h3);
  margin: 0 0 10px;
  color: var(--fx-brand);
}
.reveal .fx-quad-eyebrow {
  font-family: var(--fx-font-mono);
  font-size: var(--fx-caption);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fx-accent);
  display: block;
  margin-bottom: 4px;
}

/* Horizontal timeline — phased milestones */
.reveal .fx-timeline {
  display: grid;
  grid-template-columns: repeat(var(--fx-timeline-cols, 5), 1fr);
  gap: 0;
  position: relative;
  padding-top: 36px;
  margin-top: 12px;
}
.reveal .fx-timeline::before {
  content: "";
  position: absolute;
  top: 24px; left: 6%; right: 6%;
  height: 2px;
  background: var(--fx-rule);
}
.reveal .fx-timeline-step {
  position: relative;
  padding: 0 16px;
  text-align: center;
}
.reveal .fx-timeline-step::before {
  content: "";
  position: absolute;
  top: -19px; left: 50%;
  transform: translateX(-50%);
  width: 14px; height: 14px;
  background: var(--fx-accent);
  border-radius: 50%;
  border: 3px solid var(--fx-bg);
  box-sizing: content-box;
}
.reveal .fx-timeline-year {
  font-family: var(--fx-font-mono);
  font-size: var(--fx-caption);
  color: var(--fx-fg-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 6px;
}
.reveal .fx-timeline-title {
  font-family: var(--fx-font-display);
  font-size: 22px;
  color: var(--fx-fg);
  display: block;
  margin-bottom: 6px;
  line-height: 1.2;
}
.reveal .fx-timeline-step p {
  font-size: var(--fx-small);
  color: var(--fx-fg-muted);
  margin: 0;
  line-height: 1.4;
}

/* Numbered list — display-style numerals */
.reveal .fx-numbered { list-style: none; counter-reset: fx-num; margin: 0; padding: 0; }
.reveal .fx-numbered > li {
  counter-increment: fx-num;
  display: grid;
  /* minmax(0, 1fr) prevents the text column from collapsing to its min-content
     width when nested inside another grid (e.g. fx-cols--asym) */
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 24px;
  padding: 18px 0;
  border-top: 1px solid var(--fx-rule);
  align-items: baseline;
}
.reveal .fx-numbered > li:first-child { border-top: none; padding-top: 4px; }
.reveal .fx-numbered > li::before {
  content: counter(fx-num, decimal-leading-zero);
  font-family: var(--fx-font-display);
  font-size: 56px;
  font-weight: 400;
  color: var(--fx-accent);
  line-height: 1;
  text-align: right;
  grid-column: 1;
  grid-row: 1;
}
/* Real children all stack in column 2; without this, auto-flow drops the
   second child (e.g. <p>) into the empty 88px cell on row 2. */
.reveal .fx-numbered > li > * { grid-column: 2; }
.reveal .fx-numbered h3 {
  font-size: 24px;
  margin: 0 0 6px;
  color: var(--fx-fg);
  font-weight: 500;
}
.reveal .fx-numbered p { margin: 0; color: var(--fx-fg-muted); }

/* Comparison split — two distinct panels */
.reveal .fx-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-radius: var(--fx-radius);
  overflow: hidden;
  border: 1px solid var(--fx-rule);
}
.reveal .fx-compare__panel { padding: 28px 32px; }
.reveal .fx-compare__panel--a {
  background: var(--fx-paper-2);
  border-right: 1px solid var(--fx-rule);
}
.reveal .fx-compare__panel--b { background: var(--fx-green-200); }
.reveal .fx-compare__label {
  font-family: var(--fx-font-mono);
  font-size: var(--fx-caption);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fx-fg-muted);
  margin-bottom: 8px;
  display: block;
}
.reveal .fx-compare__panel--b .fx-compare__label { color: var(--fx-brand); }
.reveal .fx-compare h3 { margin: 0 0 12px; font-size: 28px; }

/* Process flow — boxes connected by arrows */
.reveal .fx-process {
  display: grid;
  grid-template-columns: repeat(var(--fx-process-cols, 4), 1fr);
  gap: 32px;
  align-items: stretch;
}
.reveal .fx-process-step {
  background: var(--fx-paper-2);
  padding: 20px 24px;
  border-radius: var(--fx-radius);
  border-top: 4px solid var(--fx-brand);
  position: relative;
}
.reveal .fx-process-step + .fx-process-step::before {
  content: "→";
  position: absolute;
  left: -26px; top: 50%;
  transform: translateY(-50%);
  font-family: var(--fx-font-mono);
  font-size: 24px;
  color: var(--fx-accent);
}
.reveal .fx-process-step h3 {
  font-size: 22px;
  margin: 0 0 8px;
  color: var(--fx-brand);
  font-weight: 500;
}
.reveal .fx-process-step p { margin: 0; font-size: var(--fx-small); color: var(--fx-fg-muted); }

/* Eyebrow / kicker label — sits above an h2, smaller than a pill */
.reveal .fx-eyebrow {
  font-family: var(--fx-font-mono);
  font-size: var(--fx-caption);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fx-accent);
  display: block;
  margin-bottom: 8px;
}

/* Owner row — small attribution after the heading */
.reveal .fx-owners { margin-top: -14px; margin-bottom: 24px; display: flex; gap: 8px; }

/* --- Footer (slide number, section, mark) -------------------- */
.fx-footer {
  position: absolute;
  bottom: 24px;
  left: 96px;
  right: 96px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--fx-font-mono);
  font-size: var(--fx-caption);
  color: var(--fx-fg-muted);
  letter-spacing: 0.08em;
  pointer-events: none;
  z-index: 30;
}
.fx-footer__section { text-transform: uppercase; }
.fx-footer__num { color: var(--fx-brand); font-weight: 500; }
.fx-footer__mark { display: flex; align-items: center; gap: 8px; }
.fx-footer__mark img { height: 22px; }

/* On dark slides (title, section), invert footer colours */
.reveal section.fx-title .fx-footer,
.reveal section.fx-section .fx-footer { display: none; }

/* Built-in reveal slide-number widget hidden — we render our own */
.reveal .slide-number { display: none !important; }

/* --- Fullscreen toggle button -------------------------------- */
.fx-fs-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--fx-rule);
  border-radius: 100px;
  font-family: var(--fx-font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--fx-brand);
  cursor: pointer;
  transition: transform 0.15s var(--fx-ease), background 0.15s var(--fx-ease);
  opacity: 0.6;
}
.fx-fs-btn:hover { opacity: 1; transform: translateY(-1px); background: var(--fx-white); }
.fx-fs-btn .fx-fs-icon-exit { display: none; }
body.fx-is-fs .fx-fs-btn { display: none; }   /* hide entire button while fullscreen */
@media (max-width: 900px) {
  .fx-fs-btn .fx-fs-label { display: none; }
}

/* --- Print (PDF export) ------------------------------------- */
@media print {
  .fx-footer { position: fixed; }
  .fx-fs-btn { display: none; }
}

/* --- Embed mode (used by /editor thumbnails) ---------------- */
html.fx-embed .fx-footer,
html.fx-embed .fx-fs-btn,
html.fx-embed .reveal .controls,
html.fx-embed .reveal .progress {
  display: none !important;
}
html.fx-embed body { background: var(--fx-paper); }
html.fx-embed { overflow: hidden; }
