:root {
  --stage: #15120e;
  --stage-2: #201b15;
  --stage-3: #2c261e;
  --line: #3a3228;
  --text: #f3ece0;
  --muted: #a89c8b;
  --paper: #f5efe3;
  --ink: #15120e;
  --tomato: #e5482d;
  --tomato-bright: #ff6a45;
  --display: "Fraunces", "Songti SC", "Noto Serif CJK SC", Georgia, serif;
  --sans: "IBM Plex Sans", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--stage); color: var(--text); font: 400 16px/1.5 var(--sans); }
[hidden] { display: none !important; }
h1, h2, p, ol, ul { margin: 0; }
code { font-family: var(--mono); font-size: .85em; }

.eyebrow { font: 500 12px/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.fine { font-size: 14px; color: var(--muted); }
.placeholder { color: var(--muted); font: italic 300 24px/1.3 var(--display); }
.placeholder.small { font-size: 17px; }
.spacer { flex: 1; }

/* Buttons */
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--stage-2); color: var(--text);
  font: 500 14px/1 var(--sans); padding: 11px 14px; border-radius: 3px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  transition: background .12s, border-color .12s, transform .06s;
}
.btn:hover:not(:disabled) { background: var(--stage-3); border-color: #5a4e3e; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:focus-visible, input:focus-visible { outline: 2px solid var(--tomato-bright); outline-offset: 2px; }
.btn:disabled { opacity: .4; cursor: default; }
.btn.primary { background: var(--tomato); border-color: var(--tomato); color: #fff8ef; }
.btn.primary:hover:not(:disabled) { background: var(--tomato-bright); border-color: var(--tomato-bright); }
.btn.hot { border-color: var(--tomato); color: var(--tomato-bright); }
.btn.large { font-size: 17px; padding: 16px 22px; }
.btn.small { font-size: 13px; padding: 7px 10px; }
.btn[aria-pressed="true"] { background: var(--paper); color: var(--ink); border-color: var(--paper); }
kbd { font: 500 11px/1 var(--mono); padding: 3px 5px; border: 1px solid currentColor; border-radius: 2px; opacity: .7; }

.banner {
  position: fixed; z-index: 10; top: 12px; left: 50%; transform: translateX(-50%); max-width: min(760px, calc(100vw - 32px));
  display: flex; gap: 14px; align-items: center; background: var(--paper); color: var(--ink); padding: 10px 14px; border-radius: 3px;
  font-size: 14px; box-shadow: 0 8px 30px #0008;
}

/* Lobby */
.lobby, .ended, .building { min-height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 24px; padding: 8vh max(24px, 9vw); }
.wordmark { font: 400 clamp(84px, 17vw, 240px)/.9 var(--display); letter-spacing: -.04em; font-variation-settings: "SOFT" 50, "WONK" 1; }
.lede { max-width: 620px; font-size: 20px; line-height: 1.45; color: #d9cfbf; }
.ended-title { font: 400 clamp(52px, 8vw, 110px)/1 var(--display); letter-spacing: -.03em; }
.build-line { font: italic 300 clamp(32px, 5vw, 60px)/1.15 var(--display); max-width: 900px; }

/* Login */
.login { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 20px; padding: 8vh max(24px, 9vw); }
.wordmark.small { font-size: clamp(64px, 11vw, 140px); }
.login-form { display: flex; flex-direction: column; gap: 14px; width: min(360px, 100%); margin-top: 8px; }
.login-form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.login-form input { background: var(--stage-2); border: 1px solid var(--line); color: var(--text); font: 400 16px var(--sans); padding: 12px; border-radius: 3px; }
.login-form .btn { justify-content: center; }
.login-error { color: var(--tomato-bright); font-size: 14px; }
.logout { margin-top: 4px; }

/* Seed */
.seed { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 400px); }
.seed-talk { display: flex; flex-direction: column; gap: 20px; padding: 40px max(24px, 5vw); height: 100vh; }
.section-head h2 { font: 400 clamp(30px, 3.6vw, 46px)/1.1 var(--display); letter-spacing: -.02em; margin-top: 10px; }
.conversation { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding-right: 8px; }
.line { max-width: 78%; font-size: 18px; line-height: 1.4; }
.line.speaker { align-self: flex-end; background: var(--stage-3); padding: 10px 14px; border-radius: 3px; }
.line.assistant { font: 400 21px/1.35 var(--display); color: #e9dfcf; }
.seed-actions { display: flex; gap: 12px; }
.seed-notes { background: var(--stage-2); border-left: 1px solid var(--line); padding: 40px 24px; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.notes { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.notes li { display: flex; flex-direction: column; gap: 5px; font-size: 14px; line-height: 1.4; color: #d9cfbf; border-top: 1px solid var(--line); padding-top: 12px; }
.notes code { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }

/* Review */
.review { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); gap: 32px; padding: 32px; align-items: center; }
.review-side { display: flex; flex-direction: column; gap: 16px; }
.review-side h2 { font: 400 28px/1.15 var(--display); letter-spacing: -.01em; }
.review-actions { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.review-actions .btn { justify-content: center; }
.outline { padding-left: 22px; display: flex; flex-direction: column; gap: 6px; color: #d9cfbf; }
.outline li::marker { font: 500 12px var(--mono); color: var(--muted); }
.outline .covered { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--tomato); }
.outline.compact { font-size: 13px; gap: 3px; }

/* Present */
.present { height: 100vh; display: grid; grid-template: auto minmax(0, 1fr) auto / minmax(0, 1fr) clamp(300px, 31vw, 520px); }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 18px; padding: 10px 20px; border-bottom: 1px solid var(--line); font: 400 13px var(--mono); color: var(--muted); }
.brand { font: 400 21px/1 var(--display); color: var(--text); letter-spacing: -.02em; }
.onair { display: inline-flex; align-items: center; gap: 7px; color: var(--tomato-bright); text-transform: uppercase; letter-spacing: .08em; font-size: 12px; }
.onair b { font-weight: 500; color: var(--text); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tomato-bright); animation: pulse 1.8s infinite; }
.muzzle.hot { color: var(--tomato-bright); }
.stage { display: flex; align-items: center; justify-content: center; padding: 20px; min-width: 0; min-height: 0; container-type: size; }
.stage .slide-frame { width: min(100cqw, calc(100cqh * 16 / 9)); }
.wings { border-left: 1px solid var(--line); padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; background: var(--stage-2); }
.next-head { display: flex; justify-content: space-between; align-items: center; }
.pill { font: 500 11px/1 var(--mono); padding: 5px 8px; border-radius: 2px; border: 1px solid var(--line); color: var(--muted); letter-spacing: .05em; text-transform: uppercase; }
.pill[data-state="busy"] { color: var(--ink); background: var(--tomato-bright); border-color: var(--tomato-bright); animation: pulse 1.1s infinite; }
.pill[data-state="frozen"] { color: var(--ink); background: var(--paper); border-color: var(--paper); }
.next-note { font: italic 400 16px/1.3 var(--display); color: #e9dfcf; min-height: 21px; }
.next-sources { font: 400 11px/1.4 var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.next-sources:empty { display: none; }
.outline-label { margin-top: 8px; }
.controls { grid-column: 1 / -1; border-top: 1px solid var(--line); padding: 10px 20px 14px; display: flex; flex-direction: column; gap: 10px; }
.heard { display: flex; gap: 12px; align-items: baseline; font: italic 300 17px/1.3 var(--display); color: #d9cfbf; white-space: nowrap; overflow: hidden; }
.heard #heard { overflow: hidden; text-overflow: ellipsis; direction: rtl; text-align: left; unicode-bidi: plaintext; }
.buttons { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.diagnostics { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-height: 26vh; }
.diagnostics pre { margin: 0; overflow: auto; background: #0005; padding: 10px; font: 400 11px/1.45 var(--mono); color: var(--muted); white-space: pre-wrap; }

.typed-box { display: flex; gap: 8px; width: 100%; }
.typed-box input { flex: 1; min-width: 0; background: var(--stage-2); border: 1px solid var(--line); color: var(--text); font: 400 15px var(--sans); padding: 10px 12px; border-radius: 3px; }

/* The slide. All sizes are relative to the frame, so one slide works at any scale. */
.slide-frame { container-type: inline-size; position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: #000; box-shadow: 0 18px 60px #0009; outline: 1px solid var(--line); }
.slide {
  --bg: var(--paper); --fg: var(--ink); --accent: var(--tomato);
  position: absolute; inset: 0; display: flex; flex-direction: column; padding: 5.2cqw 6cqw 5cqw; background: var(--bg); color: var(--fg);
  animation: settle .45s cubic-bezier(.2, .7, .2, 1);
}
.tone-ink { --bg: var(--ink); --fg: var(--paper); --accent: var(--tomato-bright); }
.tone-signal { --bg: var(--tomato); --fg: #fff6ea; --accent: var(--ink); }
.slide-kicker { font: 500 1.35cqw/1.2 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-bottom: 2cqw; }
.slide-title { font: 400 7.2cqw/1.02 var(--display); letter-spacing: -.025em; font-variation-settings: "SOFT" 50, "WONK" 1; text-wrap: balance; max-width: 92%; }
.len-m .slide-title { font-size: 5.8cqw; }
.len-l .slide-title { font-size: 4.6cqw; line-height: 1.06; }
.layout-statement { justify-content: center; }
.slide-subline { margin-top: 2.6cqw; font: 400 2.3cqw/1.35 var(--sans); max-width: 72%; opacity: .78; }
.layout-cards .slide-title, .layout-compare .slide-title { font-size: 4.2cqw; line-height: 1.06; max-width: 86%; }
.slide-cards { margin-top: auto; display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 3cqw; padding-bottom: 1cqw; }
.slide-card { border-top: .2cqw solid currentColor; padding-top: 1.4cqw; }
.slide-num { font: 500 1.15cqw/1 var(--mono); color: var(--accent); margin-bottom: 1.3cqw; }
.slide-card h2 { font: 500 2.5cqw/1.12 var(--display); letter-spacing: -.01em; margin-bottom: 1cqw; }
.slide-card p { font: 400 1.85cqw/1.35 var(--sans); opacity: .82; }
.layout-compare { padding-bottom: 0; padding-left: 0; padding-right: 0; }
.layout-compare .slide-kicker, .layout-compare .slide-title { margin-left: 6cqw; margin-right: 6cqw; }
.layout-compare .slide-cards { position: relative; gap: 0; flex: 1; margin-top: 3cqw; padding: 0; min-height: 0; }
.layout-compare .slide-card { border: 0; padding: 3cqw 6cqw 5cqw; display: flex; flex-direction: column; justify-content: center; }
.layout-compare .slide-card:nth-child(2) { background: var(--fg); color: var(--bg); }
.layout-compare .slide-card h2 { font-size: 3.4cqw; }
.layout-compare .slide-card p { font-size: 2.05cqw; }
.slide-vs { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-8deg); width: 7cqw; height: 7cqw; display: grid; place-items: center; border-radius: 50%; background: var(--tomato); color: #fff6ea; font: italic 400 2.6cqw/1 var(--display); }
.tone-signal .slide-vs { background: #fff6ea; color: var(--tomato); }
.slide-foot { position: absolute; left: 6cqw; bottom: 1.8cqw; font: 400 1cqw/1 var(--mono); letter-spacing: .04em; opacity: .5; }
.layout-compare .slide-foot { mix-blend-mode: difference; color: #fff; opacity: .6; }

/* The next-page preview has to be readable at a third of the size. */
.preview .slide-kicker { font-size: 2cqw; }
.preview .slide-card p { font-size: 2.5cqw; line-height: 1.28; }
.preview .slide-card h2 { font-size: 3cqw; }
.preview .slide-subline { font-size: 3cqw; max-width: 90%; }

.changed { animation: changed 2s ease-out; }

/* Audience */
.audience { background: #000; display: flex; align-items: center; justify-content: center; height: 100vh; overflow: hidden; }
.audience .slide-frame { width: min(100vw, calc(100vh * 16 / 9)); box-shadow: none; outline: 0; cursor: pointer; }
.audience .slide { animation: none; }
.audience .slide-frame.enter .slide { animation: enter .55s cubic-bezier(.2, .7, .2, 1); }

@keyframes pulse { 50% { opacity: .45; } }
@keyframes settle { from { opacity: .35; } }
@keyframes enter { from { opacity: 0; transform: scale(1.015); } }
@keyframes changed {
  0% { background: color-mix(in srgb, var(--tomato) 45%, transparent); box-shadow: 0 0 0 .5cqw color-mix(in srgb, var(--tomato) 45%, transparent); }
  100% { background: transparent; box-shadow: 0 0 0 .5cqw transparent; }
}

@media (max-width: 860px) {
  .seed, .review { grid-template-columns: 1fr; }
  .seed-talk, .seed-notes { height: auto; }
  .present { height: auto; min-height: 100vh; grid-template: auto auto auto auto / 1fr; }
  .stage { container-type: inline-size; padding: 12px; }
  .stage .slide-frame { width: 100%; }
  .wings { border-left: 0; border-top: 1px solid var(--line); }
}

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