/* LiteAppStore — tokens */
:root {
  color-scheme: light dark;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef1f8;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --border: #e3e7ef;
  --brand: #4f46e5;
  --brand-strong: #4338ca;
  --brand-soft: #eef2ff;
  --cyan: #0891b2;
  --star: #f59e0b;
  --new: #c026d3;
  --grad: linear-gradient(135deg, #22d3ee 0%, #6366f1 52%, #c026d3 100%);
  --grad-text: linear-gradient(90deg, #0891b2, #6366f1);
  --topbar: rgba(255, 255, 255, 0.82);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 14px 32px -14px rgba(30, 27, 75, 0.28);
  --radius: 20px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020;
    --surface: #121933;
    --surface-2: #1a2342;
    --text: #e8ebf5;
    --text-2: #c3c9da;
    --muted: #8d97b0;
    --border: #242e4f;
    --brand: #8b93ff;
    --brand-strong: #a5abff;
    --brand-soft: #1e2550;
    --cyan: #67e8f9;
    --new: #e879f9;
    --grad-text: linear-gradient(90deg, #67e8f9, #a5b4fc);
    --topbar: rgba(11, 16, 32, 0.8);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 18px 40px -18px rgba(0, 0, 0, 0.7);
  }
}

/* base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 8px; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }
.muted { color: var(--muted); margin: 0; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 14px; border-radius: 10px; }
.skip:focus { left: 8px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px; border-radius: 999px; border: 0;
  font-weight: 700; font-size: 15px; cursor: pointer; white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 8px 20px -10px var(--brand); }
@media (prefers-color-scheme: dark) { .btn-primary { color: #0b1020; } }
.btn-primary:hover { transform: translateY(-1px); background: var(--brand-strong); }
.btn-ghost { background: var(--surface-2); color: var(--text); }
.btn-ghost:hover { background: var(--border); }
.btn svg { width: 18px; height: 18px; fill: currentColor; }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--brand); font-weight: 700; cursor: pointer; }
.play-badge { display: inline-block; line-height: 0; }
.play-badge img { height: 66px; width: auto; margin: -10px -10px; }
.play-badge-lg img { height: 76px; margin: -12px -12px; }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--topbar);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { display: flex; align-items: center; gap: 16px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand img { border-radius: 10px; }
.brand-name { font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.brand-lite { font-weight: 700; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.search {
  flex: 1; max-width: 520px; margin-left: auto; position: relative;
  display: flex; align-items: center;
}
.search svg { position: absolute; left: 14px; width: 20px; height: 20px; fill: var(--muted); pointer-events: none; }
.search input {
  width: 100%; height: 44px; padding: 0 16px 0 44px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font: inherit; font-size: 15px; outline: none; transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.search input:focus { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
.topbar-link { font-weight: 600; font-size: 14px; color: var(--text-2); padding: 8px 4px; flex-shrink: 0; }
.topbar-link:hover { color: var(--brand); }
@media (max-width: 640px) {
  .topbar-inner { gap: 10px; }
  .brand-name { display: none; }
  .topbar-link { display: none; }
  .search { max-width: none; }
}

/* hero */
.hero { display: grid; gap: 28px; padding-top: 40px; padding-bottom: 24px; align-items: center; }
@media (min-width: 900px) { .hero { grid-template-columns: 1.15fr 1fr; padding-top: 64px; padding-bottom: 40px; } }
.eyebrow { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--cyan); }
.hero h1 { font-size: clamp(36px, 6vw, 60px); font-weight: 800; letter-spacing: -0.035em; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { font-size: 18px; color: var(--text-2); max-width: 34em; margin: 16px 0 24px; }
.hero-stats { display: flex; gap: 28px; margin-bottom: 28px; flex-wrap: wrap; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 24px; font-weight: 800; }
.hero-stats span { font-size: 13px; color: var(--muted); }
.hero-art { position: relative; height: 320px; display: none; }
@media (min-width: 900px) { .hero-art { display: block; } }
.hero-blob {
  position: absolute; inset: 30px 40px; border-radius: 42% 58% 55% 45% / 50% 40% 60% 50%;
  background: var(--grad); opacity: .18; filter: blur(30px); z-index: 0;
}
.float {
  position: absolute; z-index: 1; width: 96px; height: 96px; border-radius: 24px;
  box-shadow: var(--shadow-md); background: var(--surface);
  animation: bob 6s ease-in-out infinite;
}
.f0 { left: 8%; top: 12%; width: 120px; height: 120px; border-radius: 28px; }
.f1 { left: 42%; top: 0%; animation-delay: -1s; }
.f2 { right: 4%; top: 22%; width: 112px; height: 112px; animation-delay: -2s; }
.f3 { left: 24%; bottom: 4%; animation-delay: -3s; }
.f4 { left: 52%; top: 44%; width: 128px; height: 128px; border-radius: 30px; animation-delay: -4s; }
.f5 { right: 0; bottom: 0; width: 84px; height: 84px; border-radius: 20px; animation-delay: -5s; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-12px) rotate(2deg); } }
@media (prefers-reduced-motion: reduce) { .float { animation: none; } html { scroll-behavior: auto; } }

/* featured */
.featured {
  position: relative; overflow: hidden;
  display: grid; gap: 24px; align-items: center;
  margin: 8px 0 24px; padding: 24px;
  border-radius: 28px; border: 1px solid var(--border);
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, #6366f1 16%, transparent), transparent 60%),
    radial-gradient(90% 120% at 0% 100%, color-mix(in srgb, #22d3ee 14%, transparent), transparent 60%),
    var(--surface);
  box-shadow: var(--shadow-sm);
}
@media (min-width: 900px) { .featured { grid-template-columns: 1fr 1fr; padding: 40px; } }
.featured-title { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.featured-title img { width: 80px; height: 80px; border-radius: 20px; box-shadow: var(--shadow-sm); }
.featured-title h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 800; }
.featured-summary { font-size: 17px; color: var(--text-2); margin: 0 0 22px; max-width: 32em; }
.featured-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.featured-shots { display: flex; justify-content: center; align-items: center; gap: 14px; min-height: 200px; }
.featured-shots img {
  height: 260px; width: auto; max-width: 46%; object-fit: cover; border-radius: 18px;
  box-shadow: var(--shadow-md); border: 1px solid var(--border);
}
.featured-shots .fs1 { height: 300px; }
@media (max-width: 899px) { .featured-shots img { height: 180px; } .featured-shots .fs1 { height: 210px; } .featured-shots .fs2 { display: none; } }

/* catalog */
.catalog { padding-top: 16px; padding-bottom: 56px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { font-size: clamp(24px, 3vw, 30px); font-weight: 800; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 14px; margin: 0 -2px 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0;
  height: 38px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 14px; font-weight: 600; color: var(--text-2);
  transition: background-color .15s, color .15s, border-color .15s;
}
.chip span { font-size: 12px; color: var(--muted); font-weight: 700; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.on span { color: rgba(255, 255, 255, .8); }
@media (prefers-color-scheme: dark) { .chip.on { color: #0b1020; } .chip.on span { color: rgba(11, 16, 32, .7); } }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); }
.card {
  display: flex; flex-direction: column; gap: 12px;
  padding: 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--brand) 35%, var(--border)); }
.card-top { display: flex; gap: 14px; align-items: center; position: relative; }
.card-icon { width: 64px; height: 64px; border-radius: 16px; flex-shrink: 0; box-shadow: var(--shadow-sm); background: var(--surface-2); }
.card-heading { min-width: 0; }
.card h3 { font-size: 16.5px; font-weight: 700; letter-spacing: -0.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-cat { font-size: 13px; color: var(--muted); font-weight: 500; }
.badge-new {
  position: absolute; top: -6px; right: -6px;
  font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: #fff; background: var(--new); padding: 3px 8px; border-radius: 999px;
}
.card-summary { margin: 0; font-size: 14px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { margin-top: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); font-weight: 600; }
.card-meta .dot { opacity: .5; }
.price.free { color: #059669; }
@media (prefers-color-scheme: dark) { .price.free { color: #34d399; } }
.stars { display: inline-flex; align-items: center; gap: 3px; }
.stars svg { width: 14px; height: 14px; fill: var(--star); }
.empty { text-align: center; padding: 48px 0; color: var(--muted); }
.empty a { color: var(--brand); font-weight: 700; }

/* app detail */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 22px; font-size: 14px; color: var(--muted); }
.crumbs a:hover { color: var(--brand); }
.crumbs span:last-child { color: var(--text-2); font-weight: 600; }
.detail { display: grid; gap: 40px; padding-top: 20px; padding-bottom: 64px; }
@media (min-width: 1000px) { .detail { grid-template-columns: minmax(0, 1fr) 320px; } }
.detail-main { min-width: 0; }
.app-head { display: flex; gap: 22px; align-items: center; }
.app-icon { width: 120px; height: 120px; border-radius: 28px; box-shadow: var(--shadow-md); flex-shrink: 0; background: var(--surface-2); }
.app-head h1 { font-size: clamp(26px, 4.4vw, 44px); font-weight: 800; letter-spacing: -0.03em; }
.app-dev { display: inline-block; margin-top: 8px; color: var(--brand); font-weight: 700; }
.app-dev:hover { text-decoration: underline; }
.app-flags { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
@media (max-width: 560px) { .app-icon { width: 84px; height: 84px; border-radius: 20px; } .app-head { gap: 16px; } }

.stats {
  display: flex; margin: 26px 0 22px; padding: 4px 0;
  overflow-x: auto; scrollbar-width: none;
}
.stats::-webkit-scrollbar { display: none; }
.stat { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 24px; min-width: 112px; flex-shrink: 0; }
.stat + .stat { border-left: 1px solid var(--border); }
.stat:first-child { padding-left: 0; align-items: flex-start; text-align: left; min-width: 0; }
.stat strong { font-size: 17px; font-weight: 800; }
.stat .stars svg { width: 16px; height: 16px; }
.stat span { font-size: 13px; color: var(--muted); white-space: nowrap; }
.cta { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 30px; }

.shots { margin: 0 0 36px; }
.shots-track {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: 10px; scrollbar-width: thin;
}
.shot {
  padding: 0; border: 0; background: none; cursor: zoom-in; flex-shrink: 0; scroll-snap-align: start;
  border-radius: 16px; overflow: hidden; border: 1px solid var(--border);
}
.shot { background: var(--surface-2); }
/* min-width keeps a placeholder until lazy images arrive (their aspect ratio is unknown) */
.shot img { height: 300px; width: auto; min-width: 140px; object-fit: cover; transition: transform .25s ease; }
.shot:hover img { transform: scale(1.03); }
@media (max-width: 560px) { .shot img { height: 220px; } }

.about h2, .detail-side h2 { font-size: 22px; font-weight: 800; margin-bottom: 12px; }
.lead { font-size: 18px; font-weight: 600; color: var(--text); margin: 0 0 14px; }
.desc { color: var(--text-2); position: relative; }
.desc p { margin: 0 0 14px; }
.desc ul { margin: 0 0 14px; padding-left: 22px; }
.desc li { margin: 4px 0; }
.desc.clamped { max-height: 15.5em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 65%, transparent); mask-image: linear-gradient(#000 65%, transparent); }
.facts {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px 24px;
  margin: 26px 0 0; padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
}
.facts dt { font-size: 13px; color: var(--muted); font-weight: 600; }
.facts dd { margin: 2px 0 0; font-weight: 700; word-break: break-word; }

.detail-side { align-self: start; }
@media (min-width: 1000px) { .detail-side { position: sticky; top: 92px; } }
.side-list { display: flex; flex-direction: column; gap: 4px; }
.side-item { display: flex; gap: 14px; align-items: center; padding: 10px; margin: 0 -10px; border-radius: 16px; transition: background-color .15s; }
.side-item:hover { background: var(--surface); }
.side-item img { width: 56px; height: 56px; border-radius: 14px; flex-shrink: 0; box-shadow: var(--shadow-sm); }
.side-item span { display: flex; flex-direction: column; min-width: 0; }
.side-item strong { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-item small { font-size: 13px; color: var(--muted); }

/* lightbox */
.lightbox {
  width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(5, 8, 20, .92); color: #fff;
}
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox::backdrop { background: transparent; }
.lightbox img { max-width: calc(100vw - 120px); max-height: calc(100vh - 80px); border-radius: 14px; }
.lb-close, .lb-nav {
  position: absolute; border: 0; cursor: pointer; color: #fff; background: rgba(255, 255, 255, .12);
  width: 48px; height: 48px; border-radius: 999px; font-size: 30px; line-height: 1;
  display: grid; place-items: center;
}
.lb-close:hover, .lb-nav:hover { background: rgba(255, 255, 255, .24); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
@media (max-width: 560px) { .lightbox img { max-width: 100vw; border-radius: 0; } .lb-nav { top: auto; bottom: 20px; transform: none; } }

/* 404 */
.notfound { text-align: center; padding: 96px 16px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.notfound img { border-radius: 22px; margin-bottom: 8px; }
.notfound h1 { font-size: 32px; font-weight: 800; }

/* footer */
.footer { border-top: 1px solid var(--border); background: var(--surface); padding: 40px 0 28px; font-size: 14px; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 28px; justify-content: space-between; }
.footer-brand { max-width: 520px; }
.footer-brand .brand-name { display: inline; color: var(--text); font-size: 18px; }
.footer-brand p { margin: 12px 0 0; }
.footer-brand p a { color: var(--brand); font-weight: 600; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a:hover { color: var(--brand); }
.footer-legal { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 12.5px; }
