:root {
  --paper: #f3efe4;
  --card: #fbf9f3;
  --ink: #1b1a17;
  --ink-soft: #5d574d;
  --rule: #d9d1bf;
  --accent: #d6452b;
  --accent-ink: #fff;
  --tint: #ebe5d6;
  --display: "Playfair Display", Georgia, "Times New Roman", serif;
  --body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #15140f;
    --card: #1d1b15;
    --ink: #ece6d6;
    --ink-soft: #a69e8c;
    --rule: #37332a;
    --accent: #ef6a4c;
    --tint: #24221a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #15140f;
  --card: #1d1b15;
  --ink: #ece6d6;
  --ink-soft: #a69e8c;
  --rule: #37332a;
  --accent: #ef6a4c;
  --tint: #24221a;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
html {
  background: var(--paper);
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 3px;
}
a:hover {
  text-decoration-color: currentColor;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
}
.muted {
  color: var(--ink-soft);
}
.small {
  font-size: 14px;
}
.center {
  text-align: center;
}
.error {
  color: var(--accent);
  font-weight: 600;
}
.notice {
  margin: 10px 0 0;
  font-family: var(--ui);
  font-size: 14px;
  color: var(--ink-soft);
}
.loading {
  text-align: center;
  margin-top: 30vh;
  font-family: var(--display);
  font-style: italic;
  font-size: 22px;
}
.link {
  background: none;
  border: 0;
  padding: 0;
  text-decoration: underline;
  color: var(--ink-soft);
  font-family: var(--ui);
  font-size: 14px;
}

/* ---------- home ---------- */

.home {
  max-width: 880px;
  margin: 0 auto;
  padding: 64px 16px 80px;
}
.hero {
  text-align: center;
}
.brand {
  margin: 0;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(56px, 11vw, 112px);
  line-height: 1;
  letter-spacing: -0.02em;
}
.brand::after {
  content: "";
  display: inline-block;
  width: 0.16em;
  height: 0.16em;
  margin-left: 0.04em;
  border-radius: 50%;
  background: var(--accent);
}
.tagline {
  margin: 14px auto 36px;
  max-width: 34em;
  color: var(--ink-soft);
  font-style: italic;
  font-size: 19px;
}

.ask {
  display: flex;
  gap: 8px;
  padding: 8px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 999px;
  box-shadow: 0 10px 30px -18px rgb(0 0 0 / 0.35);
}
.ask input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 10px 18px;
  font-size: 20px;
  outline: none;
}
.ask button {
  border: 0;
  border-radius: 999px;
  padding: 10px 24px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--ui);
  font-weight: 600;
  font-size: 16px;
}
.ask button:hover {
  background: var(--accent);
  color: var(--accent-ink);
}
.ask:focus-within {
  border-color: var(--ink-soft);
}

.examples {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-family: var(--ui);
  font-size: 14px;
  color: var(--ink-soft);
}
.examples button {
  border: 1px solid var(--rule);
  background: transparent;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 14px;
  font-family: var(--ui);
  color: var(--ink-soft);
}
.examples button:hover {
  color: var(--ink);
  border-color: var(--ink-soft);
}

.connection {
  margin: 18px auto 0;
  max-width: 40em;
  font-family: var(--ui);
  font-size: 13px;
  color: var(--ink-soft);
  text-align: center;
}
.connection .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--rule);
  translate: 0 -1px;
}
.connection.ok .dot {
  background: #3f9b6b;
}
.connection.off .dot {
  background: var(--accent);
}
.connection code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--tint);
  font-size: 12px;
  white-space: nowrap;
}

.job {
  margin-top: 28px;
}
.job-card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.job-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--ui);
}
.phases {
  list-style: none;
  margin: 14px 0 6px;
  padding: 0;
  font-family: var(--ui);
  font-size: 15px;
}
.phases li {
  position: relative;
  padding: 6px 0 6px 30px;
  color: var(--ink-soft);
}
.phases li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 11px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--rule);
}
.phases li.now {
  color: var(--ink);
  font-weight: 600;
}
.phases li.now::before {
  border-color: var(--accent);
  border-top-color: transparent;
  animation: spin 0.9s linear infinite;
}
.phases li.done::before {
  background: var(--ink);
  border-color: var(--ink);
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.library {
  margin-top: 64px;
}
.library h2 {
  margin: 0 0 16px;
  font-family: var(--ui);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  text-decoration: none;
  transition: transform 0.15s, border-color 0.15s;
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--ink-soft);
}
.card strong {
  font-family: var(--display);
  font-size: 21px;
  line-height: 1.2;
}
.card-kicker,
.card-topic {
  font-family: var(--ui);
  font-size: 12px;
  color: var(--ink-soft);
}
.card-kicker {
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

/* ---------- study shell ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
  font-family: var(--ui);
}
.brand-small {
  font-family: var(--display);
  font-weight: 900;
  font-size: 24px;
  text-decoration: none;
}
.topbar-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 14px;
  color: var(--ink-soft);
}
.tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--tint);
  border-radius: 999px;
}
.tabs a {
  padding: 6px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
}
.tabs a:hover {
  color: var(--ink);
}
.tabs a.on {
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.12);
}
.sample-note {
  max-width: 1180px;
  margin: 16px auto 0;
  padding: 10px 16px;
  background: var(--tint);
  border-radius: 10px;
  font-family: var(--ui);
  font-size: 14px;
  color: var(--ink-soft);
}
.view {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px 80px;
}

/* ---------- read ---------- */

.paper-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 48px;
}
.toc {
  position: sticky;
  top: 80px;
  align-self: start;
  font-family: var(--ui);
  font-size: 14px;
}
.toc h4,
.abstract h4,
.findings h4 {
  margin: 0 0 10px;
  font-family: var(--ui);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.toc ol {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-soft);
}
.toc li {
  margin: 6px 0;
}
.toc a {
  text-decoration: none;
}
.toc a:hover {
  color: var(--accent);
}
.print {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 8px 12px;
  background: none;
  border: 1px solid var(--rule);
  border-radius: 8px;
  font-family: var(--ui);
  font-size: 13px;
  color: var(--ink-soft);
}
.print:hover {
  color: var(--ink);
}

.paper {
  max-width: 720px;
}
.kicker {
  margin: 0;
  font-family: var(--ui);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
.paper h1 {
  margin: 10px 0 10px;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.dek {
  margin: 0 0 14px;
  font-size: 22px;
  font-style: italic;
  color: var(--ink-soft);
  line-height: 1.4;
}
.meta {
  margin: 0 0 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--ui);
  font-size: 13px;
  color: var(--ink-soft);
}
.abstract,
.findings {
  margin-bottom: 20px;
  padding: 20px 24px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.abstract p {
  margin: 0;
}
.findings ul {
  margin: 0;
  padding-left: 20px;
}
.findings li {
  margin: 6px 0;
}
.findings li::marker {
  color: var(--accent);
}
.paper h2 {
  margin: 48px 0 12px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 30px;
  line-height: 1.15;
}
.paper section > p {
  hyphens: auto;
}
.cite {
  font-family: var(--ui);
  font-size: 0.62em;
  font-weight: 600;
  margin-left: 1px;
}
.cite a {
  color: var(--accent);
  text-decoration: none;
}
.refs ol {
  padding-left: 28px;
  font-size: 16px;
}
.refs li {
  margin: 8px 0;
  scroll-margin-top: 90px;
}
.refs li:target,
.refs li:focus-within {
  background: var(--tint);
}

/* ---------- slides (sized in container units so they scale anywhere) ---------- */

.slide {
  --s-bg: #17160f;
  --s-ink: #f3efe4;
  --s-accent: #ef6a4c;
  container-type: inline-size;
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  background: var(--s-bg);
  color: var(--s-ink);
  position: relative;
}
.slide.tone-1 {
  --s-bg: #f3efe4;
  --s-ink: #1b1a17;
  --s-accent: #d6452b;
}
.slide.tone-2 {
  --s-bg: #1d3b3a;
  --s-ink: #f3efe4;
  --s-accent: #f2b134;
}
.slide.layout-title,
.slide.layout-closing {
  --s-bg: #17160f;
  --s-ink: #f3efe4;
  --s-accent: #ef6a4c;
  background: radial-gradient(120% 90% at 85% 10%, color-mix(in srgb, var(--s-accent) 38%, transparent), transparent 55%), var(--s-bg);
}
.s-inner {
  position: absolute;
  inset: 0;
  padding: 7cqw 8cqw;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.s-kicker {
  font-family: var(--ui);
  font-weight: 700;
  font-size: 1.5cqw;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--s-accent);
}
.s-end {
  margin-top: 4cqw;
}
.s-title {
  margin: 1.5cqw 0;
  font-family: var(--display);
  font-weight: 900;
  font-size: 7cqw;
  line-height: 1;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.s-head {
  margin: 0 0 3cqw;
  font-family: var(--display);
  font-weight: 800;
  font-size: 4.4cqw;
  line-height: 1.05;
  text-wrap: balance;
}
.s-sub {
  margin: 0;
  max-width: 70%;
  font-family: var(--body);
  font-style: italic;
  font-size: 2.3cqw;
  line-height: 1.35;
  opacity: 0.85;
}
.s-bullets {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 2.5cqw;
  line-height: 1.35;
}
.s-bullets li {
  position: relative;
  padding-left: 3.4cqw;
  margin: 1.4cqw 0;
}
.s-bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 1.4cqw;
  height: 0.35cqw;
  background: var(--s-accent);
}
.s-stat {
  margin: 1cqw 0;
  font-family: var(--display);
  font-weight: 900;
  font-size: 13cqw;
  line-height: 1;
  color: var(--s-accent);
  letter-spacing: -0.02em;
}
.s-stat-label {
  margin: 0;
  max-width: 70%;
  font-size: 2.8cqw;
  line-height: 1.3;
}
.s-quote-mark {
  font-family: var(--display);
  font-size: 14cqw;
  line-height: 0.6;
  color: var(--s-accent);
}
.s-quote {
  margin: 0;
  font-family: var(--display);
  font-style: italic;
  font-size: 4cqw;
  line-height: 1.2;
}
.s-by {
  margin: 2cqw 0 0;
  font-size: 2cqw;
  opacity: 0.8;
}
.s-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3cqw;
}
.s-side {
  padding: 2.6cqw 3cqw;
  border-radius: 1.4cqw;
  background: color-mix(in srgb, var(--s-ink) 8%, transparent);
}
.s-side-1 {
  background: color-mix(in srgb, var(--s-accent) 22%, transparent);
}
.s-side h3 {
  margin: 0 0 1.2cqw;
  font-family: var(--ui);
  font-size: 1.7cqw;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.s-side ul {
  margin: 0;
  padding-left: 2.4cqw;
  font-size: 2.3cqw;
  line-height: 1.35;
}
.s-side li {
  margin: 0.8cqw 0;
}
.s-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 2cqw;
  border-top: 0.35cqw solid var(--s-accent);
}
.s-timeline li {
  position: relative;
  padding-top: 2.6cqw;
}
.s-timeline li::before {
  content: "";
  position: absolute;
  top: -1.1cqw;
  left: 0;
  width: 1.8cqw;
  height: 1.8cqw;
  border-radius: 50%;
  background: var(--s-bg);
  border: 0.35cqw solid var(--s-accent);
}
.s-when {
  display: block;
  font-family: var(--display);
  font-weight: 800;
  font-size: 2.6cqw;
  color: var(--s-accent);
}
.s-what {
  display: block;
  margin-top: 0.6cqw;
  font-size: 1.9cqw;
  line-height: 1.3;
}

/* the deck */
.deck-stage {
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 24px 60px -30px rgb(0 0 0 / 0.5);
}
.deck-stage:fullscreen {
  display: grid;
  place-items: center;
  background: #000;
  border-radius: 0;
}
.deck-stage:fullscreen .deck-frame {
  width: min(100vw, 177.78vh);
}
.deck-bar {
  margin-top: 12px;
}
.deck-notes {
  margin: 12px 0 0;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  font-size: 16px;
}
.thumbs {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding-bottom: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.thumb {
  flex: none;
  width: 148px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  background: none;
  opacity: 0.65;
  transition: opacity 0.15s;
}
.thumb:hover,
.thumb.on {
  opacity: 1;
}
.thumb.on {
  border-color: var(--accent);
}
.thumb .slide {
  pointer-events: none;
}

/* ---------- player ---------- */

.controls-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--ui);
  font-size: 14px;
}
.spacer {
  flex: 1;
}
.counter {
  min-width: 56px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}
.ctl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 38px;
  height: 38px;
  padding: 0 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-family: var(--ui);
  font-weight: 600;
  font-size: 13px;
}
.ctl:hover {
  background: var(--tint);
}
.ctl.text {
  color: var(--ink-soft);
}
.ctl.text.on {
  color: var(--ink);
  background: var(--tint);
}
.ctl-select {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-soft);
}
.ctl-select select {
  max-width: 150px;
  padding: 6px 8px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--card);
  font-family: var(--ui);
  font-size: 13px;
}

.player {
  max-width: 1040px;
  margin: 0 auto;
}
.stage {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  background: #0e0d0a;
  box-shadow: 0 24px 60px -30px rgb(0 0 0 / 0.55);
  cursor: pointer;
}
.player:fullscreen {
  max-width: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #000;
  padding: 0 2vw;
}
.player:fullscreen .stage {
  width: min(100%, 165vh);
  margin: 0 auto;
  border-radius: 0;
}
.player:fullscreen .controls {
  color: #eee;
  --ink: #eee;
  --ink-soft: #aaa;
  --tint: #222;
  --card: #111;
  --rule: #333;
}
.stage-frame,
.frame {
  position: absolute;
  inset: 0;
}
.frame {
  transition: opacity 0.5s ease, transform 0.6s ease;
}
.frame.entering {
  opacity: 0;
  transform: scale(1.03);
}
.frame.leaving {
  opacity: 0;
}
.slide-frame .slide {
  height: 100%;
}
.caption {
  position: absolute;
  left: 50%;
  bottom: 5%;
  max-width: 80%;
  transform: translate(-50%, 8px);
  padding: 6px 14px;
  border-radius: 8px;
  background: rgb(0 0 0 / 0.72);
  color: #fff;
  font-family: var(--ui);
  font-size: clamp(13px, 1.7vw, 19px);
  line-height: 1.4;
  text-align: center;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}
.caption.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.big-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 84px;
  height: 84px;
  border: 0;
  border-radius: 50%;
  background: rgb(0 0 0 / 0.55);
  color: #fff;
  display: grid;
  place-items: center;
  backdrop-filter: blur(6px);
  transition: transform 0.15s, opacity 0.2s;
}
.big-play .icon {
  width: 40px;
  height: 40px;
  margin-left: 4px;
}
.big-play:hover {
  transform: scale(1.06);
}
.big-play.hidden {
  opacity: 0;
  pointer-events: none;
}
.controls {
  margin-top: 12px;
}
.progress {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
}
.progress-seg {
  flex: 1;
  height: 14px;
  padding: 5px 0;
  border: 0;
  background: none;
}
.progress-seg span {
  display: block;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--accent) var(--p, 0%), var(--rule) var(--p, 0%));
}
.progress-seg.done span {
  background: var(--accent);
}
.progress-seg:not(.done):not(.now) span {
  --p: 0%;
}

/* ---------- explainer scenes ---------- */

.scene {
  container-type: inline-size;
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ui);
}
.x-inner {
  position: absolute;
  inset: 0;
  padding: 6cqw 8cqw;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.x-blobs i {
  position: absolute;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.16;
  animation: float 14s ease-in-out infinite alternate;
}
.x-blobs i:nth-child(1) {
  width: 34cqw;
  height: 34cqw;
  right: -8cqw;
  top: -10cqw;
}
.x-blobs i:nth-child(2) {
  width: 16cqw;
  height: 16cqw;
  left: -5cqw;
  bottom: -4cqw;
  animation-duration: 18s;
}
.x-blobs i:nth-child(3) {
  width: 6cqw;
  height: 6cqw;
  right: 22cqw;
  bottom: 10cqw;
  opacity: 0.3;
  animation-duration: 9s;
}
@keyframes float {
  to {
    transform: translate(-3cqw, 3cqw) scale(1.08);
  }
}

.x-head {
  margin: 0 0 3cqw;
  font-family: var(--display);
  font-weight: 900;
  font-size: 4.6cqw;
  line-height: 1.05;
  opacity: 0;
  transform: translateY(2cqw);
  transition: opacity 0.6s, transform 0.6s;
}
.x-sub {
  margin: 1.5cqw 0 0;
  max-width: 75%;
  font-family: var(--body);
  font-style: italic;
  font-size: 2.4cqw;
  line-height: 1.35;
  opacity: 0;
  transition: opacity 0.8s 0.6s;
}
.x-sub.small {
  margin: -2cqw 0 3cqw;
  font-size: 1.9cqw;
}
.x-kicker {
  margin: 0;
  font-weight: 700;
  font-size: 2cqw;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.6s;
}
.scene.in .x-head,
.scene.in .x-sub,
.scene.in .x-kicker {
  opacity: 1;
  transform: none;
}

/* parts that appear with the narration */
.step {
  opacity: 0;
  transform: translateY(2cqw);
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1.2);
}
.step.on {
  opacity: 1;
  transform: none;
}

/* title */
.kind-title .x-inner {
  align-items: flex-start;
}
.kind-title .x-title {
  margin: 0;
  max-width: 85%;
  font-family: var(--display);
  font-weight: 900;
  font-size: 7.2cqw;
  line-height: 1;
}
.w {
  display: inline-block;
  opacity: 0;
  transform: translateY(60%) rotate(4deg);
  transition: opacity 0.5s, transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1.3);
  transition-delay: calc(var(--i) * 90ms);
}
.scene.in .w {
  opacity: 1;
  transform: none;
}
.scene.kind-title .x-sub {
  transition-delay: 1.1s;
}
.x-orbit {
  position: absolute;
  right: 9cqw;
  top: 50%;
  width: 18cqw;
  height: 18cqw;
  margin-top: -9cqw;
  border: 0.4cqw dashed color-mix(in srgb, var(--ink) 40%, transparent);
  border-radius: 50%;
  animation: spin 24s linear infinite;
}
.x-orbit i {
  position: absolute;
  width: 3cqw;
  height: 3cqw;
  border-radius: 50%;
  background: var(--accent);
  top: -1.5cqw;
  left: 50%;
}
.x-orbit i:nth-child(2) {
  top: auto;
  bottom: -1.5cqw;
  background: var(--ink);
  width: 2cqw;
  height: 2cqw;
}
.x-orbit i:nth-child(3) {
  top: 50%;
  left: -1cqw;
  width: 2cqw;
  height: 2cqw;
}

/* stat */
.kind-stat .x-inner {
  align-items: center;
  text-align: center;
}
.x-stat {
  font-family: var(--display);
  font-weight: 900;
  font-size: 15cqw;
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  transform: scale(0.6);
  opacity: 0;
  transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1.3), opacity 0.4s;
}
.scene.in .x-stat {
  transform: none;
  opacity: 1;
}
.x-underline {
  width: 0;
  height: 0.6cqw;
  margin: 1.5cqw auto 0;
  background: var(--ink);
  border-radius: 1cqw;
  transition: width 1.2s 0.4s ease;
}
.scene.in .x-underline {
  width: 22cqw;
}
.scene.kind-stat .x-sub {
  margin-left: auto;
  margin-right: auto;
}

/* bars */
.x-bars {
  display: grid;
  gap: 1.8cqw;
}
.x-bar {
  display: grid;
  grid-template-columns: 22cqw 1fr 9cqw;
  align-items: center;
  gap: 2cqw;
  font-size: 2.1cqw;
  font-weight: 600;
}
.x-bar-track {
  height: 3.4cqw;
  border-radius: 1cqw;
  background: color-mix(in srgb, var(--ink) 12%, transparent);
  overflow: hidden;
}
.x-bar-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 1cqw;
  background: var(--accent);
  transition: width 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.x-bar.on .x-bar-fill {
  width: var(--w);
}
.x-bar:nth-child(odd) .x-bar-fill {
  background: var(--ink);
}
.x-bar-value {
  font-family: var(--display);
  font-weight: 800;
  font-size: 2.6cqw;
}

/* compare */
.x-compare {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6cqw;
}
.x-panel {
  padding: 3cqw;
  border-radius: 2cqw;
  background: color-mix(in srgb, var(--ink) 10%, transparent);
}
.x-panel-0 {
  transform: translateX(-6cqw);
}
.x-panel-1 {
  transform: translateX(6cqw);
  background: var(--accent);
  color: var(--bg);
}
.x-panel.on {
  transform: none;
}
.x-panel h3 {
  margin: 0 0 1.5cqw;
  font-family: var(--display);
  font-size: 3.2cqw;
}
.x-panel ul {
  margin: 0;
  padding-left: 2.6cqw;
  font-size: 2.2cqw;
  line-height: 1.4;
}
.x-panel li {
  opacity: 0;
  transition: opacity 0.4s;
  transition-delay: calc(0.35s + var(--j) * 0.25s);
}
.x-panel.on li {
  opacity: 1;
}
.x-vs {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  width: 6cqw;
  height: 6cqw;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--display);
  font-weight: 900;
  font-style: italic;
  font-size: 2.2cqw;
}

/* timeline */
.x-timeline {
  position: relative;
}
.x-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 1.2cqw;
  height: 0.5cqw;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 2.4s ease;
}
.scene.in .x-line {
  transform: scaleX(1);
}
.x-timeline ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 2cqw;
}
.x-timeline li {
  position: relative;
  padding-top: 4.4cqw;
  font-size: 2cqw;
  line-height: 1.3;
}
.x-dot {
  position: absolute;
  top: 0;
  left: 0;
  width: 2.9cqw;
  height: 2.9cqw;
  border-radius: 50%;
  background: var(--bg);
  border: 0.6cqw solid var(--ink);
}
.x-timeline strong {
  display: block;
  font-family: var(--display);
  font-size: 3cqw;
  color: var(--accent);
}

/* cycle */
.scene.kind-cycle .x-head {
  position: absolute;
  top: 5cqw;
  left: 8cqw;
}
.x-cycle {
  position: relative;
  width: 42cqw;
  height: 42cqw;
  margin: 3cqw auto 0;
}
.x-ring {
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  border: 0.6cqw dashed color-mix(in srgb, var(--ink) 45%, transparent);
}
.scene.closed .x-ring {
  border-style: solid;
  border-color: var(--accent);
  animation: spin 16s linear infinite;
}
.x-node {
  position: absolute;
  left: var(--x);
  top: var(--y);
  translate: -50% -50%;
  width: 17cqw;
  padding: 1.4cqw 1.6cqw;
  border-radius: 1.6cqw;
  background: var(--ink);
  color: var(--bg);
  text-align: center;
  font-size: 1.9cqw;
  font-weight: 700;
  line-height: 1.2;
  transform: scale(0.6);
}
.x-node.on {
  transform: none;
}
.x-node-n {
  display: block;
  margin-bottom: 0.4cqw;
  color: var(--accent);
  font-family: var(--display);
  font-size: 2.4cqw;
}
.x-cycle-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 8cqw;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.6s;
}
.scene.closed .x-cycle-center {
  opacity: 1;
}

/* icons */
.x-icons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16cqw, 1fr));
  gap: 2.4cqw;
}
.x-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.8cqw;
  transform: scale(0.4);
}
.x-icon.on {
  transform: none;
}
.x-emoji {
  display: grid;
  place-items: center;
  width: 11cqw;
  height: 11cqw;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ink) 12%, transparent);
  font-size: 5.5cqw;
}
.x-icon strong {
  font-size: 2.3cqw;
}
.x-icon span:last-child:not(.x-emoji) {
  font-size: 1.6cqw;
  opacity: 0.85;
}

/* quote */
.x-quote-mark {
  font-family: var(--display);
  font-size: 16cqw;
  line-height: 0.5;
  color: var(--accent);
}
.x-quote {
  margin: 0;
  font-family: var(--display);
  font-style: italic;
  font-size: 4.4cqw;
  line-height: 1.2;
}
.x-by {
  margin: 2cqw 0 0;
  font-size: 2cqw;
  opacity: 0;
  transition: opacity 0.6s 1.5s;
}
.scene.in .x-by {
  opacity: 0.85;
}

/* points */
.x-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2cqw;
}
.x-points li {
  display: flex;
  align-items: center;
  gap: 2.4cqw;
  transform: translateX(-4cqw);
}
.x-points li.on {
  transform: none;
}
.x-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 5.4cqw;
  height: 5.4cqw;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--display);
  font-weight: 900;
  font-size: 2.6cqw;
}
.x-points strong {
  display: block;
  font-size: 2.8cqw;
}
.x-points span {
  display: block;
  font-size: 2cqw;
  opacity: 0.85;
}

/* ---------- smaller screens ---------- */

@media (max-width: 860px) {
  .topbar {
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 10px 16px;
  }
  .topbar-title {
    display: none;
  }
  .tabs {
    order: 3;
    width: 100%;
    overflow-x: auto;
  }
  .tabs a {
    flex: 1;
    text-align: center;
    padding: 6px 10px;
  }
  .view {
    padding: 20px 16px 64px;
  }
  .paper-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .toc {
    position: static;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--rule);
  }
  .ctl-select:first-of-type {
    display: none;
  }
}
@media (max-width: 560px) {
  body {
    font-size: 17px;
  }
  .home {
    padding-top: 40px;
  }
  .ask {
    border-radius: 18px;
    flex-direction: column;
  }
  .ask input {
    font-size: 18px;
  }
  .controls-row {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
}

@media print {
  .topbar,
  .toc,
  .sample-note,
  .print {
    display: none !important;
  }
  :root {
    --paper: #fff;
    --card: #fff;
    --ink: #000;
    --ink-soft: #444;
  }
  .paper-layout {
    display: block;
  }
  .paper {
    max-width: none;
  }
}

/* credit: a link back to the main site at the foot of the home view */
.credit {
  margin: 56px 0 0;
  text-align: center;
  font-size: 13px;
}
.credit a {
  color: var(--ink-soft);
}
