/* Two voices, two colors: Sam is indigo, you are leaf green. Everything else
   stays quiet so the orb is the one thing to look at. */
:root {
  --bg: #f1f4f1;
  --surface: #ffffff;
  --ink: #1c2b27;
  --muted: #5b6b66;
  --line: #d6dfda;
  --sam: #3f4fc4;
  --you: #2c8656;
  --think: #8a9792;
  --error: #a3332f;
  --focus: #3f4fc4;
  --display: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --body: 'Atkinson Hyperlegible', ui-sans-serif, system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121917;
    --surface: #1a2320;
    --ink: #e4ece8;
    --muted: #98a8a2;
    --line: #2c3834;
    --sam: #9aa5f5;
    --you: #63c793;
    --think: #6f7d78;
    --error: #f08a80;
    --focus: #9aa5f5;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 18px/1.6 var(--body);
  min-height: 100vh;
}
a { color: var(--sam); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(30px, 5vw, 44px); }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
p { margin: 0 0 1em; }
kbd {
  font: 600 13px/1 var(--body);
  border: 1px solid currentColor;
  border-radius: 5px;
  padding: 3px 6px;
  margin-left: 8px;
  opacity: .75;
}
code { font-size: .9em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

.muted { color: var(--muted); }
.error { color: var(--error); }
.page { max-width: 760px; margin: 0 auto; padding: 48px 20px 80px; }
.page.narrow { max-width: 620px; }

button, .primary { font: inherit; cursor: pointer; }
.primary {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 999px;
  background: var(--ink); color: var(--bg);
  padding: 12px 24px; font-weight: 700; text-decoration: none;
}
.primary.big { padding: 16px 30px; font-size: 19px; }
.primary:disabled { opacity: .5; cursor: default; }
.quiet { background: none; border: 0; color: var(--muted); padding: 8px 4px; font-weight: 700; }
.quiet:hover { color: var(--ink); }

/* ---------- home ---------- */
.home-head { margin-bottom: 36px; }
.home-head h1 { max-width: 16ch; }
.choices { list-style: none; margin: 0 0 56px; padding: 0; border-top: 1px solid var(--line); }
.choice {
  display: grid; grid-template-columns: 9.5rem 1fr; column-gap: 20px; align-items: baseline;
  width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line);
  padding: 22px 4px; color: inherit;
}
.choice:hover .choice-title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.choice:disabled { opacity: .5; }
.choice-kind { grid-row: span 2; font-weight: 700; font-size: 15px; color: var(--muted); }
.kind-review .choice-kind { color: var(--you); }
.kind-new .choice-kind, .kind-next .choice-kind { color: var(--sam); }
.choice-title { font: 700 26px/1.2 var(--display); }
.choice-pitch { color: var(--muted); font-size: 16px; margin-top: 4px; }
@media (max-width: 560px) {
  .choice { grid-template-columns: 1fr; }
  .choice-kind { grid-row: auto; }
}
.recent ul { list-style: none; padding: 0; margin: 0; }
.recent a {
  display: grid; grid-template-columns: 8rem 1fr auto; gap: 12px;
  padding: 10px 4px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none;
}
.recent a:hover span:nth-child(2) { text-decoration: underline; }

/* ---------- intro before practice / review ---------- */
.intro { padding-top: 12vh; }
.scene-kind { color: var(--sam); font-weight: 700; margin-bottom: 8px; }
.lede { font-size: 21px; color: var(--muted); }
.howto { padding-left: 1.2em; margin: 28px 0 36px; }
.howto li { margin-bottom: 8px; }

/* ---------- the stage ---------- */
.stage { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; }
.stage-bar { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; }
.clock { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 700; }
.stage-center { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 20px 40px; }

.orb { position: relative; width: min(280px, 70vw); aspect-ratio: 1; margin-bottom: 36px; --c: var(--think); }
.orb.sam { --c: var(--sam); }
.orb.you { --c: var(--you); }
.orb.thinking, .orb.idle { --c: var(--think); }
.time-ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--line); stroke-width: 1.2; }
.ring-fill { fill: none; stroke: var(--muted); stroke-width: 1.2; stroke-linecap: round; transition: stroke-dasharray .5s linear; }
.orb-core {
  --level: 0;
  position: absolute; inset: 16%;
  border-radius: 50%;
  background: var(--c);
  transition: background-color .35s ease, transform .08s linear, box-shadow .08s linear;
}
.orb.you .orb-core {
  transform: scale(calc(0.92 + var(--level) * 0.14));
  box-shadow: 0 0 0 calc(var(--level) * 22px) color-mix(in srgb, var(--you) 22%, transparent);
}
.orb.sam .orb-core { animation: talk 1.6s ease-in-out infinite; }
.orb.thinking .orb-core { animation: breathe 2.4s ease-in-out infinite; }
.orb.idle .orb-core { opacity: .45; }
@keyframes talk { 50% { transform: scale(1.04); } }
@keyframes breathe { 50% { transform: scale(.9); opacity: .7; } }
@media (prefers-reduced-motion: reduce) {
  .orb-core { animation: none !important; transition: background-color .2s; }
  .orb.you .orb-core { transform: none; }
}

.stage-title { font: 700 clamp(28px, 4.5vw, 38px)/1.15 var(--display); margin-bottom: 6px; min-height: 1.2em; }
.stage-hint { color: var(--muted); min-height: 1.6em; margin-bottom: 4px; }
.stage-step { color: var(--muted); font-size: 15px; min-height: 1.6em; }
.stage-actions { min-height: 80px; margin-top: 12px; display: grid; place-items: center; }
.busy { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 22px; max-width: 360px; }
.busy p { margin-bottom: 12px; }

.drawer { border-top: 1px solid var(--line); padding: 0 20px; }
.drawer summary { cursor: pointer; padding: 14px 0; color: var(--muted); font-weight: 700; }
.drawer-body { max-height: 40vh; overflow-y: auto; padding-bottom: 20px; font-size: 16px; }
.line { margin: 6px 0; }
.line b { display: inline-block; min-width: 3.6em; color: var(--muted); }
.line.sam b { color: var(--sam); }
.line.you b { color: var(--you); }

/* ---------- takeaway ---------- */
.takeaway h1 { margin-top: 8px; }
.summary { font-size: 20px; color: var(--you); font-weight: 700; margin-bottom: 36px; }
.note { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.count { color: var(--muted); font-weight: 500; margin-left: 6px; }
.phrases { list-style: none; padding: 0; margin: 0 0 40px; border-top: 1px solid var(--line); }
.phrases li {
  display: grid; grid-template-columns: 1fr auto; column-gap: 12px;
  padding: 14px 2px; border-bottom: 1px solid var(--line);
}
.phrases .was { grid-column: 1; color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; font-size: 16px; }
.phrases .was.missing { text-decoration: none; font-style: italic; }
.phrases .now { grid-column: 1; font-weight: 700; font-size: 20px; }
.speak {
  grid-column: 2; grid-row: 1 / span 2; align-self: center;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--sam); display: grid; place-items: center;
}
.speak svg { width: 20px; height: 20px; fill: currentColor; }
.speak:hover { border-color: var(--sam); }
.review-cta { text-align: center; margin-bottom: 48px; }
.review-cta .muted { font-size: 15px; margin-top: 12px; max-width: 42ch; margin-inline: auto; }
.takeaway .drawer { padding: 0; }
.round-log { margin-bottom: 18px; }
.line.fixed b { color: var(--ink); }

.teacher-note { border-left: 3px solid var(--sam); padding: 4px 0 4px 16px; margin: 0 0 36px; }
.teacher-note p { margin-bottom: 6px; }
.teacher-note .focus { color: var(--muted); font-size: 16px; }

/* ---------- sign in ---------- */
.signin form { display: grid; gap: 12px; max-width: 320px; }
.signin label { font-weight: 700; color: var(--muted); }
.signin input {
  font: 700 28px/1.2 var(--body); letter-spacing: 0.3em; padding: 12px 16px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink);
}
.signin input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
