:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef0f6;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --accent: #4f46e5;
  --accent-2: #06b6d4;
  --accent-text: #ffffff;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
  --radius: 18px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1020;
    --surface: #131a2e;
    --surface-2: #1b2440;
    --text: #e8ecf6;
    --muted: #93a0bd;
    --line: #243052;
    --accent: #818cf8;
    --accent-2: #22d3ee;
    --accent-text: #0b1020;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  }
}
:root[data-theme="dark"] {
  --bg: #0b1020;
  --surface: #131a2e;
  --surface-2: #1b2440;
  --text: #e8ecf6;
  --muted: #93a0bd;
  --line: #243052;
  --accent: #818cf8;
  --accent-2: #22d3ee;
  --accent-text: #0b1020;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 12px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; color: #fff; font-size: 16px;
}
.spacer { flex: 1; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 8px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); display: grid; place-items: center;
}
.icon-btn:hover { background: var(--surface-2); }

/* Hero */
.hero { padding: 56px 0 28px; text-align: center; }
.hero h1 { font-size: clamp(32px, 6vw, 52px); line-height: 1.08; margin: 0 0 12px; letter-spacing: -.03em; }
.hero h1 span { background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); font-size: 18px; margin: 0 auto 28px; max-width: 560px; }
.search {
  display: flex; align-items: center; gap: 10px; max-width: 560px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 0 16px; height: 56px; box-shadow: var(--shadow);
}
.search:focus-within { border-color: var(--accent); }
.search svg { flex: none; color: var(--muted); }
.search input { flex: 1; border: 0; outline: 0; background: transparent; font: inherit; color: var(--text); min-width: 0; }

/* Chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 12px; margin: 0 -16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); font-weight: 500; color: var(--muted);
}
.chip:hover { color: var(--text); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }

/* Sections */
section { padding: 20px 0; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.sec-head h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.sec-head span { color: var(--muted); font-size: 14px; }

/* Icons */
.icon {
  flex: none; display: grid; place-items: center; color: #fff; font-weight: 800;
  width: var(--s, 64px); height: var(--s, 64px); border-radius: calc(var(--s, 64px) * .27);
  font-size: calc(var(--s, 64px) * .46);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15), 0 4px 12px rgba(0, 0, 0, .18);
}

.icon { overflow: hidden; }
.icon img { width: 100%; height: 100%; display: block; }

/* Featured row */
.rail { display: flex; gap: 14px; overflow-x: auto; padding: 4px 16px 16px; margin: 0 -16px; scroll-snap-type: x proximity; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.feature {
  flex: none; width: min(320px, 82vw); scroll-snap-align: start; border-radius: var(--radius);
  padding: 20px; color: #fff; position: relative; overflow: hidden; min-height: 170px;
  display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: var(--shadow); transition: transform .2s;
}
.feature:hover { transform: translateY(-3px); }
.feature::after { content: ""; position: absolute; inset: auto -40px -60px auto; width: 180px; height: 180px; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.feature .kicker { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; opacity: .85; }
.feature h3 { margin: 4px 0 4px; font-size: 22px; letter-spacing: -.02em; }
.feature p { margin: 0; opacity: .92; font-size: 14px; max-width: 220px; }
.feature .icon { --s: 52px; background: rgba(255, 255, 255, .22) !important; align-self: flex-end; position: relative; z-index: 1; }

/* Grid cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.card {
  display: flex; gap: 14px; align-items: center; padding: 14px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card-body { min-width: 0; flex: 1; }
.card-body b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-body small { color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { display: flex; gap: 10px; align-items: center; margin-top: 4px; font-size: 13px; color: var(--muted); }
.star { color: #f59e0b; }
.get {
  flex: none; padding: 7px 16px; border-radius: 999px; border: 0; background: var(--surface-2);
  color: var(--accent); font-weight: 700; font-size: 14px;
}
.get:hover { background: var(--accent); color: var(--accent-text); }
.empty { text-align: center; padding: 48px 0; color: var(--muted); }

/* Detail page */
.crumbs { padding: 20px 0 0; color: var(--muted); font-size: 14px; }
.crumbs a:hover { color: var(--text); }
.detail-head { display: flex; gap: 20px; align-items: center; padding: 20px 0; flex-wrap: wrap; }
.detail-head .icon { --s: 108px; }
.detail-head h1 { margin: 0; font-size: clamp(26px, 5vw, 38px); letter-spacing: -.03em; line-height: 1.1; }
.detail-head .dev { color: var(--accent); font-weight: 600; margin: 4px 0 2px; }
.detail-head .tag { color: var(--muted); margin: 0; }
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); margin: 8px 0 20px;
}
.stat { padding: 14px 8px; text-align: center; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; }
.stat b { display: block; font-size: 18px; }
.stat small { color: var(--muted); font-size: 12px; }
.cta { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 0 24px; height: 48px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface); font-weight: 700;
}
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: 0; color: #fff; }
.btn:hover { filter: brightness(1.06); }
.shots { display: flex; gap: 14px; overflow-x: auto; padding: 4px 16px 14px; margin: 0 -16px; scrollbar-width: thin; }
.shot {
  flex: none; width: 170px; aspect-ratio: 9 / 19; border-radius: 22px; padding: 14px; color: #fff;
  display: flex; flex-direction: column; justify-content: flex-end; position: relative; overflow: hidden;
  box-shadow: var(--shadow);
}
.shot::before { content: ""; position: absolute; top: 10px; left: 50%; width: 46px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .5); transform: translateX(-50%); }
.shot b { font-size: 15px; line-height: 1.25; }
.shot-fig { flex: none; margin: 0; width: min(560px, 84vw); }
.shot-img {
  display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
  border: 6px solid #0b0b12; border-radius: 22px; background: #0b0b12;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .1), 0 24px 56px -16px rgba(255, 45, 149, .4), 0 12px 28px -12px rgba(255, 179, 64, .35);
  transition: transform .25s;
}
.shot-fig:hover .shot-img { transform: translateY(-4px) scale(1.01); }
.shot-fig figcaption { margin: 14px 4px 0; color: var(--muted); font-size: 14px; line-height: 1.4; }
.shots { gap: 22px; padding-bottom: 22px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel p { margin: 0; color: var(--muted); }
.feats { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.feats li { display: flex; gap: 10px; align-items: center; }
.feats li::before { content: "✓"; flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); color: var(--accent); display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.info { width: 100%; border-collapse: collapse; }
.info td { padding: 10px 0; border-top: 1px solid var(--line); }
.info tr:first-child td { border-top: 0; }
.info td:first-child { color: var(--muted); width: 40%; }
.cols { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 800px) { .cols { grid-template-columns: 1.6fr 1fr; } }

/* Footer, toast */
footer { margin-top: 40px; border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 24px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 500;
  transition: .25s; max-width: calc(100vw - 32px); z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 640px) {
  .nav { display: none; }
  .hero { padding-top: 36px; }
  .stat b { font-size: 15px; }
}
