*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #ffffff;
  --fg: #0f172a;
  --muted: #f8fafc;
  --muted-fg: #64748b;
  --border: #e2e8f0;
  --primary: #6366f1;
  --primary-fg: #ffffff;
  --card: #ffffff;
  --shadow: 0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,.09);
  --radius: 12px;
}

.dark {
  --bg: #0f172a;
  --fg: #f8fafc;
  --muted: #1e293b;
  --muted-fg: #94a3b8;
  --border: #1e293b;
  --primary: #818cf8;
  --primary-fg: #0f172a;
  --card: #1e293b;
  --shadow: 0 1px 3px rgba(0,0,0,.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,.35);
}

body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--fg); line-height: 1.6; transition: background .2s, color .2s; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.text-primary { color: var(--primary); }

/* ── NAV ── */
.nav { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 85%, transparent); border-bottom: 1px solid var(--border); backdrop-filter: blur(16px); }
.nav-inner { display: flex; align-items: center; gap: 32px; height: 64px; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--fg); font-weight: 700; font-size: 1.1rem; }
.logo-text { letter-spacing: -.01em; }
.nav-links { display: flex; gap: 28px; margin-left: auto; }
.nav-links a { text-decoration: none; color: var(--muted-fg); font-size: .9rem; font-weight: 500; transition: color .15s; }
.nav-links a:hover { color: var(--fg); }
.nav-actions { display: flex; align-items: center; gap: 12px; margin-left: 12px; }

/* ── BUTTONS ── */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 20px; border-radius: 8px; font-size: .9rem; font-weight: 600; cursor: pointer; text-decoration: none; transition: all .15s; border: none; }
.btn-primary { background: var(--primary); color: var(--primary-fg); }
.btn-primary:hover { opacity: .88; }
.btn-icon { width: 36px; height: 36px; border-radius: 8px; border: 1.5px solid var(--border); background: transparent; color: var(--fg); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s; }
.btn-icon:hover { background: var(--muted); }

.dark .icon-sun { display: block; }
.dark .icon-moon { display: none; }
.icon-sun { display: none; }
.icon-moon { display: block; }

/* ── HERO ── */
.hero { padding: 90px 0 72px; background: radial-gradient(ellipse 80% 55% at 50% -5%, color-mix(in srgb, var(--primary) 10%, transparent), transparent); }
.hero-inner { text-align: center; max-width: 720px; margin: 0 auto; }
.badge { display: inline-block; padding: 6px 16px; border-radius: 100px; background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary); font-size: .82rem; font-weight: 600; margin-bottom: 24px; border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent); }
.hero-title { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 800; line-height: 1.15; letter-spacing: -.025em; }
.hero-desc { margin: 18px auto 0; color: var(--muted-fg); font-size: 1.05rem; max-width: 520px; }

/* ── SEARCH ── */
.search-wrap { position: relative; max-width: 520px; margin: 32px auto 0; }
.search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted-fg); pointer-events: none; }
.search-input { width: 100%; padding: 14px 16px 14px 48px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--card); color: var(--fg); font-size: .95rem; font-family: inherit; outline: none; box-shadow: var(--shadow-md); transition: border-color .15s; }
.search-input:focus { border-color: var(--primary); }
.search-input::placeholder { color: var(--muted-fg); }

.hero-stats { display: flex; align-items: center; justify-content: center; gap: 28px; margin-top: 48px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.stat-num { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.stat-label { font-size: .75rem; color: var(--muted-fg); text-transform: uppercase; letter-spacing: .06em; }
.stat-divider { width: 1px; height: 32px; background: var(--border); }

/* ── SECTIONS ── */
.section { padding: 72px 0; }
.section-alt { background: var(--muted); }
.section-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 36px; gap: 16px; flex-wrap: wrap; }
.section-title { font-size: 1.6rem; font-weight: 700; letter-spacing: -.015em; }
.section-count { color: var(--muted-fg); font-size: .87rem; margin-top: 4px; }

/* ── FILTERS ── */
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-btn { padding: 6px 14px; border-radius: 100px; border: 1.5px solid var(--border); background: transparent; color: var(--muted-fg); font-size: .82rem; font-weight: 500; cursor: pointer; transition: all .15s; font-family: inherit; }
.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn.active { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }

/* ── CATEGORIES ── */
.categories-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 12px; }
.category-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px 12px; border-radius: var(--radius); background: var(--card); border: 1.5px solid var(--border); cursor: pointer; transition: all .15s; font-family: inherit; color: var(--fg); }
.category-card:hover, .category-card.active { border-color: var(--primary); box-shadow: var(--shadow-md); }
.category-card.active { background: color-mix(in srgb, var(--primary) 6%, var(--card)); }
.category-icon { font-size: 1.75rem; }
.category-name { font-weight: 600; font-size: .85rem; text-align: center; line-height: 1.3; }
.category-count { font-size: .75rem; color: var(--muted-fg); }

/* ── PRODUCT CARDS ── */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.product-card { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: var(--radius); background: var(--card); border: 1.5px solid var(--border); box-shadow: var(--shadow); text-decoration: none; color: var(--fg); transition: all .15s; }
.product-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-2px); }

.product-header { display: flex; align-items: flex-start; gap: 12px; }
.product-avatar { width: 42px; height: 42px; border-radius: 10px; background: color-mix(in srgb, var(--primary) 15%, transparent); color: var(--primary); font-weight: 700; font-size: .85rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.product-title-wrap { flex: 1; min-width: 0; }
.product-name { font-weight: 700; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-cat { font-size: .75rem; color: var(--muted-fg); }
.featured-badge { font-size: .7rem; font-weight: 600; color: #d97706; white-space: nowrap; background: #fef3c7; padding: 2px 7px; border-radius: 100px; flex-shrink: 0; }
.dark .featured-badge { background: #422006; color: #fbbf24; }

.product-tagline { font-size: .85rem; color: var(--muted-fg); line-height: 1.5; flex: 1; }

.product-footer { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); }
.pricing-tag { padding: 3px 10px; border-radius: 100px; font-size: .73rem; font-weight: 600; flex-shrink: 0; }
.dark .pricing-tag { filter: saturate(.7) brightness(.85); }
.platforms { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.platform-tag { font-size: .68rem; padding: 2px 6px; border-radius: 4px; background: var(--muted); color: var(--muted-fg); text-transform: capitalize; }
.ext-arrow { color: var(--muted-fg); flex-shrink: 0; }
.product-card:hover .ext-arrow { color: var(--primary); }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 56px 0; color: var(--muted-fg); }
.link-btn { background: none; border: none; color: var(--primary); cursor: pointer; font-size: inherit; text-decoration: underline; font-family: inherit; }

/* ── FOOTER ── */
.footer { background: var(--muted); border-top: 1px solid var(--border); padding: 48px 0 0; }
.footer-inner { display: flex; gap: 48px; flex-wrap: wrap; }
.footer-brand { flex: 1; min-width: 160px; }
.footer-tagline { color: var(--muted-fg); font-size: .83rem; margin-top: 8px; }
.footer-links { display: flex; gap: 48px; flex-wrap: wrap; }
.footer-col { display: flex; flex-direction: column; gap: 10px; min-width: 110px; }
.footer-col h4 { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted-fg); margin-bottom: 2px; }
.footer-col a { text-decoration: none; color: var(--muted-fg); font-size: .87rem; transition: color .15s; }
.footer-col a:hover { color: var(--fg); }
.footer-bottom { margin-top: 40px; padding: 18px 24px; border-top: 1px solid var(--border); text-align: center; color: var(--muted-fg); font-size: .8rem; }

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .nav-links { display: none; }
  .hero { padding: 56px 0 44px; }
  .section { padding: 48px 0; }
  .section-header { flex-direction: column; }
  .products-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; gap: 32px; }
}
