/* =========================================================
   HERMES — Storefront styles
   All colors come from CSS variables that app.js fills from
   data/site.json → site.theme. Change JSON, not this file.
   ========================================================= */

:root {
  --primary: #22d3ee;
  --secondary: #a855f7;
  --bg: #070a12;
  --surface: #0f1422;
  --surface-alt: #141b2d;
  --text: #e8ecf5;
  --muted: #8b93a7;
  --success: #34d399;
  --danger: #fb4a72;
  --radius: 16px;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --grad: linear-gradient(135deg, var(--primary), var(--secondary));
  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Montserrat", system-ui, sans-serif;
  --on-primary: #ffffff;
  --glow-on: 1;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

.container { width: min(1180px, 100% - 32px); margin-inline: auto; }

/* ---------- Background decoration ---------- */
.bg-grid {
  position: fixed; inset: 0; z-index: -2; 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: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
}
/* Soft neon glows: radial gradients instead of blur filters (cheap to paint). */
.bg-glow {
  position: fixed; z-index: -1; pointer-events: none; border-radius: 50%;
  opacity: calc(0.55 * var(--glow-on));
}
.bg-glow--a { width: 900px; height: 900px; top: -420px; left: -380px; background: radial-gradient(circle, color-mix(in srgb, var(--primary) 40%, transparent) 0%, transparent 60%); }
.bg-glow--b { width: 900px; height: 900px; top: -60px; right: -420px; background: radial-gradient(circle, color-mix(in srgb, var(--secondary) 40%, transparent) 0%, transparent 60%); }

/* ---------- Announcement ---------- */
.announcement {
  text-align: center; font-size: 13px; font-weight: 600; padding: 9px 16px;
  background: var(--grad); color: var(--on-primary); letter-spacing: 0.01em;
}
.announcement a { color: inherit; text-decoration: underline; }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(7, 10, 18, 0.72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header__inner { display: flex; align-items: center; gap: 24px; height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.brand img { height: var(--logo-h, 44px); width: auto; }
.brand__text {
  font-family: var(--font-display); font-weight: 800; letter-spacing: 0.12em;
  font-size: 22px; color: var(--primary);
  text-shadow: 0 0 calc(18px * var(--glow-on)) color-mix(in srgb, var(--primary) 60%, transparent);
}
.brand__svg { height: 40px; width: 40px; }

.nav { display: flex; gap: 6px; margin-left: auto; }
.nav a {
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 10px 14px; border-radius: 10px; color: var(--muted);
  transition: color .2s, background .2s;
}
.nav a:hover { color: var(--text); background: rgba(255,255,255,0.05); }

.nav-actions { display: flex; gap: 10px; }
.btn-pill {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: 999px; font-weight: 700; font-size: 13px; border: 0; color: #fff;
  background: var(--pill, var(--primary));
  box-shadow: 0 6px 22px color-mix(in srgb, var(--pill, var(--primary)) calc(45% * var(--glow-on)), transparent);
  transition: transform .15s, filter .15s;
}
.btn-pill:hover { transform: translateY(-1px); filter: brightness(1.08); }
.btn-pill svg { width: 16px; height: 16px; fill: currentColor; }

.burger { display: none; margin-left: auto; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--border-strong); background: transparent; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.burger span { display: block; width: 18px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .2s, opacity .2s; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mobile-menu { padding: 8px 16px 18px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.mobile-menu a.link { padding: 12px 14px; border-radius: 10px; font-weight: 700; letter-spacing: .05em; font-size: 13px; text-transform: uppercase; color: var(--muted); }
.mobile-menu a.link:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.mobile-menu .btn-pill { justify-content: center; margin-top: 4px; }

.nav a { white-space: nowrap; }
@media (max-width: 1080px) {
  .nav, .nav-actions { display: none; }
  .burger { display: flex; }
}

/* ---------- Hero ---------- */
.hero { padding: 64px 0 24px; }
.hero__inner {
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 32px; align-items: center;
}
.hero__badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--primary); border: 1px solid color-mix(in srgb, var(--primary) 40%, transparent);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
}
.hero__badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 12px var(--primary); }
.hero h1 {
  font-family: var(--font-display); font-weight: 800; font-size: clamp(28px, 4vw, 44px);
  line-height: 1.12; margin: 18px 0 14px; letter-spacing: -0.01em;
}
.hero h1 span {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--muted); font-size: 15.5px; line-height: 1.65; max-width: 540px; margin: 0 0 24px; }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 22px; border-radius: 12px; font-weight: 700; font-size: 14px; border: 0;
  transition: transform .15s, box-shadow .15s, background .15s;
}
.btn--primary { background: var(--grad); color: var(--on-primary); box-shadow: 0 10px 30px color-mix(in srgb, var(--primary) calc(35% * var(--glow-on)), transparent); }
.btn--primary:hover { transform: translateY(-2px); }
.btn--ghost { background: rgba(255,255,255,0.04); border: 1px solid var(--border-strong); color: var(--text); }
.btn--ghost:hover { background: rgba(255,255,255,0.08); }

.hero__stats { display: flex; gap: 28px; margin-top: 36px; flex-wrap: wrap; }
.stat b { display: block; font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--text); }
.stat small { color: var(--muted); font-size: 12.5px; font-weight: 600; }

.hero__art { position: relative; display: flex; justify-content: center; align-items: flex-end; min-height: 380px; }
.hero__art::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 65%, color-mix(in srgb, var(--secondary) 35%, transparent), transparent 65%);
  opacity: var(--glow-on);
}
.hero__art img {
  position: relative; max-height: 440px; width: auto;
  filter: drop-shadow(0 0 calc(28px * var(--glow-on)) color-mix(in srgb, var(--primary) 35%, transparent));
  transition: opacity .25s;
}
.hero__art img.hover { position: absolute; inset: auto 0 0 0; margin: auto; opacity: 0; }
.hero__art:hover img.base { opacity: 0; }
.hero__art:hover img.hover { opacity: 1; }
.hero__art .mascot-missing {
  position: relative; width: 100%; max-width: 360px; aspect-ratio: 4/5; border-radius: var(--radius);
  border: 1px dashed var(--border-strong); display: grid; place-items: center; color: var(--muted);
  font-size: 13px; text-align: center; padding: 20px; background: rgba(255,255,255,0.02);
}
@media (max-width: 900px) {
  .hero { padding-top: 40px; }
  .hero__inner { grid-template-columns: 1fr; }
  .hero__art { min-height: 0; order: -1; }
  .hero__art img { max-height: 300px; }
  .hero__art .mascot-missing { max-width: 260px; aspect-ratio: 1; }
}

/* ---------- Tabs ---------- */
.shop { padding: 40px 0 40px; }
.tabs { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; margin-bottom: 52px; }
.tab { position: relative; text-align: center; }
.tab__btn {
  min-width: 160px; height: 62px; padding: 0 34px; border-radius: 14px;
  font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: .02em;
  color: var(--primary); background: transparent;
  border: 1.5px solid color-mix(in srgb, var(--primary) 55%, transparent);
  transition: all .2s;
}
.tab__btn:hover { background: color-mix(in srgb, var(--primary) 10%, transparent); }
.tab__btn[aria-selected="true"] {
  background: var(--grad); color: var(--on-primary); border-color: transparent;
  box-shadow: 0 10px 30px color-mix(in srgb, var(--primary) calc(35% * var(--glow-on)), transparent);
}
.tab__hint { display: block; margin-top: 8px; font-size: 13px; color: var(--muted); letter-spacing: .04em; min-height: 16px; }

/* ---------- Catalog ---------- */
.category { margin-bottom: 52px; animation: rise .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.category__head {
  display: inline-flex; align-items: center; gap: 12px; height: 50px; padding: 0 22px 0 18px;
  border-radius: 12px; background: var(--grad); color: var(--on-primary);
  font-family: var(--font-display); font-weight: 700; font-size: 21px; letter-spacing: .02em;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--primary) calc(28% * var(--glow-on)), transparent);
  margin-bottom: 22px;
}
.category__head svg { width: 22px; height: 22px; fill: currentColor; }

.group { margin: 0 0 30px 0; padding-left: 24px; }
.group__title { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; font-size: 21px; font-weight: 700; letter-spacing: 0; }
.group__title .markers { display: inline-flex; gap: 6px; }
.group__title .markers svg { width: 20px; height: 20px; fill: var(--success); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--success) 60%, transparent)); }

.items { display: flex; flex-direction: column; gap: 12px; }
.item {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 18px;
  padding: 18px 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.item:hover { border-color: color-mix(in srgb, var(--primary) 45%, transparent); transform: translateY(-1px); box-shadow: var(--shadow); }
.item--sold { opacity: .6; }
.item__icon {
  width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center;
  background: var(--surface-alt); border: 1px solid var(--border);
}
.item__icon svg { width: 26px; height: 26px; fill: var(--muted); }
.item__text { font-size: 16.5px; line-height: 1.45; min-width: 0; overflow-wrap: anywhere; }
.item__status { font-weight: 700; }
.item__status::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--status); margin-right: 8px; box-shadow: 0 0 8px var(--status); vertical-align: 1px; }
.item__headline { font-weight: 700; }
.item__details { color: var(--muted); }
.item__price {
  font-family: var(--font-display); font-weight: 700; font-size: 18px; white-space: nowrap;
  padding: 11px 18px; border-radius: 12px; background: var(--surface-alt); border: 1px solid var(--border);
}
.item__actions { display: inline-flex; border-radius: 12px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--primary) 45%, transparent); }
.item__actions button {
  height: 48px; padding: 0 22px; border: 0; font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; gap: 8px;
  transition: background .15s, color .15s;
}
.item__actions svg { width: 16px; height: 16px; fill: currentColor; }
.btn-copy { background: transparent; color: var(--primary); }
.btn-copy:hover { background: color-mix(in srgb, var(--primary) 12%, transparent); }
.btn-copy.done { color: var(--success); }
.btn-buy { background: var(--grad); color: var(--on-primary); }
.btn-buy:hover { filter: brightness(1.08); }
.btn-buy:disabled { background: var(--surface-alt); color: var(--muted); cursor: not-allowed; filter: none; }

.empty {
  text-align: center; padding: 60px 20px; border: 1px dashed var(--border-strong); border-radius: var(--radius);
  color: var(--muted); font-size: 15px; max-width: 560px; margin: 0 auto; background: rgba(255,255,255,0.02);
}
.empty svg { width: 40px; height: 40px; fill: var(--muted); margin-bottom: 12px; opacity: .8; }

@media (max-width: 720px) {
  .group { padding-left: 0; }
  .item { grid-template-columns: auto 1fr; }
  .item__price { grid-column: 1 / 2; justify-self: start; }
  .item__actions { grid-column: 2 / 3; justify-self: end; }
}
@media (max-width: 460px) {
  .item__actions button { padding: 0 12px; }
  .item__actions button span { display: none; }
}

/* ---------- Info sections ---------- */
.info { padding: 40px 0 60px; display: grid; gap: 20px; grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px;
}
.card h2 { font-family: var(--font-display); font-size: 16px; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 16px; color: var(--primary); }
.steps { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start; }
.steps li::before { counter-increment: s; content: counter(s); width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--grad); color: var(--on-primary); font-weight: 800; font-family: var(--font-display); font-size: 13px; }
.steps b { display: block; font-size: 14px; margin-bottom: 2px; }
.steps span { color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.rules { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.rules li { color: var(--muted); font-size: 13.5px; line-height: 1.55; padding-left: 18px; position: relative; }
.rules li::before { content: ""; position: absolute; left: 0; top: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--secondary); box-shadow: 0 0 8px var(--secondary); }
.faq details { border-top: 1px solid var(--border); padding: 10px 0; }
.faq details:first-of-type { border-top: 0; padding-top: 0; }
.faq summary { cursor: pointer; font-weight: 700; font-size: 14px; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.faq summary::after { content: "+"; color: var(--primary); font-weight: 800; }
.faq details[open] summary::after { content: "–"; }
.faq p { margin: 8px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
@media (max-width: 900px) { .info { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 26px 0; }
.footer__inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.footer__links { display: flex; gap: 18px; }
.footer__links a:hover { color: var(--text); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); z-index: 90;
  padding: 12px 18px; border-radius: 12px; font-weight: 700; font-size: 13.5px;
  background: var(--surface-alt); border: 1px solid color-mix(in srgb, var(--success) 50%, transparent); color: var(--text);
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  display: flex; align-items: center; gap: 10px;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast svg { width: 16px; height: 16px; fill: var(--success); }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.65); backdrop-filter: blur(6px); }
.modal__card {
  position: relative; width: min(480px, 100%); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 20px; padding: 28px; box-shadow: var(--shadow); animation: pop .2s ease;
}
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.modal__x { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 10px; border: 0; background: rgba(255,255,255,.05); color: var(--muted); font-size: 20px; }
.modal__x:hover { color: var(--text); }
.modal h3 { font-family: var(--font-display); margin: 0 0 6px; font-size: 18px; letter-spacing: .04em; }
.modal p { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0 0 18px; }
.modal .summary { background: var(--surface-alt); border: 1px solid var(--border); border-radius: 12px; padding: 14px; font-size: 14px; margin-bottom: 18px; display: grid; gap: 6px; }
.modal .summary .row { display: flex; justify-content: space-between; gap: 12px; }
.modal .summary .row span:last-child { font-weight: 700; text-align: right; }
.modal .summary .total { border-top: 1px solid var(--border); padding-top: 8px; margin-top: 2px; font-family: var(--font-display); }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ---------- No effects (theme.glow = false): clean flat look ---------- */
:is(html.no-fx, body.no-fx) .bg-grid, :is(html.no-fx, body.no-fx) .bg-glow { display: none; }
:is(html.no-fx, body.no-fx) .item__status::before, :is(html.no-fx, body.no-fx) .hero__badge::before, :is(html.no-fx, body.no-fx) .rules li::before,
:is(html.no-fx, body.no-fx) .coin-tab i, :is(html.no-fx, body.no-fx) .wallet__coin i, :is(html.no-fx, body.no-fx) .group__title .markers svg { box-shadow: none; filter: none; }

/* ---------- Light mode (theme.mode = "light") ---------- */
:is(html.light, body.light) { --border: rgba(16, 24, 40, 0.08); --border-strong: rgba(16, 24, 40, 0.16); --shadow: 0 10px 30px rgba(16, 24, 40, 0.10); }
:is(html.light, body.light) .header { background: color-mix(in srgb, var(--surface) 88%, transparent); box-shadow: 0 1px 0 var(--border); }
:is(html.light, body.light) .nav a:hover, :is(html.light, body.light) .mobile-menu a.link:hover { background: rgba(16,24,40,0.05); }
:is(html.light, body.light) .bg-grid { background-image: linear-gradient(rgba(0,0,0,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(0,0,0,0.04) 1px, transparent 1px); }
:is(html.light, body.light) .modal__backdrop { background: rgba(16,24,40,.45); }
:is(html.light, body.light) .btn--ghost, :is(html.light, body.light) .empty, :is(html.light, body.light) .mascot-missing { background: var(--surface); }
:is(html.light, body.light) .btn--ghost:hover { background: var(--surface-alt); }
:is(html.light, body.light) .item { box-shadow: 0 2px 10px rgba(16, 24, 40, 0.05); }
:is(html.light, body.light) .item__price { background: var(--surface-alt); }
/* Calm light look: no heavy glows, tinted (not solid) accents where possible */
:is(html.light, body.light) .btn--primary, :is(html.light, body.light) .tab__btn[aria-selected="true"], :is(html.light, body.light) .btn-pill, :is(html.light, body.light) .btn-buy { box-shadow: none; }
:is(html.light, body.light) .tab__btn:not([aria-selected="true"]) { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
:is(html.light, body.light) .tab__btn:not([aria-selected="true"]):hover { border-color: var(--primary); color: var(--primary); background: var(--surface); }
:is(html.light, body.light) .card, :is(html.light, body.light) .item, :is(html.light, body.light) .modal__card { background: var(--surface); }
:is(html.light, body.light) .item { box-shadow: none; }
:is(html.light, body.light) .item:hover { box-shadow: 0 6px 18px rgba(16, 24, 40, 0.06); }
:is(html.light, body.light) .category__head { background: color-mix(in srgb, var(--primary) 12%, var(--surface)); color: var(--primary); box-shadow: none; }
:is(html.light, body.light) .announcement { background: color-mix(in srgb, var(--primary) 9%, var(--surface)); color: var(--text); border-bottom: 1px solid var(--border); }
:is(html.light, body.light) .hero__badge { background: color-mix(in srgb, var(--primary) 8%, var(--surface)); border-color: color-mix(in srgb, var(--primary) 25%, transparent); }
:is(html.light, body.light) .steps li::before { background: color-mix(in srgb, var(--primary) 12%, var(--surface)); color: var(--primary); }
:is(html.light, body.light) .hero__art .mascot-missing, :is(html.light, body.light) .auth__form input, :is(html.light, body.light) .addr__code { background: var(--surface-alt); }
:is(html.light, body.light) .addr__qr, :is(html.light, body.light) .wallet__qr { background: #fff; } /* QR must stay white for scanners */
:is(html.light, body.light) .item__actions { border-color: var(--border-strong); }
:is(html.light, body.light) .btn-copy { color: var(--text); }
:is(html.light, body.light) .btn-copy:hover { background: var(--surface-alt); }
:is(html.light, body.light) .group__title .markers svg { fill: color-mix(in srgb, var(--success) 75%, #fff); }
:is(html.light, body.light) .brand__text { text-shadow: none; }
:is(html.light, body.light) .mascot__close:hover { background: rgba(16,24,40,.06); }
