:root {
  --bg: #020617;
  --accent: #22c55e;
  --accent-blue: #38bdf8;
  --accent-soft: #4ade80;
  --text: #f9fafb;
  --muted: #9ca3af;
  --border-subtle: #1f2937;
}

body.light-theme { --bg: #f8fafc; --text: #0f172a; --muted: #475569; --border-subtle: #cbd5e1; background: #f8fafc; color-scheme: light; }
body.light-theme header { background: rgba(248,250,252,.9); }
body.light-theme footer { background: #e2e8f0; }
body.light-theme footer,
body.light-theme footer a,
body.light-theme .footer-commerce,
body.light-theme .footer-commerce strong { color: #0f172a; }
body.light-theme footer a:hover { color: #0369a1; }

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #020617 0, #020617 55%, #000 100%);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: var(--accent-soft); text-decoration: none; }

header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background:
    radial-gradient(circle at 18% -80%, rgba(34,197,94,.22), transparent 42%),
    radial-gradient(circle at 82% -90%, rgba(56,189,248,.2), transparent 44%),
    linear-gradient(115deg, rgba(15,23,42,.98), rgba(8,20,38,.9) 52%, rgba(15,23,42,.94));
  border-bottom: 1px solid rgba(56,189,248,.2);
  box-shadow: 0 10px 35px rgba(2,6,23,.22);
}

.nav {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  min-height: 82px;
  padding: .9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
}
.home-page header::after,
.creator-layout header::after {
  content: "";
  position: absolute;
  right: 8%;
  bottom: -1px;
  left: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(74,222,128,.8), rgba(56,189,248,.8), transparent);
  opacity: .8;
}
body.light-theme header {
  background:
    radial-gradient(circle at 16% -90%, rgba(34,197,94,.12), transparent 42%),
    radial-gradient(circle at 84% -90%, rgba(56,189,248,.14), transparent 44%),
    rgba(248,250,252,.94);
  border-bottom-color: rgba(14,116,144,.22);
  box-shadow: 0 10px 28px rgba(15,23,42,.08);
}

.logo { position: relative; display: flex; align-items: center; justify-content: center; width: 220px; height: 72px; flex: 0 0 220px; }
.logo-img, body.light-theme .logo-img { width: 220px; height: 72px; object-fit: contain; object-position: center; display: block; pointer-events: none; }
.nav-links { order: 1; display: contents; }
.nav-controls { order: 2; display: flex; align-items: center; gap: .5rem; margin-left: 1rem; flex: 0 0 auto; }
.nav-links > a { order: 1; margin-left: 1.4rem; color: var(--muted); font-size: .9rem; }
.nav-links > a:hover { color: var(--text); }
.nav-links a:hover { color: var(--text); }
.nav-links > a.current {
  position: relative;
  color: #f8fafc;
  border: 1px solid rgba(56,189,248,.65);
  border-radius: 999px;
  padding: .42rem .8rem;
  background: linear-gradient(135deg, rgba(34,197,94,.28), rgba(56,189,248,.24));
  box-shadow: 0 0 0 2px rgba(56,189,248,.1), 0 6px 18px rgba(2,6,23,.2);
  text-shadow: 0 1px 8px rgba(56,189,248,.35);
}
body.light-theme .nav-links > a.current {
  color: #0f172a;
  border-color: rgba(14,116,144,.45);
  background: linear-gradient(135deg, rgba(34,197,94,.18), rgba(56,189,248,.2));
  box-shadow: 0 0 0 2px rgba(14,116,144,.08), 0 6px 18px rgba(15,23,42,.12);
  text-shadow: none;
}
.home-page .nav-links > a,
.creator-layout .nav-links > a { transition: color .2s, background .2s, border-color .2s, transform .2s; }
.home-page .nav-links > a:hover,
.creator-layout .nav-links > a:hover { transform: translateY(-1px); }
.btn-primary { border: 0; padding: .55rem 1.1rem; border-radius: 999px; background: linear-gradient(135deg, var(--accent), var(--accent-blue)); color: #020617; font: inherit; font-weight: 600; cursor: pointer; box-shadow: 0 0 18px rgba(34,197,94,.35); transition: transform .2s, box-shadow .2s; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 0 24px rgba(34,197,94,.48); }
.btn-primary:disabled { opacity: .6; cursor: wait; transform: none; }
.nav-links .nav-action { margin-left: .2rem; padding: .45rem 1.1rem; border-radius: 999px; background: linear-gradient(135deg, var(--accent), var(--accent-blue)); color: #020617; font-weight: 600; box-shadow: 0 0 18px rgba(34,197,94,.35); }
.nav-links .nav-action { order: 3; }
.nav-cart { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem; color: var(--text) !important; }
.nav-cart svg { width: 1.35rem; height: 1.35rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-cart .cart-count { position: absolute; top: -0.1rem; right: -0.15rem; }
.theme-toggle { border: 1px solid var(--border-subtle); border-radius: 999px; padding: .35rem .55rem; background: transparent; color: var(--text); cursor: pointer; font-size: 1rem; }
.nav-menu-toggle { display: none; border: 1px solid var(--border-subtle); border-radius: .5rem; padding: .4rem .55rem; background: transparent; color: var(--text); cursor: pointer; font-size: 1.1rem; }
.nav-menu-toggle span { display: block; width: 1.15rem; height: 2px; margin: 3px 0; border-radius: 2px; background: currentColor; transition: transform .25s, opacity .25s; }
.nav-menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.nav-menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

main { max-width: 1120px; margin: 0 auto; padding: 2.4rem 1.5rem 4rem; }
footer { border-top: 1px solid var(--border-subtle); background: #020617; padding: 1.2rem 1.5rem 1.8rem; font-size: .8rem; color: var(--muted); }
footer .inner { max-width: 1120px; margin: 0 auto; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-links { text-align: center; margin-top: 1rem; }
.footer-links a { margin: 0 .7rem; }
.footer-commerce { display: none; max-width: 1120px; margin: 1rem auto 0; padding-top: 1rem; border-top: 1px solid var(--border-subtle); align-items: center; justify-content: center; gap: .8rem; flex-wrap: wrap; color: var(--muted); }
.commerce-page .footer-commerce { display: flex; }
.footer-commerce strong { color: var(--text); }
.footer-payment-badges { display: inline-flex; flex-wrap: wrap; gap: .4rem; }
.footer-payment-badges span { display:inline-flex; align-items:center; justify-content:center; min-width:3.5rem; min-height:2rem; padding: .25rem .55rem; border: 1px solid var(--border-subtle); border-radius: .35rem; background: #fff; }
.footer-payment-badges img { display:block; width:auto; height:1.25rem; max-width:4.8rem; }

@media (max-width: 640px) {
  header { backdrop-filter: none; }
  body.nav-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 15;
    background: rgba(2,6,23,.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
  body.light-theme.nav-open::before { background: rgba(248,250,252,.45); }
  .nav-links.mobile-open { z-index: 21; }
  .nav { min-height: 68px; padding: .55rem 1rem; }
  .logo { width: 150px; height: 52px; flex: 0 0 150px; justify-content: flex-start; }
  .logo-img, body.light-theme .logo-img { width: 150px; height: 52px; }
  .nav-controls { display: flex; align-items: center; gap: .35rem; margin-left: auto; }
  .nav-menu-toggle { display: block; padding: .45rem; }
  .nav-links { position: absolute; top: calc(100% + .5rem); right: 1rem; left: auto; width: min(250px, calc(100vw - 2rem)); display: grid; gap: .45rem; margin-left: 0; padding: 0; visibility: hidden; opacity: 0; transform: translateY(-.5rem); pointer-events: none; transition: opacity .25s, transform .25s, visibility .25s; }
  .nav-links.mobile-open { visibility: visible; opacity: 1; transform: translateY(0); pointer-events: auto; }
  .nav-links > a { order: initial; display: block; margin-left: 0; padding: .55rem .8rem; border: 1px solid var(--border-subtle); border-radius: 999px; background: #020617; box-shadow: 0 8px 20px rgba(0,0,0,.25); color: var(--text); opacity: 0; transform: translateY(-.45rem) scale(.96); }
  body.light-theme .nav-links > a { background: #f8fafc; }
  .nav > .nav-links > .nav-cart { position: fixed !important; top: .75rem; right: 5.4rem; display: inline-flex !important; width: 2.4rem; height: 2.4rem; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; opacity: 1; transform: none; z-index: 22; }
  .nav > .nav-links > .theme-toggle { position: fixed; top: .75rem; right: 3rem; z-index: 22; }
  .nav-links.mobile-open > a { animation: mobile-menu-pop .3s cubic-bezier(.2,.8,.2,1) forwards; }
  .nav-links.mobile-open > a:nth-child(1) { animation-delay: .03s; }
  .nav-links.mobile-open > a:nth-child(2) { animation-delay: .08s; }
  .nav-links.mobile-open > a:nth-child(3) { animation-delay: .13s; }
  .nav-links.mobile-open > a:nth-child(4) { animation-delay: .18s; }
  .nav-links.mobile-open > a:nth-child(5) { animation-delay: .23s; }
  .nav-links > a:hover { border-color: var(--accent-blue); color: var(--accent-blue); }
  .nav-links > a.current { border-color: var(--accent-blue); color: var(--accent-blue); box-shadow: 0 0 0 2px rgba(56,189,248,.12); }
  .nav-links .nav-action { margin: .35rem 0 0; padding: .55rem .8rem; text-align: center; }
  .theme-toggle { padding: .3rem .45rem; }
  main { padding: 1.5rem 1rem 3rem; }
  h1 { overflow-wrap: anywhere; }
  .btn-primary, .btn-ghost { min-height: 2.75rem; }
  footer .inner { align-items: flex-start; flex-direction: column; }
  .footer-links { display: flex; flex-wrap: wrap; gap: .5rem 1rem; justify-content: flex-start; text-align: left; }
  .footer-links a { margin: 0; }
}

@keyframes mobile-menu-pop {
  from { opacity: 0; transform: translateY(-.45rem) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
