/* The welcome page taster (public/welcome.html, js/taster.js). The critical part (tokens,
   the first card, choice buttons) is inline in welcome.html; this is everything after it. */

/* ---------- Playing: the taster takes the whole screen ---------- */
html.playing, html.playing body { overflow: hidden; height: 100%; overscroll-behavior: none; }
html.playing .hero { position: fixed; inset: 0; z-index: 10; overflow-y: auto; background: var(--bg); padding-top: calc(var(--sat) + 10px); }
html.playing .peek, html.playing .about { visibility: hidden; }
html.playing .col { justify-content: flex-start; }

html.playing .t-head { position: sticky; top: 0; z-index: 3; margin-top: calc(-10px - var(--sat)); padding-top: calc(var(--sat) + 10px); background: var(--bg); box-shadow: 0 0 0 100vmax var(--bg); clip-path: inset(0 -100vmax); }
.t-top { width: 100%; max-width: 760px; margin: 0 auto 6px; display: flex; align-items: center; gap: 14px; }
.t-close { width: 38px; height: 38px; flex: none; border-radius: 19px; background: var(--surface3); color: var(--muted); font-size: 15px; font-weight: 700; }
.t-progress { flex: 1; height: 8px; border-radius: 4px; background: var(--surface3); overflow: hidden; }
.t-progress i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--good); transition: width .5s var(--spring); }
.t-count { font-size: 13px; font-weight: 750; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }

/* ---------- The street: one slot per question, bricks drop in ---------- */
.street { position: relative; width: 100%; max-width: 760px; height: 62px; margin: 0 auto 14px; display: flex; align-items: flex-end; justify-content: center; gap: 5px; padding: 0 0 9px; }
.street::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 9px; border-radius: 5px; background: var(--base); opacity: .55; }
.street .lamp { position: absolute; left: 6px; bottom: 9px; width: 14px; height: 44px; }
.street .lamp::before { content: ''; position: absolute; left: 6px; bottom: 0; width: 2px; height: 36px; background: var(--muted); opacity: .5; }
.street .lamp::after { content: ''; position: absolute; left: 1px; top: 0; width: 12px; height: 9px; border-radius: 6px 6px 2px 2px; background: var(--accent2); box-shadow: 0 0 14px var(--accent2); opacity: .85; }
.slot { position: relative; width: 34px; height: 22px; border-radius: 4px; border: 1.5px dashed color-mix(in srgb, var(--muted) 45%, transparent); }
.slot.ghost { border-style: dashed; border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.slot.now { border-color: var(--accent); border-style: solid; animation: slotPulse 1.6s ease-in-out infinite; }
@keyframes slotPulse { 50% { border-color: color-mix(in srgb, var(--accent) 30%, transparent); } }
.brick { position: absolute; inset: -1.5px; border-radius: 4px; background: linear-gradient(180deg, var(--brick-hi), var(--brick) 55%, var(--brick-lo)); box-shadow: inset 0 -2px 0 rgba(0,0,0,.22), 0 1px 0 rgba(0,0,0,.2); }
.brick.drop { animation: drop .5s var(--spring) both; }
@keyframes drop { 0% { translate: 0 -64px; rotate: -8deg; opacity: 0; } 45% { translate: 0 0; rotate: 0deg; opacity: 1; } 62% { scale: 1.12 .82; } 100% { translate: 0 0; scale: 1; } }
.puff { position: absolute; bottom: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--base); opacity: 0; pointer-events: none; animation: puff .55s ease-out .2s both; }
.puff.l { left: -6px; --dx: -14px; } .puff.r { right: -6px; --dx: 14px; }
@keyframes puff { 0% { opacity: .9; translate: 0 0; scale: .6; } 100% { opacity: 0; translate: var(--dx) -10px; scale: 1.6; } }

/* ---------- Question card ---------- */
.qcard { animation: cardIn .45s var(--ease-out) both; }
.qcard.static { animation: none; }
@keyframes cardIn { from { opacity: 0; translate: 0 18px; } }
.q-scene { margin: -2px 0 8px; color: var(--muted); font-size: 16px; line-height: 1.4; }
.q-prompt.small { font-size: clamp(26px, 6.6vw, 36px); margin-bottom: 22px; }
.q-prompt b, .md b { font-weight: 850; }
.md em { font-style: normal; font-weight: 750; color: var(--accent); }
.choices.three { grid-template-columns: 1fr; }
.choice.en { font-size: 19px; font-weight: 750; }
.choice.right { background: var(--good); color: var(--good-text); box-shadow: 0 4px 0 color-mix(in srgb, var(--good) 65%, #000); }
.choice.wrong { background: var(--bad); color: #fff; box-shadow: 0 4px 0 color-mix(in srgb, var(--bad) 65%, #000); }
.choice.dim { opacity: .35; }
.choice.wrong.dim { opacity: .5; }
.choice:disabled { cursor: default; }
.key { display: none; }
@media (hover: hover) and (pointer: fine) {
  .choice:not(:disabled):hover { translate: 0 -2px; box-shadow: 0 6px 0 var(--tile-edge), 0 12px 22px rgba(0,0,0,.16); }
  .key { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 10px; border-radius: 6px; font-size: 12px; font-weight: 800; vertical-align: 3px; background: color-mix(in srgb, currentColor 16%, transparent); }
}

/* Listen: a big play button */
.listen { display: flex; justify-content: center; margin: 4px 0 22px; }
.play { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-text); box-shadow: 0 6px 0 color-mix(in srgb, var(--accent) 60%, #000), 0 14px 30px color-mix(in srgb, var(--accent) 35%, transparent); transition: scale .45s var(--spring); }
.play svg { width: 40px; height: 40px; fill: currentColor; }
.play.on { animation: playing 1s ease-in-out infinite; }
@keyframes playing { 50% { scale: 1.06; } }

/* Build: an answer line and a tray of tiles */
.line { min-height: 64px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 4px; margin-bottom: 18px; border-bottom: 2px solid var(--line); }
.line:empty::before { content: 'Tap the tiles'; color: var(--muted); font-size: 15px; padding-left: 4px; }
.tray { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 20px; }
.tile { display: inline-flex; align-items: center; justify-content: center; min-width: 64px; height: 52px; padding: 0 18px; border-radius: 14px; background: var(--surface); color: var(--text); font-size: 21px; font-weight: 750; border: 1.5px solid var(--line); box-shadow: 0 3px 0 color-mix(in srgb, var(--text) 18%, transparent); transition: scale .4s var(--spring), opacity .2s; }
.tray.done .tile { opacity: .25; box-shadow: none; }
.tile.used { opacity: .25; box-shadow: none; pointer-events: none; }
.tile.placed { background: var(--tile); color: var(--tile-text); border-color: transparent; box-shadow: 0 3px 0 var(--tile-edge); animation: pop .35s var(--spring); }
@keyframes pop { from { scale: .7; } }
.check { width: 100%; min-height: 56px; border-radius: 16px; background: var(--accent); color: var(--accent-text); font-size: 18px; font-weight: 800; box-shadow: 0 4px 0 color-mix(in srgb, var(--accent) 60%, #000); transition: opacity .2s, scale .45s var(--spring); }
.check:disabled { opacity: .35; box-shadow: none; }

/* Spot the mistake: tappable words */
.words { display: flex; flex-wrap: wrap; gap: 8px 8px; margin: 2px 0 14px; }
.word { padding: 10px 14px; border-radius: 12px; background: var(--surface3); font-size: 24px; font-weight: 750; transition: scale .4s var(--spring), background .2s; }
.word.bad { background: var(--bad); color: #fff; text-decoration: line-through; text-decoration-thickness: 2px; }
.word.fixed { background: var(--good); color: var(--good-text); position: relative; }
.word.fixed small { position: absolute; left: 50%; top: -18px; translate: -50% 0; font-size: 13px; color: var(--muted); font-weight: 700; text-decoration: line-through; }
.gloss { color: var(--muted); font-size: 15px; margin: 0 0 4px; }

/* Type it */
.type-row { display: flex; gap: 10px; margin-bottom: 10px; }
.type-in { flex: 1; min-width: 0; height: 60px; border-radius: 16px; border: 2px solid var(--line); background: var(--bg); color: var(--text); padding: 0 18px; font: 750 24px var(--font); outline: none; transition: border-color .2s; -webkit-user-select: text; user-select: text; }
.type-in:focus { border-color: var(--accent); }
.type-in.right { border-color: var(--good); } .type-in.wrong { border-color: var(--bad); }
.accent-keys { display: flex; gap: 8px; margin-bottom: 8px; }
.akey { min-width: 48px; height: 44px; border-radius: 12px; background: var(--surface3); font-size: 20px; font-weight: 750; }
.hint { color: var(--muted); font-size: 14px; margin: 4px 0 18px; }

/* The tiny lesson */
.lesson .q-prompt { margin-bottom: 16px; }
.lesson p:not(.q-label) { font-size: 17.5px; line-height: 1.5; margin: 0 0 12px; }
.examples { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 14px; }
.ex { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px 16px; border-radius: 16px; background: var(--surface3); text-align: left; transition: scale .4s var(--spring); }
.ex b { font-size: 22px; font-weight: 850; }
.ex b u { text-decoration: none; color: var(--accent); }
.ex span { font-size: 14px; color: var(--muted); }
.ex .spk { width: 16px; height: 16px; fill: var(--muted); margin-top: 6px; }
.aside { font-size: 14.5px !important; color: var(--muted); }

/* ---------- Feedback after an answer ---------- */
.feedback { margin-top: 14px; padding: 18px 18px 16px; border-radius: 22px; background: color-mix(in srgb, var(--good) 13%, var(--surface)); animation: fbIn .4s var(--spring) both; }
.feedback.bad { background: color-mix(in srgb, var(--bad) 11%, var(--surface)); }
@keyframes fbIn { from { opacity: 0; translate: 0 16px; } }
.fb-head { display: flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 850; color: var(--good); margin-bottom: 6px; }
.feedback.bad .fb-head { color: var(--bad); }
.fb-head i { width: 30px; height: 30px; border-radius: 15px; display: grid; place-items: center; background: currentColor; font-style: normal; }
.fb-head i::after { content: '✓'; color: var(--surface); font-size: 17px; font-weight: 900; }
.feedback.bad .fb-head i::after { content: '↺'; }
.fb-msg { margin: 0 0 12px; font-size: 16.5px; line-height: 1.45; }
.fb-say { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 8px 14px 8px 10px; border-radius: 12px; background: var(--surface); font-size: 18px; font-weight: 800; }
.fb-say svg { width: 20px; height: 20px; fill: var(--accent); }
.next { display: block; width: 100%; min-height: 54px; border-radius: 16px; background: var(--good); color: var(--good-text); font-size: 18px; font-weight: 800; box-shadow: 0 4px 0 color-mix(in srgb, var(--good) 60%, #000); transition: scale .45s var(--spring); }
.feedback.bad .next { background: var(--text); color: var(--bg); box-shadow: 0 4px 0 color-mix(in srgb, var(--text) 60%, #000); }
.next kbd, .check kbd { display: none; }
@media (hover: hover) and (pointer: fine) { .next kbd, .check kbd { display: inline; font: 600 12px var(--font); opacity: .6; margin-left: 8px; } }

/* ---------- The end: the first house ---------- */
.done { text-align: center; padding-top: 6px; margin-top: 14px; }
.done .q-prompt { margin: 22px 0 8px; font-size: clamp(28px, 7vw, 40px); }
.done .warm { margin: 0 auto 6px; max-width: 36ch; color: var(--text); font-size: 17px; line-height: 1.45; }
.done .score { margin: 0 0 22px; color: var(--muted); font-size: 14px; font-weight: 650; }
.house { position: relative; width: 230px; margin: 10px auto 0; padding-top: 92px; }
.house .roof { position: absolute; top: 4px; left: -22px; right: -22px; height: 92px; opacity: 0; }
.house .roof svg { width: 100%; height: 100%; display: block; }
.house .roof .r { fill: var(--accent); } .house .roof .c { fill: var(--brick-lo); }
.house .roof .smoke { fill: var(--muted); opacity: 0; }
.house.built .roof { animation: roof .7s var(--spring) both; }
.house.built .smoke { animation: smoke 2.6s ease-out 1s infinite; }
.house.built .smoke.s2 { animation-delay: 1.8s; }
@keyframes roof { from { opacity: 0; translate: 0 -60px; } to { opacity: 1; translate: 0 0; } }
@keyframes smoke { 0% { opacity: 0; translate: 0 0; scale: .6; } 25% { opacity: .5; } 100% { opacity: 0; translate: 10px -34px; scale: 1.8; } }
.walls { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 40px); gap: 5px; padding: 6px; border-radius: 6px; background: color-mix(in srgb, var(--base) 45%, transparent); }
.walls .slot { width: auto; height: auto; border-radius: 5px; }
.walls .door { grid-column: 2; grid-row: 2 / 4; border-radius: 30px 30px 4px 4px; background: var(--window); opacity: 0; position: relative; }
.walls .door::after { content: ''; position: absolute; right: 10px; top: 50%; width: 6px; height: 6px; border-radius: 3px; background: var(--accent2); }
.house.built .door { animation: fadeIn .5s ease .2s both; }
.walls .win { grid-column: 2; grid-row: 1; margin: 6px 14px; border-radius: 4px; background: var(--accent2); opacity: 0; box-shadow: 0 0 18px color-mix(in srgb, var(--accent2) 70%, transparent); }
.house.built .win { animation: fadeIn .5s ease .55s both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.ground { height: 12px; margin: 0 -40px; border-radius: 6px; background: var(--base); opacity: .6; }
.end-actions { display: grid; gap: 10px; justify-items: center; margin-top: 26px; }
.end-actions[hidden] { display: none; }
.btn-walk { display: inline-flex; align-items: center; justify-content: center; min-height: 58px; padding: 0 28px; border-radius: 18px; background: var(--accent); color: var(--accent-text); font-size: 19px; font-weight: 800; text-decoration: none; box-shadow: 0 5px 0 color-mix(in srgb, var(--accent) 60%, #000), 0 14px 28px color-mix(in srgb, var(--accent) 28%, transparent); transition: scale .45s var(--spring), translate .2s; }
.btn-walk:active { scale: .96; }
.end-actions .btn-walk { width: 100%; max-width: 360px; animation: fbIn .5s var(--spring) both; }
.quiet { color: var(--muted); font-size: 15px; font-weight: 650; padding: 10px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--muted) 45%, transparent); }
.again { color: var(--muted); font-size: 14px; font-weight: 600; padding: 6px 10px; }

/* ---------- About (below the fold) ---------- */
.about { padding: 72px 16px calc(var(--sab) + 40px); border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface2) 40%, var(--bg)); }
.about-in { max-width: 980px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; font-size: 20px; font-weight: 850; letter-spacing: -0.01em; }
.brick-ico { display: inline-block; width: 24px; height: 14px; border-radius: 3px; background: linear-gradient(180deg, var(--brick-hi), var(--brick) 55%, var(--brick-lo)); box-shadow: inset 0 -1px 0 rgba(0,0,0,.3); }
.pitch { margin: 0 0 40px; font-size: clamp(32px, 7vw, 54px); line-height: 1.05; font-weight: 850; letter-spacing: -0.03em; text-wrap: balance; }
.pitch span { display: block; margin-top: 14px; font-size: clamp(19px, 3.4vw, 26px); line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; color: var(--muted); }
.how { display: grid; gap: 14px; }
.how article { padding: 22px 22px 20px; border-radius: 22px; background: var(--surface); box-shadow: var(--card-shadow); }
.how h3 { margin: 12px 0 6px; font-size: 19px; font-weight: 800; }
.how p { margin: 0; color: var(--muted); font-size: 15.5px; line-height: 1.5; }
.how-ico svg { width: 48px; height: 48px; display: block; }
.how-ico .b { fill: var(--brick); }
.how-ico .crack { fill: none; stroke: var(--surface); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.how-ico .bub { fill: var(--accent); }
.how-ico .dot { fill: var(--accent-text); }
.about-cta { margin: 34px 0 0; }
.plans { margin-top: 64px; }
.plans h2 { margin: 0 0 6px; font-size: clamp(26px, 5vw, 34px); font-weight: 850; letter-spacing: -0.02em; }
.plans-sub { margin: 0 0 20px; color: var(--muted); font-size: 16.5px; line-height: 1.45; }
.plan-grid { display: grid; gap: 14px; }
.plan { display: flex; flex-direction: column; padding: 22px 22px 20px; border-radius: 22px; background: var(--surface); box-shadow: var(--card-shadow); }
.plan.pro { box-shadow: var(--card-shadow), 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent); }
.plan h3 { margin: 0 0 4px; font-size: 20px; font-weight: 850; }
.plan .price { margin: 0 0 14px; color: var(--muted); font-size: 15px; }
.plan .price b { color: var(--text); font-size: 30px; font-weight: 850; letter-spacing: -0.02em; }
.plan .price span { display: block; margin-top: 2px; }
.plan .price span b { font-size: 17px; }
.plan ul { margin: 0 0 16px; padding: 0; list-style: none; display: grid; gap: 8px; }
.plan li { position: relative; padding-left: 26px; font-size: 15.5px; line-height: 1.4; }
.plan li::before { content: '✓'; position: absolute; left: 2px; top: 0; color: var(--good); font-weight: 900; }
.founding { margin: 0 0 16px; padding: 10px 12px; border-radius: 14px; background: color-mix(in srgb, var(--accent2) 18%, transparent); font-size: 14.5px; line-height: 1.4; }
.plan-go { margin-top: auto; display: grid; place-items: center; min-height: 50px; border-radius: 16px; background: var(--accent); color: var(--accent-text); font-size: 17px; font-weight: 800; text-decoration: none; }
.plan-go.soon { background: var(--surface2); color: var(--muted); cursor: default; }
.plans-fine { margin: 16px 2px 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.plans-fine a, .foot a { color: inherit; text-underline-offset: 3px; }
.foot { margin-top: 48px; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; color: var(--muted); font-size: 13px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 16px; }
@media (min-width: 700px) { .plan-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- Bigger screens ---------- */
@media (min-width: 700px) {
  .street { height: 80px; gap: 8px; margin-bottom: 26px; }
  .slot { width: 52px; height: 28px; }
  .q-scene { font-size: 18px; }
  .choices.three { grid-template-columns: 1fr; }
  .feedback { padding: 22px 26px 20px; }
  .how { grid-template-columns: repeat(3, 1fr); }
  .about { padding-top: 110px; }
  .house { width: 270px; }
  .walls { grid-template-rows: repeat(3, 46px); }
}
@media (min-width: 1024px) {
  /* Desktop: the card sits on a quiet street scene instead of floating in a stretched phone. */
  .hero { padding-left: 32px; padding-right: 32px; }
  .hero::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 150px; pointer-events: none;
    background: var(--surface2); opacity: .7;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 120'%3E%3Cpath d='M26 120V70H20L60 40l40 30h-6v50z'/%3E%3Cpath d='M120 120V40h-6l31-25 31 25h-6v80z'/%3E%3Cpath d='M200 120V80h-6l36-22 36 22h-6v40z'/%3E%3Cpath d='M290 120V30h-4l21-25 21 25h-4v90z'/%3E%3Cpath d='M350 120V64h-6l51-28 51 28h-6v56z'/%3E%3Cpath d='M470 120V74h-6l28-22 28 22h-6v46z'/%3E%3Cpath d='M535 120V56h-6l31-24 31 24h-6v64z'/%3E%3C/svg%3E") bottom left / 600px 120px repeat-x; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 120'%3E%3Cpath d='M26 120V70H20L60 40l40 30h-6v50z'/%3E%3Cpath d='M120 120V40h-6l31-25 31 25h-6v80z'/%3E%3Cpath d='M200 120V80h-6l36-22 36 22h-6v40z'/%3E%3Cpath d='M290 120V30h-4l21-25 21 25h-4v90z'/%3E%3Cpath d='M350 120V64h-6l51-28 51 28h-6v56z'/%3E%3Cpath d='M470 120V74h-6l28-22 28 22h-6v46z'/%3E%3Cpath d='M535 120V56h-6l31-24 31 24h-6v64z'/%3E%3C/svg%3E") bottom left / 600px 120px repeat-x; }
  .hero::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 12px; background: var(--base); opacity: .5; pointer-events: none; }
  html.playing .hero::after { display: none; }
  html.playing .hero::before { display: none; }
  .col { position: relative; z-index: 1; max-width: 720px; }
  .peek { position: relative; z-index: 1; margin-bottom: 18px; }
  .qcard.static .q-prompt, .q-prompt:not(.small) { font-size: 54px; }
  .q-prompt.small { font-size: 40px; }
  .lesson p:not(.q-label) { font-size: 18.5px; }
  .examples { gap: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}

/* Ana says hello back (taster.js showMeet). */
.meet { text-align: center; }
.meet-face { display: block; width: 112px; height: 112px; margin: 0 auto 14px; border-radius: 50%; overflow: hidden; background: color-mix(in srgb, var(--c, var(--accent2)) 26%, var(--surface)); box-shadow: 0 0 0 5px var(--surface), 0 0 0 7px color-mix(in srgb, var(--c, var(--accent2)) 45%, transparent); animation: fbIn .5s var(--spring) both; }
.meet-face svg { width: 100%; height: 100%; display: block; }
.meet-say { display: inline-flex; align-items: center; gap: 10px; margin: 0 auto; }
.meet-say svg { flex: none; width: 26px; height: 26px; color: var(--accent); }
.meet-say .q-prompt { margin: 0; }
.meet-en { margin: 6px 0 14px; color: var(--muted); font-size: 16px; }
.about-cta2 { margin: 10px 0 0; text-align: center; }
