/* The homepage's one component: your unread pile, playing itself (play/pile.js). Uses site.css's colours; Mika's colour
   is this visit's (--mika, dealt by js/mika2.js). The waitlist under it is index.html's own #join. */
.pile-wrap { --pop: cubic-bezier(.2, 1.3, .3, 1); --out: cubic-bezier(.16, 1, .3, 1); --soft: cubic-bezier(.22, 1, .36, 1); }
.pile button:not(.btn) { font: inherit; color: inherit; }
body { min-height: 100svh; display: flex; flex-direction: column; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 0; box-sizing: border-box; overflow-x: hidden; }
button { font: inherit; color: inherit; }
.pile-wrap { flex: 1 0 auto; width: min(440px, 100%); margin: 0 auto; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 3vh 0 2vh; }
.unread { display: inline-flex; align-items: center; gap: 10px; height: 38px; padding: 0 6px 0 14px; border-radius: 999px; background: var(--surface-2); font-size: 14px; font-weight: 500; animation: pop .7s var(--pop) both .1s; }
.unread .count { display: inline-flex; gap: 5px; align-items: baseline; }
.unread .n { display: inline-block; min-width: .6em; font-variant-numeric: tabular-nums; }
.unread .n.roll { animation: roll .55s var(--pop); }
@keyframes roll { 0% { transform: translateY(-.6em) scale(.5); opacity: 0; } }
.unread.bump { animation: bump .55s var(--pop); }
@keyframes bump { 35% { transform: scale(1.12); } }
.avs { display: inline-flex; }
.avs i { width: 26px; height: 26px; margin-left: -6px; border-radius: 50%; background: var(--surface-3); box-shadow: 0 0 0 2px var(--surface-2); display: grid; place-items: center; font: 600 11px/1 var(--sans); font-style: normal; transition: transform .45s var(--pop), opacity .25s, width .45s var(--pop), margin .45s var(--pop); }
.avs i.gone { transform: translateY(-14px) scale(.2); opacity: 0; width: 0; margin-left: 0; }
.unread.zero { background: var(--mika); color: #0a0a0a; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.pile-wrap h1 { margin: 18px 0 0; font-size: clamp(46px, 11vw, 64px); line-height: .98; font-weight: 600; letter-spacing: -0.045em; animation: rise .7s var(--pop) both .18s; }
.pile-wrap .sub { margin: 10px 0 0; max-width: 28ch; font-size: 16.5px; line-height: 1.4; color: var(--ink-2); text-wrap: balance; animation: rise .7s var(--pop) both .26s; }
@keyframes rise { from { transform: translateY(16px) scale(.96); opacity: 0; } }
/* the pile: the front card plays; the ones behind peek out above it */
.pile { position: relative; width: 100%; height: 380px; margin-top: 34px; animation: rise .8s var(--pop) both .34s; }
.card { position: absolute; left: 0; right: 0; bottom: 0; height: 340px; box-sizing: border-box; display: flex; flex-direction: column; padding: 18px 16px 16px; border-radius: 30px; background: var(--surface); text-align: left; transform-origin: 50% 100%; transition: transform .6s var(--pop), opacity .35s, filter .35s; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.card[data-pos="1"] { transform: translateY(-16px) scale(.94); filter: brightness(.7); }
.card[data-pos="2"] { transform: translateY(-30px) scale(.88); filter: brightness(.5); }
.card[data-pos="3"] { transform: translateY(-40px) scale(.82); opacity: 0; }
.card:not([data-pos="0"]) > * { visibility: hidden; }
.card.dragging { transition: none; }
.card.toss { transition: transform .5s cubic-bezier(.3, .1, .6, 1), opacity .5s; opacity: 0; }
.who { display: flex; align-items: center; gap: 9px; }
.av { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-size: 13px; font-weight: 600; }
.nm { font-weight: 500; font-size: 14.5px; }
.when { margin-left: auto; font: 500 10.5px/1 var(--mono); color: var(--ink-3); letter-spacing: .04em; }
.thread { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; padding: 10px 0; overflow: hidden; -webkit-mask-image: linear-gradient(transparent, #000 26px); mask-image: linear-gradient(transparent, #000 26px); }
.b { max-width: 82%; padding: 9px 13px; border-radius: 19px; font-size: 15px; line-height: 1.35; animation: b-in .5s var(--pop) both; }
@keyframes b-in { from { opacity: 0; transform: translateY(12px) scale(.9); } }
.b.them { align-self: flex-start; background: var(--surface-2); }
.b.mine { align-self: flex-end; background: var(--ink); color: #0a0a0a; position: relative; }
.b.typing { display: inline-flex; gap: 4px; padding: 13px 14px; }
.b.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); animation: dot 1s ease-in-out infinite; }
.b.typing i:nth-child(2) { animation-delay: .15s; }
.b.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 100% { opacity: .35; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }
.rx { position: absolute; left: -12px; bottom: -12px; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-3); box-shadow: 0 0 0 2px var(--surface); display: grid; place-items: center; font-size: 14px; animation: rx .55s var(--pop) both; }
@keyframes rx { from { opacity: 0; transform: scale(.3) rotate(-25deg); } }
.box { display: flex; align-items: center; gap: 10px; }
.field { flex: 1 1 auto; min-width: 0; min-height: 46px; display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 16px; border-radius: 23px; background: var(--surface-2); font-size: 15px; line-height: 1.3; }
.field .ph { color: var(--ink-3); }
.field .tx { flex: 1 1 auto; min-width: 0; }
.field .tx:empty { display: none; }
.field.has .ph { display: none; }
.send { flex: none; margin-left: auto; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--mika); color: #0a0a0a; display: grid; place-items: center; cursor: pointer; opacity: 0; transform: scale(.4); pointer-events: none; transition: opacity .2s, transform .45s var(--pop); }
.send.on { opacity: 1; transform: none; pointer-events: auto; }
.send.nudge { animation: nudge 1.4s var(--out) infinite 1s; }
@keyframes nudge { 0%, 70%, 100% { transform: none; } 80% { transform: scale(1.18); } 90% { transform: scale(.95); } }
.send svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.mk-host { flex: none; width: 50px; height: 50px; }
.w { display: inline-block; white-space: pre; animation: w-in .5s var(--pop) both; }
.w.lit { color: var(--mika); transition: color .5s ease .35s; }
.w.cool { color: inherit; }
@keyframes w-in { from { opacity: 0; transform: translateY(.35em) scale(.7); } }
/* the gists you can say: white hold pills with voice bars, like the guides */
.gists { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; min-height: 48px; }
.g { position: relative; height: 46px; padding: 0 14px 0 12px; border: 0; border-radius: 23px; background: var(--ink); color: #0a0a0a; display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 500; cursor: pointer; touch-action: none; -webkit-touch-callout: none; transition: transform .35s var(--pop), opacity .25s; animation: pop .6s var(--pop) both; }
.g:nth-child(2) { animation-delay: .07s; }
.g:nth-child(3) { animation-delay: .14s; }
.g.down { transform: scale(.95); }
.g.used { opacity: 0; transform: scale(.6); pointer-events: none; }
.g .bars { display: inline-flex; align-items: center; gap: 2px; height: 14px; }
.g .bars i { width: 2.5px; height: 14px; border-radius: 2px; background: #0a0a0a; transform: scaleY(.3); transition: transform .12s; }
.g .pp-said { color: rgba(10, 10, 10, .3); }
.g .pp-said span { transition: color .12s; }
.g .pp-said span.on { color: #0a0a0a; }
.g.shake { animation: shake .4s ease-out; }
@keyframes shake { 20% { transform: translateX(-5px); } 45% { transform: translateX(4px); } 70% { transform: translateX(-2px); } }
.g .hold { font: 500 9.5px/1 var(--mono); letter-spacing: .1em; color: rgba(10, 10, 10, .45); padding: 4px 6px; border-radius: 6px; background: rgba(10, 10, 10, .07); }
.gists.first .g:first-child { animation: pop .6s var(--pop) both, nudge 2.6s var(--out) infinite 1.6s; }
.quip { height: 34px; margin: 14px 0 0; display: grid; place-items: center; }
.quip-t { padding: 6px 12px; border-radius: 14px; background: var(--surface-2); font-size: 13.5px; opacity: 0; transform: translateY(6px) scale(.9); transition: opacity .2s, transform .45s var(--pop); }
.quip.on .quip-t { opacity: 1; transform: none; }
/* all caught up: the last card */
.card.end { justify-content: center; align-items: center; text-align: center; gap: 10px; }
.end .big-mk { width: 96px; height: 96px; margin-bottom: 8px; }
.end h2 { margin: 0; font-size: 40px; line-height: 1; font-weight: 600; letter-spacing: -0.04em; }
.end h2.slam { animation: slam .8s var(--pop) both; }
@keyframes slam { 0% { transform: scale(1.5); opacity: 0; } 35% { opacity: 1; } }
.end p { margin: 0; color: var(--ink-2); font-size: 15px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; } .card, .g, .send { transition-duration: .01s !important; } }
/* keyboard focus: a soft white ring, never Mika's colour */
.g:focus-visible, .send:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--ink-2); }
.mk-host, .big-mk { position: relative; z-index: 2; }
.mk-host svg, .big-mk svg { cursor: pointer; will-change: transform; }
/* it plays itself: the gists are a show, not buttons */
.g { pointer-events: none; cursor: default; }
/* Mika is the one thing to touch */
.mk-host { position: relative; outline: none; }
.mk-host::after { content: "hold me"; position: absolute; left: 50%; top: calc(100% + 3px); transform: translateX(-50%); font: 500 9px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; pointer-events: none; }
.mk-host:focus-visible svg { border-radius: 50%; box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--ink-2); }
/* the voice note while you hold: words stream in, fillers dim; on letting go they strike or light */
.cap { display: none; margin: 0 0 10px; padding: 10px 14px; border-radius: 18px; background: var(--surface-3); font-size: 15px; line-height: 1.45; max-height: 4.6em; overflow: hidden; flex-wrap: wrap; align-content: flex-end; }
.cap.on { display: flex; gap: 0 .28em; animation: pop .35s var(--pop) both; }
.cw { display: inline-block; animation: w-in .35s var(--pop) both; color: var(--ink); transition: color .3s, opacity .3s; }
.cw.f { color: var(--ink-3); }
.cw.x { color: var(--ink-3); opacity: .5; text-decoration: line-through; text-decoration-thickness: 2px; }
.cw.kept { color: var(--mika); }
/* no pills: the gists are said, not pressed */
.gists { display: none; }
/* voice bars at the start of the voice note: they move while someone is talking */
.vb { display: inline-flex; align-items: center; gap: 2px; height: 1.45em; margin-right: .45em; }
.vb i { width: 2.5px; height: 12px; border-radius: 2px; background: var(--ink-2); transform: scaleY(.3); }
.cap.talking .vb i { animation: vb .55s ease-in-out infinite alternate; }
.cap.talking .vb i:nth-child(2) { animation-delay: .12s; }
.cap.talking .vb i:nth-child(3) { animation-delay: .24s; }
.cap.talking .vb i:nth-child(4) { animation-delay: .06s; }
@keyframes vb { to { transform: scaleY(1); } }
/* the send button wears this visit's Mika colour; its arrow is always the dark of Mika's eyes */
.pile button.send { color: #0b0b0c; }
.pile, .pile * { user-select: none; -webkit-user-select: none; }
html, body { overflow-x: clip; }
/* the waitlist, always there under the pile */
.joinrow { width: 100%; margin-top: 10px; }
.joinrow .join { max-width: 420px; }
.joinrow .fine { text-align: center; }
