body { margin: 0; }
[hidden] { display: none !important; }

/* Layout: fixed grey grid canvas with a cursor halo that turns the grid blue; floating island nav; single centered column, max 1120px */
:root {
  --bg: #F7F9FC;
  --grid: rgba(110, 124, 150, .16);
  --grid-hot: rgba(10, 108, 255, .55);
  --glow: rgba(64, 150, 255, .18);
  --surface: #FFFFFF;
  --line: #E3E8F0;
  --fg: #0B1526;
  --muted: #5B6880;
  --accent: #0A6CFF;
  --accent-2: #5AB8FF;
  --accent-soft: #E8F1FF;
  --island: rgba(255, 255, 255, .78);
  --shadow: 0 1px 2px rgba(11, 21, 38, .04), 0 12px 32px rgba(11, 40, 90, .08);
  --bezel: #0E1A2E;
  --chat-1: #DCEBFF;
  --chat-2: #B7D3FA;
  --chat-grid: rgba(255, 255, 255, .45);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #070D19; --grid: rgba(140, 160, 200, .10); --grid-hot: rgba(90, 170, 255, .6);
    --glow: rgba(40, 120, 255, .22); --surface: #0E1728; --line: #1C2940; --fg: #EEF3FB;
    --muted: #93A1BA; --accent: #3D8BFF; --accent-2: #7CC6FF; --accent-soft: #12264A;
    --island: rgba(14, 23, 40, .72); --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 32px rgba(0,0,0,.35);
    --bezel: #24324B; --chat-1: #10264A; --chat-2: #0A1830; --chat-grid: rgba(120, 170, 255, .08);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #070D19; --grid: rgba(140, 160, 200, .10); --grid-hot: rgba(90, 170, 255, .6);
  --glow: rgba(40, 120, 255, .22); --surface: #0E1728; --line: #1C2940; --fg: #EEF3FB;
  --muted: #93A1BA; --accent: #3D8BFF; --accent-2: #7CC6FF; --accent-soft: #12264A;
  --island: rgba(14, 23, 40, .72); --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 32px rgba(0,0,0,.35);
  --bezel: #24324B; --chat-1: #10264A; --chat-2: #0A1830; --chat-grid: rgba(120, 170, 255, .08);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  background: var(--bg); color: var(--fg); font-family: var(--font);
  font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

/* ---------- grid + halo ---------- */
.bg, .bg::before, .bg::after { position: fixed; inset: 0; pointer-events: none; }
.bg { z-index: 0; --x: 70vw; --y: 38vh; --r: 260px; }
.bg::before {
  content: ""; background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px; background-position: -1px -1px;
}
.bg::after {
  content: ""; background-image:
    radial-gradient(calc(var(--r) * 1.6) circle at var(--x) var(--y), var(--glow), transparent 70%),
    linear-gradient(var(--grid-hot) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-hot) 1px, transparent 1px);
  background-size: 100% 100%, 32px 32px, 32px 32px;
  background-position: 0 0, -1px -1px, -1px -1px;
  -webkit-mask-image: radial-gradient(var(--r) circle at var(--x) var(--y), #000 0%, rgba(0,0,0,.35) 45%, transparent 100%);
          mask-image: radial-gradient(var(--r) circle at var(--x) var(--y), #000 0%, rgba(0,0,0,.35) 45%, transparent 100%);
  transition: opacity .4s;
}
.bg.off::after { opacity: 0; }
main, .island-wrap, footer { position: relative; z-index: 1; }

/* ---------- island nav ---------- */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
.island-wrap { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 14px); z-index: 5; display: flex; justify-content: center; }
.island {
  display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 14px;
  background: var(--island); border: 1px solid var(--line); border-radius: 999px;
  backdrop-filter: blur(16px) saturate(1.6); -webkit-backdrop-filter: blur(16px) saturate(1.6);
  box-shadow: var(--shadow); max-width: 100%;
}
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: -.01em; margin-right: 8px; white-space: nowrap; }
.logo-mark { width: 28px; height: 28px; border-radius: 8px; object-fit: cover; box-shadow: 0 0 0 1px var(--line); }
.island nav { display: flex; gap: 2px; position: relative; }
.island nav a { position: relative; z-index: 1; padding: 8px 12px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--muted); transition: color .25s; }
.island nav a:hover { color: var(--accent); }
/* theme toggle: shows the theme you switch to */
.theme-btn {
  width: 36px; height: 36px; flex: none; display: grid; place-items: center; border: 0; border-radius: 50%;
  background: none; color: var(--muted); cursor: pointer; transition: background-color .2s, color .2s;
}
.theme-btn:hover { background: var(--accent-soft); color: var(--accent); }
.theme-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; grid-area: 1 / 1; transition: opacity .25s, rotate .35s, scale .35s; }
.theme-btn .i-sun, .theme-btn[data-mode="dark"] .i-moon { opacity: 0; rotate: -90deg; scale: .5; }
.theme-btn[data-mode="dark"] .i-sun { opacity: 1; rotate: 0deg; scale: 1; }
html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
  transition: background-color .35s, color .35s, border-color .35s, fill .35s, stroke .35s !important;
}

/* sliding highlight: position and width are set from app.js as the page scrolls */
.nav-pill {
  position: absolute; left: 0; top: 0; height: 100%; width: 0; border-radius: 999px; pointer-events: none;
  background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
  opacity: 0; transition: transform .35s cubic-bezier(.2,.7,.2,1), width .35s cubic-bezier(.2,.7,.2,1), opacity .3s;
}

.btn {
  display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; font-weight: 600;
  padding: 12px 22px; font-size: 15px; transition: transform .15s, box-shadow .2s; white-space: nowrap;
}
.btn-sm { padding: 8px 16px; font-size: 14px; }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%); box-shadow: 0 6px 18px rgba(10, 108, 255, .28); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(10, 108, 255, .34); }
.btn-ghost { background: var(--surface); border: 1px solid var(--line); color: var(--fg); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- layout ---------- */
.wrap { max-width: 1120px; margin: 0 auto; }
section { padding-block: 72px; }
h1, h2, h3 { margin: 0; letter-spacing: -.03em; text-wrap: balance; }
h1 { font-size: clamp(36px, 6vw, 64px); line-height: 1.04; font-weight: 800; }
h2 { font-size: clamp(28px, 4vw, 40px); line-height: 1.1; font-weight: 700; }
h3 { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.grad { background: linear-gradient(100deg, var(--accent) 10%, var(--accent-2) 90%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 18px; color: var(--muted); max-width: 52ch; margin: 0; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- hero ---------- */
.hero { padding-block: 64px 48px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero-copy { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.stats { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 6px; }
.stats div { display: flex; flex-direction: column; }
.stats b { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.stats span { font-size: 13px; color: var(--muted); }

/* app card mock (mirrors the bot's App Card) */
.appcard {
  background: var(--surface); border: 1px solid var(--line); border-radius: 28px; padding: 24px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 20px; min-width: 0;
}
.appcard-top { display: flex; gap: 18px; align-items: center; }
.app-icon {
  width: 88px; height: 88px; border-radius: 22px; flex: none;
  background: linear-gradient(160deg, #6FCF7A 0%, #3D9A4B 55%, #7A5531 56%, #5C3F24 100%);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}
.app-meta { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.app-meta h3 { font-size: 22px; }
.app-meta span { color: var(--muted); font-size: 14px; }
.app-meta .get:hover { background: #0066DD; }
.app-meta .get { align-self: flex-start; margin-top: 6px; background: #007AFF; color: #fff; font-weight: 700; font-size: 14px; padding: 6px 20px; border-radius: 999px; }
.cols { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); padding-top: 16px; }
.cols div { display: flex; flex-direction: column; gap: 2px; padding-inline: 12px; border-left: 1px solid var(--line); }
.cols div:first-child { border-left: 0; padding-left: 0; }
.cols small { font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--muted); }
.cols b { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.cols s { color: var(--muted); font-weight: 500; }
.cols .total b { color: var(--accent); }
.appcard-note { font-size: 13px; color: var(--muted); background: var(--accent-soft); border-radius: 14px; padding: 10px 14px; margin: 0; }
.appcard-note b { color: var(--fg); }

/* ---------- steps ---------- */
.head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 36px; max-width: 640px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.step-n { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: var(--accent); background: var(--accent-soft); }
.step p { margin: 0; font-size: 15px; color: var(--muted); }

/* ---------- region checklist ---------- */
.split { display: grid; grid-template-columns: .9fr 1.1fr; gap: 48px; align-items: start; }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.checklist li { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.tick { flex: none; width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--accent); display: grid; place-items: center; margin-top: 1px; }
.checklist strong { display: block; font-weight: 600; }
.checklist span { font-size: 14px; color: var(--muted); }

/* ---------- faq ---------- */
.faq { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 20px 0; font-weight: 600; font-size: 17px; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-weight: 500; font-size: 22px; line-height: 1; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { margin: 0 0 20px; color: var(--muted); max-width: 65ch; }

/* ---------- cta band ---------- */
.cta {
  border-radius: 32px; padding: 56px 40px; color: #fff; text-align: left;
  background: linear-gradient(120deg, #0A5BFF 0%, #2B8CFF 45%, #8FD3FF 100%);
  display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap;
  position: relative; overflow: hidden;
}
.cta::before { content: ""; position: absolute; inset: 0; opacity: .18;
  background-image: linear-gradient(#fff 1px, transparent 1px), linear-gradient(90deg, #fff 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000); mask-image: linear-gradient(90deg, transparent, #000); }
.cta > * { position: relative; }
.cta h2 { color: #fff; }
.cta p { margin: 8px 0 0; opacity: .9; }
.btn-white { background: #fff; color: #0A5BFF; }
.btn-white:hover { transform: translateY(-1px); }

footer { padding-block: 32px 40px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 14px; color: var(--muted); max-width: 1120px; margin: 0 auto; }

/* ---------- responsive ---------- */
/* ---------- operator or self ---------- */
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mode {
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 28px;
  display: flex; flex-direction: column; gap: 20px; min-width: 0;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.mode:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.mode-main { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); background: linear-gradient(180deg, var(--accent-soft), var(--surface) 60%); }
.mode-top { display: flex; gap: 16px; align-items: center; }
.mode-top h3 { font-size: 20px; }
.mode-top p { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.mode-ic { width: 48px; height: 48px; border-radius: 14px; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.mode-main .mode-ic { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.mode-ic svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mode-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.mode-list li { display: flex; gap: 12px; font-size: 15px; line-height: 1.45; }
.mode-list li::before {
  content: ""; flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%;
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232F7BFF' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-9'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.mode-list li.no::before { background: rgba(229, 72, 77, .14) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E5484D' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7 7 17'/%3E%3C/svg%3E") center / 11px no-repeat; }
.mode-btn { margin-top: auto; align-self: flex-start; font-size: 13px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 8px 14px; border-radius: 10px; }

/* ---------- app marquee (live iTunes data) ---------- */
.marquee {
  margin-inline: calc(50% - 50vw); display: flex; flex-direction: column; gap: 12px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.mq-row { overflow: hidden; padding-block: 4px; }
.mq-track { display: flex; gap: 12px; width: max-content; animation: mq 70s linear infinite; }
.mq-row.rev .mq-track { animation-direction: reverse; animation-duration: 80s; }
.marquee:hover .mq-track { animation-play-state: paused; }
@keyframes mq { to { transform: translateX(calc(-50% - 6px)); } }
.mq-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 18px 10px 10px; flex: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.mq-item:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-2px); }
.mq-item img, .mq-item i { width: 52px; height: 52px; border-radius: 12px; flex: none; background: var(--accent-soft); }
.mq-item b { display: block; font-size: 15px; font-weight: 600; max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mq-item small { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.mq-item.sk { cursor: default; width: 220px; height: 74px; }
.mq-item.sk i { animation: sk 1.3s linear infinite; background: linear-gradient(90deg, var(--accent-soft) 30%, var(--line) 50%, var(--accent-soft) 70%) 0 0 / 300% 100%; }
@media (prefers-reduced-motion: reduce) { .mq-row { overflow-x: auto; } }

@media (max-width: 900px) {
  .modes { grid-template-columns: 1fr; }
  .hero, .split { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .island nav { display: none; }
  .steps { grid-template-columns: 1fr; }
  section { padding-block: 48px; }
  .cta { padding: 36px 24px; }
  .cols b { font-size: 17px; }
  .cols div { padding-inline: 8px; }
}
/* ---------- motion ---------- */
@keyframes rise { from { opacity: 0; translate: 0 18px; } }
@keyframes drop { from { opacity: 0; translate: 0 -18px; } }
.island { animation: drop .6s cubic-bezier(.2,.7,.2,1) both; transition: box-shadow .3s, background .3s; }
.scrolled .island { box-shadow: 0 1px 2px rgba(11,21,38,.06), 0 18px 44px rgba(11,40,90,.16); }
.island nav a.active { color: var(--accent); }
.hero-copy > * { animation: rise .7s cubic-bezier(.2,.7,.2,1) both; }
.hero-copy > :nth-child(2) { animation-delay: .07s; }
.hero-copy > :nth-child(3) { animation-delay: .14s; }
.hero-copy > :nth-child(4) { animation-delay: .21s; }
.hero-copy > :nth-child(5) { animation-delay: .28s; }

/* app card: rise in, tilt toward the cursor, region scan */
.appcard {
  animation: rise .8s .2s cubic-bezier(.2,.7,.2,1) both;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .4s cubic-bezier(.2,.7,.2,1), opacity .3s, filter .3s;
}
.appcard.dim { opacity: .4; filter: saturate(.4); }
.scan { display: flex; flex-direction: column; gap: 8px; }
.scan-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.scan-row .num { margin-left: auto; }
.done #scanLabel { color: var(--accent); font-weight: 600; }
.scan-bar { height: 4px; border-radius: 4px; background: var(--accent-soft); overflow: hidden; }
.scan-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .08s linear; }
.flip { animation: flip .16s ease-out; }
@keyframes flip { from { translate: 0 -35%; opacity: .2; } }
.get { position: relative; overflow: hidden; }
.get::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.6) 50%, transparent 70%); translate: -120% 0; animation: sheen 3.6s 1.8s ease-in-out infinite; }
@keyframes sheen { 0%, 60% { translate: -120% 0; } 85%, 100% { translate: 120% 0; } }

/* steps hover */
.step, .step-n { transition: transform .25s, border-color .25s, box-shadow .25s, background .25s, color .25s; }
.step:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: var(--shadow); }
.step:hover .step-n { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }

/* cta light drifting across the gradient */
.cta::after { content: ""; position: absolute; top: -50%; left: -30%; width: 60%; height: 200%; background: radial-gradient(closest-side, rgba(255,255,255,.28), transparent); animation: drift 9s ease-in-out infinite alternate; pointer-events: none; }
@keyframes drift { to { translate: 180% 0; } }

/* click ripple: a blue ring travels across the grid */
@property --rr { syntax: "<length>"; inherits: false; initial-value: 0px; }
.ripple {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: linear-gradient(var(--grid-hot) 1px, transparent 1px), linear-gradient(90deg, var(--grid-hot) 1px, transparent 1px);
  background-size: 32px 32px; background-position: -1px -1px;
  -webkit-mask-image: radial-gradient(circle at var(--cx) var(--cy), transparent calc(var(--rr) - 80px), #000 var(--rr), transparent calc(var(--rr) + 4px));
          mask-image: radial-gradient(circle at var(--cx) var(--cy), transparent calc(var(--rr) - 80px), #000 var(--rr), transparent calc(var(--rr) + 4px));
  animation: ripple 1.3s cubic-bezier(.2,.6,.3,1) forwards;
}
@keyframes ripple { 60% { opacity: 1; } to { --rr: 760px; opacity: 0; } }

/* scroll-linked reveals: browsers without support just show everything */
@supports (animation-timeline: view()) {
  .step, .checklist li, .faq details, .cta { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% entry 55%; }
  @keyframes reveal { from { opacity: 0; translate: 0 28px; scale: .98; } }
  .tick path { stroke-dasharray: 24; animation: draw linear both; animation-timeline: view(); animation-range: entry 50% cover 30%; }
  @keyframes draw { from { stroke-dashoffset: 24; } }
}

/* ---------- hero search demo ---------- */
.hero-demo { display: flex; flex-direction: column; gap: 14px; min-width: 0; position: relative; }
.search {
  position: relative; display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
  font-size: 16px; font-weight: 500; animation: rise .7s .1s cubic-bezier(.2,.7,.2,1) both;
}
.search > svg { color: var(--muted); flex: none; }
/* skeleton: shown until the first real App Store answer arrives */
.appcard.skeleton {
  --sk: color-mix(in srgb, var(--fg) 6%, var(--surface));
  --sk-hi: color-mix(in srgb, var(--fg) 12%, var(--surface));
}
.appcard.skeleton :is(#appIcon, #appName, #appSub, .get, #scanLabel, #scanCount, #reg, #appUsd, #tot, #appNote) {
  width: fit-content; color: transparent !important; text-decoration-color: transparent; box-shadow: none;
  background: linear-gradient(90deg, var(--sk) 30%, var(--sk-hi) 50%, var(--sk) 70%) 0 0 / 300% 100% !important;
  border-radius: 8px; animation: sk 1.3s linear infinite;
}
.appcard.skeleton #appIcon { width: 88px; border-radius: 22px; }
.appcard.skeleton #appNote { width: auto; }
.appcard.skeleton #appNote * { color: transparent !important; }
.appcard.skeleton .get::after { visibility: hidden; }
.appcard.skeleton #scanBar { width: 0 !important; }
@keyframes sk { to { background-position: -150% 0; } }

/* above the card: both run an entrance animation, so each is its own stacking layer */
#search { z-index: 4; }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font: inherit; color: inherit; }
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { display: none; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); }
.suggest { max-height: 360px; overflow-y: auto; }
button.sg-row { width: 100%; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
button.sg-row:disabled { cursor: default; }
button.sg-row:not(:disabled):hover { background: var(--accent-soft); }
.sg-empty { padding: 12px; color: var(--muted); font-size: 14px; }
img.app-icon { object-fit: cover; background: var(--accent-soft); }
.app-icon.has-img { background-size: cover; background-position: center; }
.appcard-note a { color: var(--accent); font-weight: 600; }
.suggest {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 3; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
  animation: rise .25s cubic-bezier(.2,.7,.2,1) both;
}
.sg-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; transition: background .2s; }
.sg-row.hot { background: var(--accent-soft); }
.sg-row.dim { opacity: .5; }
.sg-row div { flex: 1; min-width: 0; }
.sg-row b { display: block; font-size: 15px; }
.sg-row small { color: var(--muted); font-size: 13px; }
.sg-row .app-icon, .mini .app-icon { width: 38px; height: 38px; border-radius: 10px; }
.app-icon.edu { background: linear-gradient(160deg, #9AD7FF, #3C7BD9); }
.sg-price { font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }

/* ---------- telegram chat mock ---------- */
.phone { width: min(340px, 100%); justify-self: center; border-radius: 44px; padding: 10px; background: var(--bezel); box-shadow: 0 2px 4px rgba(11, 21, 38, .1), 0 24px 48px rgba(11, 40, 90, .22); }
.phone-screen { border-radius: 34px; overflow: hidden; display: flex; flex-direction: column; height: 580px; background: linear-gradient(165deg, var(--chat-1), var(--chat-2)); }
.tg-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.tg-ava { object-fit: cover;  width: 36px; height: 36px; border-radius: 50%; }
.tg-head b { display: block; font-size: 15px; line-height: 1.2; }
.tg-head small { color: var(--accent); font-size: 12px; }
.tg-chat {
  flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 14px 12px; overflow: hidden;
  background-image: linear-gradient(var(--chat-grid) 1px, transparent 1px), linear-gradient(90deg, var(--chat-grid) 1px, transparent 1px);
  background-size: 24px 24px;
}
.msg { max-width: 84%; padding: 9px 12px; border-radius: 18px; font-size: 14px; line-height: 1.4; animation: pop .35s cubic-bezier(.2,.8,.2,1.2) both; }
.msg.out { align-self: flex-end; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-bottom-right-radius: 6px; }
.msg.in { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg p { margin: 8px 0 0; }
.kb { display: grid; gap: 4px; margin-top: 8px; }
.kb.two { grid-template-columns: 1fr 1fr; }
.kb span { display: block; text-align: center; font-size: 13px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 10px; padding: 7px 8px; }
.mini { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.mini div { flex: 1; }
.mini b { display: block; font-size: 14px; }
.mini small { color: var(--muted); font-size: 12px; }
.mini .sg-price { font-size: 15px; }
.typing { align-self: flex-start; display: flex; gap: 4px; padding: 13px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; border-bottom-left-radius: 6px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: bounce 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes pop { from { opacity: 0; translate: 0 10px; scale: .96; } }
@keyframes bounce { 0%, 60%, 100% { opacity: .3; translate: 0 0; } 30% { opacity: 1; translate: 0 -3px; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
