@import url(fonts/fonts.css);

:root {
  --ink: #050505;
  --paper: #f2f0ea;
  --accent: #c6ff00;
  --mono: 'Space Mono', ui-monospace, Menlo, monospace;
  --display: 'Anton', Impact, 'Arial Narrow Bold', sans-serif;
  --wide: 'Syne', 'Arial Black', sans-serif;
  --pad: clamp(16px, 3vw, 40px);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--ink); color: var(--paper); -webkit-text-size-adjust: 100%; }
body { font-family: var(--mono); background: var(--ink); min-height: 100vh; min-height: 100dvh; overflow-x: hidden; }
::selection { background: var(--accent); color: var(--ink); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ---------- background + overlays ---------- */
#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
.grain {
  position: fixed; inset: -50%; width: 200%; height: 200%; z-index: 1; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .5 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: .14; mix-blend-mode: overlay; animation: grain .6s steps(4) infinite;
}
@keyframes grain { 0% { transform: translate(0,0) } 25% { transform: translate(-3%,2%) } 50% { transform: translate(2%,-4%) } 75% { transform: translate(-1%,5%) } 100% { transform: translate(3%,-2%) } }
.scan { position: fixed; inset: 0; z-index: 1; pointer-events: none; background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(0,0,0,.18) 3px 4px); opacity: .5; }
.flash { position: fixed; inset: 0; z-index: 50; pointer-events: none; background: var(--paper); opacity: 0; }
.flash.go { animation: strobe .5s steps(1) forwards; }
@keyframes strobe { 0% { opacity: 1; background: var(--paper) } 14% { opacity: 0 } 28% { opacity: 1; background: var(--accent) } 42% { opacity: 0 } 56% { opacity: 1; background: var(--ink) } 70% { opacity: 0 } 100% { opacity: 0 } }

/* ---------- tickers ---------- */
.frame { position: fixed; inset: 0; z-index: 3; pointer-events: none; }
.ticker {
  position: absolute; left: 0; right: 0; overflow: hidden; white-space: nowrap;
  font-family: var(--wide); font-weight: 800; font-size: clamp(11px, 1.3vw, 15px); letter-spacing: .08em;
  text-transform: uppercase; background: var(--accent); color: var(--ink); padding: 5px 0; line-height: 1;
}
.ticker--top { top: 0; } .ticker--bottom { bottom: 0; }
.ticker span { display: inline-block; padding-right: 2em; animation: tick 30s linear infinite; }
.ticker--bottom span { animation-direction: reverse; animation-duration: 38s; }
@keyframes tick { to { transform: translateX(-50%); } }

/* ---------- stages ---------- */
.stage::before { content: ""; position: fixed; inset: 0; background: radial-gradient(ellipse at 50% 45%, rgba(5,5,5,.6), rgba(5,5,5,.2) 70%); pointer-events: none; z-index: -1; }
.stage { position: relative; z-index: 2; min-height: 100vh; min-height: 100dvh; display: none; flex-direction: column; justify-content: center; padding: calc(var(--pad) + 34px) var(--pad) calc(var(--pad) + 90px); }
.stage.in { display: flex; animation: rise .45s cubic-bezier(.2,.9,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.wrap { width: 100%; max-width: 1100px; margin: 0 auto; }
.wrap--narrow { max-width: 860px; }
.center { text-align: center; }

.tag { font-size: clamp(11px, 1.1vw, 14px); letter-spacing: .3em; text-transform: uppercase; color: var(--accent); }
.tag::before { content: "■ "; }

.h { font-family: var(--display); text-transform: uppercase; line-height: .9; letter-spacing: -.01em; color: var(--paper); text-shadow: 0 2px 30px rgba(0,0,0,.6); }
.h .acid { color: var(--accent); }
.h--intro { font-size: clamp(56px, 11vw, 150px); margin: 14px 0 clamp(20px, 4vh, 40px); }

/* ---------- step 1 ---------- */
.field { border: 3px solid var(--paper); background: rgba(5,5,5,.55); padding: 6px 18px; margin-bottom: 16px; }
.field input {
  width: 100%; background: transparent; border: 0; outline: 0; color: var(--accent);
  font-family: var(--display); text-transform: uppercase; font-size: clamp(38px, 7vw, 92px); line-height: 1.15; caret-color: var(--accent);
}
.field:focus-within { border-color: var(--accent); }
.field input::placeholder { color: var(--paper); opacity: .35; }
.btn {
  display: inline-block; font-family: var(--wide); font-weight: 800; text-transform: uppercase; letter-spacing: .08em;
  font-size: clamp(14px, 1.5vw, 19px); padding: 16px 26px; border: 3px solid var(--paper); color: var(--paper);
  position: relative; overflow: hidden; isolation: isolate; transition: color .2s; text-align: center; background: rgba(5,5,5,.5);
}
.btn::before { content: ""; position: absolute; inset: 0; background: var(--accent); transform: translateX(-101%) skewX(-12deg); transition: transform .25s cubic-bezier(.2,.9,.2,1); z-index: -1; }
.btn:hover::before, .btn:focus-visible::before { transform: translateX(0) skewX(0); }
.btn:hover, .btn:focus-visible { color: var(--ink); }
.btn--acid { background: var(--accent); color: var(--ink); border-color: var(--accent); }
.btn--acid::before { background: var(--paper); }
.btn--big { width: 100%; padding: 22px 26px; font-size: clamp(16px, 1.9vw, 24px); }
.btn--small { padding: 12px 18px; font-size: 13px; border-width: 2px; }
.btn[disabled] { opacity: .3; pointer-events: none; }
.or { display: flex; align-items: center; gap: 14px; margin: 26px 0 12px; font-size: 12px; letter-spacing: .3em; text-transform: uppercase; opacity: .7; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: rgba(242,240,234,.4); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { font-family: var(--wide); font-weight: 800; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; border: 2px solid rgba(242,240,234,.5); padding: 12px 16px; background: rgba(5,5,5,.5); transition: .15s; }
.chip:hover, .chip:focus-visible { border-color: var(--accent); color: var(--accent); }

/* ---------- step 2 ---------- */
.scramble { font-size: clamp(48px, 11vw, 160px); margin: 18px 0 30px; word-break: break-word; min-height: 1em; }
.scramble .set { color: var(--paper); }
.scramble .rnd { color: var(--accent); opacity: .85; }
.status { list-style: none; display: grid; gap: 10px; justify-items: center; font-size: clamp(12px, 1.3vw, 16px); letter-spacing: .18em; text-transform: uppercase; }
.status li { opacity: 0; transform: translateY(6px); transition: .3s; }
.status li.on { opacity: 1; transform: none; }
.status li::before { content: "→ "; color: var(--accent); }
.status li.done::before { content: "✓ "; }

/* ---------- step 3: deck ---------- */
.deck { justify-content: flex-start; }
.deck-head { margin-bottom: clamp(14px, 3vh, 26px); }
.h--said { font-size: clamp(38px, 7vw, 96px); margin: 8px 0 12px; word-break: break-word; }
.profile { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pill { font-family: var(--wide); font-weight: 800; font-size: clamp(11px, 1.2vw, 15px); letter-spacing: .1em; padding: 7px 12px; background: var(--paper); color: var(--ink); transform: skewX(-8deg); }
.pill:nth-child(even) { background: var(--accent); }

.card {
  position: relative; display: grid; grid-template-columns: minmax(200px, 300px) 1fr; gap: clamp(16px, 3vw, 40px); align-items: center;
  border: 3px solid var(--paper); background: rgba(5,5,5,.78); padding: clamp(18px, 3vw, 40px); min-height: 320px;
  box-shadow: inset 0 0 120px rgba(0,0,0,.6);
}
.card.swap { animation: cardin .35s cubic-bezier(.2,.9,.2,1) both; }
.card.swap-back { animation: cardback .35s cubic-bezier(.2,.9,.2,1) both; }
@keyframes cardin { from { opacity: 0; transform: translateX(40px) skewX(-4deg); } to { opacity: 1; transform: none; } }
@keyframes cardback { from { opacity: 0; transform: translateX(-40px) skewX(4deg); } to { opacity: 1; transform: none; } }
.card__count { position: absolute; top: 12px; right: 16px; font-family: var(--wide); font-weight: 800; font-size: clamp(14px, 1.5vw, 20px); color: var(--accent); letter-spacing: .1em; }
.card__art { width: 100%; height: auto; aspect-ratio: 1; display: block; }
.card__kicker { font-size: 12px; letter-spacing: .3em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.card__name { font-family: var(--display); text-transform: uppercase; line-height: .95; font-size: clamp(32px, 5vw, 72px); text-shadow: 0 2px 24px rgba(0,0,0,.6); }
.card__note { margin-top: 14px; font-size: clamp(15px, 1.5vw, 19px); line-height: 1.55; }
.card--real { background: var(--paper); color: var(--ink); border-color: var(--paper); transform: rotate(-1deg); box-shadow: none; }
.card--real .card__count, .card--real .card__kicker { color: var(--ink); }
.card--real .card__name { text-shadow: none; }

.nav { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; margin-top: 16px; }
.dots { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.dots i { width: 10px; height: 10px; background: rgba(242,240,234,.3); transform: skewX(-12deg); }
.dots i.on { background: var(--accent); }

.why { margin: 22px auto 0; max-width: 820px; font-size: clamp(13px, 1.3vw, 16px); line-height: 1.55; text-transform: uppercase; letter-spacing: .03em; text-align: center; }
.why--clock { margin-top: 10px; opacity: .75; font-size: clamp(12px, 1.1vw, 14px); }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }

/* ---------- kitchen toy (decoration only) ---------- */
.toy { margin-top: clamp(36px, 6vh, 64px); padding-bottom: 24px; }
.toy__row { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 12px; align-items: end; max-width: 520px; margin: 0 auto; perspective: 1200px; }
.app { position: relative; display: block; width: 100%; -webkit-tap-highlight-color: transparent; }
.app--fridge { aspect-ratio: 3 / 5; }
.app--oven { aspect-ratio: 1 / 1; }
.app--cup { aspect-ratio: 4 / 5; }
.app__in { position: absolute; inset: 0; border: 3px solid rgba(242,240,234,.35); background: #000; overflow: hidden; display: grid; place-items: center; }
.app__in canvas { position: relative; width: 78%; height: auto; aspect-ratio: 1; opacity: 0; transform: scale(.5) rotate(-8deg); transition: opacity .35s .2s, transform .5s .2s cubic-bezier(.2,1.4,.4,1); }
.app__light { position: absolute; inset: 0; opacity: 0; transition: opacity .4s; }
.app--fridge .app__light { background: radial-gradient(circle at 50% 8%, rgba(235,248,255,.95), rgba(143,211,255,.35) 38%, rgba(0,0,0,0) 75%); }
.app--oven .app__light { background: radial-gradient(circle at 50% 90%, rgba(255,150,40,.95), rgba(255,60,0,.4) 45%, rgba(0,0,0,0) 85%); }
.app--cup .app__light { background: radial-gradient(circle at 50% 30%, rgba(255,230,180,.55), rgba(0,0,0,0) 70%); }
.app--oven.open .app__light { animation: flicker .25s steps(2) infinite; }
@keyframes flicker { 50% { filter: brightness(1.25); } }
.app__face {
  position: absolute; inset: 0; border: 3px solid var(--paper); background: rgba(5,5,5,.9);
  display: grid; place-items: center; transform-origin: left center; backface-visibility: hidden;
  transition: transform .6s cubic-bezier(.3,.8,.2,1), border-color .2s;
}
.app__face canvas { width: 78%; height: auto; aspect-ratio: 1; }
.app__handle { position: absolute; right: 10px; top: 40%; width: 5px; height: 20%; background: var(--paper); }
.app--oven .app__face { transform-origin: center bottom; }
.app--oven .app__handle { right: 20%; left: 20%; top: 12px; width: auto; height: 5px; }
.app--cup .app__face { transform-origin: right center; }
.app--cup .app__handle { right: auto; left: 10px; }
.app:hover .app__face, .app:focus-visible .app__face { border-color: var(--accent); }
.app.open .app__face { transform: rotateY(-112deg); }
.app--oven.open .app__face { transform: rotateX(-100deg); }
.app--cup.open .app__face { transform: rotateY(112deg); }
.app.open .app__light { opacity: 1; }
.app.open .app__in canvas { opacity: 1; transform: none; }
.app.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-3px) rotate(-1deg); } 75% { transform: translateX(3px) rotate(1deg); } }
.toy__quip { text-align: center; min-height: 1.6em; margin-top: 14px; font-family: var(--wide); font-weight: 800; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }

.toast { position: fixed; left: 50%; bottom: 60px; transform: translate(-50%, 20px); z-index: 60; background: var(--accent); color: var(--ink); font-family: var(--wide); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: 13px; padding: 14px 20px; opacity: 0; pointer-events: none; transition: .25s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 720px) {
  .stage { padding: 44px 14px 120px; justify-content: flex-start; }
  .intro, .decode { justify-content: center; }
  .h--said { font-size: clamp(34px, 11vw, 60px); }
  .card { grid-template-columns: 1fr; min-height: 0; padding: 18px 16px 22px; }
  .card__art { max-width: 200px; margin: 0 auto; }
  .card__body { text-align: center; }
  .card__name { font-size: clamp(30px, 9vw, 44px); }
  .nav { grid-template-columns: 1fr 1.6fr; }
  .actions .btn { flex: 1 1 100%; }
  .toy__row { max-width: 330px; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) { .grain, .ticker span, .card.swap, .card.swap-back { animation: none; } }
