/* presentation.css — click-to-advance slide deck.
   Pairs with tokens.css + base.css (linked first). Uses only design-system
   variables (var(--...)); no hardcoded hexes. Hierarchy by size/weight/space,
   one Powder Blush accent per slide, hairline rules, generous whitespace. */

/* ---- deck shell ---- */
html, body { height: 100%; }
body {
  overflow: hidden;            /* one slide at a time, no page scroll */
}

.deck {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3.6rem 0;
}

/* thin progress hairline pinned at the very top, in the accent */
.deck-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 1px;
  width: 0%;
  background: var(--accent);
  z-index: 20;
  transition: width 240ms ease;
}
@media (prefers-reduced-motion: reduce) {
  .deck-progress { transition: none; }
}

/* slide counter + home link, corners, small uppercase muted */
.deck-counter {
  position: fixed;
  bottom: 18px;
  right: 22px;
  z-index: 20;
  user-select: none;
}
.deck-home {
  position: fixed;
  bottom: 18px;
  left: 22px;
  z-index: 20;
}
.deck-home a { border-bottom: 1px solid var(--accent); }

/* ---- slide ---- */
.slide {
  display: none;
  width: 100%;
  max-width: min(96vw, 72rem);   /* wider than the reading measure for a deck */
  margin-inline: auto;
  padding: 0 clamp(16px, 2.5vw, 40px);
  max-height: calc(100svh - 7.2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.slide.is-active {
  display: block;
  animation: slide-in 360ms ease;
}
@keyframes slide-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .slide.is-active { animation: none; }
}

/* slide title: sans, Deep Walnut */
.slide-title {
  font-family: Avenir, "Avenir Next", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--text-strong);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: 0;
  font-size: 2.35rem;
  margin: 0 0 0.6em;
}
.slide-body {
  font-size: 1.34rem;
  line-height: 1.6;
  color: var(--text);
  margin: 0;
}
.deck .meta { letter-spacing: 0; }

/* the single accent word per slide — emphasis via a Powder Blush underline,
   NOT accent-colored glyphs (Powder Blush on Antique White is too low-contrast
   for text; see fal-design-preferences "contrast caution"). Keeps high-contrast
   Deep Walnut text in light mode and reads correctly in dark mode. */
.accent {
  color: var(--text-strong);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}

/* ---- kind: title ---- */
.slide--title {
  text-align: center;
  max-width: min(92vw, 64rem);
}
.slide--title .slide-title {
  font-size: clamp(1.75rem, 3.9vw, 3.05rem);
  line-height: 1.14;
  max-width: 22ch;             /* keep the title a tidy centered block, not an edge-to-edge wall */
  margin-inline: auto;
  margin-bottom: 0;
  text-wrap: balance;          /* even out line lengths */
}
/* short accent hairline separating the title from the question below it */
.slide--title .title-rule {
  width: 3rem;
  height: 2px;
  margin: 0.95em auto 1.05em;
  background: var(--accent);
  border-radius: 2px;
}
.slide--title .slide-body {
  font-size: clamp(1rem, 1.85vw, 1.32rem);
  line-height: 1.55;
  color: var(--text-muted);    /* secondary to the title — clear hierarchy */
  max-width: 40ch;
  margin-inline: auto;
  text-wrap: balance;
}
/* the three dimensions we vary: square, scannable labels rather than prose. */
.slide--title .title-dims {
  margin: 1.5em auto 0;
  display: flex;
  justify-content: center;
  gap: 0.55em;
  flex-wrap: wrap;
}
.slide--title .dim {
  font-family: Avenir, "Avenir Next", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text-strong);
  background: var(--bg-subtle);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.4em 0.95em;
}
/* compact credits at the foot of the slide */
.slide--title .title-meta {
  margin-top: 2.6em;
}
.slide--title .title-authors {
  margin: 0;
  font-size: 1.02rem;
  color: var(--text);
}
.slide--title .title-aff {
  color: var(--text-muted);
  font-size: 0.82em;
}
.slide--title .title-evidence {
  margin: 0.6em 0 0;
  letter-spacing: 0;
}

/* ---- kind: statement ---- */
.slide--statement {
  text-align: center;
}
.slide--statement .slide-title {
  font-size: 2.48rem;
  max-width: 50rem;
  margin-inline: auto;
}
.slide--statement .slide-body {
  font-size: 1.2rem;
  line-height: 1.55;
  max-width: 46ch;             /* tighter measure — no more wall of text */
  margin-inline: auto;
  color: var(--text-muted);    /* setup is secondary to the turn + risks below */
}
/* the pivot: the whole point of the slide, given weight */
.slide--statement .statement-turn {
  margin: 1.15em auto 0;
  max-width: 40ch;
  font-family: Avenir, "Avenir Next", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: clamp(1.15rem, 2vw, 1.6rem);
  font-weight: 700;
  line-height: 1.28;
  color: var(--text-strong);
}
/* the three failure modes — scannable list, not buried in prose */
.slide--statement .statement-risks {
  margin: 1.35em auto 0;
  max-width: 34ch;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.6em;
  text-align: left;
}
.slide--statement .statement-risks li {
  position: relative;
  padding-left: 1.35em;
  font-size: clamp(0.98rem, 1.55vw, 1.18rem);
  line-height: 1.4;
  color: var(--text);
}
.slide--statement .statement-risks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.6em;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

/* ---- kind: columns ---- */
.slide--columns .slide-body { margin-bottom: 0.4em; }
.cols {
  display: grid;
  gap: 0;
  margin-top: 1.8em;
  border-top: 1px solid var(--rule);
}
.cols.cols-2 { grid-template-columns: 1fr 1fr; }
.cols.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols.cols-4 { grid-template-columns: repeat(2, 1fr); }
.col {
  padding: 1.2em 1.3em;
  border-bottom: 1px solid var(--rule);
}
.cols-2 .col:not(:last-child),
.cols-3 .col:not(:last-child),
.cols-4 .col:nth-child(odd) {
  border-right: 1px solid var(--rule);
}
.col .meta { display: block; margin-bottom: 0.5em; }
.col p { margin: 0; font-size: 1.12rem; line-height: 1.5; }
.col.is-dimmed {
  background: var(--bg-subtle);
}
.col.is-dimmed .meta,
.col.is-dimmed p {
  color: var(--text-muted);
}

/* ---- kind: design ---- */
.slide--design .slide-body { margin-bottom: 0.8em; }
.dimension-block { margin-top: 1.1em; }
.dimension-title {
  margin: 0 0 0.55em;
  font-family: Avenir, "Avenir Next", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0;
}
.slide--design .cols {
  margin-top: 0;
}
.slide--design .col {
  padding: 0.95em 1.05em;
}
.slide--design .col p {
  font-size: 1.02rem;
}

/* ---- kind: code ---- */
.slide--code .slide-body { margin-bottom: 0.2em; }
.slide--code pre {
  margin-top: 1.4em;
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.slide--code pre code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.slide--example .cols {
  margin-top: 1.25em;
}
.slide--example .col p {
  font-size: 1.04rem;
}
.slide--example pre {
  margin-top: 1.1em;
}

/* ---- kind: result ---- */
.slide--result .slide-body { margin-bottom: 0.4em; }
.bars {
  margin-top: 1.8em;
  border-top: 1px solid var(--rule);
}
.bar-row {
  display: grid;
  grid-template-columns: minmax(9rem, 16rem) 1fr 4.6rem;
  align-items: center;
  gap: 1em;
  padding: 0.9em 0;
  border-bottom: 1px solid var(--rule);
}
.bar-label {
  font-family: Avenir, "Avenir Next", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--text-strong);
}
.bar-label small {
  display: block;
  margin-top: 0.08em;
  font-size: 0.72em;
  font-weight: 500;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.bar-track {
  height: 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--rule);
  border-radius: 0;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: var(--rule-strong);
  border-radius: 0;
}
.bar-row.is-accent .bar-fill { background: var(--accent); }
.bar-value {
  font-family: Avenir, "Avenir Next", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1.08rem;
  font-weight: 600;
  text-align: right;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}

/* result cols variant (non-numeric-bar pairs) reuse .cols */
.slide--result .cols { margin-top: 1.8em; }

.sample-meta {
  margin-top: 1.8em;
  text-align: center;
  overflow-wrap: anywhere;
}

/* ---- kind: close ---- */
.slide--close { text-align: center; }
.slide--close .slide-title {
  font-size: 2.65rem;
  max-width: 36rem;
  margin-inline: auto;
}
.slide--close .slide-body {
  max-width: 34rem;
  margin-inline: auto;
}
.close-actions {
  margin-top: 2em;
  display: flex;
  justify-content: center;
  gap: 1em;
  flex-wrap: wrap;
}

/* ---- download-PDF button ---- */
.deck-pdf {
  position: fixed;
  top: 14px;
  right: 22px;
  z-index: 25;
  font-family: Avenir, "Avenir Next", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-strong);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 2px;
  min-width: 36px;
  height: 30px;
  padding: 0 0.65em;
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 160ms ease, background 160ms ease, border-color 160ms ease;
}
.deck-pdf:hover {
  opacity: 1;
  background: var(--bg-subtle);
  border-color: var(--rule-strong);
}

/* ---- in-slide chart (scatter) ---- */
.deck-chart {
  margin: 1.4em auto 0;
  max-width: 50rem;
}
.deck-chart .chart-svg { max-height: 50vh; }
.deck-chart .chart-legend { font-size: 0.82rem; }

/* ---- print → PDF: every slide on its own landscape page ---- */
@media print {
  @page { size: landscape; margin: 12mm; }
  html, body { height: auto; overflow: visible; background: #fff; }
  .deck {
    position: static;
    display: block;
    padding: 0;
  }
  .slide {
    display: block !important;
    max-width: 100%;
    max-height: none;
    overflow: visible;
    page-break-after: always;
    break-after: page;
    padding: 6mm 8mm;
    animation: none;
  }
  .slide:last-child { page-break-after: auto; break-after: auto; }
  .deck-progress,
  .deck-counter,
  .deck-home,
  .deck-pdf { display: none !important; }
  .deck-chart .chart-svg { max-height: none; }
  /* keep the accent underline + bar fills in the PDF */
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---- responsive layout ---- */
@media (max-width: 700px) {
  .deck {
    align-items: flex-start;
    padding: 3.2rem 0 4.8rem;
  }
  .slide {
    max-width: 100%;
    max-height: calc(100svh - 8rem);
    padding-inline: 18px;
  }
  .slide-title { font-size: 1.68rem; }
  .slide-body { font-size: 1.08rem; line-height: 1.52; }
  .slide--title.is-active {
    display: flex;
    min-height: calc(100svh - 8rem);
    flex-direction: column;
    justify-content: flex-start;
    padding-top: clamp(1.6rem, 7svh, 4rem);
  }
  .slide--title .slide-title {
    font-size: 1.62rem;
  }
  .slide--title .title-rule {
    margin: 0.78em auto 0.82em;
  }
  .slide--title .slide-body {
    font-size: 1.02rem;
    line-height: 1.45;
  }
  .slide--title .title-dims {
    margin-top: 1.25em;
  }
  .slide--title .dim {
    padding: 0.34em 0.82em;
  }
  .slide--title .title-meta {
    margin-top: auto;
    padding-top: 2.4rem;
    padding-bottom: clamp(1.1rem, 5svh, 2.6rem);
  }
  .slide--title .title-authors {
    font-size: 0.98rem;
  }
  .slide--statement .slide-title { font-size: 1.85rem; }
  .slide--statement .slide-body { font-size: 1.14rem; }
  .cols.cols-3 { grid-template-columns: 1fr; }
  .cols.cols-4 { grid-template-columns: 1fr; }
  .cols.cols-2 { grid-template-columns: 1fr; }
  .slide--design .dimension-block { margin-top: 0.75em; }
  .slide--design .dimension-title { margin-bottom: 0.35em; }
  .slide--design .slide-body { font-size: 1rem; line-height: 1.42; }
  .slide--design .cols.cols-3,
  .slide--design .cols.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .slide--design .col { padding: 0.65em 0.55em; }
  .slide--design .col p { font-size: 0.86rem; line-height: 1.34; }
  .cols .col { border-right: 0 !important; }
  .cols { margin-top: 1.2em; }
  .col { padding: 0.9em 0; }
  .col p { font-size: 1rem; }
  .title-cols { gap: 1.4em; }
  .bar-row { grid-template-columns: minmax(8.2rem, 1.05fr) minmax(6.5rem, 1fr) 3.2rem; gap: 0.6em; }
  .bar-label,
  .bar-value { font-size: 0.9rem; }
  .bar-label small { font-size: 0.74em; }
  .bar-track { height: 10px; }
  .sample-meta { margin-top: 1.2em; font-size: 11px; }
  .slide--code pre { font-size: 0.78rem; }
  .slide--close .slide-title { font-size: 1.82rem; }
  .deck-counter,
  .deck-home { bottom: 14px; }
}

@media (min-width: 1100px) {
  .slide-title { font-size: 2.75rem; }
  .slide-body { font-size: 1.48rem; }
  /* .slide--title sizes are handled by clamp() — no fixed override here */
  .slide--statement .slide-title { font-size: 3.2rem; }
  .slide--statement .slide-body { font-size: 1.78rem; }
  .slide--close .slide-title { font-size: 3rem; }
}
