/* ─── Voice Kata — see DESIGN.md "Look" ────────────────────── */
:root {
  --paper: #FAF4EA;
  --paper-2: #F3EADC;
  --ink: #2B221C;
  --muted: #7C6F64;
  --dim: #B9AEA1;
  --line: #E6DCCD;
  --good: #3E9A6D;
  --good-soft: #CBE7D6;
  --warn: #D48A2C;
  --warn-soft: #FBEBD3;
  /* purpose accents, keyed by purpose id */
  --p-dating: #E2655F;       --p-dating-soft: #FBE3DF;
  --p-presentation: #E0922E; --p-presentation-soft: #FBE8CF;
  --p-general: #3E9C8C;      --p-general-soft: #D9EFE9;
  --accent: var(--p-dating);
  --accent-soft: var(--p-dating-soft);
  --display: "Bricolage Grotesque", "Avenir Next", "Helvetica Neue", sans-serif;
  --body: "Nunito Sans", "Avenir Next", "Segoe UI", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.5; min-height: 100vh; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.hidden { display: none !important; }

.stage { max-width: 560px; margin: 0 auto; padding: 40px 24px 80px; min-height: 100vh; }
.screen { display: none; animation: rise .4s ease both; }
.screen.on { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
h1, h2 { font-family: var(--display); text-wrap: balance; margin: 0; }
h1 { font-size: 2.1rem; line-height: 1.15; font-weight: 600; }
.lede { color: var(--muted); margin: 8px 0 0; max-width: 34ch; }
.hint { margin: 14px 0 0; color: var(--muted); font-size: .95rem; }
.hint b { color: var(--ink); }

/* ── Home ─────────────────────────────────────────────────── */
.brand { display: flex; align-items: center; justify-content: space-between; margin-bottom: 42px; }
.brand b { font-family: var(--display); font-weight: 700; letter-spacing: .01em; }
.streak { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: #fff; border: 1.5px solid var(--line); font-size: .82rem; font-weight: 700; color: var(--muted); }
.streak:empty { display: none; }
.streak svg { width: 14px; height: 14px; color: var(--p-presentation); }
.cards { display: grid; gap: 14px; margin-top: 28px; }
.card {
  display: grid; grid-template-columns: 72px 1fr; gap: 18px; align-items: center;
  text-align: left; padding: 18px 20px 18px 16px;
  background: #fff; border-radius: 22px; border: 1.5px solid var(--line);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 12px 30px #2b221c14; border-color: var(--c); }
.card:focus-visible { outline: 3px solid var(--c); outline-offset: 3px; }
.card .face-wrap { width: 72px; height: 72px; }
.card h3 { margin: 0; font-family: var(--display); font-size: 1.25rem; font-weight: 600; }
.card p { margin: 2px 0 8px; color: var(--muted); font-size: .95rem; }
.today { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; color: var(--c); }
.today i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }

/* ── Session screens ──────────────────────────────────────── */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 36px; }
.top .close { width: 36px; height: 36px; border-radius: 50%; background: var(--paper-2); font-size: 1.1rem; color: var(--muted); flex: none; }
.dots { display: flex; gap: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); transition: background .3s; }
.dots i.done { background: var(--good); }
.dots i.now { background: var(--accent); transform: scale(1.25); }
.dots i.miss { background: var(--warn); }
.instruction { margin: 0; color: var(--muted); font-size: 1.1rem; font-weight: 600; max-width: 38ch; }

/* The lines to say out loud: the only white card on the screen. */
.cue { margin-top: 28px; padding: 22px 28px 26px; background: #fff; border: 1.5px solid var(--line); border-radius: 24px; box-shadow: 0 14px 34px #2b221c0f; }
.cue.flash { animation: knock .6s ease-out; }
@keyframes knock { 0% { box-shadow: 0 0 0 0 #D48A2C88; transform: translateX(0); } 20% { transform: translateX(-3px); } 40% { transform: translateX(3px); } 100% { box-shadow: 0 14px 34px #2b221c0f; transform: none; } }
.cue-label { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.cue-label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.listening-cue .cue-label::before { animation: blink 1.6s ease-in-out infinite; }
.cue-label.hold { color: var(--warn); }
@keyframes blink { 50% { opacity: .25; } }

/* One line, one breath. The marker is the teacher's finger. */
.lines { display: grid; gap: 4px; }
.line { position: relative; margin-left: -14px; padding: 4px 12px 4px 14px; border-radius: 12px; font-family: var(--display); font-weight: 500; font-size: 1.85rem; line-height: 1.3; letter-spacing: -.005em; text-wrap: pretty; color: var(--dim); transition: color .25s ease, background .25s ease; }
.line.now { color: var(--ink); }
.line.now::before { content: ""; position: absolute; left: 0; top: .55em; width: 6px; height: .8em; border-radius: 3px; background: var(--accent); }
.line.ok { color: var(--ink); opacity: .5; }
.line.ok::after { content: "✓"; display: inline-block; margin-left: 10px; font-family: var(--body); font-size: .8rem; font-weight: 700; color: var(--good); vertical-align: middle; animation: pop .35s ease; }
.line.stop { color: var(--ink); background: var(--warn-soft); text-decoration: underline wavy var(--warn); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.line.stop::before { content: ""; position: absolute; left: 0; top: .55em; width: 6px; height: .8em; border-radius: 3px; background: var(--warn); }
.line.later { color: var(--dim); }
.line.later::after { content: "later"; margin-left: 10px; font-family: var(--body); font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--warn); vertical-align: middle; }
.line.later.now { color: var(--ink); }
.line .w { transition: color .2s ease; }
.line.now .w.read { color: var(--dim); }
.read-btn { display: block; margin: 14px auto 0; padding: 8px 16px; border-radius: 999px; background: var(--paper-2); color: var(--muted); font-size: .78rem; font-weight: 700; }
.read-btn[hidden] { display: none; }
#wu-lines .line { color: var(--ink); }

/* The goal band: where your usual voice sits, where to aim, where you are now. */
.gauge { position: relative; margin: 22px 0 6px; height: 8px; border-radius: 4px; background: var(--paper-2); }
.gauge-low  { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px 0 0 4px; background: var(--warn-soft); }
.gauge-band { position: absolute; top: 0; bottom: 0; background: var(--good-soft); }
.gauge-over { position: absolute; right: 0; top: 0; bottom: 0; width: 0; border-radius: 0 4px 4px 0; background: var(--warn-soft); }
.gauge-base { position: absolute; top: -5px; width: 2px; height: 18px; border-radius: 1px; background: var(--muted); transform: translateX(-1px); }
.gauge-dot  { position: absolute; top: -5px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: 3px solid #fff; box-shadow: 0 2px 8px #2b221c33; transform: translateX(-9px); transition: left .2s ease, background .2s ease, opacity .3s ease; opacity: .35; }
.gauge.hot .gauge-dot { opacity: 1; }
.gauge-dot.low { background: var(--warn); }
.gauge-labels { position: relative; height: 16px; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.gauge-labels span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }

/* The teacher. */
.coach { display: grid; grid-template-columns: 112px 1fr; gap: 18px; align-items: center; margin-top: 40px; }
.face-wrap { position: relative; width: 112px; height: 112px; }
.face-wrap svg { width: 100%; height: 100%; display: block; }
.ripple { position: absolute; inset: -14px; border-radius: 50%; border: 2px solid var(--accent); opacity: 0; transition: transform .12s ease, opacity .3s ease; }
.listening .ripple { animation: ripple 1.6s ease-out infinite; }
.live .ripple { animation: none; opacity: .45; }
@keyframes ripple { 0% { transform: scale(.85); opacity: .5; } 100% { transform: scale(1.15); opacity: 0; } }
.listening .face { animation: breathe 3.2s ease-in-out infinite; transform-origin: 50% 60%; }
.live .face { animation: none; }
@keyframes breathe { 50% { transform: scale(1.035); } }
.bubble { position: relative; background: #fff; border: 1.5px solid var(--line); border-radius: 18px; padding: 14px 16px; font-size: 1.02rem; line-height: 1.45; min-height: 58px; }
.bubble::before { content: ""; position: absolute; left: -9px; top: 26px; width: 14px; height: 14px; background: #fff; border-left: 1.5px solid var(--line); border-bottom: 1.5px solid var(--line); transform: rotate(45deg); }
.bubble b { font-weight: 700; }
.bubble q { quotes: "‘" "’"; font-style: italic; }
.bubble .but { display: block; margin-top: 4px; color: var(--warn); font-weight: 600; }
.bubble.quiet { color: var(--muted); }
.bubble.good { border-color: var(--good); }
.bubble.good::before { border-color: var(--good); }
.bubble.hmm { border-color: var(--warn); }
.bubble.hmm::before { border-color: var(--warn); }
.ring { position: absolute; inset: -10px; }
.ring circle { fill: none; stroke-width: 5; stroke-linecap: round; }
.ring .track { stroke: var(--line); }
.ring .fill { stroke: var(--accent); transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset .5s ease; }

.primary { display: block; width: 100%; padding: 16px; border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 700; font-size: 1.05rem; transition: transform .1s ease; }
.primary:active { transform: scale(.985); }
.ghost { display: block; width: 100%; padding: 14px; border-radius: 999px; color: var(--muted); font-weight: 700; }
.actions { display: grid; gap: 8px; margin-top: 36px; }

/* ── Game layer: combo, stars, badges ─────────────────────── */
.combo { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 800; letter-spacing: .04em; color: var(--accent); background: var(--accent-soft); opacity: 0; transform: scale(.8); transition: opacity .2s, transform .2s; white-space: nowrap; }
.combo.on { opacity: 1; transform: none; }
.combo.pop { animation: pop .35s ease; }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
.stars { display: flex; gap: 6px; margin-top: 28px; }
.stars svg { width: 34px; height: 34px; color: var(--line); }
.stars svg.lit { color: var(--p-presentation); animation: star .5s cubic-bezier(.2,1.4,.4,1) both; }
.stars svg:nth-child(2).lit { animation-delay: .15s; }
.stars svg:nth-child(3).lit { animation-delay: .3s; }
@keyframes star { from { transform: scale(0) rotate(-30deg); opacity: 0; } to { transform: none; opacity: 1; } }
.reward { display: grid; grid-template-columns: 64px 1fr; gap: 16px; align-items: center; margin-top: 28px; padding: 16px 18px; border-radius: 20px; background: #fff; border: 1.5px solid var(--line); }
.reward:empty { display: none; }
.reward.new { border-color: var(--p-presentation); animation: rise .5s .4s ease both; }
.reward .eyebrow { color: var(--p-presentation); }
.reward h4 { margin: 2px 0 0; font-family: var(--display); font-size: 1.15rem; font-weight: 600; }
.reward p { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }
.badge { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--paper-2); color: var(--dim); border: 2px solid var(--line); }
.badge svg { width: 30px; height: 30px; }
.badge.earned { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge.gold { background: var(--p-presentation-soft); color: var(--p-presentation); box-shadow: 0 0 0 4px #FBE8CF88; }
.reward.new .badge { animation: star .6s .5s cubic-bezier(.2,1.4,.4,1) both; }
.progress { position: relative; height: 6px; border-radius: 3px; background: var(--paper-2); margin-top: 10px; overflow: hidden; }
.progress i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--p-presentation); }
.shelf { margin-top: 34px; }
.shelf .eyebrow { display: flex; justify-content: space-between; margin-bottom: 12px; }
.shelf-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.shelf-row .badge { width: 100%; height: auto; aspect-ratio: 1; }
.shelf-row figure { margin: 0; display: grid; gap: 6px; justify-items: center; text-align: center; }
.shelf-row figcaption { font-size: .72rem; font-weight: 700; color: var(--muted); line-height: 1.2; }
.shelf-row figure.locked figcaption { color: var(--dim); }

/* ── Done ─────────────────────────────────────────────────── */
.score { font-family: var(--display); font-size: 3.4rem; font-weight: 700; line-height: 1; letter-spacing: -.02em; margin: 14px 0 6px; font-variant-numeric: tabular-nums; }
.score small { font-size: 1.4rem; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.goals { display: grid; gap: 0; margin-top: 32px; }
.goal { display: grid; grid-template-columns: 14px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.goal:last-child { border-bottom: 1px solid var(--line); }
.goal i { width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
.goal i.good { background: var(--good); }
.goal i.ok { background: var(--warn); }
.goal i.low, .goal i.over, .goal i.strained, .goal i.clipping { background: var(--line); border: 2px solid var(--warn); }
.goal .name { font-weight: 700; }
.goal .name small { display: block; font-weight: 400; color: var(--muted); font-size: .88rem; }
.goal .state { font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; text-align: right; }
.goal.focus .name > span::after { content: "today"; margin-left: 8px; font-size: .72rem; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); vertical-align: 2px; }
.details { text-align: center; margin-top: 20px; font-size: .85rem; }
.details button { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .screen, .listening .ripple, .listening .face, .cue.flash, .combo.pop, .stars svg.lit, .reward.new, .reward.new .badge, .line.ok::after { animation: none; }
}
@media (max-width: 480px) {
  .stage { padding: 24px 18px 60px; }
  .line { font-size: 1.5rem; }
  .cue { padding: 18px 20px 20px; }
  .coach { grid-template-columns: 88px 1fr; gap: 14px; }
  .face-wrap { width: 88px; height: 88px; }
  .shelf-row { gap: 8px; }
}
