:root {
  --bg: #070912;
  --bg2: #0e1330;
  --ink: #eef1ff;
  --dim: #9aa3c7;
  --faint: #5d668f;
  --light: #ffd98a;
  --person: #ffb4a2;
  --place: #8fd3ff;
  --thing: #c3a6ff;
  --name: #e6e9f5;
  --question: #ffe58a;
  --ok: #8be3b0;
  --line: rgba(220, 228, 255, 0.18);
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Inter', system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(120% 90% at 50% 0%, var(--bg2), var(--bg) 70%) fixed, var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  overflow-x: hidden;
}
#stars { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.top, main, .foot { position: relative; z-index: 1; }
.top { display: flex; justify-content: space-between; align-items: center; padding: 18px 24px; }
.brand { font: 600 22px var(--serif); letter-spacing: 0.01em; }
.brand .dot { color: var(--light); text-shadow: 0 0 12px var(--light); }
.mode { font-size: 12px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--dim); }
.mode.live { color: var(--ok); border-color: rgba(139, 227, 176, 0.4); }
main { max-width: 1100px; margin: 0 auto; padding: 0 16px 80px; }
.frame { display: none; animation: rise 0.6s ease both; }
.frame.active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

h1, h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }
h1 { font-size: clamp(30px, 5vw, 54px); line-height: 1.12; text-align: center; margin: 9vh auto 12px; max-width: 18ch; }
h2 { font-size: clamp(24px, 3.4vw, 36px); margin: 6px 0 4px; }
.sub { text-align: center; color: var(--dim); margin: 0 auto 36px; max-width: 46ch; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 12px; color: var(--light); margin: 28px 0 6px; }
.by { text-transform: none; letter-spacing: 0; color: var(--faint); font-size: 12px; }
.hint { text-align: center; color: var(--dim); min-height: 1.6em; font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.mic {
  display: grid; place-items: center; position: relative; margin: 0 auto; width: 168px; height: 168px; border-radius: 50%;
  border: 1px solid rgba(255, 217, 138, 0.5); background: radial-gradient(circle, rgba(255, 217, 138, 0.18), transparent 70%);
  color: var(--ink); font: 500 15px var(--sans); cursor: pointer;
}
.mic-ring { position: absolute; inset: -1px; border-radius: 50%; border: 1px solid var(--light); opacity: 0; }
.mic.on { background: radial-gradient(circle, rgba(255, 217, 138, 0.38), transparent 72%); }
.mic.on .mic-ring { animation: ring 1.6s ease-out infinite; }
@keyframes ring { from { transform: scale(1); opacity: 0.8; } to { transform: scale(1.5); opacity: 0; } }
.alts { display: flex; justify-content: center; gap: 10px; color: var(--faint); margin-top: 18px; }
button { font: inherit; }
.link { background: none; border: 0; color: var(--dim); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 4px; }
.link:hover { color: var(--ink); }
.primary { background: var(--light); color: #1a1405; border: 0; border-radius: 999px; padding: 12px 22px; font-weight: 600; cursor: pointer; }
.primary:disabled { opacity: 0.6; cursor: progress; }
.ghost { background: none; color: var(--dim); border: 1px solid var(--line); border-radius: 999px; padding: 11px 20px; cursor: pointer; }
:focus-visible { outline: 2px solid var(--light); outline-offset: 3px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.center { justify-content: center; margin-top: 18px; }

.type-form { max-width: 640px; margin: 22px auto 0; display: grid; gap: 12px; }
textarea, input {
  width: 100%; background: rgba(255, 255, 255, 0.04); color: var(--ink); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; font: 18px/1.5 var(--serif);
}
.type-form .primary { justify-self: end; }
.code-form { max-width: 420px; margin: 40px auto 0; text-align: center; color: var(--faint); font-size: 14px; }
.code-form .row { margin-top: 10px; flex-wrap: nowrap; }
.code-form input { padding: 10px 14px; font: 16px var(--sans, inherit); }
.code-form .by { min-height: 1.2em; margin-top: 6px; }

.transcript {
  font: clamp(18px, 2.2vw, 24px)/1.6 var(--serif); padding: 22px 24px; border: 1px solid var(--line); border-radius: 16px;
  background: rgba(10, 14, 36, 0.6); margin-bottom: 22px; max-height: 46vh; overflow: auto;
}
#board .transcript { font-size: 17px; max-height: none; }
mark { background: none; color: inherit; border-bottom: 1px dashed rgba(255, 217, 138, 0.6); transition: background 0.3s; }
mark.lit { background: rgba(255, 217, 138, 0.12); }
mark.on { background: rgba(255, 217, 138, 0.32); border-bottom-style: solid; }
.transcript p { margin: 0 0 12px; }
.transcript p:last-child { margin-bottom: 0; }
.transcript .asked { font: italic 14px var(--sans); color: var(--light); opacity: 0.8; margin-top: 18px; }
.transcript .asked::before { content: '↳ '; }

.check { color: var(--dim); margin: 6px 0 18px; }
.check b { color: var(--ok); font-weight: 600; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.card.new { opacity: 0; transform: translateY(18px) scale(0.96); transition: opacity 0.55s, transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1); }
.card.new.in { opacity: 1; transform: none; }
.card.new.in button { animation: arrive 1.8s ease-out; }
@keyframes arrive { from { box-shadow: 0 0 30px color-mix(in srgb, var(--c) 55%, transparent); } }
.card button {
  --c: var(--thing);
  width: 100%; height: 100%; text-align: left; display: grid; gap: 6px; align-content: start; padding: 14px 16px 12px;
  border-radius: 14px; border: 1.5px dashed color-mix(in srgb, var(--c) 55%, transparent);
  background: rgba(12, 16, 40, 0.75); color: var(--ink); cursor: pointer; position: relative; transition: all 0.25s;
}
.k-person button, .k-person { --c: var(--person); }
.k-place button, .k-place { --c: var(--place); }
.k-thing button, .k-thing { --c: var(--thing); }
.k-name button, .k-name { --c: var(--name); }
.k-question button, .k-question { --c: var(--question); }
.card .kind { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--c); }
.card .icon { margin-right: 6px; }
.card .label { font: 600 21px/1.2 var(--serif); }
.card .quote { font: italic 15px/1.45 var(--serif); color: var(--dim); }
.card .quote b { color: var(--ink); font-weight: 600; font-style: normal; }
.card .proof { font-size: 11.5px; color: var(--ok); opacity: 0.85; }
.card .state::after { content: 'Tap to keep'; font-size: 11px; color: var(--faint); }
.card.kept button { border-style: solid; border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, #0c1028); box-shadow: 0 0 22px color-mix(in srgb, var(--c) 35%, transparent); }
.card.kept .state::after { content: '✓ Kept'; color: var(--c); }
.card.about button { box-shadow: 0 0 0 2px var(--light), 0 0 26px rgba(255, 217, 138, 0.4); }

.dropped { margin-top: 14px; color: var(--dim); font-size: 14px; }
.dropped summary { cursor: pointer; }
.dropped li { margin: 6px 0; }

.ask, .keep { margin-top: 28px; padding: 22px 24px; border-radius: 16px; border: 1px solid rgba(255, 217, 138, 0.35); background: rgba(20, 18, 40, 0.75); }
.ask .eyebrow { margin-top: 0; }
.ask-q { font: clamp(22px, 3vw, 30px)/1.3 var(--serif); margin: 0 0 16px; }
.ask-q em { color: var(--light); font-style: normal; }
.answer { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; }
#ask-form { display: grid; gap: 10px; }
.mic.small { width: 112px; height: 112px; font-size: 13px; text-align: center; padding: 8px; }
.keep { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; border-color: var(--line); }
.keep.ready { border-color: rgba(255, 217, 138, 0.6); box-shadow: 0 0 30px rgba(255, 217, 138, 0.15); }
.keep:not(.ready) .primary { background: none; color: var(--dim); border: 1px solid var(--line); }
.keep-h { font: 22px var(--serif); margin: 0; }
.keep:not(.ready) .keep-h { font-size: 16px; color: var(--dim); }

.title { font-size: clamp(48px, 9vw, 110px); margin-top: 18vh; }
.top-r { display: flex; gap: 8px; align-items: center; }
.chip { font-size: 12px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--dim); cursor: pointer; }
.chip[aria-pressed="true"] { color: var(--faint); text-decoration: line-through; }

.sky { position: relative; margin: 8px 0 0; border-radius: 18px; overflow: hidden; border: 1px solid var(--line);
  aspect-ratio: 1792 / 1024; background: radial-gradient(120% 120% at 50% 100%, #1b2350, #060814 70%); }
.sky img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 2.4s ease; }
.sky img.in { opacity: 0.92; }
.sky svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.sky figcaption { position: absolute; left: 14px; bottom: 10px; }
.fil { stroke: rgba(255, 236, 190, 0.55); stroke-width: 2; stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: draw 1.6s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.star { opacity: 0; animation: twinkle 0.9s ease forwards; }
@keyframes twinkle { to { opacity: 1; } }
.star .halo { fill: color-mix(in srgb, var(--c) 22%, transparent); }
.star .core { fill: #fffaf0; filter: drop-shadow(0 0 10px var(--c)); }
.star .core.open { fill: none; stroke: var(--question); stroke-width: 3; stroke-dasharray: 4 5; }
.star text { fill: #fff; font: 600 34px var(--serif); paint-order: stroke; stroke: rgba(4, 6, 20, 0.85); stroke-width: 8px; }

.handoff { max-width: 520px; margin: 22px auto 0; text-align: center; }
.handoff .by { margin-top: 10px; line-height: 1.5; }

.foot { text-align: center; color: var(--faint); font-size: 12.5px; padding: 24px 16px 32px; }
.foot b { color: var(--dim); font-weight: 500; }

@media (max-width: 600px) {
  .top { padding: 14px 16px; gap: 10px; }
  .chip, .mode { white-space: nowrap; }
  .mode { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; }
  .sky { aspect-ratio: 3 / 4; }
  .star text { font-size: 40px; }
  .keep { flex-direction: column; align-items: stretch; }
  .answer { grid-template-columns: 1fr; justify-items: center; }
  .answer form { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
