:root {
  --bg: #0d0d0d;
  --surface: #161616;
  --surface-2: #1f1f1f;
  --line: #2a2a2a;
  --text: #f2f0ea;
  --muted: #9a978f;
  --accent: #c8ff00;
  --accent-ink: #0d0d0d;
  --thumb: #e4e1d9;
  --radius: 14px;
  --display: 'Anton', Impact, sans-serif;
  --body: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--display); font-size: 28px; letter-spacing: .5px; }
.brand span { color: var(--accent); margin-left: 6px; }
.nav { display: flex; align-items: center; gap: 22px; font-weight: 700; font-size: 14px; }
.nav a { color: var(--muted); transition: color .15s; }
.nav a:hover { color: var(--text); }
.nav .nav-cta { background: var(--text); color: var(--bg); border-radius: 999px; padding: 8px 16px; }
.nav .nav-cta:hover { color: var(--bg); filter: brightness(.92); }

/* ---------- marquee ---------- */
.marquee { background: var(--accent); color: var(--accent-ink); overflow: hidden; white-space: nowrap; }
.marquee-track { display: inline-flex; animation: scroll 28s linear infinite; }
.marquee span {
  font-family: var(--display); text-transform: uppercase; font-size: 15px;
  letter-spacing: 1px; padding: 7px 22px;
}
.marquee span::after { content: '✦'; margin-left: 44px; font-family: var(--body); }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ---------- layout ---------- */
.shop { flex: 1; display: grid; grid-template-columns: 1fr minmax(380px, 520px); align-items: start; }

.stage {
  position: sticky; top: 0; height: calc(100vh - 0px); min-height: 560px; overflow: hidden;
  background: radial-gradient(60% 55% at 50% 58%, #262626 0%, #121212 70%, #0d0d0d 100%);
}
.stage-bg {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  font-family: var(--display); font-size: clamp(90px, 15vw, 240px); line-height: .86;
  color: transparent; -webkit-text-stroke: 1.5px rgba(242, 240, 234, .07);
  pointer-events: none; user-select: none;
}
.viewer { position: absolute; inset: 0; }
.viewer canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.stage-label { position: absolute; top: 22px; left: 26px; right: 150px; display: flex; flex-direction: column; pointer-events: none; }
.stage-label .kicker { color: var(--accent); font-weight: 800; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; }
.stage-label .title { font-family: var(--display); font-size: 34px; line-height: 1.05; text-transform: uppercase; }
.spin-btn {
  position: absolute; top: 24px; right: 22px;
  border: 1px solid var(--line); background: rgba(0,0,0,.55); backdrop-filter: blur(6px);
  border-radius: 999px; padding: 9px 16px; font-weight: 800; font-size: 13px;
}
.spin-btn:hover { background: var(--text); color: var(--bg); }
.stage-bar {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  pointer-events: none;
}
.stage-bar > * { pointer-events: auto; }
.stage-hint {
  background: rgba(0,0,0,.55); backdrop-filter: blur(6px);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 16px; font-size: 13px; color: var(--muted); pointer-events: none; white-space: nowrap;
}
.stage-buy { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.tip {
  position: absolute; pointer-events: none; transform: translate(14px, -50%);
  background: var(--accent); color: var(--accent-ink);
  font-weight: 800; font-size: 12px; padding: 5px 10px; border-radius: 999px; white-space: nowrap;
}
.loading {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--muted); font-weight: 600; transition: opacity .4s;
}
.loading.done { opacity: 0; pointer-events: none; }

/* ---------- buy buttons ---------- */
.buy {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 12px; padding: 12px 18px;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--display); font-size: 17px; text-transform: uppercase; letter-spacing: .5px;
  white-space: nowrap; transition: transform .12s, filter .12s;
}
.buy:hover { filter: brightness(1.08); }
.buy:active { transform: scale(.97); }
.buy:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; filter: none; transform: none; }
.buy.small { padding: 9px 12px; font-size: 14px; border-radius: 10px; }

/* ---------- panel ---------- */
.panel {
  border-left: 1px solid var(--line);
  padding: 28px 26px 40px;
  display: flex; flex-direction: column; gap: 6px;
}
.panel h1 { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: 44px; margin: 0; line-height: 1; }
.sub { margin: 4px 0 10px; color: var(--muted); font-size: 14px; }

.drop { margin-top: 18px; }
.drop h2 {
  margin: 0 0 12px; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; gap: 10px;
}
.drop h2::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }

.card {
  background: var(--surface); border: 1.5px solid transparent; border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: border-color .15s, transform .15s;
}
.card:hover { transform: translateY(-2px); }
.card.is-worn { border-color: var(--accent); }
.photo { position: relative; background: var(--thumb); aspect-ratio: 1 / 1.05; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .open { all: unset; position: absolute; inset: 0; cursor: zoom-in; }
.photo .open:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.meta .name { all: unset; cursor: pointer; }
.meta .name:hover { text-decoration: underline; }
.meta .name:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.badges { position: absolute; top: 8px; left: 8px; display: flex; gap: 6px; pointer-events: none; }
.badge {
  background: var(--accent); color: var(--accent-ink);
  font-size: 10px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
  padding: 4px 8px; border-radius: 999px;
}
.badge.limited { background: #ff3b30; color: #fff; }
.flip {
  position: absolute; bottom: 8px; right: 8px;
  border: 0; background: rgba(13,13,13,.78); color: var(--text);
  font-size: 11px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase;
  padding: 5px 9px; border-radius: 999px;
}
.meta { padding: 12px 12px 4px; display: flex; flex-direction: column; gap: 4px; }
.meta h3 { margin: 0; font-size: 15px; font-weight: 800; line-height: 1.25; }
.meta .line2 { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.meta .line2 b { color: var(--text); }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); border: 1px solid rgba(255,255,255,.25); flex: none; }
.meta p { margin: 2px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.card-foot { display: flex; gap: 8px; padding: 10px 12px 12px; margin-top: auto; }
.card-foot > * { flex: 1; }
.card-foot > * { flex: 1; }
.tryon {
  border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px;
  padding: 9px 6px; font-size: 13px; font-weight: 800; white-space: nowrap;
}
.tryon:hover { background: var(--text); color: var(--bg); }
.tryon[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: transparent; }

/* ---------- product popup ---------- */
body.pd-open { overflow: hidden; }
.pd { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 28px; }
.pd[hidden], .pd-nav[hidden], .badge[hidden] { display: none; }
.pd-scrim { position: absolute; inset: 0; background: rgba(0,0,0,.72); opacity: 0; transition: opacity .2s; }
.pd-box {
  position: relative; width: min(1120px, 100%); max-height: calc(100vh - 56px);
  background: var(--bg); border: 1px solid var(--line); border-radius: 20px; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, 1fr);
  opacity: 0; transform: translateY(14px) scale(.98); transition: opacity .2s, transform .2s;
}
.pd.in .pd-scrim { opacity: 1; }
.pd.in .pd-box { opacity: 1; transform: none; }
.pd-close {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  width: 38px; height: 38px; border-radius: 50%; border: 0;
  background: rgba(13,13,13,.8); color: var(--text); font-size: 16px;
}
.pd-close:hover { background: var(--text); color: var(--bg); }
.pd-gallery { position: relative; display: flex; flex-direction: column; min-height: 0; background: var(--surface); }
.pd-main {
  position: relative; overflow: hidden; aspect-ratio: 1 / 1; max-height: calc(100vh - 160px);
  background: var(--thumb); cursor: zoom-in; touch-action: pan-y; user-select: none;
}
.pd-main.design { background: var(--swatch, #222); }
.pd-main img {
  width: 100%; height: 100%; object-fit: contain; display: block;
  transition: transform .25s ease; -webkit-user-drag: none;
}
.pd-main.photo img { object-fit: cover; }
.pd-main.design img { padding: 9%; }
.pd-main.zoomed { cursor: zoom-out; touch-action: none; }
.pd-main.zoomed img { transform: scale(2.4); }
.pd-label {
  position: absolute; left: 14px; top: 14px; pointer-events: none;
  background: rgba(13,13,13,.78); color: var(--text); border-radius: 999px;
  font-size: 12px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; padding: 6px 11px;
}
.pd-zoomhint {
  position: absolute; right: 14px; bottom: 14px; pointer-events: none;
  background: rgba(13,13,13,.6); color: var(--text); border-radius: 999px; font-size: 12px; font-weight: 700; padding: 5px 10px;
  transition: opacity .2s;
}
.pd-main.zoomed .pd-zoomhint { opacity: 0; }
.pd-nav {
  position: absolute; top: calc(50% - 60px); z-index: 2;
  width: 42px; height: 42px; border-radius: 50%; border: 0;
  background: rgba(13,13,13,.75); color: var(--text); font-size: 26px; line-height: 1;
}
.pd-nav:hover { background: var(--text); color: var(--bg); }
.pd-nav.prev { left: 12px; }
.pd-nav.next { right: 12px; }
.pd-thumbs { display: flex; gap: 8px; padding: 12px; overflow-x: auto; scrollbar-width: thin; }
.pd-thumb {
  flex: none; width: 76px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden;
  background: var(--thumb); display: flex; flex-direction: column;
}
.pd-thumb.design { background: var(--swatch, #222); }
.pd-thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.pd-thumb.design img { object-fit: contain; padding: 8px; }
.pd-thumb span {
  font-size: 10px; font-weight: 800; letter-spacing: .3px; text-transform: uppercase; padding: 4px 2px;
  background: var(--surface-2); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pd-thumb[aria-current="true"] { border-color: var(--accent); }
.pd-thumb[aria-current="true"] span { color: var(--text); }
.pd-info { padding: 34px 30px 28px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.pd-info .badge { align-self: flex-start; }
.pd-info h2 { margin: 0; font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: 40px; line-height: 1.02; padding-right: 40px; }
.pd-price { font-family: var(--display); font-size: 28px; }
.pd-info .line2 { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.pd-desc { margin: 4px 0 8px; color: var(--muted); font-size: 15px; line-height: 1.55; }
.pd-actions { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.pd-actions .buy { padding: 15px; font-size: 19px; }
.tryon.big { padding: 13px; font-size: 15px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: calc(24px + env(safe-area-inset-bottom)); left: 50%; transform: translate(-50%, 20px);
  background: var(--text); color: var(--bg); font-weight: 700; font-size: 14px;
  padding: 11px 18px; border-radius: 999px; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 30; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- small screens (most fans: Instagram's in-app browser) ---------- */
@media (max-width: 900px) {
  .shop { grid-template-columns: 1fr; }
  .stage { position: relative; height: 68svh; min-height: 430px; }
  .panel { border-left: 0; border-top: 1px solid var(--line); padding: 22px 16px 40px; }
  .panel h1 { font-size: 36px; }
  .topbar { padding: 12px 16px; }
  .brand { font-size: 24px; }
  .nav a:not(.nav-cta) { display: none; }
  .stage-label { top: 16px; left: 16px; right: 120px; }
  .stage-label .title { font-size: 26px; }
  .spin-btn { top: 16px; right: 14px; }
  .stage-bar { padding: 12px 14px; }
  .stage-hint { display: none; }
  .stage-buy { width: 100%; }
  .stage-buy .buy { flex: 1; }
}
@media (max-width: 900px) {
  .pd { padding: 0; place-items: end stretch; }
  .pd-box {
    grid-template-columns: 1fr; width: 100%; max-height: 100%; height: 100%;
    border-radius: 0; border: 0; overflow-y: auto; transform: translateY(30px);
  }
  .pd-main { max-height: none; }
  .pd-nav { top: calc(50vw - 21px); }
  .pd-info { padding: 18px 16px calc(24px + env(safe-area-inset-bottom)); overflow: visible; }
  .pd-info h2 { font-size: 32px; padding-right: 0; }
  .pd-actions { margin-top: 6px; }
}
@media (max-width: 520px) {
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .meta { padding: 10px 10px 2px; }
  .meta h3 { font-size: 14px; }
  .meta p { font-size: 12px; }
  .card-foot { flex-direction: column; padding: 8px 10px 10px; gap: 6px; }
  .tryon { font-size: 12px; padding: 8px 4px; }
}
