:root {
  --bg: #0a0a0f; --card: #15151f; --card2: #1c1c2b; --line: #272738;
  --txt: #eceaf4; --dim: #9a97ad;
  --gold: #fbbf24; --cyan: #22d3ee; --pink: #f472b6; --green: #34d399; --red: #ef4444;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* the attribute must beat author display rules */
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--txt);
  font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  line-height: 1.5;
}
h2 { font-size: 1.6rem; margin: 0 0 .3rem; }
section { padding: 3rem 1.2rem; max-width: 1100px; margin: 0 auto; }
.dim { color: var(--dim); }
.small { font-size: .85rem; }

/* ticker */
.ticker { overflow: hidden; background: var(--gold); color: #111; font-weight: 700; font-size: .8rem; }
.ticker__track { display: inline-block; white-space: nowrap; padding: 6px 0; animation: marquee 60s linear infinite; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-66.66%); } }

/* header */
.top { display: flex; align-items: center; gap: 1.2rem; padding: .9rem 1.2rem; max-width: 1100px; margin: 0 auto; flex-wrap: wrap; }
.logo { font-weight: 700; font-size: 1.25rem; letter-spacing: .06em; }
.logo span { color: var(--gold); }
.top nav { display: flex; gap: 1rem; flex: 1; flex-wrap: wrap; }
.top nav a { color: var(--dim); text-decoration: none; font-size: .92rem; }
.top nav a:hover { color: var(--txt); }
.creds { color: var(--green); font-weight: 700; font-size: .9rem; }

/* hero */
.hero { text-align: center; padding-top: 4rem; }
.hero h1 { font-size: clamp(2.6rem, 7vw, 5rem); margin: 0 0 1rem; letter-spacing: -0.02em; }
.hero em { font-style: normal; color: var(--gold); text-shadow: 0 0 30px rgba(251, 191, 36, .45); }
.hero .tag { max-width: 620px; margin: 0 auto 1.6rem; color: var(--dim); font-size: 1.08rem; }
.cta { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1rem; }
.fineprint { color: var(--dim); font-size: .85rem; }

.btn {
  display: inline-block; padding: .7rem 1.4rem; border-radius: 999px; cursor: pointer;
  border: 2px solid var(--line); background: var(--card); color: var(--txt);
  font: inherit; font-weight: 700; text-decoration: none; transition: transform .12s, border-color .12s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--dim); }
.btn--primary { background: var(--gold); border-color: var(--gold); color: #111; }
.btn--small { padding: .4rem .9rem; font-size: .85rem; }

/* scan layout */
.scan { display: grid; grid-template-columns: 1.25fr .75fr; gap: 1.4rem; align-items: start; }
.cam-wrap { position: relative; border-radius: 18px; overflow: hidden; background: #000; border: 1px solid var(--line); aspect-ratio: 16 / 10; }
.cam-wrap video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.cam-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; transform: scaleX(-1); pointer-events: none; }
.cam-msg { position: absolute; inset: 0; display: flex; flex-direction: column; gap: .8rem; align-items: center; justify-content: center; text-align: center; padding: 1.4rem; background: rgba(10, 10, 15, .82); }
.cam-msg p { max-width: 420px; margin: 0; }
.demo-banner { position: absolute; top: 10px; left: 10px; background: var(--pink); color: #111; font-weight: 700; font-size: .78rem; padding: .3rem .7rem; border-radius: 999px; }
.demo-art { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; pointer-events: none; }
.demo-art svg { height: 74%; filter: drop-shadow(0 10px 30px rgba(251, 191, 36, .18)); }
.demo-art .demo-label { font-size: .8rem; font-weight: 700; letter-spacing: .08em; color: var(--gold); text-transform: uppercase; text-align: center; padding: 0 1rem; }
.stamp {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-12deg) scale(0);
  font-size: clamp(1.4rem, 4vw, 2.6rem); font-weight: 700; letter-spacing: .1em; color: var(--green);
  border: 6px solid var(--green); border-radius: 12px; padding: .5rem 1.2rem; background: rgba(10, 10, 15, .75);
  pointer-events: none; white-space: nowrap;
}
.stamp.show { animation: stampIn .35s cubic-bezier(.2, 2.2, .4, 1) forwards; }
@keyframes stampIn { to { transform: translate(-50%, -50%) rotate(-12deg) scale(1); } }
.scan-side h2 { font-size: 1.05rem; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); margin-top: 1.2rem; }
.scan-side h2:first-child { margin-top: 0; }
.detect-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1rem; min-height: 140px; }
.detect-hand { font-size: 2.6rem; display: block; }
.detect-name { font-size: 1.3rem; font-weight: 700; }
.detect-gang { color: var(--gold); font-size: .92rem; }
.detect-sus { color: var(--dim); font-size: .85rem; margin-bottom: .6rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { font-size: 1.1rem; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: .25rem .55rem; filter: grayscale(1); opacity: .45; }
.chip--on { filter: none; opacity: 1; border-color: var(--green); box-shadow: 0 0 10px rgba(52, 211, 153, .35); }
#streetName { width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 10px; color: var(--txt); font: inherit; padding: .6rem .8rem; }

/* catalog */
.section-sub { color: var(--dim); margin-top: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 1rem; }
.card {
  position: relative; text-align: left; background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 1rem; cursor: pointer; color: var(--txt); font: inherit;
  transition: transform .14s, border-color .14s;
}
.card:hover { transform: translateY(-4px); border-color: var(--gold); }
.card--earned { border-color: var(--green); }
.card__hand { display: flex; justify-content: center; }
.card__hand svg { width: 108px; height: 126px; }
.card__stamp {
  position: absolute; top: 10px; right: 10px; color: var(--green); border: 2px solid var(--green);
  font-size: .62rem; font-weight: 700; padding: .15rem .4rem; border-radius: 6px; transform: rotate(8deg);
}
.card__name { font-weight: 700; font-size: 1.05rem; margin-top: .4rem; }
.card__gang { color: var(--gold); font-size: .85rem; }
.card__meta { display: flex; justify-content: space-between; margin-top: .4rem; font-size: .85rem; }
.stars { color: var(--gold); }
.sus { color: var(--dim); }

/* practice */
.practice { background: var(--card); border: 1px solid var(--line); border-radius: 20px; }
.practice-head { display: flex; justify-content: space-between; gap: 1rem; align-items: start; }
.practice-head h2 { margin-bottom: .1rem; }
.lore { color: var(--dim); font-style: italic; max-width: 640px; }
.practice-body { display: grid; grid-template-columns: 1.2fr .8fr; gap: 1.4rem; }
.steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
.step { margin: 0; background: var(--card2); border: 1px solid var(--line); border-radius: 14px; padding: .8rem; }
.step__art svg { width: 100%; height: auto; }
.step figcaption { font-size: .88rem; margin-top: .5rem; color: var(--txt); }
.practice-live ul { list-style: none; padding: 0; margin: 0 0 1rem; }
.practice-live li { padding: .45rem .6rem; border-radius: 8px; margin-bottom: .35rem; font-size: .95rem; background: var(--card2); border: 1px solid var(--line); }
.practice-live li.pass { color: var(--green); border-color: var(--green); }
.practice-live li.fail { color: var(--dim); }
.holdbar { position: relative; height: 38px; background: var(--card2); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
#holdFill { position: absolute; inset: 0; width: 0%; background: linear-gradient(90deg, var(--green), var(--cyan)); transition: width .12s; }
#holdText { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem; text-shadow: 0 1px 2px rgba(0,0,0,.6); }

/* lectures */
.grid--lectures { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.lecture { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: .9rem; }
.lecture iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 10px; }
.lecture p { font-size: .9rem; margin-bottom: 0; }

/* faq + footer */
#faq details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.2rem; margin-bottom: .7rem; }
#faq summary { cursor: pointer; font-weight: 700; }
#faq p { color: var(--dim); }
footer { text-align: center; padding: 2.5rem 1rem 3rem; color: var(--dim); font-size: .9rem; }
footer p { margin: .3rem 0; }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 99; }

@media (max-width: 900px) {
  .scan, .practice-body { grid-template-columns: 1fr; }
  .top nav { order: 3; width: 100%; }
}
