@font-face { font-family: Anton; src: url(fonts/Anton.ttf) format('truetype'); font-display: swap; }
@font-face { font-family: Archivo; src: url(fonts/ArchivoBlack.ttf) format('truetype'); font-display: swap; }
@font-face { font-family: Mono; src: url(fonts/SpaceMono.ttf) format('truetype'); font-display: swap; }
@font-face { font-family: Inter; src: url(fonts/InterBold.ttf) format('truetype'); font-weight: 700; font-display: swap; }

:root {
  --bg: #0a0c14;
  --bg2: #111524;
  --ink: #0a0c14;
  --fg: #ffffff;
  --muted: #9aa3b8;
  --accent: #d7ff3a;
  --blue: #1666ff;
  --hot: #ff3b5c;
  --beat: 469ms; /* 128 BPM */
  --pad: clamp(16px, 4vw, 56px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: Inter, system-ui, sans-serif; font-weight: 700;
  overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; }

/* film grain */
.grain {
  position: fixed; inset: -50%; pointer-events: none; z-index: 50; opacity: .07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain .5s steps(4) infinite;
}
@keyframes grain { 0%{transform:translate(0,0)} 25%{transform:translate(-3%,2%)} 50%{transform:translate(2%,-3%)} 75%{transform:translate(-2%,-1%)} 100%{transform:translate(0,0)} }

/* ================================================= HUD */
.hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; gap: 16px; padding: 14px var(--pad);
  font-family: Mono, monospace; font-size: 13px; letter-spacing: .08em;
  background: linear-gradient(var(--bg), transparent);
}
.hud__brand { display: flex; align-items: center; gap: 10px; }
.hud__dot { width: 12px; height: 12px; background: var(--accent); animation: pulse var(--beat) infinite; }
.hud__rec { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.rec { width: 10px; height: 10px; border-radius: 50%; background: var(--hot); display: inline-block; animation: blink 1s steps(2) infinite; }
.hud__bar { position: absolute; left: var(--pad); right: var(--pad); top: 4px; height: 4px; background: rgba(255,255,255,.15); border-radius: 2px; }
.hud__bar span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 2px; }
.hud__cfg { background: none; border: 1px solid rgba(255,255,255,.3); color: var(--fg); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; }
.hud__cfg:hover { border-color: var(--accent); color: var(--accent); }
@keyframes pulse { 0%{opacity:1; transform:scale(1.25)} 60%{opacity:.5; transform:scale(1)} 100%{opacity:1} }
@keyframes blink { 50% { opacity: 0; } }

/* ================================================= HERO */
.hero {
  position: relative; min-height: 100svh; display: grid; grid-template-columns: 1.2fr .8fr; align-items: center;
  gap: clamp(24px, 5vw, 80px); padding: 110px var(--pad) 60px; overflow: hidden;
}
.hero__lines {
  position: absolute; inset: -20%; z-index: 0; opacity: .35;
  background: repeating-conic-gradient(from 0deg at 70% 45%, rgba(255,255,255,.14) 0 1.2deg, transparent 1.2deg 9deg);
  animation: spin 40s linear infinite; mask: radial-gradient(circle at 70% 45%, transparent 18%, #000 40%);
}
@keyframes spin { to { transform: rotate(360deg); } }
.hero__copy { position: relative; z-index: 2; }
.kicker { font-family: Mono, monospace; color: var(--accent); letter-spacing: .12em; font-size: 14px; margin: 0 0 18px; min-height: 1.2em; }
.type::after { content: '█'; animation: blink .9s steps(2) infinite; margin-left: 2px; }
.hero__title { font-family: Anton, Impact, sans-serif; font-weight: 400; line-height: .92; margin: 0;
  font-size: clamp(64px, 11vw, 176px); text-transform: uppercase; }
.slam { display: block; opacity: 0; transform: scale(2.4); filter: blur(8px);
  animation: slam .42s cubic-bezier(.2,1.4,.4,1) forwards; animation-delay: calc(var(--d) * var(--beat) + 200ms);
  text-shadow: 6px 6px 0 var(--ink); }
.slam--bar i { font-style: normal; background: var(--accent); color: var(--ink); padding: 0 .12em; display: inline-block;
  clip-path: polygon(0 0, 100% 0, 96% 100%, 0 100%); text-shadow: none; }
@keyframes slam { 60% { opacity: 1; filter: blur(0); transform: scale(.94); } 100% { opacity: 1; filter: blur(0); transform: scale(1); } }
.rotator { margin: 26px 0 0; display: flex; align-items: baseline; gap: 14px; font-family: Archivo, sans-serif; font-size: clamp(22px, 3vw, 40px); }
.rotator span { color: var(--muted); }
.rotator b { font-family: Anton, sans-serif; font-weight: 400; font-size: 1.5em; color: var(--fg); display: inline-block;
  -webkit-text-stroke: 2px var(--accent); color: transparent; }
.rotator b.pop { animation: pop .35s cubic-bezier(.2,1.6,.4,1); }
@keyframes pop { 0% { transform: translateY(40%) scale(1.6) rotate(-6deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
.hero__sub { max-width: 34em; color: #cfd5e4; font-family: Inter, sans-serif; font-size: clamp(15px, 1.4vw, 18px); line-height: 1.6; margin: 22px 0 30px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; }

.btn { --b: var(--accent); position: relative; display: inline-flex; align-items: center; gap: 14px; cursor: pointer;
  padding: 18px 28px; border: 3px solid var(--b); background: var(--b); color: var(--ink); text-decoration: none;
  font-family: Archivo, sans-serif; font-size: 18px; letter-spacing: .02em; overflow: hidden;
  clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 100%, 0 100%); transition: transform .15s; }
.btn em { font-style: normal; transition: transform .2s; }
.btn::before { content: ''; position: absolute; inset: 0; background: #fff; transform: translateX(-102%); transition: transform .25s cubic-bezier(.7,0,.3,1); }
.btn > * { position: relative; }
.btn:hover::before { transform: none; }
.btn:hover em { transform: translateX(6px); }
.btn:active { transform: scale(.96); }
.btn--ghost { background: transparent; color: var(--fg); --b: rgba(255,255,255,.6); }
.btn--ghost:hover { color: var(--ink); }
.btn--wide { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .35; cursor: not-allowed; }
.btn[disabled]::before { display: none; }

/* phone */
.phone { position: relative; z-index: 2; justify-self: center; width: min(360px, 80vw); aspect-ratio: 9 / 19;
  border-radius: 44px; padding: 12px; background: #1b2033; box-shadow: 0 40px 120px rgba(22,102,255,.35), inset 0 0 0 2px #2d3550;
  transform: rotate(4deg); animation: float 6s ease-in-out infinite, phoneIn .8s cubic-bezier(.2,1.2,.4,1) both; animation-delay: 0s, calc(3 * var(--beat)); }
@keyframes float { 50% { transform: rotate(2deg) translateY(-14px); } }
@keyframes phoneIn { from { transform: translateY(60%) rotate(20deg); opacity: 0; } }
.phone__screen { position: relative; width: 100%; height: 100%; border-radius: 34px; overflow: hidden; background: #000; }
.phone__screen video { width: 100%; height: 100%; object-fit: cover; display: block; }
.phone__hud { position: absolute; top: 14px; left: 18px; right: 18px; display: flex; justify-content: space-between; font: 12px Mono, monospace; }
.sticker { position: absolute; font-family: Archivo, sans-serif; font-size: 15px; padding: 10px 16px; border-radius: 30px;
  background: var(--accent); color: var(--ink); border: 4px solid #fff; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.sticker--a { top: 16%; left: -18%; transform: rotate(-10deg); animation: wob 2.6s ease-in-out infinite; }
.sticker--b { bottom: 14%; right: -16%; transform: rotate(8deg); background: #fff; animation: wob 3.1s ease-in-out infinite reverse; }
@keyframes wob { 50% { transform: rotate(3deg) scale(1.06); } }
.ring { position: absolute; width: 150%; left: -25%; top: 20%; z-index: -1; fill: none; stroke: var(--accent); stroke-width: 3;
  stroke-dasharray: 580; stroke-dashoffset: 580; animation: draw 1.2s cubic-bezier(.6,0,.2,1) forwards; animation-delay: calc(4 * var(--beat)); opacity: .8; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ================================================= TAPES */
.tapes { position: relative; height: 240px; margin: -40px 0 20px; overflow: hidden; }
.tape { position: absolute; left: -10%; width: 120%; padding: 14px 0; white-space: nowrap; overflow: hidden; }
.tape--a { top: 50px; background: var(--accent); color: var(--ink); transform: rotate(-4deg); }
.tape--b { top: 120px; background: var(--ink); color: #fff; transform: rotate(3deg); border-block: 3px solid var(--accent); }
.tape__track { display: inline-block; font-family: Anton, sans-serif; font-size: 44px; letter-spacing: .02em; animation: marquee 18s linear infinite; }
.tape--b .tape__track { animation-direction: reverse; animation-duration: 22s; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ================================================= STATS */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; margin: 0 var(--pad); background: rgba(255,255,255,.1); }
.stat { background: var(--bg); padding: 36px 20px; text-align: center; }
.stat b { display: block; font-family: Anton, sans-serif; font-weight: 400; font-size: clamp(56px, 8vw, 120px); line-height: 1; color: var(--accent); }
.stat span { font-family: Mono, monospace; font-size: 13px; letter-spacing: .12em; color: var(--muted); }

/* ================================================= HOW */
.how, .make { padding: 120px var(--pad) 40px; }
.section-title { font-family: Anton, sans-serif; font-weight: 400; font-size: clamp(48px, 8vw, 120px); line-height: .95; margin: 0 0 48px; }
.section-title i { font-style: normal; background: var(--accent); color: var(--ink); padding: 0 .12em; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step { position: relative; padding: 34px 28px 30px; background: var(--bg2); border: 2px solid rgba(255,255,255,.08); overflow: hidden; }
.step::after { content: ''; position: absolute; left: 0; top: 0; height: 6px; width: 0; background: var(--accent); transition: width .6s cubic-bezier(.7,0,.2,1) .2s; }
.step.in::after { width: 100%; }
.step__num { font-family: Anton, sans-serif; font-size: 72px; color: transparent; -webkit-text-stroke: 2px var(--accent); line-height: 1; }
.step h3 { font-family: Archivo, sans-serif; font-size: 26px; margin: 14px 0 10px; }
.step p { font-family: Inter, sans-serif; color: #c4cadb; line-height: 1.6; margin: 0; }
.reveal { opacity: 0; transform: translateY(60px) rotate(2deg); transition: transform .7s cubic-bezier(.2,1.3,.4,1), opacity .5s; }
.reveal.in { opacity: 1; transform: none; }
.steps .reveal:nth-child(2) { transition-delay: .12s; }
.steps .reveal:nth-child(3) { transition-delay: .24s; }

/* ================================================= WALL */
.wall { padding: 60px 0; overflow: hidden; }
.wall__row { display: flex; gap: 16px; width: max-content; padding: 8px 0; }
.wall__row span { font-family: Anton, sans-serif; font-size: clamp(34px, 5vw, 64px); padding: 6px 22px; white-space: nowrap;
  border: 2px solid rgba(255,255,255,.2); }
.wall__row span:nth-child(3n) { background: var(--accent); color: var(--ink); border-color: var(--accent); }
.wall__row span:nth-child(3n+1) { color: transparent; -webkit-text-stroke: 1.5px #fff; }

/* ================================================= MAKE */
.panel { max-width: 760px; margin: 0 auto; background: var(--bg2); border: 2px solid rgba(255,255,255,.1); padding: clamp(18px, 4vw, 36px);
  position: relative; }
.panel::before { content: ''; position: absolute; inset: -2px; border: 2px solid var(--accent); clip-path: polygon(0 0, 60px 0, 60px 2px, 2px 2px, 2px 60px, 0 60px, 0 0, 100% 100%, calc(100% - 60px) 100%, calc(100% - 60px) calc(100% - 2px), calc(100% - 2px) calc(100% - 2px), calc(100% - 2px) calc(100% - 60px), 100% calc(100% - 60px)); pointer-events: none; }
.drop { display: block; position: relative; cursor: pointer; border: 3px dashed rgba(255,255,255,.35); padding: 46px 20px; text-align: center;
  background: repeating-linear-gradient(-45deg, transparent 0 18px, rgba(255,255,255,.025) 18px 36px); transition: border-color .2s, transform .2s; }
.drop:hover, .drop:focus, .drop.over { border-color: var(--accent); outline: none; }
.drop.over { transform: scale(1.02); background-color: rgba(215,255,58,.06); }
.drop__idle strong { display: block; font-family: Anton, sans-serif; font-weight: 400; font-size: clamp(34px, 6vw, 60px); margin: 18px 0 8px; }
.drop__idle small { font-family: Mono, monospace; color: var(--muted); }
.drop__icon { width: 74px; height: 74px; margin: 0 auto; border-radius: 50%; background: var(--accent); position: relative; animation: pulse calc(var(--beat) * 2) infinite; }
.drop__icon span { position: absolute; left: 50%; top: 22px; width: 6px; height: 30px; background: var(--ink); transform: translateX(-50%); }
.drop__icon span::before { content: ''; position: absolute; left: 50%; top: -6px; width: 22px; height: 22px; border-left: 6px solid var(--ink); border-top: 6px solid var(--ink); transform: translateX(-50%) rotate(45deg); }
.drop__file { display: flex; gap: 18px; align-items: center; text-align: left; }
.drop__file video { width: 110px; aspect-ratio: 9 / 16; object-fit: cover; background: #000; border: 3px solid var(--accent); }
.drop__meta b { display: block; font-family: Archivo, sans-serif; font-size: 18px; word-break: break-all; }
.drop__meta small { display: block; font-family: Mono, monospace; color: var(--muted); margin: 6px 0 10px; }
.field { display: block; margin: 22px 0 0; }
.field span { display: block; font-family: Mono, monospace; font-size: 12px; letter-spacing: .12em; color: var(--accent); margin-bottom: 8px; }
.field input { width: 100%; padding: 16px 18px; background: var(--bg); color: var(--fg); border: 2px solid rgba(255,255,255,.2);
  font: 16px Inter, sans-serif; outline: none; transition: border-color .2s; }
.field input:focus { border-color: var(--accent); }
.more { margin: 18px 0 0; font-family: Mono, monospace; }
.more summary { cursor: pointer; color: var(--muted); font-size: 13px; letter-spacing: .1em; }
.check { display: flex; gap: 10px; align-items: center; margin-top: 16px; font-family: Inter, sans-serif; color: #c4cadb; }
.check input { accent-color: var(--accent); width: 18px; height: 18px; }
#go { margin-top: 28px; }
.form-note { font-family: Mono, monospace; font-size: 13px; color: var(--hot); min-height: 1.2em; margin: 14px 0 0; }
.link { background: none; border: 0; padding: 0; color: var(--accent); font-family: Mono, monospace; letter-spacing: .1em; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.muted { color: var(--muted); font-family: Inter, sans-serif; line-height: 1.6; }

/* progress */
.stages { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 22px; }
.stages li { font-family: Mono, monospace; font-size: 12px; letter-spacing: .1em; padding: 8px 12px; border: 2px solid rgba(255,255,255,.2); color: var(--muted); }
.stages li.active { border-color: var(--accent); color: var(--accent); animation: pulse var(--beat) infinite; }
.stages li.done { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.meter { position: relative; height: 54px; border: 3px solid #fff; overflow: hidden; }
.meter span { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent);
  background-image: repeating-linear-gradient(-45deg, transparent 0 14px, rgba(0,0,0,.12) 14px 28px); background-size: 40px 40px;
  animation: stripes 1s linear infinite; transition: width .6s cubic-bezier(.2,1,.3,1); }
@keyframes stripes { to { background-position: 40px 0; } }
.meter b { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-family: Anton, sans-serif; font-weight: 400; font-size: 30px; mix-blend-mode: difference; }
.log { margin: 20px 0; height: 160px; overflow: auto; background: #05060b; padding: 14px; font: 12px/1.7 Mono, monospace; color: #b6f58a; white-space: pre-wrap; }

/* result */
.result { display: grid; grid-template-columns: 300px 1fr; gap: 28px; align-items: center; max-width: 860px; }
.result__video video { width: 100%; aspect-ratio: 9 / 16; background: #000; border: 3px solid var(--accent); display: block; }
.result__side h3 { font-family: Anton, sans-serif; font-weight: 400; font-size: 64px; margin: 0 0 10px; line-height: 1; }
.result__side .btn { margin: 18px 0 16px; }
.result__side .link { display: block; }

/* settings */
dialog { background: var(--bg2); color: var(--fg); border: 3px solid var(--accent); padding: 0; width: min(520px, 92vw); }
dialog::backdrop { background: rgba(5,6,11,.8); backdrop-filter: blur(6px); }
.settings { padding: 28px; }
.settings h3 { font-family: Anton, sans-serif; font-weight: 400; font-size: 48px; margin: 0 0 8px; }
.settings__row { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }
.settings__row .btn { padding: 12px 20px; font-size: 15px; }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 60px var(--pad) 40px; font: 12px Mono, monospace; color: var(--muted); letter-spacing: .08em; }

/* flash on beat when a slam lands */
.flash { position: fixed; inset: 0; background: #fff; pointer-events: none; z-index: 60; opacity: 0; }
.flash.go { animation: flash .35s ease-out; }
@keyframes flash { 0% { opacity: .55; } 100% { opacity: 0; } }

/* ================================================= RESPONSIVE */
@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; padding-top: 96px; }
  .phone { width: min(300px, 72vw); margin-top: 10px; }
  .sticker--a { left: -8%; } .sticker--b { right: -8%; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .result { grid-template-columns: 1fr; }
  .result__video { max-width: 280px; margin: 0 auto; }
  .tape__track { font-size: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .slam, .reveal { opacity: 1; transform: none; filter: none; }
}
