/* demo.css — the playable deck's additions to the landing page (Design, 2026-11-06, L-5).
   Everything the static hero already has stays in landing.css; this file only adds what the demo
   needs: the invitation in the card's foot (words + a hand-drawn arrow at the speaker), the speaker as
   the voice switch (on · reading · off), the word-by-word highlight, the tiles as buttons, the card swap
   and the end card. Same tokens as landing.css. (landing2, 2026-11-06: the sticker above the table and the
   pill on the picture are gone.) */

/* ---------- the card face: a tap anywhere on it turns to the What else? card (demo.js) ---------- */
.card.is-live { cursor: pointer; -webkit-tap-highlight-color: transparent; }

/* M1 (landing3): after a card turns, its question takes focus so a screen reader hears it (demo.js
   focusAndShow). A heading is not a control: no ring, on tap or on keyboard. Real controls keep theirs. */
.card-q:focus, .end-card h2:focus { outline: none; }

/* ---------- the foot: More › on the left, the invitation or the state line in the middle, the speaker on the right ---------- */
.card-foot { gap: 6px; }
.foot-left { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 6px; }

/* M3 (landing3): the app's quiet "More ›" (Table.tsx QuietLink): felt-green words, no pill; "‹ Back" on the more layer */
.more-link {
  display: inline-flex; align-items: center; gap: 4px; flex: none; height: 44px; padding: 0 8px; margin-left: -8px; border: none; border-radius: 22px;
  background: transparent; color: var(--felt); font-family: var(--display); font-weight: 600; font-size: 22px; line-height: 1; cursor: pointer;
  white-space: nowrap; -webkit-tap-highlight-color: transparent; margin-right: auto; /* the speaker stays on the right of its row */
}
.more-link .chev { font-size: 1.25em; line-height: 1; margin-top: -.1em; }
.more-link:hover { background: rgba(31, 107, 94, .08); }
.more-link:active { background: rgba(31, 107, 94, .14); }
.more-link:focus-visible { outline: 4px solid var(--marigold); outline-offset: 0; }
/* the more layer: the picture and question stay, the answer's place holds the card's "more" text, a size down (the app's M_SIZES) */
.card-a.is-more { font-size: 17px; }
.card-a.is-more .w-todo { color: var(--ink-soft); }
@media (min-width: 700px) { .card-a.is-more { font-size: 19px; } }
@media (min-width: 960px) { .card-a.is-more { font-size: 20px; } }

/* ---------- the invitation: "Tap to hear it read aloud" and an arrow INTO the speaker, until the first play ---------- */
/* M2 (landing3): the arrow's head is at the right-hand middle of its box, and the box is centred on the
   speaker's row (align-items: center), so the head lands at the speaker's middle at any width. */
.spk-callout { display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 600; font-size: 20px; line-height: 1.15; color: var(--ink); text-align: right; }
.spk-callout .callout-words { max-width: 11em; text-wrap: balance; }
.spk-arrow { width: 64px; height: 40px; flex: none; transform-origin: 10% 50%; }
.spk-arrow path { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.spk-arrow.is-nudging { animation: arrowNudge 2.6s ease-in-out infinite; }
@keyframes arrowNudge { 0%, 70%, 100% { transform: translate(0, 0) rotate(0); } 80% { transform: translate(3px, 0) rotate(2deg); } 90% { transform: translate(-1px, 0) rotate(-1deg); } }
.spk-callout.is-leaving { transition: opacity .2s ease; opacity: 0; }
.spk.spk-invite { box-shadow: 0 0 0 4px var(--marigold), 0 4px 12px rgba(0, 0, 0, .18); animation: inviteRing 2.6s ease-in-out infinite; }
@keyframes inviteRing { 0%, 100% { box-shadow: 0 0 0 4px var(--marigold), 0 4px 12px rgba(0, 0, 0, .18); } 50% { box-shadow: 0 0 0 9px rgba(246, 183, 60, .45), 0 4px 12px rgba(0, 0, 0, .18); } }
@media (max-width: 699px) {
  .spk-callout .callout-words { max-width: 7.6em; }
  .more-link { font-size: 20px; }
}
/* on a phone the foot is two rows: the invitation (or the state line) on its own row above, then
   More › on the left and the speaker on the right. The phone arrow turns DOWN into the speaker:
   its head is at the middle of a speaker-wide box, right-aligned over the speaker. */
@media (max-width: 479px) {
  .card-foot { flex-wrap: wrap; row-gap: 0; }
  .foot-left { flex: 0 0 100%; order: -1; }
  .spk-callout { font-size: 18px; gap: 2px; margin-bottom: 2px; }
  .spk-callout .callout-words { max-width: 9em; }
  .spk-arrow { width: 56px; height: 34px; transform-origin: 20% 20%; }
  .spk-arrow.wide { display: none; }
  .card-foot .card-state { margin-bottom: 8px; }
}
@media (min-width: 480px) { .spk-arrow.phone { display: none; } }
/* the wide arrow's head is 7px in from its box's right edge, and the foot's gap adds 6 more: pull it 4px
   closer so the head sits within the device suite's 12px of the speaker (POINTS-TO), nudge or not */
.spk-arrow.wide { margin-right: -4px; }

/* ---------- the "Hear it" pill (owner, 2026-11-08, Design's option B; the app's twin is app/src/ui/playInvite.css) ----------
   Until the first play the speaker is dressed as a marigold pill: a dark triangle and "Hear it" in Fredoka, the
   halo breathing four times on the house curve and then holding a still ring (still from the start under reduced
   motion). It rides in .pill-dock, a box laid over the card's padding box, at its bottom-right corner, which is
   exactly where the speaker sits in the foot (a speaker-sized .spk-slot keeps its place there). The dock is as
   tall as the card, so the pill is sticky inside it: on a screen too short to show the card's foot (a phone
   inside Instagram's browser) it floats at the bottom of the visible card, and settles into the foot's corner
   once the foot scrolls into view. demo.js moves the button back into the foot when the pill goes. */
.spk-slot { width: 56px; height: 56px; flex: none; }
.pill-dock {
  position: absolute; inset: 0; padding: inherit; z-index: 3; pointer-events: none;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-end;
}
.pill-dock .spk {
  pointer-events: auto; position: sticky; bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  width: auto; padding: 0 22px 0 18px; gap: 8px; background: var(--marigold); color: var(--ink);
  font-family: var(--display); font-weight: 600; font-size: 20px; line-height: 1; white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .16), 0 0 0 4px rgba(246, 183, 60, .45);
  animation: pillGlow 1.6s var(--ease) .3s 4 both;
}
.pill-dock .spk svg { width: 22px; height: 22px; display: block; flex: none; }
.pill-dock .spk:focus-visible { outline: 4px solid var(--ink); outline-offset: 2px; }
/* a short phone: 8px off the screen's edge, so it clears the card's question (landing.css, the short-screen hero) */
@media (max-width: 699px) and (max-height: 640px) { .pill-dock .spk { bottom: calc(8px + env(safe-area-inset-bottom, 0px)); } }
@media (min-width: 700px) { .pill-dock .spk { font-size: 22px; padding: 0 24px 0 20px; } .pill-dock .spk svg { width: 24px; height: 24px; } }
@keyframes pillGlow {
  0%, 100% { box-shadow: 0 2px 6px rgba(0, 0, 0, .16), 0 0 0 4px rgba(246, 183, 60, .45); }
  50% { box-shadow: 0 2px 6px rgba(0, 0, 0, .16), 0 0 0 8px rgba(246, 183, 60, .6); }
}

/* ---------- the speaker: the app's three states (on · reading · off), still a filled felt circle here ---------- */
.spk { cursor: pointer; border: none; padding: 0; transition: transform .2s var(--ease), background-color .2s ease; }
.spk:active { transform: scale(.94); }
.spk:focus-visible { outline: 4px solid var(--marigold); outline-offset: 3px; }
.spk .wave { transform-box: fill-box; transform-origin: 0 50%; }
.spk-reading { background: var(--coral); }
.spk-reading .wave { animation: spkWave 1s ease-in-out infinite; }
.spk-reading .wave2 { animation-delay: .25s; }
.spk-off { background: var(--ink); }            /* voice off: the app's crossed speaker */
.spk .slash { display: none; }
.spk-off .wave { display: none; }
.spk-off .slash { display: block; }
@keyframes spkWave { 0%, 100% { transform: scaleX(1); opacity: 1; } 50% { transform: scaleX(.55); opacity: .4; } }

/* ---------- the words: the app's Spoken — said words ink, the word being said marigold, unsaid soft ---------- */
.card-a .w, .card-q .w { display: inline-block; border-radius: 8px; padding: 0 3px; margin: 0 -2px; transition: background-color .2s ease, color .2s ease; }
.card-a .w-todo, .card-q .w-todo { color: var(--ink-soft); }
.card-a .w-done, .card-q .w-done { color: var(--ink); }
.card-a .w-hi, .card-q .w-hi { background: var(--marigold); color: var(--ink); }
.card-q .w-todo { color: var(--ink); }           /* the question is read first; it stays ink while unsaid */

/* the state line beside the speaker: what the demo is doing (also the aria-live region); empty until the first play */
.card-foot .card-state { font-family: var(--body); font-size: 16px; color: var(--ink-soft); text-align: left; flex: 1 1 auto; }
.card-foot .card-state:empty { display: none; }

/* ---------- the three ways: real buttons now ---------- */
.tile-btn { border: none; padding: 0; margin: 0; background: transparent; font: inherit; color: inherit; text-align: inherit; display: contents; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tile { cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s ease; }
.tile:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(0, 0, 0, .34); }
.tile:active { transform: translateY(0) scale(.98); }
.tile:focus-within { outline: 4px solid var(--marigold); outline-offset: 3px; }
.tile[aria-busy="true"] { opacity: .7; }

/* ---------- the swap: the new card comes up from under; reduced motion = a plain swap ---------- */
.card.is-entering { animation: cardIn .38s var(--ease) both; }
.tile.is-picked { animation: tilePick .3s var(--ease) both; }
@keyframes cardIn { from { opacity: .4; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes tilePick { 0% { transform: scale(1); } 50% { transform: scale(1.06); } 100% { transform: scale(1); } }

/* ---------- the end card ---------- */
.end-card { text-align: center; padding: 28px 20px 28px; max-width: 760px; margin: 0 auto; grid-column: 1 / -1; }
.end-card .card-tab { left: 50%; transform: translateX(-50%); }
.end-faces { display: flex; justify-content: center; gap: 6px; }
.end-faces img { width: 52px; height: 52px; border-radius: 50%; box-shadow: 0 0 0 3px #FFFFFF, 0 4px 10px rgba(0, 0, 0, .2); }
.end-faces img:nth-child(1) { transform: rotate(-8deg); }
.end-faces img:nth-child(3) { transform: rotate(8deg); }
.end-card h2 { font-size: 28px; margin-top: 16px; }
.end-card .end-more { font-size: 19px; margin-top: 10px; color: var(--ink); max-width: 520px; margin-left: auto; margin-right: auto; }
.end-card .end-more strong { color: var(--felt); }
.end-ctas { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 16px; margin-top: 22px; }
.end-ctas .btn { max-width: 100%; white-space: normal; text-align: center; }
.end-keep { display: inline-flex; align-items: center; min-height: 44px; margin-top: 15px; font-family: var(--display); font-weight: 600; font-size: 17px; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; background: none; border: none; cursor: pointer; padding: 8px 12px; border-radius: 12px; }
.end-keep:focus-visible { outline: 4px solid var(--marigold); outline-offset: 2px; }
@media (min-width: 700px) {
  .end-card { padding: 36px 40px 36px; }
  .end-card h2 { font-size: 36px; }
  .end-card .end-more { font-size: 21px; }
}
/* on the wide table the end card takes the card's column and the rail is gone */
@media (min-width: 960px) { .table.is-ended { grid-template-columns: minmax(0, 1fr); } }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .spk.spk-invite, .spk-arrow.is-nudging, .spk-reading .wave, .card.is-entering, .tile.is-picked { animation: none !important; }
  .pill-dock .spk { animation: none !important; }
  .spk-callout.is-leaving { transition: none; }
  .tile, .spk, .card-a .w, .card-q .w { transition: none !important; }
  .tile:hover { transform: none; }
}
