/* Chalk Talk: one dark, chalkboard-coloured design across three screens
   (home, making a lesson, the lesson itself). */

:root {
  --bg: #0E1412;
  --bg-raised: #141C19;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.065);
  --surface-3: rgba(255, 255, 255, 0.1);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #EEF2EF;
  --text-soft: #A7B5AF;
  --text-faint: #6E7C76;
  --accent: #F6D55C;
  --accent-ink: #1A2420;
  --accent-glow: rgba(246, 213, 92, 0.18);
  --right: #6CCB8F;
  --wrong: #F08A73;

  --board: #24453C;
  --board-deep: #1B2D27;
  --frame: #8C6B4B;
  --chalk: #F1F3EE;
  --chalk-dim: rgba(241, 243, 238, 0.6);
  --chalk-yellow: #F6D55C;
  --chalk-blue: #9CCFEA;

  --sans: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --display: "Bricolage Grotesque", "Atkinson Hyperlegible", system-ui, sans-serif;
  --hand: "Patrick Hand", "Comic Neue", "Segoe Print", cursive;
  --radius: 16px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

/* ---------- Base ---------- */

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: 100%; max-width: 1180px; margin-left: auto; margin-right: auto; padding-left: 24px; padding-right: 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.faint { color: var(--text-faint); }
a { color: inherit; }

button, .primary, .ghost {
  font: inherit;
  font-weight: 700;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 0.6rem 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
button:hover:not(:disabled), .ghost:hover { background: var(--surface-3); }
.primary, button.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  box-shadow: 0 6px 20px var(--accent-glow);
}
.primary:hover:not(:disabled) { background: #FFE07A; transform: translateY(-1px); }
.ghost { background: transparent; border-color: transparent; color: var(--text-soft); font-weight: 400; }
.ghost:hover { color: var(--text); }
button.link { background: none; border: 0; padding: 0.2rem 0; font-weight: 400; text-decoration: underline; color: var(--text-soft); }
button:disabled { opacity: 0.4; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
input[type="text"], select {
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
}

/* Soft light behind every screen */
.ambience {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 85% -10%, rgba(246, 213, 92, 0.09), transparent 60%),
    radial-gradient(800px 600px at -10% 10%, rgba(80, 160, 120, 0.12), transparent 60%),
    radial-gradient(1000px 700px at 50% 120%, rgba(36, 69, 60, 0.35), transparent 70%);
}

/* Screens fade in */
.view { animation: view-in 0.45s ease both; }
@keyframes view-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Top bar ---------- */

.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 22px; padding-bottom: 10px; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; font-family: var(--hand); font-size: 1.85rem; line-height: 1; }
.brand-mark { width: 2.2rem; height: 2.2rem; flex: none; }
.nav-links { display: flex; gap: 0.25rem; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0.3rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-soft);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.pulse-dot.live { animation: live 1.4s ease-in-out infinite; }
@keyframes live { 50% { opacity: 0.35; } }

/* ---------- Home ---------- */

/* Chalk grain: white with tiny gaps, used to texture chalk text and the board. */
:root {
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.15' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.95 0 0 0 0 0.96 0 0 0 0 0.93 0 0 0 -2.4 2.2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  --grain-yellow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.15' numOctaves='2' stitchTiles='stitch' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0.97 0 0 0 0 0.84 0 0 0 0 0.36 0 0 0 -2.4 2.2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  --dust: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='d'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.09 -0.03'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23d)'/%3E%3C/svg%3E");
}

.hero { padding-top: 26px; padding-bottom: 8px; }

/* A chalkboard on the wall: wooden frame, slate, and a ledge with chalk on it */
.hero-board {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: center;
  gap: 36px;
  padding: 56px 44px 60px 56px;
  border-radius: 6px;
  color: var(--chalk);
  background:
    var(--dust),
    radial-gradient(ellipse 60% 50% at 22% 30%, rgba(255, 255, 255, 0.07), transparent 70%),
    radial-gradient(ellipse 50% 45% at 78% 70%, rgba(255, 255, 255, 0.05), transparent 70%),
    radial-gradient(ellipse 30% 20% at 60% 12%, rgba(255, 255, 255, 0.04), transparent 70%),
    #1D3830;
  box-shadow: inset 0 0 90px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}
.ledge {
  position: absolute;
  left: -10px;
  right: -10px;
  bottom: -14px;
  height: 22px;
  border-radius: 4px 4px 8px 8px;
  background: linear-gradient(180deg, #A9865F, #74563A);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.ledge .stick {
  position: absolute;
  top: -7px;
  left: 18%;
  width: 54px;
  height: 11px;
  border-radius: 5px;
  background: linear-gradient(180deg, #FBFAF5, #DAD7CC);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.35);
  transform: rotate(-4deg);
}
.ledge .stick.yellow { left: calc(18% + 70px); width: 38px; background: linear-gradient(180deg, #FBE58A, #E2BE45); transform: rotate(3deg); }
.ledge .eraser {
  position: absolute;
  top: -14px;
  right: 14%;
  width: 84px;
  height: 18px;
  border-radius: 4px;
  background: linear-gradient(180deg, #C9A57A 0 45%, #3B3F44 45%);
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.4);
}

/* Chalk writing */
.hero-copy { container-type: inline-size; min-width: 0; }
.hero-kicker { margin: 0 0 0.6rem; font-size: 1.35rem; color: var(--chalk-yellow); letter-spacing: 0.02em; }
.hero-title {
  margin: 0 0 1.1rem;
  font-weight: 400;
  /* Sized by the column, so "Learn anything on" always fits on one line. */
  font-size: clamp(2rem, 13.5cqi, 4.15rem);
  line-height: 1;
  letter-spacing: 0.005em;
}
.hero-title .line { display: block; position: relative; white-space: nowrap; animation: chalk-in 0.9s ease-out both; }
.hero-title .line:nth-child(2) { animation-delay: 0.45s; }
.hero-title .line:nth-child(3) { animation-delay: 0.9s; }
@keyframes chalk-in {
  from { clip-path: inset(-10% 100% -45% 0); }
  to { clip-path: inset(-10% -5% -45% 0); }
}
.hero-title em { position: relative; display: inline-block; font-style: normal; color: var(--chalk-yellow); }
/* Chalk grain in the letters: the board shows through tiny gaps. */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero-title .line {
    background: var(--grain);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  .hero-title .line:nth-child(3) { background-image: var(--grain-yellow); }
}
.scribble { position: absolute; left: -2%; bottom: -0.14em; width: 100%; height: 0.32em; overflow: visible; }
.scribble path { fill: none; stroke: var(--chalk-yellow); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: scribble 0.9s ease-out 1.7s forwards; opacity: 0.9; }
@keyframes scribble { to { stroke-dashoffset: 0; } }
.hero-sub { margin: 0 0 1.6rem; max-width: 30rem; text-wrap: pretty; font-size: clamp(1.02rem, 1.4vw, 1.15rem); color: rgba(241, 243, 238, 0.72); }

/* The topic box, chalked onto the board */
.ask { max-width: 36rem; }
.ask-box {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 6px 6px 6px 18px;
  background: rgba(8, 18, 14, 0.42);
  border: 1.5px solid rgba(241, 243, 238, 0.32);
  border-radius: 18px 14px 20px 13px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.ask-box:focus-within { border-color: var(--chalk-yellow); box-shadow: 0 0 0 4px rgba(246, 213, 92, 0.14); }
.ask-box input {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0.2rem;
  font-size: 1.45rem;
  color: var(--chalk);
  background: none;
  border: 0;
  outline: none;
}
.ask-box input::placeholder { color: rgba(241, 243, 238, 0.42); }
.ask-box input:focus-visible { outline: none; }
.ask-box .primary { padding: 0.8rem 1.2rem; border-radius: 13px; white-space: nowrap; }

/* A picture to learn from: the camera button, then a thumbnail once one is added */
.ask-box:has(.photo-btn:not([hidden])) { padding-left: 6px; }
.photo-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  color: rgba(241, 243, 238, 0.6);
  background: transparent;
  border: 0;
  border-radius: 11px;
  box-shadow: none;
}
.photo-btn:hover:not(:disabled) { color: var(--chalk-yellow); background: rgba(246, 213, 92, 0.1); }
.photo-btn svg, .drop-zone svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.photo-chip { position: relative; flex: none; margin-left: -6px; }
.photo-chip img { display: block; width: 58px; height: 44px; object-fit: cover; border-radius: 8px; border: 1.5px solid var(--chalk-yellow); }
.photo-remove {
  position: absolute;
  top: -7px;
  right: -7px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1;
  color: var(--accent-ink);
  background: var(--chalk-yellow);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.snap-btn {
  padding: 0;
  font-weight: 400;
  font-size: inherit;
  color: var(--chalk-yellow);
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  text-decoration: underline dotted rgba(246, 213, 92, 0.5);
  text-underline-offset: 4px;
}
.snap-btn:hover:not(:disabled) { background: none; color: #FFE07A; }
.snap-hint { color: rgba(241, 243, 238, 0.45); }

/* While a picture is dragged over the page */
.drop-zone {
  position: absolute;
  inset: 14px;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  font-size: clamp(1.4rem, 2.6vw, 2.2rem);
  color: var(--chalk-yellow);
  background: rgba(14, 26, 22, 0.86);
  border: 3px dashed rgba(246, 213, 92, 0.75);
  border-radius: 14px;
  pointer-events: none;
  animation: view-in 0.2s ease both;
}
.drop-zone svg { width: 54px; height: 54px; }

/* Two quiet rows under the topic box: who it's for, and ideas to try */
.choice-row { display: grid; grid-template-columns: 4rem minmax(0, 1fr); align-items: baseline; margin: 0.9rem 0 0; font-size: 0.97rem; }
.choice-row + .choice-row { margin-top: 0.4rem; }
.choice-label { color: rgba(241, 243, 238, 0.45); }
.choice-options { display: flex; flex-wrap: wrap; row-gap: 0.25rem; }
.levels label { position: relative; }
.levels label:not(:last-child)::after, .idea:not(:last-child)::after { content: "\00b7"; margin: 0 0.5rem; color: rgba(241, 243, 238, 0.3); }
.levels input { position: absolute; opacity: 0; pointer-events: none; }
.levels span { color: rgba(241, 243, 238, 0.62); cursor: pointer; border-bottom: 2px solid transparent; transition: color 0.15s ease, border-color 0.15s ease; }
.levels span:hover { color: var(--chalk); }
.levels input:checked + span { color: var(--chalk-yellow); border-bottom-color: rgba(246, 213, 92, 0.7); }
.levels input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
.idea {
  padding: 0;
  font-weight: 400;
  font-size: inherit;
  color: rgba(241, 243, 238, 0.82);
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.idea:hover:not(:disabled) { color: var(--chalk-yellow); background: none; }
.idea:hover::after { color: rgba(241, 243, 238, 0.3); }
.ask-error { color: #FFB4A3; margin: 0.9rem 0 0; font-size: 0.95rem; }
.ask-error:empty { display: none; }

/* Real lesson scenes, drawing themselves on the board */
.demo {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  text-align: left;
  color: var(--chalk);
  background: none;
  border: 0;
  border-radius: 12px;
  box-shadow: none;
}
.demo:hover:not(:disabled) { background: none; }
.demo-svg {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: visible;
  transition: opacity 0.7s ease, filter 0.7s ease;
}
.demo-svg.out { opacity: 0; filter: blur(6px); }
.demo-caption {
  position: absolute;
  top: -1.9rem;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 1.2rem;
  color: rgba(241, 243, 238, 0.7);
  transition: opacity 0.5s ease;
}
.dm-sketch { opacity: 0.32; }
.dm-lit, .dm-full { opacity: 0; transition: opacity 0.9s ease 0.35s; }
.dm-part.on .dm-lit, .dm-full.on { opacity: 1; }
.dm-trace {
  fill: none;
  stroke: var(--chalk-yellow);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 1.3s ease-in-out, stroke 0.6s ease, opacity 0.6s ease;
}
.dm-part.on .dm-trace { stroke-dashoffset: 0; }
.dm-part.rest .dm-trace { stroke: var(--chalk); opacity: 0.55; }
.dm-arrow { fill: none; stroke: var(--chalk); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 0.5s ease 1.2s; }
.dm-part.on .dm-arrow { stroke-dashoffset: 0; }
.dm-label {
  font-family: var(--hand);
  fill: var(--chalk-yellow);
  paint-order: stroke;
  stroke: rgba(12, 22, 19, 0.85);
  stroke-width: 16px;
  stroke-linejoin: round;
  opacity: 0;
  transition: opacity 0.5s ease 1.4s, fill 0.6s ease;
}
.dm-part.on .dm-label { opacity: 1; }
.dm-part.rest .dm-label { fill: var(--chalk); }
.demo { margin-bottom: 2.4rem; }
.demo-play {
  position: absolute;
  left: 50%;
  bottom: -2.9rem;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  color: var(--chalk);
  background: rgba(8, 18, 14, 0.6);
  border: 1.5px solid rgba(241, 243, 238, 0.4);
  border-radius: 999px;
  backdrop-filter: blur(6px);
  transition: all 0.2s ease;
}
.demo:hover .demo-play, .demo:focus-visible .demo-play { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.play-icon { font-size: 0.8em; }

.powered { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem; margin: 30px 0 0; color: var(--text-faint); font-size: 0.88rem; }
.powered-label { font-weight: 700; color: var(--text-soft); margin-right: 0.3rem; }
.powered .chip { margin: 0; }
.powered-note { margin-left: 0.4rem; }

/* A lesson still being made, while you're on the home screen */
.home-building {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 18px;
  padding-top: 0;
  padding-bottom: 0;
  text-decoration: none;
}
.home-building > span {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  padding: 0.85rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
}
.home-building b { font-weight: 700; }
.home-building .go { margin-left: auto; color: var(--accent); font-weight: 700; white-space: nowrap; }

/* Sections */
.section-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 0.4rem 1.5rem; margin-bottom: 1.1rem; }
.section-head h2 { font-family: var(--display); font-weight: 700; font-size: clamp(1.5rem, 2.4vw, 2rem); letter-spacing: -0.015em; margin: 0; }
.section-head p { margin: 0; color: var(--text-soft); }
.library { padding-top: 56px; }

.saved { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.see-all { white-space: nowrap; color: var(--accent); font-weight: 700; }
.see-all:hover { color: #FFE07A; }
.lesson-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  text-align: left;
  font-weight: 400;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.lesson-card:hover:not(:disabled) { background: var(--surface-2); border-color: var(--border-strong); transform: translateY(-3px); box-shadow: var(--shadow); }
.lesson-card.sample { border-color: rgba(246, 213, 92, 0.5); }
.lesson-card-pic { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--board-deep); }
.lesson-card-pic img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.lesson-card-pic::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(14, 20, 18, 0.55)); }
.lesson-card:hover .lesson-card-pic img { transform: scale(1.06); }
.card-play {
  position: absolute;
  z-index: 1;
  right: 0.7rem;
  bottom: 0.7rem;
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  padding-left: 0.15rem;
  font-size: 0.85rem;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(6px) scale(0.9);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.lesson-card:hover .card-play, .lesson-card:focus-visible .card-play { opacity: 1; transform: none; }
.badge {
  position: absolute;
  z-index: 1;
  top: 0.6rem;
  left: 0.6rem;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--accent);
  color: var(--accent-ink);
}
.lesson-card-body { display: flex; flex-direction: column; gap: 0.35rem; flex: 1; padding: 0.9rem 1rem 1rem; }
.lesson-card-title {
  font-family: var(--display);
  font-weight: 650;
  font-size: 1.08rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.lesson-card-topic { color: var(--text-soft); font-size: 0.86rem; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lesson-card-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.15rem; }
.lesson-card-tags span { padding: 0.05rem 0.5rem; font-size: 0.74rem; font-weight: 700; color: var(--text-soft); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; }
.lesson-card-meta { margin-top: auto; padding-top: 0.35rem; font-size: 0.78rem; color: var(--text-faint); }

/* A topic idea fills an empty slot in the row */
.idea-card {
  align-items: flex-start;
  justify-content: center;
  gap: 0.5rem;
  min-height: 100%;
  padding: 1.3rem 1.2rem;
  background: transparent;
  border: 1.5px dashed var(--border-strong);
}
.idea-card:hover:not(:disabled) { border-color: var(--accent); background: rgba(246, 213, 92, 0.05); }
.idea-plus { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; font-size: 1.5rem; color: var(--accent); border: 1.5px solid rgba(246, 213, 92, 0.6); border-radius: 50%; }
.idea-card .lesson-card-title { font-size: 1.15rem; }
.idea-card .lesson-card-meta { margin-top: 0; padding-top: 0; color: var(--accent); font-weight: 700; }

.how { padding-top: 72px; }
.how-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.how-steps li {
  position: relative;
  padding: 1.4rem 1.3rem 1.3rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.how-num {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  margin-bottom: 0.9rem;
  font-family: var(--hand);
  font-size: 1.5rem;
  color: var(--accent);
  border: 2px solid var(--accent);
  border-radius: 50% 45% 55% 48%;
}
.how-steps h3 { font-family: var(--display); font-weight: 700; font-size: 1.2rem; margin: 0 0 0.4rem; }
.how-steps p { margin: 0 0 1rem; color: var(--text-soft); font-size: 0.95rem; }
.chip {
  display: inline-block;
  margin: 0.15rem 0.2rem 0 0;
  padding: 0.15rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-soft);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.foot { padding-top: 64px; padding-bottom: 48px; color: var(--text-faint); font-size: 0.9rem; }
.foot p { margin: 0; padding-top: 22px; border-top: 1px solid var(--border); }

/* ---------- Making a lesson ---------- */

.making { min-height: 100vh; position: relative; }
.making-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.making-bg img {
  position: absolute;
  inset: -10%;
  width: 120%;
  height: 120%;
  object-fit: cover;
  filter: blur(48px) saturate(1.2);
  opacity: 0;
  transition: opacity 1.6s ease;
}
.making-bg img.on { opacity: 0.32; }
.making-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(14, 20, 18, 0.55), var(--bg) 85%); }

.making-inner { padding-top: 40px; padding-bottom: 64px; text-align: center; }
.making-inner .eyebrow { margin-bottom: 1.2rem; }
.making-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2rem, 4.2vw, 3.3rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 auto 0.7rem;
  max-width: 22ch;
}
.making-stage { margin: 0 auto; color: var(--text-soft); font-size: 1.12rem; min-height: 1.6em; max-width: 46rem; }

.progress { position: relative; max-width: 560px; height: 8px; margin: 1.8rem auto 0.6rem; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress-bar {
  height: 100%;
  width: 2%;
  border-radius: inherit;
  background: linear-gradient(90deg, #E7B93F, var(--accent), #FFF0A8);
  box-shadow: 0 0 18px rgba(246, 213, 92, 0.6);
  transition: width 0.8s ease;
}
.progress-bar::after {
  content: "";
  display: block;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  background-size: 200px 100%;
  background-repeat: no-repeat;
  animation: sweep 1.6s linear infinite;
}
@keyframes sweep { from { background-position: -200px 0; } to { background-position: 600px 0; } }
.making-time { margin: 0; font-size: 0.92rem; color: var(--text-soft); font-variant-numeric: tabular-nums; }

/* Each model as a station on a line */
.pipeline { list-style: none; display: flex; justify-content: center; gap: 0; margin: 2.6rem auto 2.4rem; padding: 0; max-width: 900px; }
.pipeline li { position: relative; flex: 1 1 0; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 0.4rem; opacity: 0.45; transition: opacity 0.4s ease; }
.pipeline li + li::before {
  content: "";
  position: absolute;
  top: 28px;
  right: calc(50% + 34px);
  left: calc(-50% + 34px);
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--border-strong) 0 6px, transparent 6px 12px);
}
.pipeline li.now::before, .pipeline li.done::before {
  background: repeating-linear-gradient(90deg, var(--accent) 0 6px, transparent 6px 12px);
  background-size: 24px 2px;
  animation: flow 0.9s linear infinite;
}
.pipeline li.done::before { animation: none; background: var(--accent); opacity: 0.6; }
@keyframes flow { to { background-position: 24px 0; } }
.station {
  position: relative;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 0.7rem;
  border-radius: 50%;
  background: var(--bg-raised);
  border: 1.5px solid var(--border-strong);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.station svg { width: 24px; height: 24px; fill: none; stroke: var(--text-soft); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pipeline li.now, .pipeline li.done { opacity: 1; }
.pipeline li.now .station { border-color: var(--accent); box-shadow: 0 0 0 6px var(--accent-glow), 0 0 30px rgba(246, 213, 92, 0.35); animation: station 1.6s ease-in-out infinite; }
.pipeline li.now .station svg { stroke: var(--accent); }
.pipeline li.done .station { border-color: rgba(108, 203, 143, 0.6); }
.pipeline li.done .station::after {
  content: "\2713";
  position: absolute;
  right: -4px;
  bottom: -4px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #0E1412;
  background: var(--right);
  border-radius: 50%;
}
@keyframes station { 50% { box-shadow: 0 0 0 10px rgba(246, 213, 92, 0.08), 0 0 40px rgba(246, 213, 92, 0.45); } }
.pipeline b { font-family: var(--display); font-weight: 700; font-size: 0.98rem; }
.pipeline small { color: var(--text-soft); font-size: 0.82rem; line-height: 1.3; }

/* Scenes appear as they're painted */
.film { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 14px; margin: 0; padding: 0; text-align: left; }
.shot { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; transition: border-color 0.4s ease, transform 0.4s ease; }
.shot[data-step="ready"] { border-color: rgba(246, 213, 92, 0.55); }
.shot-img { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: linear-gradient(135deg, #18241F, #1E2E28); }
.shot-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.07) 50%, transparent 70%);
  background-size: 250% 100%;
  animation: shimmer 1.6s linear infinite;
}
.shot[data-step="ready"] .shot-img::after, .shot-img:has(img.on)::after { display: none; }
.shot-img img { position: relative; z-index: 1; display: block; width: 100%; height: 100%; object-fit: cover; clip-path: inset(0 100% 0 0); transition: clip-path 1.1s cubic-bezier(0.65, 0, 0.35, 1); }
.shot-img img.on { clip-path: inset(0 0 0 0); }
.shot-num {
  position: absolute;
  z-index: 2;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text);
  background: rgba(14, 20, 18, 0.7);
  border-radius: 999px;
}
.shot-head { margin: 0.7rem 0.85rem 0.2rem; font-family: var(--display); font-weight: 600; font-size: 0.95rem; line-height: 1.25; min-height: 1.25em; }
.shot-step { display: flex; align-items: center; gap: 0.45rem; margin: 0 0.85rem 0.8rem; font-size: 0.8rem; color: var(--text-soft); min-height: 1.2em; }
.shot-step::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); }
.shot[data-step="painting"] .shot-step::before,
.shot[data-step="repainting"] .shot-step::before,
.shot[data-step="painted"] .shot-step::before,
.shot[data-step="looking"] .shot-step::before,
.shot[data-step="tracing"] .shot-step::before { background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: live 1.2s ease-in-out infinite; }
.shot[data-step="ready"] .shot-step { color: var(--accent); }
.shot[data-step="ready"] .shot-step::before { background: var(--right); box-shadow: none; }
@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -100% 0; } }

.making-ready {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  max-width: 640px;
  margin: 2.4rem auto 0;
  padding: 1.1rem 1.2rem 1.1rem 1.5rem;
  text-align: left;
  background: rgba(246, 213, 92, 0.07);
  border: 1px solid rgba(246, 213, 92, 0.45);
  border-radius: 20px;
  box-shadow: 0 0 60px rgba(246, 213, 92, 0.12);
  animation: view-in 0.4s ease both;
}
.ready-title { margin: 0; font-family: var(--display); font-weight: 700; font-size: 1.25rem; }
.ready-sub { margin: 0; color: var(--text-soft); font-size: 0.92rem; }
.big { padding: 0.9rem 1.5rem; font-size: 1.08rem; border-radius: 14px; white-space: nowrap; }
.making-error { max-width: 560px; margin: 2.4rem auto 0; padding: 1.2rem; color: var(--wrong); background: rgba(240, 138, 115, 0.08); border: 1px solid rgba(240, 138, 115, 0.4); border-radius: var(--radius); }
.making-error p { margin: 0 0 1rem; }
.making-error .primary { display: inline-block; }

/* ---------- The lesson ---------- */

/* Size the lesson by the window's height too, so the controls stay on screen on a laptop. */
/* The board fills the window like a video: only the subtitles and the control bar share its height. */
.stage { padding-top: 16px; padding-bottom: 48px; max-width: max(760px, min(1400px, calc((100vh - 196px) * 16 / 9 + 48px))); }

.frame, .hero-frame {
  position: relative;
  padding: 14px;
  border-radius: 16px;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.05) 0 2px, transparent 2px 9px),
    linear-gradient(180deg, #A07D57, #7F5F3F);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
/* The lesson's frame is slimmer than the home page's, so the board gets the room. */
.frame { padding: 7px; border-radius: 11px; margin-bottom: 20px; }
.frame .board { border-radius: 5px; box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.28); }
.frame .ledge { left: -5px; right: -5px; bottom: -9px; height: 12px; border-radius: 3px 3px 6px 6px; }
.frame .ledge .stick { top: -5px; width: 40px; height: 8px; }
.frame .ledge .stick.yellow { left: calc(18% + 52px); width: 28px; }
.frame .ledge .eraser { top: -10px; width: 62px; height: 13px; }
.board {
  position: relative;
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(255, 255, 255, 0.05), transparent 55%),
    radial-gradient(ellipse at 80% 75%, rgba(255, 255, 255, 0.04), transparent 50%),
    var(--board);
  color: var(--chalk);
  overflow: hidden;
}
.board.has-picture { background: var(--board-deep); }
.chalk { font-family: var(--hand); }

.heading {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  right: 0;
  margin: 0;
  padding: 1rem 1.6rem 2.4rem;
  font-size: clamp(1.35rem, 3.1vw, 2.45rem);
  font-weight: 400;
  line-height: 1.1;
  pointer-events: none;
}
.heading:empty { display: none; }
/* A faint shade behind the heading, with the letters' own shadow doing most of the work,
   so the heading stays readable without darkening the top of the picture. */
.has-picture .heading {
  background: linear-gradient(rgba(12, 22, 19, 0.32), rgba(12, 22, 19, 0) 85%);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75), 0 2px 14px rgba(0, 0, 0, 0.7);
}
.heading.write { animation: write 0.9s ease-out both; }
@keyframes write {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}

.status {
  position: absolute;
  z-index: 3;
  left: 1.6rem;
  right: 1.6rem;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  text-align: center;
  color: var(--chalk-dim);
  font-size: clamp(1.1rem, 2.2vw, 1.4rem);
}
.status:empty { display: none; }

/* The scene picture and its chalk layers */
.picture { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.picture .sketch { opacity: 0; transition: opacity 1.1s ease; }
.picture.on .sketch { opacity: 0.3; }
.picture .lit { opacity: 0; transition: opacity 0.8s ease 0.3s; }
.picture .lit.on { opacity: 1; }
.picture .full { opacity: 0; transition: opacity 1.6s ease; }
.picture .full.on { opacity: 1; }

.trace {
  fill: none;
  stroke: var(--chalk);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0.8;
  transition: stroke 0.4s, opacity 0.6s, stroke-width 0.4s;
}
.outline.active .trace { stroke: var(--chalk-yellow); stroke-width: 9; opacity: 1; }
.outline.rest .trace { opacity: 0.35; }
.outline.pulse .trace { animation: pulse-line 0.9s ease-in-out 3; }
@keyframes pulse-line {
  50% { stroke: var(--chalk-blue); stroke-width: 16; opacity: 1; }
}

.label { opacity: 0; transition: opacity 0.25s; }
.label.on { opacity: 1; }
.label text {
  font-family: var(--hand);
  fill: var(--chalk);
  paint-order: stroke;
  stroke: rgba(12, 22, 19, 0.85);
  stroke-width: 14px;
  stroke-linejoin: round;
  transition: fill 0.4s;
}
.label .arrow {
  fill: none;
  stroke: var(--chalk);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke 0.4s;
}
.label.active text { fill: var(--chalk-yellow); }
.label.active .arrow { stroke: var(--chalk-yellow); }
.label.pulse text { animation: pulse-text 0.9s ease-in-out 3; }
@keyframes pulse-text {
  50% { fill: var(--chalk-blue); }
}

/* "Find it": tap the parts on the picture */
.board.finding .picture { cursor: crosshair; }
.miss {
  fill: none;
  stroke: #F4A3A3;
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.outline.answer .trace { stroke: var(--chalk-blue); stroke-width: 9; opacity: 1; }
.label.answer text { fill: var(--chalk-blue); }
.label.answer .arrow { stroke: var(--chalk-blue); }

.tip { opacity: 0; transition: opacity 0.2s; pointer-events: none; }
.tip.on { opacity: 1; }
.tip rect { fill: #F4F1E6; stroke: rgba(0, 0, 0, 0.35); stroke-width: 3; }

/* Raise your hand, shown on the board */
.ask-bubble {
  position: absolute;
  z-index: 5;
  right: 1.2rem;
  top: 1.1rem;
  max-width: min(70%, 34rem);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 1rem 0.6rem 0.8rem;
  border: 2px solid var(--chalk-dim);
  border-radius: 18px 14px 20px 12px;
  background: rgba(12, 22, 19, 0.82);
  color: var(--chalk);
  pointer-events: none;
}
.ask-bubble p { margin: 0; font-size: clamp(1rem, 2vw, 1.35rem); line-height: 1.2; }
/* While listening, the bubble has its own Done and Cancel buttons, right where you're looking. */
.ask-bubble[data-state="listening"] { pointer-events: auto; }
.ask-done, .ask-cancel { display: none; font-family: var(--hand); font-weight: 400; box-shadow: none; }
.ask-bubble[data-state="listening"] .ask-done,
.ask-bubble[data-state="listening"] .ask-cancel { display: inline-block; }
.ask-done {
  margin-left: 0.4rem;
  padding: 0.3rem 1.1rem;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  color: #1C2A26;
  background: var(--chalk-yellow);
  border: 0;
  border-radius: 12px 9px 13px 8px;
}
.ask-done:hover:not(:disabled) { background: #FFE07A; }
.ask-cancel {
  padding: 0.3rem 0.2rem;
  font-size: clamp(0.95rem, 1.8vw, 1.15rem);
  color: var(--chalk-dim);
  background: none;
  border: 0;
  text-decoration: underline;
}
.ask-cancel:hover:not(:disabled) { background: none; color: var(--chalk); }
.ask-bubble[data-state="listening"] { border-color: #F4A3A3; }
.ask-bubble[data-state="thinking"], .ask-bubble[data-state="answering"] { border-color: var(--chalk-yellow); }
.ask-meter { display: flex; align-items: center; gap: 3px; height: 1.6rem; flex: none; }
.ask-meter i {
  display: block;
  width: 4px;
  height: 100%;
  border-radius: 2px;
  background: currentColor;
  transform: scaleY(0.18);
  transition: transform 0.08s linear;
}
.ask-bubble[data-state="listening"] .ask-meter { color: #F4A3A3; }
.ask-bubble[data-state="thinking"] .ask-meter { color: var(--chalk-yellow); }
.ask-bubble[data-state="thinking"] .ask-meter i { animation: think 1s ease-in-out infinite; }
.ask-bubble[data-state="thinking"] .ask-meter i:nth-child(2) { animation-delay: 0.12s; }
.ask-bubble[data-state="thinking"] .ask-meter i:nth-child(3) { animation-delay: 0.24s; }
.ask-bubble[data-state="thinking"] .ask-meter i:nth-child(4) { animation-delay: 0.36s; }
.ask-bubble[data-state="thinking"] .ask-meter i:nth-child(5) { animation-delay: 0.48s; }
.ask-bubble[data-state="answering"] .ask-meter { display: none; }
@keyframes think {
  0%, 100% { transform: scaleY(0.2); }
  50% { transform: scaleY(0.9); }
}

/* Eraser sweep between scenes */
.wipe {
  position: absolute;
  z-index: 6;
  top: -10%;
  bottom: -10%;
  left: -60%;
  width: 220%;
  pointer-events: none;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--board-deep) 20%, var(--board-deep) 80%, transparent);
}
.wipe.go { animation: wipe 0.76s ease-in-out forwards; }
@keyframes wipe {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

/* Chalk cards, for scenes without a picture */
.visuals {
  position: absolute;
  inset: 5.5rem 1.75rem 1.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem 1.25rem;
  align-content: center;
}
.visuals:empty { display: none; }
.visual {
  border: 2.5px solid var(--chalk-dim);
  border-radius: 22px 16px 26px 14px;
  padding: 0.9rem 1rem;
  font-family: var(--hand);
  opacity: 0;
  transform: translateY(8px) rotate(-1.5deg) scale(0.96);
  transition: opacity 0.45s ease, transform 0.45s ease, border-color 0.3s, color 0.3s;
}
.visual:nth-child(even) { border-radius: 16px 24px 14px 22px; }
.visual.shown { opacity: 1; transform: none; }
.visual.active { border-color: var(--chalk-yellow); color: var(--chalk-yellow); }
.v-label { display: block; font-size: 1.7rem; line-height: 1.1; }
.v-note { display: block; font-size: 1.1rem; color: var(--chalk-dim); margin-top: 0.25rem; }
.visual.active .v-note { color: var(--chalk-blue); }

/* Subtitles under the board: one sentence at a time, never covering the picture.
   Two lines tall, so the controls don't jump between short and long sentences. */
.caption {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  column-gap: 0.32em;
  max-width: 52rem;
  min-height: 3em;
  margin: 0 auto 0.4rem;
  text-align: center;
  font-size: clamp(1.05rem, 1.55vw, 1.3rem);
  line-height: 1.5;
}
.word { color: var(--text-faint); transition: color 0.15s; }
.word.off { display: none; }
.word.spoken { color: var(--text); }
.word.current { color: var(--accent-ink); background: var(--accent); border-radius: 4px; box-shadow: 0 0 0 2px var(--accent); }

/* Controls under the board: the lesson and scene, the transport, and the raised hand */
.controls { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 1rem; }
.where { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.where-text { min-width: 0; }
.lesson-title { margin: 0; font-family: var(--display); font-weight: 700; font-size: 1rem; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scene-line { margin: 0; font-size: 0.85rem; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn.back { flex: none; text-decoration: none; }
.lesson-note { margin: 0; color: var(--text-faint); font-size: 0.88rem; flex-basis: 100%; }
.lesson-note:empty { display: none; }
.icon-btn .i-shrink, .icon-btn[aria-pressed="true"] .i-expand { display: none; }
.icon-btn[aria-pressed="true"] .i-shrink { display: block; }
#fullscreen[aria-pressed="true"] { color: var(--text-soft); }
.transport { display: flex; align-items: center; gap: 0.35rem; }
.transport-gap { width: 0.6rem; }
.icon-btn {
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  padding: 0 0.55rem;
  color: var(--text-soft);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  box-shadow: none;
}
.icon-btn:hover:not(:disabled) { color: var(--text); background: var(--surface-2); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn svg .solid, .play-btn svg .solid { fill: currentColor; stroke: none; }
.icon-btn[aria-pressed="true"] { color: var(--accent); }
.icon-btn.speed { font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.play-btn {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 0.3rem;
  padding: 0;
  color: var(--accent-ink);
  background: var(--accent);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 8px 26px rgba(246, 213, 92, 0.32);
}
.play-btn:hover:not(:disabled) { background: #FFE07A; transform: scale(1.05); }
.play-btn svg { width: 26px; height: 26px; }
.play-btn .i-pause, .play-btn.is-playing .i-play { display: none; }
.play-btn.is-playing .i-pause { display: block; }
.play-btn .i-play { margin-left: 3px; }
.hand {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  color: var(--accent);
  background: rgba(246, 213, 92, 0.08);
  border: 1px solid rgba(246, 213, 92, 0.5);
  border-radius: 999px;
}
.hand:hover:not(:disabled) { background: rgba(246, 213, 92, 0.16); }
.hand kbd { font: inherit; font-size: 0.72rem; padding: 0 0.35rem; color: rgba(246, 213, 92, 0.75); border: 1px solid rgba(246, 213, 92, 0.4); border-radius: 5px; }
.hand.listening { color: #fff; background: var(--wrong); border-color: var(--wrong); animation: listen 1.2s ease-in-out infinite; }
@keyframes listen { 50% { box-shadow: 0 0 0 6px rgba(240, 138, 115, 0.25); } }

/* Full screen: just the board, subtitles and controls on a dark stage, like a video */
.player:fullscreen {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18px 28px 16px;
  background: #0A0F0D;
  overflow-y: auto;
}
.player:fullscreen .frame, .player:fullscreen .controls, .player:fullscreen .caption, .player:fullscreen .hand-panel {
  width: min(100%, calc((100vh - 160px) * 16 / 9));
  margin-left: auto;
  margin-right: auto;
}
.player:fullscreen .frame { padding: 0; background: none; box-shadow: none; margin-bottom: 14px; }
.player:fullscreen .frame .board { border-radius: 10px; }
.player:fullscreen .ledge { display: none; }
.player:fullscreen .caption { max-width: none; font-size: clamp(1.1rem, 1.7vw, 1.55rem); }
.player:fullscreen .hand-panel { max-width: none; }

.transcript { margin: 1.2rem 0 0; padding: 1rem 1.25rem; max-width: 70ch; font-size: 1.08rem; line-height: 1.65; color: var(--text-soft); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }

/* Raise your hand panel */
.hand-panel, .quiz {
  margin-top: 1.2rem;
  padding: 1.1rem 1.25rem;
  max-width: 70ch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.hand-status { margin: 0 0 0.8rem; font-size: 1.1rem; min-height: 1.5em; }
.hand-form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.hand-form input { flex: 1 1 240px; }

/* Quiz */
.quiz h3 { font-family: var(--display); margin: 0 0 0.25rem; }
.quiz .q { margin: 0 0 0.85rem; font-size: 1.15rem; }
.choices { display: grid; gap: 0.5rem; }
.choices button { text-align: left; font-weight: 400; }
.choices button.right { border-color: var(--right); color: var(--right); font-weight: 700; }
.choices button.wrong { border-color: var(--wrong); color: var(--wrong); }
.choices button:disabled { opacity: 1; cursor: default; }
.feedback { margin: 0.75rem 0 0; min-height: 1.4em; }

/* Under the lesson */
.lesson-foot { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1rem 2rem; margin-top: 2.4rem; padding-top: 1.2rem; border-top: 1px solid var(--border); }
.keys { margin: 0; color: var(--text-faint); font-size: 0.88rem; }
.keys kbd {
  font: inherit;
  font-size: 0.8rem;
  color: var(--text-soft);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 0 0.4rem;
  margin: 0 0.15rem 0 0.7rem;
}
.keys kbd:first-child { margin-left: 0; }
.settings { color: var(--text-soft); font-size: 0.95rem; }
.settings summary { cursor: pointer; }
.voice-note { margin: 0.75rem 0 0; max-width: 60ch; }
.settings-row { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.75rem; }
.settings-row label { width: 4rem; }
.settings-row select { max-width: 100%; }

/* ---------- Small screens ---------- */

@media (max-width: 900px) {
  .hero-board { grid-template-columns: 1fr; gap: 20px; min-height: 0; padding: 36px 28px 40px; }
  .demo { max-width: 620px; margin: 0.6rem auto 0; display: flex; flex-direction: column; align-items: center; gap: 0.4rem; }
  .demo-caption, .demo-play { position: static; transform: none; }
  .demo-play { order: 3; }
  .how-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .saved { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipeline small { display: none; }
}

@media (max-width: 640px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .brand { font-size: 1.5rem; }
  .brand-mark { width: 1.8rem; height: 1.8rem; }
  .nav-links .ghost { padding: 0.5rem 0.6rem; }
  .hero-frame { padding: 10px; }
  .hero-board { padding: 26px 18px 34px; }
  .ask-box { flex-wrap: wrap; padding: 8px; }
  .ask-box input { flex-basis: 100%; padding: 0.4rem 0.4rem; }
  .ask-box .primary { flex: 1; }
  .powered-note { flex-basis: 100%; text-align: center; margin: 0; }
  .how-steps { grid-template-columns: 1fr; }
  .saved { grid-template-columns: 1fr; }
  .pipeline { gap: 0; }
  .pipeline b { font-size: 0.78rem; }
  .station { width: 44px; height: 44px; }
  .station svg { width: 20px; height: 20px; }
  .pipeline li + li::before { top: 22px; left: calc(-50% + 26px); right: calc(50% + 26px); }
  .film { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .making-ready { flex-direction: column; align-items: stretch; text-align: center; }
  .frame { border-width: 8px; }
  .heading { padding: 0.6rem 0.9rem 1.6rem; font-size: 1.25rem; }
  .status { left: 0.9rem; right: 0.9rem; bottom: 0.6rem; }
  .visuals { inset: 3rem 0.9rem 0.9rem; gap: 0.5rem; }
  .v-label { font-size: 1.2rem; }
  .v-note { display: none; }
  .controls { grid-template-columns: 1fr; justify-items: center; gap: 0.7rem; }
  .where { justify-self: stretch; }
  .hand { justify-self: center; }
  .caption { font-size: 1rem; min-height: 4.5em; }
  .transport { flex-wrap: nowrap; gap: 0.1rem; }
  .transport-gap { width: 0.2rem; }
  .icon-btn { min-width: 36px; height: 38px; padding: 0 0.35rem; }
  .play-btn { width: 52px; height: 52px; margin: 0 0.2rem; }
  .keys { display: none; }
  .ask-bubble { left: 0.6rem; right: 0.6rem; top: 1.8rem; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .view, .making-ready { animation: none; }
  .visual, .word, .picture .sketch, .picture .lit, .picture .full, .shot-img img, .making-bg img, .progress-bar { transition: none; }
  .visual { transform: none; }
  .heading.write, .shot-img::after, .hand.listening, .outline.pulse .trace, .label.pulse text,
  .pipeline li.now .station, .pipeline li::before, .ask-bubble .ask-meter i, .pulse-dot.live, .progress-bar::after,
  .shot-step::before { animation: none !important; }
  .hero-title .line, .scribble path { animation: none; stroke-dashoffset: 0; }
}
