/* AAA Only. Mobile-first. Anything that must sit above the WebGL canvas gets z-index 3
   and must not live inside an ancestor that creates a stacking context. */
:root {
  --bg: #07070a; --ink: #f5f4ef; --mute: #9b9ba6; --line: rgba(255,255,255,.11);
  --brand: #ffd23f; --r: 8px; --ease: cubic-bezier(.2,.8,.2,1);
  --pad: 18px;
  color-scheme: dark;
}
@media (min-width: 760px) { :root { --pad: clamp(28px, 5vw, 72px); } }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.5; -webkit-font-smoothing: antialiased;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a { color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

/* ---------- canvas + progress ---------- */
#gl { position: fixed; top: 0; left: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .9s var(--ease); }
.gl-ready #gl { opacity: 1; }
.progress { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 60; }
.progress i { display: block; height: 100%; background: var(--brand); transform: scaleX(0); transform-origin: 0 50%; }

/* ---------- nav ---------- */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 40; display: flex; justify-content: space-between; align-items: center;
  padding: 14px var(--pad); transition: background .3s, border-color .3s; border-bottom: 1px solid transparent; }
.nav.stuck { background: rgba(7,7,10,.72); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); border-color: var(--line); }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; text-decoration: none; font-size: 1.1rem; }
.mark { position: relative; width: 12px; height: 22px; border-radius: 3px; background: var(--brand); box-shadow: 0 0 18px rgba(255,210,63,.45); }
.mark::before { content: ""; position: absolute; left: 3px; top: -3px; width: 6px; height: 3px; border-radius: 1px 1px 0 0; background: #cfd3d8; }
.links { display: flex; align-items: center; gap: 22px; font-size: .92rem; color: var(--mute); }
.links > a { display: none; text-decoration: none; transition: color .2s; }
.links > a:hover { color: var(--ink); }
@media (min-width: 640px) { .links > a { display: inline; } }
#cartbtn { background: none; border: 1px solid rgba(255,255,255,.28); border-radius: var(--r); padding: 8px 14px; font-weight: 600; font-size: .9rem; cursor: pointer; color: var(--ink); transition: background .2s, color .2s; }
#cartbtn:hover { background: var(--ink); color: var(--bg); }
#cartbtn span { display: inline-block; min-width: 1.2em; text-align: center; margin-left: 4px; padding: 0 5px; border-radius: 4px; background: var(--brand); color: #111; font-size: .8rem; }
#cartbtn.bump span { animation: bump .5s var(--ease); }
@keyframes bump { 30% { transform: scale(1.5); } }

/* ---------- buttons ---------- */
.btn { display: inline-block; padding: 13px 22px; border-radius: var(--r); font-weight: 700; font-size: .95rem; text-decoration: none; border: 1px solid rgba(255,255,255,.3); cursor: pointer; transition: transform .2s var(--ease), background .2s, color .2s; }
.btn:hover { transform: translateY(-2px); background: rgba(255,255,255,.08); }
.btn.fill { background: var(--brand); border-color: var(--brand); color: #111; }
.btn.fill:hover { background: #ffe07a; }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100svh; display: flex; flex-direction: column; justify-content: space-between;
  padding: 92px var(--pad) 28px; overflow: hidden;
  background: radial-gradient(55% 45% at 58% 52%, rgba(255,210,63,.13), transparent 70%); }
.ghost { position: absolute; inset: 0; display: grid; place-items: center; z-index: 0; user-select: none;
  font-size: clamp(11rem, 46vw, 56rem); font-weight: 900; letter-spacing: -.07em; line-height: 1; transform: translate(6%, 6%);
  color: transparent; -webkit-text-stroke: 1.5px rgba(255,255,255,.075); }
.hero-copy, .hero-foot, .cue { position: relative; z-index: 3; }
.eyebrow { font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; color: var(--mute); margin-bottom: 14px; }
.hero h1 { font-size: clamp(2.9rem, 9.2vw, 7.6rem); line-height: .92; letter-spacing: -.055em; font-weight: 800; }
.hero-foot { display: flex; flex-direction: column; gap: 20px; max-width: 30rem; margin-top: 52vh; }
.hero-foot p { color: #c4c4cc; font-size: 1.05rem; }
.btns { display: flex; gap: 10px; flex-wrap: wrap; }
.cue { display: none; }
@media (min-width: 900px) {
  .hero h1 br { display: none; }
  .hero-foot { flex-direction: row; align-items: flex-end; justify-content: space-between; max-width: none; margin-top: 0; gap: 40px; }
  .hero-foot p { max-width: 24rem; }
  .cue { display: flex; align-items: center; gap: 10px; position: absolute; right: var(--pad); bottom: 100px; writing-mode: vertical-rl; font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--mute); }
  .cue i { width: 1px; height: 54px; background: linear-gradient(var(--mute), transparent); animation: cue 2s ease-in-out infinite; transform-origin: top; }
}
@keyframes cue { 0% { transform: scaleY(0); } 60% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }
.hero-copy > *, .hero-foot > * { animation: rise .9s var(--ease) both; }
.hero-copy h1 { animation-delay: .1s; }
.hero-foot > :nth-child(1) { animation-delay: .35s; }
.hero-foot > :nth-child(2) { animation-delay: .45s; }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } }

/* ---------- marquee ---------- */
.marquee { position: relative; z-index: 1; overflow: hidden; border-block: 1px solid var(--line); background: var(--bg); }
.track { display: flex; width: max-content; animation: slide 38s linear infinite; }
.track span { padding: 16px 0; font-size: .8rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--mute); white-space: nowrap; }
.track span::after { content: "\2022"; margin: 0 28px; color: var(--brand); }
@keyframes slide { to { transform: translateX(-50%); } }

/* ---------- anatomy (pinned, scroll-driven) ---------- */
.ana { position: relative; height: 480svh; }
/* sticky makes a stacking context; z-index 3 keeps captions and callout lines above the canvas */
.ana-stage { position: sticky; top: 0; z-index: 3; height: 100svh; overflow: hidden;
  background: radial-gradient(40% 50% at 50% 48%, rgba(255,210,63,.1), transparent 70%); }
.ana-eyebrow { position: absolute; z-index: 3; top: 88px; left: var(--pad); font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; color: var(--mute); }
.lines { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; }
.lines path { stroke: rgba(255,255,255,.5); stroke-width: 1; fill: none; }
.lines circle { fill: var(--brand); }
.caps { position: absolute; z-index: 3; left: var(--pad); right: var(--pad); bottom: 6svh; min-height: 8.5rem; }
.cap { position: absolute; inset: auto 0 0 0; opacity: 0; transform: translateY(18px); transition: opacity .5s var(--ease), transform .5s var(--ease); pointer-events: none; }
.cap.on { opacity: 1; transform: none; }
.cap h2 { font-size: clamp(1.7rem, 4.4vw, 3rem); line-height: 1; letter-spacing: -.045em; font-weight: 800; }
.cap p { margin-top: 10px; color: #c4c4cc; max-width: 26rem; }
.callout { display: none; position: absolute; z-index: 3; width: 250px; opacity: 0; transform: translateY(-50%); }
.callout h4 { font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); margin-bottom: 4px; }
.callout p { font-size: .9rem; color: #c4c4cc; line-height: 1.4; }
@media (min-width: 900px) {
  .callout { display: block; }
  .callout[data-side="left"] { left: clamp(24px, 6vw, 96px); text-align: right; }
  .callout[data-side="right"] { right: clamp(24px, 6vw, 96px); }
  .caps { max-width: 44rem; }
}

/* ---------- shop ---------- */
.shop { position: relative; z-index: 1; padding: 96px var(--pad) 40px; }
.head { max-width: 40rem; margin-bottom: 36px; }
.head h2, .why h2 { font-size: clamp(2.2rem, 6vw, 4.4rem); line-height: .95; letter-spacing: -.05em; font-weight: 800; }
.head p { margin-top: 14px; color: var(--mute); }
.grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, 1fr); gap: 16px; } }

.card { position: relative; border: 1px solid var(--line); border-radius: var(--r); background: rgba(255,255,255,.025); padding: 10px; overflow: hidden;
  transition: border-color .3s, transform .5s var(--ease), opacity .7s var(--ease); }
.card::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%); }
.card:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.card:hover::before { opacity: 1; }
@media (min-width: 1000px) { .card:nth-child(4n+2), .card:nth-child(4n+4) { margin-top: 28px; } }  /* uneven rhythm */

.stage { position: relative; height: 290px; border-radius: 4px; cursor: grab; touch-action: pan-y; user-select: none;
  background: radial-gradient(60% 55% at 50% 56%, color-mix(in srgb, var(--accent) 34%, transparent), transparent 72%), rgba(0,0,0,.38); }
.stage.grab { cursor: grabbing; }
.badge { position: absolute; z-index: 3; top: 10px; left: 10px; font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 4px 8px; border-radius: 3px; background: var(--accent); color: #111; }
.hint { position: absolute; z-index: 3; bottom: 10px; left: 0; right: 0; text-align: center; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); transition: opacity .3s; }
.stage:hover .hint, .stage.grab .hint { opacity: 0; }
.info { padding: 16px 8px 10px; }
.info h3 { font-size: 1.1rem; letter-spacing: -.02em; }
.info p { margin: 4px 0 18px; color: var(--mute); font-size: .9rem; min-height: 2.7em; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.price { font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; }
.price small { color: var(--mute); font-weight: 500; font-size: .72rem; letter-spacing: 0; }
.add { border: 0; border-radius: var(--r); padding: 10px 14px; font-weight: 700; font-size: .85rem; cursor: pointer; background: var(--accent); color: #111; transition: transform .15s var(--ease), filter .2s; }
.add:hover { filter: brightness(1.12); }
.add:active { transform: scale(.95); }

/* static fallback when WebGL is unavailable */
.fb { display: none; position: absolute; inset: 0; align-items: center; justify-content: center; gap: 10px; }
.fb i { width: 34px; height: 120px; border-radius: 7px; box-shadow: 0 12px 18px rgba(0,0,0,.4), inset 0 0 0 1px rgba(255,255,255,.12); }
.fb i:nth-child(1) { transform: rotate(-8deg); } .fb i:nth-child(3) { transform: rotate(8deg); }
.no-webgl .fb { display: flex; }

/* ---------- why ---------- */
.why { position: relative; z-index: 1; padding: 110px var(--pad) 70px; display: grid; gap: 40px; }
.why dl { margin: 0; border-top: 1px solid var(--line); }
.why dl > div { display: grid; grid-template-columns: 3.2rem 1fr; gap: 12px; padding: 24px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.why dt { font-size: .8rem; letter-spacing: .12em; color: var(--brand); font-weight: 700; }
.why dd { margin: 0; font-size: clamp(1.15rem, 3vw, 1.7rem); letter-spacing: -.02em; color: var(--mute); line-height: 1.25; }
.why dd b { color: var(--ink); }
@media (min-width: 900px) { .why { grid-template-columns: 1fr 1.5fr; gap: 80px; padding-top: 150px; } .why h2 { position: sticky; top: 110px; align-self: start; } }

/* ---------- finale ---------- */
.finale { position: relative; z-index: 1; display: grid; gap: 0; padding: 40px var(--pad) 0; border-top: 1px solid var(--line);
  background: radial-gradient(50% 60% at 50% 62%, rgba(255,150,60,.13), transparent 70%); }
.finale-copy { padding-top: 40px; }
.finale-copy h2 { font-size: clamp(2.6rem, 7vw, 5.6rem); line-height: .94; letter-spacing: -.055em; font-weight: 800; margin-bottom: 26px; text-wrap: balance; max-width: 11em; }
.finale-view { height: 420px; }
@media (min-width: 900px) { .finale { grid-template-columns: 1.1fr 1fr; align-items: center; } .finale-copy { padding: 90px 0; } .finale-view { height: 560px; } }

footer { position: relative; z-index: 1; border-top: 1px solid var(--line); }
footer div { padding: 26px var(--pad); color: var(--mute); font-size: .9rem; }

/* ---------- cart drawer ---------- */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.55); opacity: 0; pointer-events: none; transition: opacity .3s; }
.scrim.open { opacity: 1; pointer-events: auto; }
#drawer { position: fixed; inset: 0 0 0 auto; width: min(400px, 100%); z-index: 55; background: #101015; border-left: 1px solid var(--line);
  padding: 22px; display: flex; flex-direction: column; gap: 16px; transform: translateX(102%); transition: transform .4s var(--ease); }
#drawer.open { transform: none; }
#drawer h2 { display: flex; justify-content: space-between; align-items: center; font-size: 1.3rem; letter-spacing: -.02em; }
#close { background: none; border: 0; font-size: 1.7rem; line-height: 1; cursor: pointer; color: var(--mute); }
#close:hover { color: var(--ink); }
#lines { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.empty { color: var(--mute); padding: 30px 0; }
.line { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: rgba(255,255,255,.03); }
.line .dot { flex: none; width: 14px; height: 30px; border-radius: 3px; }
.line .nm { flex: 1; font-weight: 600; font-size: .95rem; }
.line .nm small { display: block; color: var(--mute); font-weight: 400; font-size: .75rem; }
.line .q { display: flex; align-items: center; gap: 8px; }
.line .q button { width: 28px; height: 28px; border-radius: 4px; border: 1px solid rgba(255,255,255,.25); background: none; cursor: pointer; }
.line .q button:hover { background: var(--ink); color: var(--bg); }
.total { display: flex; justify-content: space-between; font-size: 1.2rem; font-weight: 800; padding-top: 6px; border-top: 1px solid var(--line); }
.pay { background: var(--brand); color: #111; border: 0; border-radius: var(--r); padding: 15px; font-weight: 800; font-size: 1rem; cursor: pointer; }
.pay:hover:not(:disabled) { background: #ffe07a; }
.pay:disabled { opacity: .3; cursor: not-allowed; }

/* ---------- reveal ---------- */
.rv { opacity: 0; transform: translateY(28px); }
.rv.in { opacity: 1; transform: none; transition-delay: calc(var(--i, 0) * 70ms); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .track, .cue i, .hero-copy > *, .hero-foot > * { animation: none; }
  .rv { opacity: 1; transform: none; }
}
