/* Screen styles for the deck. Edit freely and rebuild; nothing here is generated.

   One idea runs through the file: a slide is a CONTAINER. Below 880px of slide
   width the slide is a normal, stacked, rem-sized reading block. From 880px up
   it is a "stage": text is sized in container units (cqw) so a 16:9 slide looks
   the same at 1024px, 1920px and on paper (print.css sets it to 13.333in x
   7.5in). Presentation mode, reading mode and the PDF therefore differ only in
   the box around the slide, never in how its content is set. */

:root {
  color-scheme: light;
  --paper: #f7f2e8;
  --paper-2: #ece3d0;
  --ink: #1b1a17;
  --ink-2: #2b2924;
  --muted: #4a463d;
  --accent: #9c3412;
  --accent-dark: #7d2a0e;
  --teal: #1f5b63;
  --teal-tint: #dde9e8;
  --accent-tint: #f2ddd0;
  --rule: #b9ad8f;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bar: 3rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
}
h1, h2, h3, p, ul, ol, figure { margin: 0; }
img { display: block; max-width: 100%; }

/* ------------------------------------------------------------ chrome */

.skip {
  position: absolute; left: .5rem; top: -4rem; z-index: 30;
  padding: .6rem 1rem; background: var(--paper); color: var(--ink); border: 2px solid var(--ink);
}
.skip:focus { top: .5rem; }

.deck-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem;
  padding: .5rem 1rem; background: var(--ink); color: var(--paper);
}
.deck-name { flex: 1 1 14rem; min-width: 0; font: 600 .875rem/1.2 var(--sans); overflow-wrap: anywhere; }
.deck-badge { font: 600 .8125rem/1.2 var(--sans); padding: .15rem .5rem; border: 1px solid #e9dfc6; border-radius: 2px; color: #f3ead4; }
.deck-controls { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.deck-controls[hidden] { display: none; }
.deck-controls button {
  font: 600 .875rem/1 var(--sans); color: var(--ink); background: var(--paper);
  border: 2px solid var(--paper); border-radius: 3px; padding: .55rem .8rem; min-height: 2.5rem; cursor: pointer;
}
.deck-controls button:hover { background: #fff; }
.deck-controls button[aria-disabled="true"] { opacity: 1; background: #3a372f; color: #d9d0b9; border-color: #3a372f; cursor: default; }
.deck-counter { font: 600 .9375rem/1 var(--sans); min-width: 4.2rem; text-align: center; font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.deck-bar :focus-visible, .layout-title :focus-visible, .layout-closing :focus-visible { outline-color: #ffd9a8; }

.deck-reading [data-prev], .deck-reading [data-next], .deck-reading .deck-counter, .deck-reading [data-outline-toggle],
html:not(.deck-can-present) [data-mode-toggle] { display: none; }
html:not(.deck-can-present) .deck-controls { display: none; }

.deck-outline { padding: .75rem 1rem 0; max-width: 70rem; margin: 0 auto; }
.deck-outline summary { cursor: pointer; font: 600 1rem/1.4 var(--sans); padding: .4rem 0; }
.deck-outline ol { padding-left: 1.4rem; margin: .4rem 0 .6rem; display: grid; gap: .25rem; }
.deck-outline a { color: var(--teal); text-underline-offset: .15em; }
.deck-outline a:hover { color: var(--ink); }

.deck-status {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.deck-status[data-kind="error"] {
  position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 40; width: max-content; max-width: min(92vw, 40rem); height: auto;
  clip-path: none; white-space: normal; overflow: visible;
  padding: .7rem 1rem; background: var(--accent-dark); color: #fff; font: 600 1rem/1.35 var(--sans); border-radius: 4px;
}
.deck-status:empty { display: none; }

/* reading mode (also the no-script page): slides are ordinary blocks */
.deck { display: block; padding: 0 0 2rem; }
.deck:focus { outline: none; }
.slide {
  container-type: inline-size;
  position: relative; display: block;
  margin: 1.25rem auto 0; max-width: 68rem; width: calc(100% - 1.5rem);
  background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; overflow-wrap: anywhere;
  scroll-margin-top: 1rem;
}
.slide:focus { outline: none; }
.slide:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.slide-inner { display: grid; align-content: start; gap: 1rem; padding: 1.5rem 1.25rem 1rem; min-width: 0; }
.slide-foot { display: flex; justify-content: space-between; gap: 1rem; padding: 0 1.25rem 1rem; font: 600 .875rem/1.2 var(--sans); color: var(--muted); }
.slide-tag { text-transform: uppercase; letter-spacing: .06em; }

/* ------------------------------------------------------------ slide content, compact */

.slide h2 { font: 700 clamp(1.55rem, 1.2rem + 1.5vw, 2.1rem)/1.15 var(--serif); letter-spacing: -.01em; text-wrap: balance; }
.slide h3 { font: 700 1rem/1.3 var(--sans); letter-spacing: .06em; text-transform: uppercase; }
.body, .summary { display: grid; gap: .75rem; font-size: 1.125rem; line-height: 1.5; max-width: 42rem; }
.summary { color: var(--muted); }
.source { font-size: .9375rem; line-height: 1.4; color: var(--muted); }
.source a { color: var(--teal); }
.media img { width: 100%; height: auto; border-radius: 3px; }
.media figcaption { margin-top: .5rem; font-size: .9375rem; line-height: 1.4; color: var(--muted); }
.compare { display: grid; gap: 1rem; }
.side { display: grid; align-content: start; gap: .6rem; padding: 1rem 1.1rem; border-radius: 4px; font-size: 1.0625rem; line-height: 1.45; }
.side[data-side="left"] { background: var(--teal-tint); border-top: 5px solid var(--teal); }
.side[data-side="right"] { background: var(--accent-tint); border-top: 5px solid var(--accent); }
.side[data-side="left"] h3 { color: var(--teal); }
.side[data-side="right"] h3 { color: var(--accent-dark); }
.side ul { padding-left: 1.2rem; display: grid; gap: .3rem; }

.layout-title { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.layout-title h2 { font-size: clamp(1.9rem, 1.3rem + 3vw, 3rem); }
.layout-title .body { color: #e7dec6; }
.layout-title .slide-foot, .layout-closing .slide-foot { color: #d9d0b9; }
.layout-closing { background: var(--accent-dark); color: #fff; border-color: var(--accent-dark); }
.layout-closing .body { color: #fff; }
.layout-closing .body p:first-child { font-family: var(--serif); font-weight: 700; font-size: 1.35rem; line-height: 1.3; }
.layout-title .source, .layout-closing .source { color: #e7dec6; }
.layout-title .source a, .layout-closing .source a { color: #ffe0b8; }
.layout-statement h2 { border-left: .45rem solid var(--accent); padding-left: .9rem; }

/* charts, compact */
.chart { display: grid; gap: .6rem; padding: 1rem; background: #fffdf8; border: 1px solid var(--rule); border-radius: 4px; --dot: .85rem; }
.chart-title { font: 700 1rem/1.3 var(--sans); }
.chart-note { font-size: .9375rem; line-height: 1.4; color: var(--muted); border-top: 1px solid var(--rule); padding-top: .5rem; }
.axis-label { font-size: .9375rem; color: var(--muted); text-align: center; }

.dp-row { display: grid; gap: .3rem; margin-bottom: .6rem; }
.dp-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem 1.2rem; }
.dp-label { font: 700 1rem/1.3 var(--sans); }
.dp-n { font-weight: 500; color: var(--muted); margin-left: .4rem; }
.dp-plot, .dp-axis { position: relative; margin-inline: calc(var(--dot) * .8); }
.dp-plot { height: calc(var(--dot) * 6.6); }
.dp-base { position: absolute; left: calc(var(--dot) * -.8); right: calc(var(--dot) * -.8); bottom: 0; border-bottom: 2px solid var(--ink); }
.dp-col { position: absolute; bottom: 3px; left: calc(var(--x) * 1%); transform: translateX(-50%); display: flex; flex-direction: column-reverse; gap: calc(var(--dot) * .12); }
.dot { width: var(--dot); height: var(--dot); border-radius: 50%; background: var(--teal); }
.dp-row:nth-of-type(2) .dot { background: var(--accent); }
.dp-line { position: absolute; top: 0; bottom: 0; left: calc(var(--x) * 1%); border-left: 3px solid var(--ink); transform: translateX(-1.5px); }
.dp-line[data-mark="median"] { border-left-style: dashed; border-left-width: 3px; }
.dp-marks { display: flex; flex-wrap: wrap; gap: .2rem 1.2rem; font-size: 1rem; line-height: 1.3; }
.mark { display: inline-flex; align-items: center; gap: .45rem; font-weight: 600; }
.mark::before { content: ""; width: 0; height: 1.1em; border-left: 3px solid var(--ink); }
.mark[data-mark="median"]::before { border-left-style: dashed; }
.dp-axis { height: 1.4rem; margin-top: -.2rem; }
.tick { white-space: nowrap; position: absolute; top: 0; left: calc(var(--x) * 1%); transform: translateX(-50%); font-size: .875rem; line-height: 1.2; color: var(--muted); font-variant-numeric: tabular-nums; }
.tick::before { content: ""; position: absolute; left: 50%; top: -.2rem; height: .2rem; border-left: 1px solid var(--muted); }

.bars { list-style: none; padding: 0; display: grid; gap: .9rem; }
.bar-row { display: grid; gap: .25rem; }
.bar-label { font-weight: 700; font-size: 1rem; line-height: 1.3; }
.bar-track { height: 1rem; background: #e6dcc6; border-radius: 1px; overflow: hidden; }
.bar-fill { display: block; height: 100%; width: calc(var(--w) * 1%); background: var(--teal); }
.bar-text { font-size: 1rem; line-height: 1.3; color: var(--muted); font-variant-numeric: tabular-nums; }

.timeline { list-style: none; padding: 0; display: grid; gap: .6rem; }
.tl-item { display: grid; gap: .1rem; padding: .6rem .8rem; border-left: 6px solid var(--teal); background: #fff; }
.tl-item[data-state="next"] { border-left-color: var(--accent); background: var(--accent-tint); }
.tl-item[data-state="later"] { border-left-style: dashed; border-left-color: #6b6554; }
.tl-when { font: 600 .9375rem/1.2 var(--sans); color: var(--muted); }
.tl-label { font-weight: 700; font-size: 1.0625rem; line-height: 1.3; }
.tl-state { font: 700 .875rem/1.2 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--teal); }
.tl-item[data-state="next"] .tl-state { color: var(--accent-dark); }
.tl-item[data-state="later"] .tl-state { color: #4a463d; }
.tl-detail { font-size: .9375rem; line-height: 1.35; color: var(--muted); }

@container (min-width: 36rem) {
  .compare { grid-template-columns: 1fr 1fr; }
  .layout-image .slide-inner { grid-template-columns: 1fr 1fr; align-items: start; }
  .layout-image h2, .layout-image .source { grid-column: 1 / -1; }
  .timeline { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
  .bar-row { grid-template-columns: minmax(8rem, 14rem) 1fr; align-items: center; }
  .bar-text { grid-column: 2; }
}

/* ------------------------------------------------------------ the stage: >= 880px of slide width */

@container (min-width: 880px) {
  .slide-inner { gap: 2cqw; padding: 3.6cqw 6cqw 1.2cqw; align-content: start; }
  .slide-foot { padding: 0 6cqw 1.9cqw; font-size: 1.45cqw; }
  .slide h2 { font-size: 4.1cqw; line-height: 1.12; }
  .slide h3 { font-size: 1.8cqw; }
  .body { font-size: 2.15cqw; line-height: 1.42; max-width: 62cqw; gap: 1.1cqw; }
  .summary { font-size: 2cqw; line-height: 1.4; max-width: 80cqw; }
  .source { font-size: 1.45cqw; }
  .media figcaption { font-size: 1.45cqw; margin-top: .8cqw; }
  .side { font-size: 1.85cqw; line-height: 1.32; padding: 1.4cqw 1.8cqw; gap: .6cqw; border-top-width: .5cqw !important; }
  .side ul { padding-left: 2cqw; gap: .4cqw; }
  .compare { gap: 2cqw; }

  .layout-title .slide-inner { align-content: end; padding-bottom: 3.5cqw; gap: 2.2cqw; }
  .layout-title h2 { font-size: 5.6cqw; line-height: 1.08; max-width: 80cqw; }
  .layout-title .body { font-size: 2.3cqw; max-width: 60cqw; }
  .layout-title .slide-inner::before { content: ""; width: 9cqw; border-top: .7cqw solid #e8895e; order: -1; margin-bottom: .6cqw; }
  .layout-statement .slide-inner { align-content: center; }
  .layout-statement h2 { font-size: 4.9cqw; border-left-width: .7cqw; padding-left: 2cqw; max-width: 82cqw; }
  .layout-statement .body { font-size: 2.3cqw; margin-left: 2.7cqw; }
  .layout-image .slide-inner { grid-template-columns: 4fr 7fr; gap: 1.6cqw 3cqw; }
  .layout-image h2 { font-size: 3.7cqw; }
  .layout-image .body { grid-column: 1; grid-row: 2; align-self: start; font-size: 2.1cqw; }
  .layout-image .media { grid-column: 2; grid-row: 2; }
  .layout-image .media img { width: auto; max-width: 100%; height: auto; max-height: 25cqw; }
  .layout-image .source { grid-row: 3; }
  .layout-comparison .slide-inner, .layout-image .slide-inner { align-content: center; }
  .layout-comparison h2 { font-size: 3.4cqw; }
  .layout-chart .slide-inner { grid-template-columns: 30cqw minmax(0, 1fr); grid-template-rows: auto 1fr auto; column-gap: 2cqw; row-gap: 1.6cqw; }
  .layout-chart h2 { font-size: 3.2cqw; grid-column: 1; grid-row: 1; }
  .layout-chart .body { grid-column: 1; grid-row: 2; align-self: start; font-size: 1.9cqw; }
  .layout-chart .chart { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
  .layout-chart .source { grid-column: 1 / -1; grid-row: 4; }
  .layout-closing .slide-inner { align-content: center; gap: 2.4cqw; }
  .layout-closing h2 { font-size: 4.6cqw; max-width: 80cqw; }
  .layout-closing .body { font-size: 2.2cqw; max-width: 66cqw; }
  .layout-closing .body p:first-child { font-size: 2.9cqw; line-height: 1.25; }

  .chart { --dot: 1.1cqw; padding: 1.3cqw 2cqw; gap: .7cqw; }
  .chart-title { font-size: 1.85cqw; }
  .chart-note { font-size: 1.45cqw; padding-top: .7cqw; }
  .axis-label { font-size: 1.5cqw; }
  .dp-row { margin-bottom: .4cqw; gap: .2cqw; }
  .dp-head { gap: 0 2cqw; }
  .dp-label { font-size: 1.85cqw; }
  .dp-marks { font-size: 1.8cqw; gap: .2cqw .6cqw; }
  .tick { font-size: 1.45cqw; }
  .dp-axis { height: 2.2cqw; }
  .bars { gap: 1.2cqw; }
  .bar-label { font-size: 1.85cqw; }
  .bar-text { font-size: 1.85cqw; }
  .bar-track { height: 1.9cqw; }
  .bar-row { grid-template-columns: 25cqw 1fr; column-gap: 1.6cqw; }
  .bar-text { grid-column: 1 / -1; }
  .timeline { grid-auto-flow: row; grid-template-columns: 1fr; gap: .8cqw; }
  .tl-item { grid-template-columns: 11cqw 1fr; grid-template-areas: "when label" "state detail"; column-gap: 1.6cqw; row-gap: .1cqw; padding: .5cqw 1.4cqw; border-left-width: .6cqw; }
  .tl-when { grid-area: when; font-size: 1.45cqw; }
  .tl-label { grid-area: label; font-size: 1.85cqw; }
  .tl-state { grid-area: state; font-size: 1.45cqw; }
  .tl-detail { grid-area: detail; font-size: 1.45cqw; }
}

/* ------------------------------------------------------------ presentation mode (screen only) */

@media screen {
  html.deck-presenting, html.deck-presenting body { height: 100%; overflow: hidden; }
  html.deck-presenting body { display: grid; grid-template-rows: var(--bar) minmax(0, 1fr); background: #0f0e0c; }
  html.deck-presenting .deck-bar { height: var(--bar); flex-wrap: nowrap; padding-block: .25rem; }
  html.deck-presenting .deck-name { line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  html.deck-presenting .deck-controls { flex-wrap: nowrap; flex: none; }
  html.deck-presenting .deck-badge { display: none; }
  html.deck-presenting .deck { display: grid; place-items: center; min-height: 0; padding: 0; touch-action: pan-y pinch-zoom; }
  html.deck-presenting .slide { display: none; margin: 0; border: 0; border-radius: 0; max-width: none; scroll-margin-top: 0; }
  html.deck-presenting .slide[data-active] {
    display: grid; grid-template-rows: minmax(0, 1fr) auto;
    width: min(100vw, calc((100vh - var(--bar)) * 16 / 9)); aspect-ratio: 16 / 9; overflow: hidden;
    animation: deck-in .22s ease-out;
  }
  html.deck-presenting .slide-num { visibility: hidden; }
  html.deck-presenting .slide:focus-visible { outline: none; } /* one slide fills the stage; the announcement and the counter say where you are */
  html.deck-presenting .deck-outline {
    display: none; position: fixed; z-index: 20; top: var(--bar); right: 0; bottom: 0; width: min(28rem, 92vw); overflow: auto;
    margin: 0; padding: 1rem 1.25rem; background: var(--paper); border-left: 4px solid var(--ink); max-width: none;
  }
  html.deck-presenting .deck-outline[data-open] { display: block; }
  html.deck-presenting .deck-outline summary { display: none; }
}
/* reading mode on a screen big enough for the stage keeps the bar in view; on a phone it scrolls away so no slide ever starts under it */
@media screen and (min-width: 1024px) and (min-height: 640px) {
  html.deck-reading .deck-bar { position: sticky; top: 0; z-index: 10; flex-wrap: nowrap; height: var(--bar); padding-block: .25rem; }
  html.deck-reading .deck-badge { display: none; }
  html.deck-reading .slide { scroll-margin-top: calc(var(--bar) + 1rem); }
}
@keyframes deck-in { from { opacity: 0; transform: translateY(.6rem); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; animation-duration: 0s !important; transition-duration: 0s !important; scroll-behavior: auto !important; }
}
