/* LootNest — hub homepage styles (Agent B owns this file).
   Contract: build on the frozen tokens in styles.css + fx.css. No external fonts/libs.
   All rules here layer on top of the shared design system; home.css loads last. */

:root { --header-h: 66px; }

/* ── Header actions + sound toggle ─────────────────────── */
.top-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.nx-sound-toggle .ico-off { display: none; }
.nx-sound-toggle[aria-pressed="true"] { color: var(--accent); border-color: rgba(124, 140, 255, 0.4); }
.nx-sound-toggle[aria-pressed="true"]:hover { box-shadow: 0 0 18px -4px var(--glow); }
.nx-sound-toggle[aria-pressed="false"] { color: #5f6b80; }
.nx-sound-toggle[aria-pressed="false"] .ico-on { display: none; }
.nx-sound-toggle[aria-pressed="false"] .ico-off { display: inline-block; }

/* ── Hero ──────────────────────────────────────────────── */
.home-hero { position: relative; padding: 62px 0 30px; text-align: center; overflow: hidden; }
.home-hero::before {
  content: ""; position: absolute; inset: -140px 0 auto; height: 460px; pointer-events: none;
  background:
    radial-gradient(640px 280px at 50% 0%, var(--glow), transparent 70%),
    radial-gradient(520px 220px at 84% 16%, rgba(34, 211, 238, 0.1), transparent 65%);
  filter: blur(6px);
}
.home-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(560px 320px at 50% 6%, #000, transparent 76%);
  mask-image: radial-gradient(560px 320px at 50% 6%, #000, transparent 76%);
}
.home-hero > .wrap { position: relative; z-index: 1; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--line); background: var(--panel-2); border-radius: 999px; padding: 7px 15px;
}
.hero-badge-dot {
  width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: var(--ok); box-shadow: 0 0 10px var(--ok);
  animation: nx-pulse-dot 2.2s ease-in-out infinite;
}

.home-hero h1 { font-size: clamp(30px, 5.4vw, 52px); letter-spacing: -0.015em; line-height: 1.12; }
.home-hero h1 .hl {
  color: var(--accent);
  background: linear-gradient(92deg, var(--accent) 0%, var(--accent2) 45%, var(--accent) 90%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: nx-gradient-pan 6s linear infinite;
}
@keyframes nx-gradient-pan {
  0% { background-position: 0% 50%; }
  100% { background-position: 220% 50%; }
}
.home-hero .lead { font-size: 15.5px; max-width: 660px; margin-top: 16px; }

/* ── Stats band ────────────────────────────────────────── */
.home-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; max-width: 800px; margin: 30px auto 4px; }
.home-stat {
  position: relative; text-align: left; overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0) 58%), var(--panel);
  border: 1px solid var(--line); border-radius: 16px; padding: 15px 16px 13px;
}
.home-stat::before {
  content: ""; position: absolute; top: 0; left: 14px; right: 14px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: 0.55;
}
.home-stat b {
  display: block; font-family: "JetBrains Mono", monospace; font-size: 24px; line-height: 1.15;
  color: var(--accent);
  background: linear-gradient(135deg, var(--text) 10%, var(--accent) 90%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.home-stat .stat-ico { position: absolute; top: 14px; right: 14px; width: 16px; height: 16px; color: var(--accent); opacity: 0.6; }
.home-stat .stat-ico svg { width: 100%; height: 100%; display: block; }
.home-stat span { font-size: 10.5px; letter-spacing: 0.1em; }

/* ── Search ────────────────────────────────────────────── */
.hub-toolbar { max-width: 640px; margin: 30px auto 10px; }
.search-row { position: relative; max-width: 640px; margin: 0 auto; }
.search-ico {
  position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--muted); pointer-events: none; transition: color 0.15s;
}
.search-ico svg { width: 100%; height: 100%; display: block; }
.search-row:focus-within .search-ico { color: var(--accent); }
.search-box {
  height: 56px; padding: 16px 18px 16px 50px; border-radius: 16px; font-size: 15px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 70%), var(--panel);
}
.search-box:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), 0 18px 44px -20px var(--glow); }
.search-box::placeholder { color: #6b7690; }

/* ── Sticky filter dock ───────────────────────────────── */
.filter-dock {
  position: sticky; top: var(--header-h, 66px); z-index: 35;
  padding: 10px 0; margin-top: 8px;
  background: rgba(5, 7, 13, 0.85);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.filter-dock .cat-row { margin-bottom: 0; justify-content: center; }
.cat-row { gap: 9px; }
.cat-chip { padding: 9px 16px; }
.cat-chip:hover { transform: translateY(-1px); }
.cat-chip.active { box-shadow: 0 10px 24px -10px var(--glow); }

/* ── Featured / top picks strip ───────────────────────── */
.featured { margin: 28px 0 4px; }
.featured-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 13px; }
.featured-head h2 {
  display: flex; align-items: center; gap: 9px;
  font-family: Cinzel, Georgia, serif; font-weight: 700; font-size: clamp(18px, 2.4vw, 22px);
}
.featured-head h2 svg { width: 17px; height: 17px; color: var(--accent2); flex: none; }
.featured-sub { font-size: 12px; color: var(--muted); }
.featured-row {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(232px, 254px); gap: 12px;
  overflow-x: auto; padding: 2px 2px 12px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}
.featured-row::-webkit-scrollbar { height: 6px; }
.featured-row::-webkit-scrollbar-track { background: transparent; }
.featured-row::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 99px; }
.feat-item { min-width: 0; scroll-snap-align: start; }
.feat-item .niche-card { height: 100%; }
[data-reveal].feat-item { transition-delay: calc(var(--rd, 0) * 45ms); }

/* ── Grid heading ─────────────────────────────────────── */
.hub-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin: 32px 0 14px; }
.hub-head h2 { font-family: Cinzel, Georgia, serif; font-size: clamp(19px, 2.6vw, 24px); font-weight: 700; }
.hub-note { font-family: "JetBrains Mono", monospace; font-size: 11.5px; color: var(--muted); }
.empty { font-size: 14px; }

/* ── Cards: category tint + richer hover ──────────────── */
.niche-card {
  --cat: var(--accent);
  --cat-soft: var(--glow);
  --cat-ink: var(--accent-soft);
  border-radius: 16px; padding: 12px 13px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 62%), var(--panel);
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.niche-card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(170px 96px at 88% 0%, var(--cat-soft), transparent 72%);
  opacity: 0; transition: opacity 0.2s ease;
}
.niche-card:hover { border-color: var(--cat); transform: translateY(-3px); box-shadow: 0 16px 38px -16px var(--cat-soft), inset 0 0 0 1px var(--cat-ink); }
.niche-card:hover::after { opacity: 0.85; }

.niche-card[data-cat="gaming"] { --cat: #7c8cff; --cat-soft: rgba(124, 140, 255, 0.3); --cat-ink: rgba(124, 140, 255, 0.16); }
.niche-card[data-cat="giftcard"] { --cat: #f5c842; --cat-soft: rgba(245, 200, 66, 0.28); --cat-ink: rgba(245, 200, 66, 0.16); }
.niche-card[data-cat="crypto"] { --cat: #34d399; --cat-soft: rgba(52, 211, 153, 0.28); --cat-ink: rgba(52, 211, 153, 0.16); }
.niche-card[data-cat="social"] { --cat: #fe2c55; --cat-soft: rgba(254, 44, 85, 0.28); --cat-ink: rgba(254, 44, 85, 0.16); }
.niche-card[data-cat="saas"] { --cat: #a78bfa; --cat-soft: rgba(167, 139, 250, 0.28); --cat-ink: rgba(167, 139, 250, 0.16); }

.nc-icon { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s; }
.nc-fallback {
  width: 44px; height: 44px; border-radius: 12px; color: var(--cat);
  background: linear-gradient(135deg, var(--cat-ink), transparent 70%), var(--panel-2);
  border: 1px solid var(--line); transition: border-color 0.18s, box-shadow 0.18s;
}
.niche-card:hover .nc-icon { border-color: var(--cat); transform: scale(1.06); box-shadow: 0 0 0 3px var(--cat-ink); }
.niche-card:hover .nc-fallback { border-color: var(--cat); box-shadow: 0 0 0 3px var(--cat-ink); }
.nc-name { font-size: 13px; }
.nc-reward { font-size: 10.5px; }
.niche-card .hot { border-bottom-left-radius: 10px; box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.7); }

/* ── Footer ───────────────────────────────────────────── */
.footer {
  margin-top: 56px; padding: 32px 0 46px;
  background: linear-gradient(180deg, transparent, rgba(124, 140, 255, 0.035));
}
.footer-trust { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-bottom: 20px; font-size: 12px; color: var(--muted); }
.footer-trust span { display: inline-flex; align-items: center; gap: 7px; }
.footer-trust svg { width: 13px; height: 13px; color: var(--ok); flex: none; }
.footer-in { padding-top: 16px; border-top: 1px solid var(--line); }
.disclaimer { border-left: 2px solid rgba(124, 140, 255, 0.35); padding-left: 12px; margin-top: 16px; line-height: 1.65; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 820px) {
  .home-stats { grid-template-columns: repeat(2, 1fr); max-width: 560px; }
  .hub-note { display: none; }
}
@media (max-width: 720px) {
  .featured { display: none; }
}
@media (max-width: 640px) {
  .filter-dock .cat-row {
    flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto;
    padding: 2px 2px 4px; margin: 0 -20px; padding-left: 20px; padding-right: 20px;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .filter-dock .cat-row::-webkit-scrollbar { display: none; }
  .cat-chip { flex: none; }
  .featured-head, .hub-head { flex-direction: column; gap: 4px; }
}
@media (max-width: 520px) {
  .home-hero { padding-top: 44px; }
  .search-box { height: 52px; }
  .home-stat { padding: 13px 14px 12px; }
  .home-stat b { font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  .home-hero h1 .hl { animation: none; }
  .hero-badge-dot { animation: none; }
}
