/* Interactive extras (js/gimmicks.js): missed-call demo, app picker, bundle builder, reading progress, confetti,
   the mobile action bar. Everything respects prefers-reduced-motion. */

/* ---- shared ---- */
.gm-section { padding: clamp(56px, 8vw, 96px) 0; }
.gm-section.soft { background: var(--bg-soft); }
.gm-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(20px, 3vw, 32px); box-shadow: var(--shadow); }
.gm-chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 6px; }
.gm-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 16px; border-radius: 999px; border: 1.5px solid var(--line);
  background: #fff; font: inherit; font-size: .95rem; font-weight: 500; color: var(--ink); cursor: pointer; transition: border-color .2s, background .2s, transform .15s; }
.gm-chip:hover { border-color: #cbd5e1; } .gm-chip:active { transform: scale(.97); }
.gm-chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.gm-chip img { width: 22px; height: 22px; border-radius: 6px; }
.gm-chip .tick { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid currentColor; display: grid; place-items: center; font-size: 11px; line-height: 1; }
.gm-chip[aria-pressed="true"] .tick { background: var(--accent); border-color: var(--accent); color: #fff; }
.gm-result { margin-top: 18px; padding: 18px 20px; border-radius: var(--radius); background: var(--navy); color: #fff; display: grid; gap: 10px; }
.gm-result .apps { display: flex; flex-wrap: wrap; gap: 8px; }
.gm-result .app { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: rgba(255,255,255,.1); font-size: .9rem; color: #fff; text-decoration: none; }
.gm-result .app img { width: 24px; height: 24px; border-radius: 6px; }
.gm-result .total { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; }
.gm-result .total small { font-size: .9rem; font-weight: 400; color: #cbd5e1; }
.gm-result .tip { color: #cbd5e1; font-size: .95rem; line-height: 1.5; } .gm-result .tip b { color: #8fb0ff; }
.gm-result .row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.gm-empty { color: var(--muted); font-size: .95rem; margin-top: 14px; }

/* ---- missed-call demo ---- */
.mcd { display: grid; grid-template-columns: 1fr 340px; gap: clamp(28px, 5vw, 64px); align-items: center; }
.mcd h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); letter-spacing: -.03em; line-height: 1.1; margin: 10px 0 12px; }
.mcd p { color: var(--ink-2); line-height: 1.6; max-width: 520px; }
.mcd .btn { margin-top: 8px; }
.mcd-note { font-size: .85rem; color: var(--muted) !important; margin-top: 14px; }
.mcd-phone { width: 300px; height: 600px; margin: 0 auto; border-radius: 46px; background: #0b1526; padding: 12px; box-shadow: var(--shadow-lg); position: relative; }
.mcd-screen { position: relative; height: 100%; border-radius: 36px; overflow: hidden; background: linear-gradient(180deg, #f8fafc, #eef2f7); display: flex; flex-direction: column; }
.mcd-notch { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 90px; height: 24px; border-radius: 14px; background: #0b1526; z-index: 3; }
.mcd-status { display: flex; justify-content: space-between; padding: 12px 22px 0; font-size: 12px; font-weight: 600; color: #0b1526; height: 38px; }
.mcd-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px 12px; border-bottom: 1px solid #e2e8f0; background: rgba(255,255,255,.8); }
.mcd-av { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #f472b6, #e11d48); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.mcd-head b { display: block; font-size: 14px; } .mcd-head small { color: #64748b; font-size: 12px; }
.mcd-msgs { flex: 1; padding: 14px 12px; display: flex; flex-direction: column; gap: 8px; overflow: hidden; justify-content: flex-end; }
.mcd-b { max-width: 82%; padding: 9px 12px; border-radius: 18px; font-size: 13.5px; line-height: 1.4; opacity: 0; transform: translateY(8px) scale(.98); transition: opacity .35s, transform .35s var(--ease); }
.mcd-b.in { align-self: flex-start; background: #fff; color: #0b1526; border: 1px solid #e2e8f0; border-bottom-left-radius: 6px; }
.mcd-b.out { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
.mcd-b.sys { align-self: center; background: #fee2e2; color: #b91c1c; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 6px 12px; }
.mcd-b.show { opacity: 1; transform: none; }
.mcd-typing { align-self: flex-end; display: none; gap: 4px; padding: 11px 14px; background: var(--accent); border-radius: 18px; border-bottom-right-radius: 6px; }
.mcd-typing.left { align-self: flex-start; background: #fff; border: 1px solid #e2e8f0; border-bottom-left-radius: 6px; }
.mcd-typing.on { display: inline-flex; }
.mcd-typing i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.85); animation: mcd-dot 1s infinite; }
.mcd-typing.left i { background: #94a3b8; }
.mcd-typing i:nth-child(2) { animation-delay: .15s; } .mcd-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes mcd-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
.mcd-call { position: absolute; inset: 0; z-index: 2; background: linear-gradient(180deg, #1e293b, #0b1526); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  opacity: 0; pointer-events: none; transition: opacity .3s; }
.mcd-call.on { opacity: 1; }
.mcd-call .ring { width: 86px; height: 86px; border-radius: 50%; background: linear-gradient(135deg, #f472b6, #e11d48); display: grid; place-items: center; font-size: 30px; font-weight: 700; position: relative; }
.mcd-call .ring::before, .mcd-call .ring::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(244,114,182,.6); animation: mcd-ring 1.4s infinite; }
.mcd-call .ring::after { animation-delay: .7s; }
@keyframes mcd-ring { from { transform: scale(1); opacity: .9; } to { transform: scale(1.9); opacity: 0; } }
.mcd-call b { font-size: 20px; } .mcd-call small { color: #94a3b8; }
.mcd-call .missed { color: #fca5a5; font-weight: 700; display: none; } .mcd-call.missed .missed { display: block; } .mcd-call.missed .ring::before, .mcd-call.missed .ring::after { animation: none; opacity: 0; }
.mcd-win { position: absolute; left: 14px; right: 14px; bottom: 16px; z-index: 2; background: #059669; color: #fff; border-radius: 16px; padding: 10px 14px; font-size: 13px; font-weight: 600;
  display: flex; justify-content: space-between; align-items: center; transform: translateY(140%); transition: transform .5s var(--ease); }
.mcd-win.on { transform: none; }
.mcd-screen.won .mcd-msgs { padding-bottom: 78px; }
.mcd-msgs { transition: padding .4s var(--ease); } .mcd-win b { font-size: 18px; }

/* ---- reading progress ---- */
.gm-progress { position: fixed; left: 0; top: 0; height: 3px; width: 100%; z-index: 200; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--accent), #5eead4); pointer-events: none; }
.gm-readtime { display: inline-block; margin-left: 10px; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .82rem; font-weight: 600; }

/* ---- confetti ---- */
.gm-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 300; }

/* ---- mobile action bar ---- */
.gm-bar { display: none; }
@media (max-width: 760px) {
  .gm-bar { display: flex; position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 150; align-items: center; gap: 10px;
    padding: 10px 10px 10px 16px; border-radius: 18px; background: rgba(11,21,38,.94); backdrop-filter: blur(10px); color: #fff; box-shadow: 0 12px 30px rgba(11,21,38,.35);
    transform: translateY(160%); transition: transform .35s var(--ease); }
  .gm-bar.on { transform: none; }
  .gm-bar span { flex: 1; font-size: .88rem; line-height: 1.25; } .gm-bar span b { display: block; font-size: .95rem; }
  .gm-bar a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 12px; font-weight: 600; font-size: .92rem; text-decoration: none; white-space: nowrap; }
  .gm-bar .go { background: #fff; color: var(--navy); } .gm-bar .alt { color: #fff; border: 1px solid rgba(255,255,255,.25); }
  body.gm-has-bar .footer { padding-bottom: 90px; }
}

/* ---- small screens ---- */
@media (max-width: 860px) { .mcd { grid-template-columns: 1fr; } .mcd-phone { transform: scale(.92); margin-top: -10px; } }
@media (max-width: 400px) { .mcd-phone { transform: scale(.86); margin: -30px auto -40px; } }

@media (prefers-reduced-motion: reduce) {
  .mcd-b, .mcd-win, .gm-bar, .mcd-call { transition: none; }
  .mcd-call .ring::before, .mcd-call .ring::after, .mcd-typing i { animation: none; }
}

/* ---- short ads (video[data-ad]) ---- */
.ad-vid { position: relative; margin: 0; border-radius: var(--radius-lg); overflow: hidden; background: #06060e; box-shadow: var(--shadow); aspect-ratio: 16 / 9; }
.ad-vid video { display: block; width: 100%; height: 100%; object-fit: cover; }
.ad-sound { position: absolute; right: 12px; top: 12px; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 14px;
  border: 0; border-radius: 999px; background: rgba(6,6,14,.66); color: #fff; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.ad-sound:hover { background: rgba(6,6,14,.85); }
.ad-sound svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ad-band { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.ad-band h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); letter-spacing: -.03em; margin: 8px 0 12px; }
.ad-band p { color: var(--muted, #475569); line-height: 1.6; margin: 0 0 18px; }
.ad-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 22px; }
.ad-grid figcaption { padding: 12px 2px 0; font-weight: 600; }
.ad-grid figcaption small { display: block; font-weight: 400; color: var(--muted, #64748b); margin-top: 2px; }
@media (max-width: 860px) { .ad-band { grid-template-columns: 1fr; } }

/* ---- trade links (homepage) ---- */
.trade-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.trade-chips a { padding: 10px 16px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); text-decoration: none; font-weight: 500; transition: border-color .2s, color .2s; }
.trade-chips a:hover { border-color: var(--accent); color: var(--accent); }

/* ---- sounds switch (footer) ---- */
.sound-toggle { margin-left: 14px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: inherit;
  font: inherit; font-size: .85em; cursor: pointer; opacity: .8; }
.sound-toggle:hover { opacity: 1; border-color: currentColor; }
.sound-toggle[aria-pressed="false"] { opacity: .55; }
