/* ===== Bit-Freaks · Keep Playing ===== */
:root {
  --bg: #12052a;
  --bg-2: #1c0b3d;
  --panel: rgba(36, 16, 78, 0.55);
  --line: rgba(139, 233, 255, 0.18);
  --text: #f1ecff;
  --muted: #b8a9e0;
  --pink: #ff2e88;
  --red: #ff1f4b;
  --cyan: #29b6ff;
  --ice: #8be9ff;
  --yellow: #ffd23f;
  --lime: #b6ff3b;
  --grad: linear-gradient(90deg, var(--pink), #c13bff 45%, var(--cyan));
  --pixel: "Press Start 2P", monospace;
  --display: "Orbitron", sans-serif;
  --body: "Rajdhani", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.5;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ===== Ambient layers ===== */
#stars {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}
.scanlines {
  position: fixed; inset: 0; z-index: 60; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0 2px, rgba(0,0,0,.18) 2px 3px);
  mix-blend-mode: multiply;
}
main, .nav, .footer { position: relative; z-index: 2; }

/* ===== Pixel sprites (drawn by script.js) ===== */
.sprite { display: inline-block; line-height: 0; }
.sprite svg { width: 100%; height: auto; image-rendering: pixelated; shape-rendering: crispEdges; }

/* ===== Nav ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 4vw, 48px);
  transition: background .3s, backdrop-filter .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(18, 5, 42, .78);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--line);
}
.nav__brand { display: flex; align-items: center; gap: 10px; }
.nav__brand .sprite { width: 30px; }
.nav__name {
  font-family: var(--display); font-weight: 900; font-style: italic; font-size: 18px;
  letter-spacing: .04em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nav__links { display: flex; gap: 28px; font-family: var(--pixel); font-size: 10px; }
.nav__links a { color: var(--muted); transition: color .2s, text-shadow .2s; }
.nav__links a:hover { color: var(--ice); text-shadow: 0 0 10px var(--cyan); }

/* ===== Buttons ===== */
.btn {
  --c: var(--pink);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--pixel); font-size: 13px; letter-spacing: .05em;
  padding: 18px 26px; color: #fff;
  border: 2px solid var(--c);
  background: rgba(255, 46, 136, .12);
  box-shadow: 0 0 12px rgba(255,46,136,.5), inset 0 0 12px rgba(255,46,136,.35);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  transition: transform .15s, background .2s, box-shadow .2s;
  cursor: pointer;
}
.btn:hover { transform: translateY(-2px); background: rgba(255, 46, 136, .3); box-shadow: 0 0 24px rgba(255,46,136,.8), inset 0 0 18px rgba(255,46,136,.5); }
.btn:active { transform: translateY(1px); }
.btn--small { padding: 12px 16px; font-size: 10px; }
.btn--ghost { --c: var(--cyan); background: rgba(41,182,255,.08); box-shadow: 0 0 12px rgba(41,182,255,.4), inset 0 0 12px rgba(41,182,255,.25); }
.btn--ghost:hover { background: rgba(41,182,255,.22); box-shadow: 0 0 24px rgba(41,182,255,.8), inset 0 0 18px rgba(41,182,255,.4); }
.btn--start { --c: var(--yellow); color: var(--yellow); background: rgba(255,210,63,.1); box-shadow: 0 0 14px rgba(255,210,63,.5), inset 0 0 12px rgba(255,210,63,.3); }
.btn--start:hover { background: rgba(255,210,63,.25); box-shadow: 0 0 28px rgba(255,210,63,.9), inset 0 0 18px rgba(255,210,63,.5); }
.blink-text { animation: blink 1.1s steps(1) infinite; }
.blink { color: var(--lime); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ===== Hero ===== */
.hero {
  position: relative; min-height: 100svh;
  display: grid; place-items: center;
  padding: 110px 16px 140px;
  overflow: hidden;
  isolation: isolate;
}
.hero__sun {
  position: absolute; left: 50%; bottom: 22%; z-index: -2;
  width: min(70vw, 620px); aspect-ratio: 1; transform: translateX(-50%);
  border-radius: 50%;
  background: linear-gradient(180deg, var(--yellow) 0%, #ff7a3b 35%, var(--pink) 65%, #a21cff 100%);
  -webkit-mask: linear-gradient(180deg, #000 0 48%, transparent 48% 51%, #000 51% 60%, transparent 60% 64%, #000 64% 71%, transparent 71% 76%, #000 76% 81%, transparent 81% 87%, #000 87% 90%, transparent 90%);
  mask: linear-gradient(180deg, #000 0 48%, transparent 48% 51%, #000 51% 60%, transparent 60% 64%, #000 64% 71%, transparent 71% 76%, #000 76% 81%, transparent 81% 87%, #000 87% 90%, transparent 90%);
  opacity: .32;
  filter: blur(1px) drop-shadow(0 0 60px var(--pink));
}
.hero__grid {
  position: absolute; left: -50%; right: -50%; bottom: 0; height: 42%; z-index: -1;
  background:
    linear-gradient(to top, transparent, var(--bg) 92%),
    repeating-linear-gradient(90deg, rgba(255,46,136,.55) 0 2px, transparent 2px 80px),
    repeating-linear-gradient(0deg, rgba(41,182,255,.55) 0 2px, transparent 2px 80px);
  background-blend-mode: normal;
  transform: perspective(300px) rotateX(62deg);
  transform-origin: bottom;
  animation: gridmove 1.6s linear infinite;
  -webkit-mask: linear-gradient(to top, #000 30%, transparent);
  mask: linear-gradient(to top, #000 30%, transparent);
}
@keyframes gridmove { to { background-position: 0 0, 0 0, 0 80px; } }

.hero__content {
  position: relative; text-align: center; max-width: 900px;
  display: flex; flex-direction: column; align-items: center;
}
.hero__kicker { font-family: var(--pixel); font-size: 10px; color: var(--muted); letter-spacing: .1em; margin: 0 0 4px; }
.hero__logo {
  width: min(100vw, 860px); height: auto;
  margin: -10px 0 -30px;
  -webkit-mask: radial-gradient(ellipse 58% 60% at 50% 48%, #000 62%, transparent 100%);
  mask: radial-gradient(ellipse 58% 60% at 50% 48%, #000 62%, transparent 100%);
  animation: hover 5s ease-in-out infinite;
  filter: saturate(1.15);
}
@keyframes hover { 50% { transform: translateY(-12px); } }
.hero__tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 0 0 18px; }
.tag {
  font-family: var(--pixel); font-size: 11px; padding: 8px 12px;
  border: 2px solid currentColor; text-shadow: 0 0 8px currentColor;
  box-shadow: 0 0 10px currentColor inset, 0 0 10px currentColor;
}
.tag--game { color: var(--cyan); }
.tag--cine { color: var(--pink); }
.tag--anime { color: var(--lime); }
.hero__lead { max-width: 620px; font-size: clamp(18px, 2.2vw, 22px); color: var(--muted); margin: 0 0 30px; }
.hero__lead strong { color: var(--text); }
.hero__cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.hero__scroll {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  color: var(--ice); font-size: 22px; animation: bob 1.6s ease-in-out infinite;
  text-shadow: 0 0 12px var(--cyan);
}
@keyframes bob { 50% { transform: translate(-50%, 8px); } }

.hero__floaters .float { position: absolute; width: 48px; opacity: .8; filter: drop-shadow(0 0 10px currentColor); animation: drift 9s ease-in-out infinite; }
.f1 { top: 18%; left: 8%;  width: 64px !important; color: var(--yellow); }
.f2 { top: 24%; right: 9%; width: 56px !important; color: var(--cyan); animation-delay: -2s !important; }
.f3 { bottom: 26%; left: 12%; color: var(--pink); animation-delay: -4s !important; }
.f4 { top: 62%; right: 14%; width: 36px !important; color: var(--pink); animation-delay: -6s !important; }
.f5 { top: 72%; left: 26%; width: 40px !important; color: var(--lime); animation-delay: -3s !important; opacity: .5 !important; }
.f6 { bottom: 34%; right: 30%; width: 28px !important; color: var(--ice); animation-delay: -1s !important; }
@keyframes drift {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  33% { transform: translate(14px, -18px) rotate(6deg); }
  66% { transform: translate(-10px, 10px) rotate(-5deg); }
}

/* ===== Ticker ===== */
.ticker {
  position: relative; overflow: hidden; z-index: 3;
  background: var(--grad);
  transform: rotate(-2deg) scale(1.04);
  padding: 14px 0;
  box-shadow: 0 0 40px rgba(255,46,136,.5);
}
.ticker__track {
  display: flex; gap: 28px; width: max-content;
  font-family: var(--display); font-weight: 900; font-style: italic; font-size: clamp(20px, 3vw, 30px);
  color: #12052a; white-space: nowrap;
  animation: marquee 28s linear infinite;
}
.ticker__track i { font-style: normal; color: var(--yellow); text-shadow: 0 0 8px #fff; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ===== Sections ===== */
.section { padding: clamp(80px, 12vw, 140px) clamp(16px, 5vw, 64px); max-width: 1240px; margin: 0 auto; }
.section__head { text-align: center; margin-bottom: 56px; }
.eyebrow { font-family: var(--pixel); font-size: 11px; color: var(--lime); letter-spacing: .2em; margin: 0 0 16px; text-shadow: 0 0 10px rgba(182,255,59,.6); }
.title {
  font-family: var(--display); font-weight: 900; font-style: italic;
  font-size: clamp(34px, 6vw, 64px); line-height: 1.05; margin: 0;
  text-transform: uppercase; letter-spacing: -.01em;
  text-shadow: 3px 3px 0 #000, 0 0 30px rgba(255,46,136,.35);
}
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(3px 3px 0 #000); }
.section__sub { color: var(--muted); font-size: 20px; margin: 16px auto 0; max-width: 560px; }

/* ===== Worlds ===== */
.worlds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.world {
  position: relative; padding: 32px 28px 28px;
  background: linear-gradient(160deg, rgba(255,255,255,.06), rgba(255,255,255,0) 40%), var(--panel);
  border: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 0 0 1px rgba(0,0,0,.4), 0 0 24px color-mix(in srgb, var(--accent) 25%, transparent);
  clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px);
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.world:hover {
  transform: translateY(-8px);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(0,0,0,.4), 0 0 46px color-mix(in srgb, var(--accent) 55%, transparent);
}
.world__badge {
  position: absolute; top: 18px; right: 18px;
  font-family: var(--pixel); font-size: 10px; color: var(--accent);
  animation: blink 1.2s steps(1) infinite; animation-play-state: paused; opacity: .7;
}
.world:hover .world__badge { animation-play-state: running; opacity: 1; }
.world__icon {
  width: 72px; height: 72px; display: grid; place-items: center;
  font-size: 34px; color: var(--accent);
  border: 2px solid var(--accent); margin-bottom: 22px;
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 60%, transparent), inset 0 0 18px color-mix(in srgb, var(--accent) 40%, transparent);
  text-shadow: 0 0 14px var(--accent);
}
.world h3 { font-family: var(--display); font-weight: 900; font-style: italic; font-size: 30px; margin: 0 0 10px; color: var(--accent); text-shadow: 2px 2px 0 #000; }
.world p { color: var(--muted); margin: 0 0 24px; }
.stats { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.stats li { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 10px; font-family: var(--pixel); font-size: 9px; color: var(--text); }
.stats b {
  position: relative; height: 12px; border: 1px solid rgba(255,255,255,.25); background: rgba(0,0,0,.3);
}
.stats b::after {
  content: ""; position: absolute; inset: 1px auto 1px 1px; width: 0;
  background: repeating-linear-gradient(90deg, var(--accent) 0 8px, transparent 8px 10px);
  box-shadow: 0 0 8px var(--accent);
  transition: width 1.2s cubic-bezier(.2,.8,.2,1) .2s;
}
.world.is-visible .stats b::after { width: calc(var(--v) - 2px); }

/* ===== Socials ===== */
.section--socials { position: relative; }
.socials { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.social {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 4px;
  padding: 26px 22px 22px; min-height: 230px;
  background: var(--panel);
  border: 1px solid rgba(255,255,255,.12);
  transition: transform .25s, border-color .25s, box-shadow .25s;
  isolation: isolate;
}
.social::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  opacity: 0; transition: opacity .3s;
}
.social::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; z-index: -1;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.25), transparent);
  transform: skewX(-20deg); transition: left .6s;
}
.social > i:first-child {
  font-size: 40px; margin-bottom: auto; color: var(--brand);
  filter: drop-shadow(0 0 12px var(--brand));
  transition: transform .3s, color .3s;
}
.social__name { font-family: var(--display); font-weight: 900; font-size: 22px; font-style: italic; margin-top: 20px; }
.social__handle { font-family: var(--pixel); font-size: 10px; color: var(--brand); transition: color .3s; }
.social__perk { color: var(--muted); font-size: 16px; transition: color .3s; }
.social__go {
  margin-top: 12px; font-family: var(--pixel); font-size: 9px; display: flex; gap: 8px; align-items: center;
  opacity: .6; transition: opacity .3s, gap .3s;
}
.social:hover, .social:focus-visible {
  transform: translateY(-6px) scale(1.02);
  border-color: transparent;
  box-shadow: 0 16px 40px -10px var(--brand), 0 0 30px -6px var(--brand2);
  outline: none;
}
.social:hover::before, .social:focus-visible::before { opacity: .92; }
.social:hover::after { left: 130%; }
.social:hover > i:first-child { color: #fff; transform: scale(1.15) rotate(-8deg); }
.social:hover .social__handle, .social:hover .social__perk { color: #fff; }
.social:hover .social__go { opacity: 1; gap: 14px; }
.social:hover .social__name { text-shadow: 2px 2px 0 rgba(0,0,0,.4); }

/* ===== Continue ===== */
.continue { padding: 40px 16px clamp(90px, 12vw, 140px); display: grid; place-items: center; }
.continue__box {
  text-align: center; max-width: 620px; width: 100%;
  padding: 48px 28px;
  border: 3px double var(--pink);
  background: radial-gradient(ellipse at top, rgba(255,46,136,.18), transparent 70%), rgba(18,5,42,.7);
  box-shadow: 0 0 40px rgba(255,46,136,.35), inset 0 0 40px rgba(255,46,136,.15);
}
.continue__label { font-family: var(--pixel); font-size: clamp(18px, 4vw, 28px); color: var(--pink); margin: 0; text-shadow: 0 0 14px var(--pink); }
.continue__count {
  font-family: var(--pixel); font-size: clamp(72px, 16vw, 128px); line-height: 1; margin: 22px 0;
  color: var(--yellow); text-shadow: 6px 6px 0 #ff7a3b, 0 0 30px rgba(255,210,63,.7);
}
.continue__count.tick { animation: tick .35s ease-out; }
@keyframes tick { from { transform: scale(1.35); } }
.continue__text { color: var(--muted); font-size: 20px; margin: 0 0 28px; }
.continue__text strong { color: var(--text); }
.continue__hint { font-family: var(--body); font-weight: 600; font-size: 14px; color: rgba(184,169,224,.5); margin: 28px 0 0; letter-spacing: .15em; }
.hint--touch { display: none; }
@media (hover: none) and (pointer: coarse) {
  .hint--keys { display: none; }
  .hint--touch { display: inline; }
}
.nav__brand .sprite { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sprite.wiggle { animation: wiggle .3s ease-out; }
@keyframes wiggle {
  30% { transform: rotate(-18deg) scale(1.25); }
  60% { transform: rotate(14deg) scale(1.15); }
}

/* ===== Footer ===== */
.footer {
  text-align: center; padding: 48px 16px 40px;
  border-top: 1px solid var(--line);
  background: linear-gradient(to bottom, transparent, rgba(0,0,0,.35));
}
.footer__icons { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-bottom: 26px; }
.footer__icons a {
  width: 46px; height: 46px; display: grid; place-items: center; font-size: 18px;
  border: 1px solid var(--line); color: var(--muted);
  transition: color .2s, border-color .2s, box-shadow .2s, transform .2s;
}
.footer__icons a:hover { color: var(--ice); border-color: var(--cyan); box-shadow: 0 0 16px rgba(41,182,255,.6); transform: translateY(-3px); }
.footer__tag {
  font-family: var(--display); font-weight: 900; font-style: italic; font-size: 22px; letter-spacing: .15em; margin: 0 0 8px;
  background: linear-gradient(90deg, var(--yellow), var(--lime)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.footer__copy { color: var(--muted); font-size: 15px; margin: 0; }
.footer__copy i { color: var(--pink); }

/* ===== Reveal on scroll ===== */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal.is-visible:hover { transition: transform .25s, box-shadow .25s, border-color .25s, opacity .7s; }

/* ===== Konami ===== */
.konami {
  position: fixed; inset: 0; z-index: 100; pointer-events: none;
  display: grid; place-content: center; text-align: center;
  font-family: var(--pixel); color: var(--yellow);
  opacity: 0; transition: opacity .3s;
}
.konami p { margin: 0; font-size: clamp(20px, 5vw, 44px); text-shadow: 4px 4px 0 var(--pink), 0 0 30px var(--yellow); }
.konami .konami__sub { font-size: clamp(10px, 2vw, 16px); color: var(--lime); margin-top: 18px; text-shadow: 2px 2px 0 #000; }
.konami.is-on { opacity: 1; }
.rain { position: fixed; top: -60px; z-index: 99; pointer-events: none; width: 36px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(115vh) rotate(360deg); } }
.freak-mode main, .freak-mode .footer { animation: hue 3s linear infinite; }
@keyframes hue { to { filter: hue-rotate(360deg); } }

/* ===== Responsive ===== */
@media (max-width: 1000px) {
  .socials { grid-template-columns: repeat(2, 1fr); }
  .worlds { grid-template-columns: 1fr; max-width: 560px; margin: 0 auto; }
}
@media (max-width: 640px) {
  body { font-size: 17px; }
  .nav__links { display: none; }
  .nav__name { font-size: 15px; }
  .hero { padding-top: 96px; }
  .hero__logo { margin: 0 0 -10px; }
  .hero__floaters .f5, .hero__floaters .f6 { display: none; }
  .hero__floaters .float { width: 34px !important; opacity: .55; }
  .btn { padding: 16px 18px; font-size: 11px; }
  .socials { grid-template-columns: 1fr 1fr; gap: 12px; }
  .social { padding: 18px 14px 16px; min-height: 190px; }
  .social > i:first-child { font-size: 30px; }
  .social__name { font-size: 18px; margin-top: 14px; }
  .social__perk { font-size: 14px; }
  .stats li { grid-template-columns: 96px 1fr; }
}
@media (max-width: 340px) {
  .socials { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}
