/* Small interactions (interact.js): the + menu, the ask's Undo pill, stay steps, the friend-code check, time hints,
   and the founder's signature. Same tokens as app.css; everything is still under reduced motion. */

/* ---- the + action menu */
.explore-head { position: relative; }
.explore-head .pm-btn { position: absolute; top: 40px; right: 0; }
@media (min-width: 900px) { .explore-head .pm-btn { top: 64px; } }
.explore-head .display { padding-right: 56px; }
.pm-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; flex: none; background: var(--ink); color: var(--on-ink); z-index: 2;
  transition: transform var(--dur-quick) var(--ease); -webkit-tap-highlight-color: transparent; }
.pm-btn .i { width: 20px; height: 20px; stroke-width: 1.9; transition: transform 420ms var(--ease-bounce); }
.pm-btn:active { transform: scale(.94); }
.pm-btn[aria-expanded="true"] { visibility: hidden; }
.pm-layer { position: fixed; inset: 0; z-index: 85; }
.pm-scrim { position: absolute; inset: 0; background: color-mix(in srgb, var(--page) 42%, transparent); backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px); opacity: 0;
  transition: opacity 320ms var(--ease), backdrop-filter 320ms var(--ease), -webkit-backdrop-filter 320ms var(--ease); }
.pm-layer.open .pm-scrim { opacity: 1; backdrop-filter: blur(14px) saturate(1.1); -webkit-backdrop-filter: blur(14px) saturate(1.1); }
.pm-x { position: fixed; box-shadow: var(--shadow-menu); }
.pm-layer.open .pm-x .i { transform: rotate(135deg); }
.pm-items { position: fixed; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; max-width: calc(100vw - 24px); }
.pm-item { display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 18px; min-height: 56px; border-radius: var(--r-pill); background: var(--card); color: var(--ink); box-shadow: var(--shadow-menu); text-align: right;
  opacity: 0; transform: translate(var(--fx, 0), var(--fy, 0)) scale(.3); filter: blur(4px);
  transition: opacity 260ms var(--ease) calc(var(--i) * 45ms), transform 520ms var(--ease-bounce) calc(var(--i) * 45ms), filter 300ms var(--ease) calc(var(--i) * 45ms), background-color var(--dur-quick) var(--ease); }
.pm-layer.open .pm-item { opacity: 1; transform: none; filter: none; }
.pm-layer.closing .pm-item { transition-duration: 180ms, 280ms, 180ms; transition-timing-function: var(--ease-close); transition-delay: calc((3 - var(--i)) * 30ms); }
.pm-t { display: flex; flex-direction: column; min-width: 0; }
.pm-t b { font-size: 15px; font-weight: 500; letter-spacing: -.01em; }
.pm-t span { font-size: 12px; color: var(--muted); }
.pm-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--chip); flex: none; }
@media (hover: hover) { .pm-item:hover { background: color-mix(in srgb, var(--card) 92%, var(--ink)); } }
.pm-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pm-item:active { transform: scale(.97); }
@media (max-width: 380px) { .pm-t span { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .pm-item, .pm-scrim, .pm-btn .i, .pm-layer.closing .pm-item { transition: opacity 120ms linear; transform: none; filter: none; }
  .pm-layer.open .pm-x .i { transform: rotate(45deg); }
}

/* ---- the ask's Undo pill: a dark capsule at the top, shaped like the island it grows out of */
.au-pill { position: fixed; z-index: 95; top: calc(10px + env(safe-area-inset-top)); left: 50%; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 6px 0 8px; max-width: calc(100vw - 24px);
  border-radius: 999px; background: #0B0B0D; color: #F2F1F4; box-shadow: 0 10px 40px rgba(0, 0, 0, .28), inset 0 0 0 1px rgba(255, 255, 255, .06);
  transform: translateX(-50%) scale(.42, .8); opacity: 0; clip-path: inset(0 round 999px);
  transition: transform 520ms cubic-bezier(.32, 1.25, .5, 1), opacity 200ms ease; }
.au-pill.in { transform: translateX(-50%); opacity: 1; }
.au-pill.out { transform: translateX(-50%) scale(.42, .8); opacity: 0; transition-duration: 360ms, 300ms; }
.au-ring { position: relative; width: 28px; height: 28px; flex: none; display: grid; place-items: center; }
.au-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); fill: none; stroke-width: 2.2; }
.au-track { stroke: rgba(255, 255, 255, .14); }
.au-run { stroke: #4ADE80; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; animation: au-count linear forwards; }
.au-pill.undoing .au-run { animation-play-state: paused; stroke: rgba(255, 255, 255, .4); }
.au-pill.undone .au-ring, .au-pill.undone .au-undo { display: none; }
.au-pill.undone { padding: 0 18px; }
@keyframes au-count { to { stroke-dashoffset: 1; } }
.au-check { width: 22px; height: 22px; border-radius: 50%; background: #4ADE80; color: #0B0B0D; display: grid; place-items: center; transform: scale(0); transition: transform 380ms var(--ease-bounce); }
.au-check .i { width: 14px; height: 14px; stroke-width: 2.4; }
.au-pill.sent .au-check { transform: scale(1); }
.au-pill.sent .au-run, .au-pill.sent .au-track { opacity: 0; transition: opacity 200ms ease; }
.au-text { font-size: 14px; font-weight: 500; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; padding-right: 4px; }
.au-undo { height: 32px; padding: 0 14px; border-radius: 999px; background: rgba(255, 255, 255, .12); color: #F2F1F4; font-size: 13px; font-weight: 600; flex: none; transition: background-color var(--dur-quick) var(--ease), transform var(--dur-quick) var(--ease); }
@media (hover: hover) { .au-undo:hover { background: rgba(255, 255, 255, .2); } }
.au-undo:active { transform: scale(.95); }
.au-undo:focus-visible { outline: 2px solid #4ADE80; outline-offset: 2px; }
.au-pill.sent .au-text { padding-right: 10px; }
.au-ghost { position: fixed; z-index: 94; border-radius: 24px; background: var(--card); color: var(--ink); display: grid; place-items: center; transform-origin: center; pointer-events: none; box-shadow: var(--shadow-lift); overflow: hidden; }
.au-ghost > span { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.au-ghost b { font-size: 28px; font-weight: 500; letter-spacing: -.03em; }
.au-ghost b + span { font-size: 14px; opacity: .7; }
.au-gone { opacity: 0; pointer-events: none; transition: opacity 160ms ease; }
@media (prefers-reduced-motion: reduce) {
  .au-pill, .au-pill.out { transform: translateX(-50%); transition: opacity 160ms linear; }
  .au-check { transition: none; }
}

/* ---- stay steps */
.ss-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ss { position: relative; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ss:not(:last-child)::after { content: ""; position: absolute; top: 10px; left: 26px; right: -6px; height: 1.5px; border-radius: 1px; background: var(--line); }
.ss.on:not(:last-child)::after { background: linear-gradient(90deg, var(--ink), var(--ink)) left / 100% 100% no-repeat, var(--line); animation: ss-line var(--dur-xslow) var(--ease) both; animation-delay: calc(var(--i) * 120ms + 200ms); }
@keyframes ss-line { from { background-size: 0 100%, auto; } }
.ss-dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; box-shadow: inset 0 0 0 1.5px var(--line); background: var(--card); color: var(--on-ink); }
.ss-dot .i { width: 13px; height: 13px; stroke-width: 2.4; }
.ss.on .ss-dot, .ss-dot.on { background: var(--ink); box-shadow: none; animation: ss-pop 420ms var(--ease-bounce) both; animation-delay: calc(var(--i, 0) * 120ms + 120ms); }
.ss.now .ss-dot { box-shadow: inset 0 0 0 1.5px var(--ink); }
@keyframes ss-pop { from { transform: scale(.4); opacity: 0; } }
.ss-t { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ss-t b { font-size: 13px; font-weight: 500; color: var(--faint); letter-spacing: -.005em; }
.ss.on .ss-t b, .ss.now .ss-t b { color: var(--ink); }
.ss-t span { font-size: 11.5px; color: var(--muted); overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .ss-list { grid-template-columns: 1fr; gap: 0; }
  .ss { flex-direction: row; align-items: flex-start; gap: 12px; padding-bottom: 14px; }
  .ss:last-child { padding-bottom: 0; }
  .ss:not(:last-child)::after { top: 26px; bottom: 2px; left: 10.25px; right: auto; width: 1.5px; height: auto; }
  .ss.on:not(:last-child)::after { background: var(--ink); animation: none; }
  .ss-t { padding-top: 2px; }
}
.ss-done { border-radius: 18px; background: color-mix(in srgb, var(--card) 70%, transparent); box-shadow: 0 0 0 1px var(--border); }
.ss-done summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; font-size: 14px; font-weight: 500; }
.ss-done summary::-webkit-details-marker { display: none; }
.ss-done .ss-more { color: var(--muted); display: inline-flex; transition: transform var(--dur-fast) var(--ease); }
.ss-done[open] .ss-more { transform: rotate(180deg); }
.ss-done .ss-list { padding: 4px 14px 14px; }
@media (prefers-reduced-motion: reduce) { .ss.on .ss-dot, .ss-dot.on, .ss.on:not(:last-child)::after { animation: none; } }

/* ---- the friend-code check */
.cc-row { display: flex; gap: 8px; align-items: center; }
.cc-out { min-height: 40px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; }
.cc-out:empty { min-height: 40px; }
.cc-hint { color: var(--faint); font-size: 13px; }
.cc-person { display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 8px 0 6px; border-radius: 999px; background: var(--ok-soft); animation: cc-in 380ms var(--ease-bounce) both; }
.cc-person .av { width: 28px; height: 28px; }
.cc-person b { font-weight: 500; }
.cc-ok { width: 22px; height: 22px; border-radius: 50%; background: var(--ok); color: var(--on-ink); display: grid; place-items: center; }
.cc-ok .i { width: 13px; height: 13px; stroke-width: 2.6; }
.cc-bad { color: var(--bad); font-size: 13px; }
.cc-spin { width: 14px; height: 14px; border-radius: 50%; border: 1.6px solid var(--muted); border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes cc-in { from { opacity: 0; transform: scale(.9); filter: blur(4px); } }
.code-input { font-family: var(--mono); letter-spacing: .16em; text-transform: uppercase; text-align: center; font-size: 20px; height: 56px; }
.cc-form .cc-out { justify-content: flex-start; }
@media (prefers-reduced-motion: reduce) { .cc-person { animation: none; } }

/* ---- local time hints under a message */
.bubble-hint { align-self: flex-start; display: inline-flex; align-items: center; gap: 5px; margin: -2px 0 2px 6px; font-size: 12px; color: var(--faint); }
.bubble-hint .i { width: 12px; height: 12px; }

/* ---- the founder's signature on the intro's card */
.dc-sig { display: block; flex: none; width: 110px; height: 44px; margin: -6px 0 -4px -2px; color: #F2F1F4; opacity: .9; }
.dc-sig path { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.reveal.in .dc-sig path { animation: sig-draw var(--dur, 900ms) cubic-bezier(.45, .05, .35, 1) forwards; animation-delay: calc(600ms + var(--at, 0ms)); }
@keyframes sig-draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .dc-sig path, .reveal.in .dc-sig path { animation: none; stroke-dashoffset: 0; } }
