/* Styled after the CCM PowerPoint template (2025): navy text on white, Flatiron
   orange and blue accents, Tiempos Headline titles and Founders Grotesk body text.
   The brand fonts are used when installed; otherwise the bundled open fonts
   Source Serif 4 and Hanken Grotesk stand in. */
@font-face { font-family: "Source Serif 4"; font-weight: 300; src: url("vendor/fonts/source-serif-4-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 400; src: url("vendor/fonts/source-serif-4-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 400; src: url("vendor/fonts/hanken-grotesk-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 600; src: url("vendor/fonts/hanken-grotesk-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 700; src: url("vendor/fonts/hanken-grotesk-latin-700-normal.woff2") format("woff2"); }

/* Slides keep the template's light colors in both themes; only the window
   around them and the nav bar follow the system theme. */
:root {
  --bg: #ffffff;
  --fg: #1c2954;
  --accent: #537eba;
  --brand-orange: #f6862d;
  --cursor: #f6862d;
  --ch1: #1f77b4;
  --ch2: #d62728;
  --ch3: #2ca02c;
  --ch4: #9467bd;
  --ch5: #ff7f0e;
  --font-head: "Tiempos Headline", "Source Serif 4", Georgia, serif;
  --font-body: "Founders Grotesk", "Hanken Grotesk", system-ui, sans-serif;
  --window-bg: #eef0f4;
  --window-fg: #1c2954;
}

@media (prefers-color-scheme: dark) {
  :root {
    --window-bg: #141416;
    --window-fg: #e8e8ea;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--window-bg);
  color: var(--window-fg);
  font-family: var(--font-body);
}

/* The area above the nav bar (main.js sets bottom); the deck is scaled to fit inside it. */
main {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
}

/* Slides are laid out at 1920 x 1080 and scaled as a whole by main.js,
   so sizes below are in slide pixels. */
#deck {
  position: absolute;
  width: 1920px;
  height: 1080px;
  transform-origin: 0 0;
}

.page {
  display: none;
  position: absolute;
  inset: 0;
  background: var(--bg);
  color: var(--fg);
  border: 3px solid color-mix(in srgb, var(--fg) 35%, transparent);
  text-align: center;
}
.page.active { display: block; }

/* Flatiron logo, added to every slide by main.js: top right as in the
   template's content layouts, bottom right on the title slide. */
.page > .logo { position: absolute; top: 30px; right: 98px; height: 42px; }
#title > .logo { top: auto; bottom: 90px; height: 50px; }

/* Title slide: the template's white title layout, text left-aligned. */
#title.active {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 240px 98px 0;
  text-align: left;
}

/* Slides with a title on top, text on the left and demos on the right. */
.page.split.active {
  display: grid;
  grid-template-columns: 720px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0 72px;
  padding: 84px 98px 40px;
  text-align: left;
}

.page.split > h2 { grid-column: 1 / -1; }

h1, h2 { font-family: var(--font-head); font-weight: 300; }

h2 {
  font-size: 76px;
  line-height: 1.1;
  text-align: left;
  margin: 0 0 34px;
}

.text p { font-size: 44px; line-height: 1.4; margin: 0 0 48px; }

.demo { display: flex; flex-direction: column; gap: 28px; min-height: 0; }

figure { margin: 0; }
figcaption { font-size: 26px; opacity: 0.7; margin-top: 10px; text-align: center; }

/* Stands in for a PNG: always on white, like a figure pasted into a paper. */
.static-figure {
  display: block;
  width: 100%;
  height: 270px;
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--fg) 20%, transparent);
}

.app-frame {
  border: 2px solid color-mix(in srgb, var(--fg) 25%, transparent);
  border-radius: 10px;
  padding: 14px 16px;
}

.app-controls { display: flex; align-items: center; gap: 16px; font-size: 24px; margin-bottom: 10px; }
.app-controls button { padding: 2px 16px; font-size: 28px; line-height: 1.2; }
.app-controls label { display: flex; align-items: center; gap: 10px; }
.app-controls input[type="range"] { width: 160px; }
.readout { margin-left: auto; font-size: 21px; opacity: 0.7; font-variant-numeric: tabular-nums; }

#why-traces { display: block; width: 100%; height: 290px; cursor: grab; touch-action: none; }
#why-traces.dragging { cursor: grabbing; }
#why-timeline { display: block; width: 100%; height: 36px; margin-top: 10px; cursor: pointer; }

/* Code or long text on the left needs more room. */
.page.code-split.active,
.page.wide-left.active { grid-template-columns: 860px minmax(0, 1fr); gap: 0 56px; }

.text.compact p, .text.compact ul.points { font-size: 30px; line-height: 1.4; }
.text.compact p { margin: 0 0 22px; }
.text.compact p.list-head { margin-bottom: 6px; }
.text.compact ul.points li { margin-bottom: 4px; }
.text.compact p.data-source { margin-top: 48px; font-size: 22px; line-height: 1.4; opacity: 0.7; }

/* A title and one element filling the rest of the slide. */
.page.full.active {
  display: flex;
  flex-direction: column;
  padding: 84px 98px 40px;
}
.manage-frame {
  flex: 1;
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--fg) 20%, transparent);
  border-radius: 6px;
  background: #fff;
}

/* Gallery: a scrollable list of figures on the left, the selected one on the right. */
.page.gallery-split.active { grid-template-columns: 440px minmax(0, 1fr); gap: 0 48px; }
.gallery-side { display: flex; flex-direction: column; min-height: 0; }
.gallery-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 0 8px 0 0;
}
.gallery-list button {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  border-left: 5px solid transparent;
  border-radius: 0;
  padding: 12px 18px;
  color: var(--fg);
  font-size: 27px;
}
.gallery-list button .cat { display: block; font-size: 19px; opacity: 0.6; margin-top: 2px; }
.gallery-list button:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--fg); }
.gallery-list button.selected {
  border-left-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  font-weight: 600;
}
.text p.gallery-more {
  font-size: 24px;
  line-height: 1.4;
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid color-mix(in srgb, var(--fg) 15%, transparent);
}
.gallery-more a { color: var(--accent); }
.gallery-frame {
  display: block;
  width: 100%;
  height: 800px;
  border: 1px solid color-mix(in srgb, var(--fg) 20%, transparent);
  border-radius: 6px;
  background: #fff;
}

/* A title and a single column of text. */
.page.prose.active { padding: 84px 98px; }
.page.prose > .text { max-width: 1400px; margin: 40px auto 0; text-align: left; }
.page.prose .text p, .page.prose ul.points { font-size: 52px; line-height: 1.45; }
.page.prose .text p { margin: 0 0 44px; }
.page.prose .text p.list-head { margin-bottom: 12px; }
.page.prose ul.points li { margin-bottom: 12px; }
.text a { color: var(--accent); }

/* Remix: short text on the left, a wide embedded page on the right. */
.page.remix-split.active { grid-template-columns: 560px minmax(0, 1fr); gap: 0 48px; }
.remix-frame {
  display: block;
  width: 100%;
  height: 800px;
  border: 1px solid color-mix(in srgb, var(--fg) 20%, transparent);
  border-radius: 6px;
  background: #fff;
}

/* Integrations: one card per project, logo on top. */
.integrations {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 64px;
}
.integration {
  width: 460px;
  padding: 48px 32px 40px;
  border-radius: 18px;
  border: 2px solid color-mix(in srgb, var(--fg) 18%, transparent);
  background: color-mix(in srgb, var(--fg) 3%, var(--bg));
  text-align: center;
}
.integration img { display: block; height: 220px; max-width: 360px; margin: 0 auto 36px; object-fit: contain; }
.integration p { margin: 0; }
.integration .name { font-size: 52px; font-weight: 600; }
.integration .status {
  display: inline-block;
  margin-top: 18px;
  padding: 4px 20px;
  border-radius: 999px;
  font-size: 28px;
  background: color-mix(in srgb, var(--accent) 16%, var(--bg));
  color: var(--accent);
  font-weight: 600;
}
.integration .detail { margin-top: 18px; font-size: 26px; opacity: 0.7; }
.integration:not(.future) .detail { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.integration.future { border-style: dashed; background: var(--bg); }
.integration.future .status { background: color-mix(in srgb, var(--brand-orange) 18%, var(--bg)); color: #b45309; }

/* Future directions: a 2 x 2 grid of cards, the last one an open question. */
.directions {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-content: center;
  gap: 48px;
  padding: 0 20px;
  text-align: left;
}
.direction {
  display: flex;
  align-items: center;
  gap: 36px;
  min-height: 250px;
  padding: 40px 44px;
  border-radius: 18px;
  border: 2px solid color-mix(in srgb, var(--fg) 18%, transparent);
  background: color-mix(in srgb, var(--fg) 3%, var(--bg));
}
.direction p { margin: 0; }
.dir-icon {
  flex: none;
  width: 120px;
  height: 120px;
  padding: 26px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 16%, var(--bg));
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.dir-title { font-size: 44px; font-weight: 600; line-height: 1.2; }
.dir-sub { font-size: 32px; opacity: 0.7; margin-top: 10px !important; }
.direction.open { border-style: dashed; background: var(--bg); }
.direction.open .dir-icon { background: color-mix(in srgb, var(--brand-orange) 18%, var(--bg)); stroke: #c2410c; }

/* Options diagram: a need, three ways to get a view, one result. */
.odiagram { display: block; width: 100%; height: auto; margin-top: 40px; }
.odiagram text { fill: var(--fg); font-family: var(--font-body); }
.odiagram .node { fill: color-mix(in srgb, var(--fg) 6%, var(--bg)); stroke: color-mix(in srgb, var(--fg) 35%, transparent); stroke-width: 2; }
.odiagram .node.done { fill: color-mix(in srgb, var(--accent) 18%, var(--bg)); stroke: var(--accent); }
.odiagram .node-title { font-size: 34px; font-weight: 600; }
.odiagram .option { stroke-width: 3; }
.odiagram .opt1 { fill: color-mix(in srgb, var(--ch1) 14%, var(--bg)); stroke: var(--ch1); }
.odiagram .opt2 { fill: color-mix(in srgb, var(--ch3) 14%, var(--bg)); stroke: var(--ch3); }
.odiagram .opt3 { fill: color-mix(in srgb, var(--ch4) 14%, var(--bg)); stroke: var(--ch4); }
.odiagram .opt-title { font-size: 32px; font-weight: 600; }
.odiagram .opt-sub { font-size: 21px; opacity: 0.7; }
.odiagram .edge { fill: none; stroke: color-mix(in srgb, var(--fg) 45%, var(--bg)); stroke-width: 3; }
.odiagram .dashed { stroke-dasharray: 12 9; }
.odiagram.flow { margin: auto 0; overflow: visible; }
.odiagram .arrowhead { fill: color-mix(in srgb, var(--fg) 45%, var(--bg)); }

/* Lifetime tiers diagram. */
.ldiagram svg { display: block; width: 100%; height: auto; overflow: visible; }
.ldiagram text { fill: var(--fg); font-family: var(--font-body); }
.ldiagram text.muted { opacity: 0.65; }
.ldiagram .grid { stroke: var(--fg); stroke-opacity: 0.12; stroke-width: 1; }

.text p.lead { font-size: 40px; margin: 0 0 20px; }

pre.code {
  margin: 0;
  padding: 18px 24px;
  font-size: 18px;
  line-height: 1.3;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--fg) 15%, transparent);
  background: color-mix(in srgb, var(--fg) 4%, var(--bg));
  overflow: hidden;
}
/* overflow: visible so the circle below the last line isn't clipped. */
pre.code code.hljs { padding: 0; background: none; overflow: visible; }

/* An ellipse around a piece of code, without shifting the text. */
pre.code .circled { position: relative; }
pre.code .circled::after {
  content: '';
  position: absolute;
  inset: -9px -14px;
  border: 3px solid var(--cursor);
  border-radius: 50%;
  pointer-events: none;
}

.figure-frame {
  display: block;
  width: 100%;
  height: 790px;
  border: 1px solid color-mix(in srgb, var(--fg) 20%, transparent);
  border-radius: 6px;
  background: #fff;
}

.figure-url { font-size: 17px; margin: 12px 0 0; text-align: center; overflow-wrap: anywhere; }
.figure-url a { color: var(--accent); }

ul.points { font-size: 44px; line-height: 1.5; margin: 0; padding-left: 1.2em; }

/* Directory listing: name, size, and what the key files are. */
.tree {
  display: grid;
  grid-template-columns: max-content max-content max-content;
  gap: 0 36px;
  padding: 32px 36px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 27px;
  line-height: 1.65;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--fg) 15%, transparent);
  background: color-mix(in srgb, var(--fg) 4%, var(--bg));
}
.tree > span { white-space: pre; }
.tree .dir { font-weight: 600; }
.tree .key { color: var(--accent); font-weight: 600; }
.tree .size { text-align: right; opacity: 0.6; font-variant-numeric: tabular-nums; }
.tree .role { color: var(--accent); font-family: var(--font-body); }
.tree-total { font-size: 26px; opacity: 0.7; margin: 14px 0 0; text-align: right; }

/* Slides with more text on the left. */
.text.dense p, .text.dense ul.points { font-size: 36px; }
.text.dense p { margin-bottom: 36px; }

/* Zarr layout diagram. Elements sharing a data-key are one chunk;
   hovering any of them highlights the others. */
.zdiagram svg { display: block; width: 100%; height: auto; overflow: visible; }
.zdiagram text { fill: var(--fg); font-family: var(--font-body); }
.zdiagram text.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.zdiagram text.muted { opacity: 0.65; }
.zdiagram .chunk { stroke: var(--bg); stroke-width: 2; }
.zdiagram .link { fill: none; stroke-width: 2; opacity: 0.55; }
.zdiagram [data-key] { transition: opacity 0.15s; cursor: default; }
.zdiagram.hovering [data-key]:not(.hl) { opacity: 0.15; }
.zdiagram .link.hl { opacity: 1; stroke-width: 3; }

.zrefs {
  margin: 20px 0 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  padding: 16px 22px;
  font-size: 18px;
  line-height: 1.38;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--fg) 15%, transparent);
  background: color-mix(in srgb, var(--fg) 4%, var(--bg));
  overflow: hidden;
}
.zrefs .hdr { opacity: 0.65; }
.zrefs .swatch { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 8px; }

.pager {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--window-bg);
  color: var(--window-fg);
  border-top: 1px solid color-mix(in srgb, var(--window-fg) 12%, transparent);
}

.pager button { padding: 0.35rem 0.8rem; font-size: 0.9rem; }
.pager button:disabled { opacity: 0.3; cursor: default; background: none; color: var(--accent); }
/* Slide counter; opens the table of contents. */
.pager .nav-toc { border-color: transparent; color: inherit; font-size: 0.85rem; opacity: 0.75; }
.pager .nav-toc:hover, .pager .nav-toc[aria-expanded="true"] { opacity: 1; background: color-mix(in srgb, var(--window-fg) 10%, transparent); color: inherit; }

/* Table of contents, opening upward from the nav bar. */
.toc {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: min(460px, calc(100vw - 32px));
  max-height: min(70vh, 560px);
  overflow-y: auto;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--window-fg) 18%, transparent);
  background: var(--window-bg);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
}
.toc ol { margin: 0; padding: 0; list-style: none; counter-reset: slide; }
.toc li { counter-increment: slide; }
.toc button {
  display: flex;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: none;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 0.95rem;
  color: var(--window-fg);
}
.toc button::before { content: counter(slide); min-width: 1.6em; text-align: right; opacity: 0.5; font-variant-numeric: tabular-nums; }
.toc button:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--window-fg); }
.toc button.current { background: color-mix(in srgb, var(--accent) 22%, transparent); font-weight: 600; }

h1 {
  font-size: 108px;
  line-height: 1.08;
  max-width: 1400px;
  margin: 0 0 120px;
}

.author { font-size: 48px; margin: 0 0 10px; }
.affiliation { font-size: 40px; margin: 0 0 40px; }
.date { font-size: 40px; margin: 0; }

/* Link on the title slide to the replay of how the recipe was written. */
.crafted { margin-top: 64px; font-size: 28px; }
.crafted a { color: inherit; opacity: 0.8; text-decoration: none; }
.crafted a:hover { opacity: 1; text-decoration: underline; }

button {
  font: inherit;
  color: var(--accent);
  background: none;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 0.6rem 1.2rem;
  cursor: pointer;
}

button:hover { background: var(--accent); color: var(--bg); }
