:root {
  --bg: #0b0d1a;
  --surface: #151933;
  --surface-2: #1d2245;
  --line: #2a3060;
  --text: #eef0ff;
  --muted: #a3a8cc;
  --coral: #ff6b5e;
  --gold: #ffd27a;
  --paper: #f4f2ee;
  --radius: 14px;
  --display: 'Unbounded', system-ui, sans-serif;
  --body: 'Space Grotesk', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--body);
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }

/* Starfield */
.stars {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1px 1px at 12% 18%, #fff8, transparent),
    radial-gradient(1px 1px at 72% 12%, #fff9, transparent),
    radial-gradient(1.5px 1.5px at 38% 62%, #fff6, transparent),
    radial-gradient(1px 1px at 88% 48%, #fff7, transparent),
    radial-gradient(1px 1px at 22% 86%, #fff6, transparent),
    radial-gradient(1.5px 1.5px at 58% 34%, #ffd27a88, transparent),
    radial-gradient(1px 1px at 92% 82%, #fff6, transparent),
    radial-gradient(900px 500px at 85% -10%, #2a1f5c66, transparent),
    radial-gradient(700px 500px at -10% 110%, #5c1f3a44, transparent);
}

/* Header */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 1180px; width: 100%; margin: 0 auto; padding: 20px 20px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 50%; flex: none; position: relative;
  background: var(--coral);
  box-shadow: 0 0 24px #ff6b5e66;
}
.brand-mark::after {
  content: ''; position: absolute; left: -9px; right: -9px; top: 10px; height: 8px;
  border: 2px solid var(--gold); border-radius: 50%; transform: rotate(-20deg);
}
.brand-name { font: 800 19px/1 var(--display); letter-spacing: .02em; text-transform: uppercase; }
.brand-tld { color: var(--gold); text-transform: none; }
nav { display: flex; gap: 6px; }
nav a {
  text-decoration: none; padding: 8px 14px; border-radius: 999px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 8px;
}
nav a:hover, nav a[aria-current="page"] { background: var(--surface-2); }
.cart-count {
  background: var(--coral); color: #1a0b0a; font-weight: 700; font-size: 12px;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  display: inline-grid; place-items: center;
}
.cart-count[hidden] { display: none; }

.demo-banner {
  max-width: 1180px; margin: 0 auto 8px; padding: 10px 16px; width: calc(100% - 32px);
  background: #ffd27a1a; border: 1px solid #ffd27a55; color: var(--gold);
  border-radius: 10px; font-size: 14px;
}
.demo-banner[hidden] { display: none; }

main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px 64px; outline: none; }

/* Hero */
.hero { padding: 48px 0 40px; max-width: 760px; }
.hero h1 {
  font: 800 clamp(34px, 7vw, 64px)/1.02 var(--display);
  margin: 0 0 16px; letter-spacing: -.01em;
}
.hero h1 em { font-style: normal; color: var(--coral); }
.hero p { color: var(--muted); font-size: 18px; margin: 0; max-width: 560px; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.chip {
  border: 1px solid var(--line); background: transparent; border-radius: 999px;
  padding: 7px 14px; font-size: 14px;
}
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

/* Grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px; }
.card {
  text-decoration: none; background: var(--surface); border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--line);
  transition: transform .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-3px); border-color: #ff6b5e88; }
.card-img { aspect-ratio: 1; background: var(--paper); }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 14px 16px 16px; }
.card-title { font-weight: 700; margin: 0 0 4px; line-height: 1.3; }
.card-price { color: var(--muted); margin: 0; }

/* Product page */
.back { display: inline-block; margin: 8px 0 20px; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--text); }
.product { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 44px; align-items: start; }
.gallery-main { aspect-ratio: 1; background: var(--paper); border-radius: var(--radius); overflow: hidden; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.thumbs { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; padding-bottom: 4px; }
.thumbs button {
  flex: none; width: 70px; height: 70px; padding: 0; border-radius: 10px; overflow: hidden;
  border: 2px solid transparent; background: var(--paper);
}
.thumbs button[aria-current="true"] { border-color: var(--coral); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.product h1 { font: 800 clamp(24px, 4vw, 36px)/1.15 var(--display); margin: 0 0 10px; }
.price { font-size: 24px; font-weight: 700; color: var(--gold); margin: 0 0 24px; }
.opt { margin: 0 0 20px; }
.opt-label { font-weight: 700; margin: 0 0 8px; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.opt-label span { color: var(--text); text-transform: none; letter-spacing: 0; font-weight: 500; }
.values { display: flex; flex-wrap: wrap; gap: 8px; }
.val {
  min-width: 48px; padding: 9px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface);
}
.val[aria-pressed="true"] { border-color: var(--coral); box-shadow: inset 0 0 0 1px var(--coral); }
.val:disabled { opacity: .35; text-decoration: line-through; cursor: not-allowed; }
.swatch {
  width: 38px; height: 38px; min-width: 0; padding: 0; border-radius: 50%;
  border: 2px solid var(--line);
}
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--coral); border-color: transparent; }
.buy { display: flex; gap: 12px; align-items: stretch; margin: 28px 0 8px; }
.qty {
  display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
}
.qty button { background: none; border: 0; width: 40px; height: 100%; font-size: 18px; }
.qty output { min-width: 28px; text-align: center; font-weight: 700; }
.btn {
  border: 0; border-radius: 12px; padding: 14px 22px; font-weight: 700; font-size: 16px;
  background: var(--coral); color: #1a0b0a; text-decoration: none; text-align: center;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.btn.wide { flex: 1; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.added { color: var(--gold); min-height: 24px; margin: 0; font-size: 14px; }
.desc { color: var(--muted); border-top: 1px solid var(--line); margin-top: 22px; padding-top: 18px; }
.desc :is(p, ul) { margin: 0 0 12px; }

/* Cart */
.page-title { font: 800 clamp(26px, 5vw, 40px)/1.1 var(--display); margin: 24px 0 24px; }
.cart { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 36px; align-items: start; }
.lines { display: flex; flex-direction: column; gap: 14px; }
.line {
  display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; gap: 16px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px;
}
.line img { width: 88px; height: 88px; object-fit: cover; border-radius: 10px; background: var(--paper); }
.line-title { font-weight: 700; margin: 0; text-decoration: none; }
.line-variant { color: var(--muted); margin: 2px 0 8px; font-size: 14px; }
.line .qty { display: inline-flex; height: 36px; }
.line-right { text-align: right; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.remove { background: none; border: 0; color: var(--muted); font-size: 14px; text-decoration: underline; padding: 0; }
.summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; position: sticky; top: 20px; }
.summary-row { display: flex; justify-content: space-between; margin: 0 0 10px; }
.summary-row.total { font-size: 20px; font-weight: 700; }
.summary small { display: block; color: var(--muted); margin: 0 0 18px; }
.summary .btn { width: 100%; }
.error { color: var(--coral); font-size: 14px; margin: 12px 0 0; }

.empty, .thanks { text-align: center; padding: 72px 0; }
.empty p, .thanks p { color: var(--muted); margin: 0 auto 24px; max-width: 460px; }
.thanks .orbit { width: 72px; height: 72px; margin: 0 auto 20px; }
.loading { color: var(--muted); padding: 60px 0; text-align: center; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 28px 20px; text-align: center; color: var(--muted); font-size: 14px; }
.site-footer p { margin: 0 0 6px; }
.site-footer .fine { opacity: .7; }
.site-footer a { color: var(--gold); }

@media (max-width: 820px) {
  .product, .cart { grid-template-columns: 1fr; gap: 28px; }
  .summary { position: static; }
}
@media (max-width: 480px) {
  .site-header { padding: 16px; }
  main { padding: 0 16px 48px; }
  .brand-name { font-size: 16px; }
  nav a { padding: 8px 10px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card-body { padding: 10px 12px 12px; }
  .card-title { font-size: 14px; }
  .line { grid-template-columns: 64px minmax(0, 1fr); }
  .line img { width: 64px; height: 64px; }
  .line-right { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
}
