:root {
  --bg: #07050f;
  --bg-alt: #0c0818;
  --surface: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.1);
  --text: #e8e6f5;
  --muted: #9a96b8;
  --cyan: #00f0ff;
  --magenta: #ff2bd6;
  --violet: #7a00ff;
  --font-display: "Orbitron", sans-serif;
  --font-body: "Rajdhani", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.15rem;
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

#particles {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

main, .footer { position: relative; z-index: 1; }

.container { width: min(1180px, 92%); margin-inline: auto; }
.container.narrow { width: min(680px, 92%); }

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 4%;
  transition: background 0.3s, backdrop-filter 0.3s, padding 0.3s, border-color 0.3s;
  border-bottom: 1px solid transparent;
}
.navbar.scrolled {
  background: rgba(7, 5, 15, 0.8);
  backdrop-filter: blur(12px);
  padding-block: 0.6rem;
  border-color: var(--border);
}

.logo {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: 0.12em;
}
.logo span {
  color: var(--cyan);
  text-shadow: 0 0 12px var(--cyan);
}

.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links a:not(.btn) {
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.95rem;
  position: relative;
  color: var(--muted);
  transition: color 0.25s;
}
.nav-links a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 0; height: 2px;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  transition: width 0.3s;
}
.nav-links a:not(.btn):hover { color: #fff; }
.nav-links a:not(.btn):hover::after { width: 100%; }

.burger {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  width: 36px; height: 28px;
  position: relative;
  z-index: 110;
}
.burger span {
  position: absolute;
  left: 4px; right: 4px;
  height: 3px;
  background: var(--cyan);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s, top 0.3s;
}
.burger span:nth-child(1) { top: 5px; }
.burger span:nth-child(2) { top: 12px; }
.burger span:nth-child(3) { top: 19px; }
.burger.open span:nth-child(1) { top: 12px; transform: rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { top: 12px; transform: rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #07050f;
  background: linear-gradient(135deg, var(--cyan), #5affff);
  padding: 0.95rem 2rem;
  border: 2px solid var(--cyan);
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.45);
  clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
  transition: transform 0.25s, box-shadow 0.25s, background 0.25s, color 0.25s;
}
.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 32px rgba(0, 240, 255, 0.8);
}
.btn-ghost {
  background: transparent;
  color: var(--cyan);
  box-shadow: none;
}
.btn-ghost:hover { background: rgba(0, 240, 255, 0.12); }
.btn-small { padding: 0.6rem 1.3rem; font-size: 0.75rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 7rem 5% 4rem;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  width: 80vmax; height: 80vmax;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle at 30% 40%, rgba(122, 0, 255, 0.28), transparent 45%),
    radial-gradient(circle at 70% 60%, rgba(0, 240, 255, 0.2), transparent 45%);
  animation: drift 14s ease-in-out infinite alternate;
}
.hero-grid {
  position: absolute;
  left: -50%; right: -50%;
  bottom: -10%;
  height: 65%;
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.35) 1px, transparent 1px);
  background-size: 60px 60px;
  transform: perspective(500px) rotateX(62deg);
  transform-origin: center bottom;
  mask-image: linear-gradient(to top, #000 10%, transparent 90%);
  -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 90%);
  animation: gridMove 3s linear infinite;
}
.hero-content { position: relative; max-width: 860px; }

.eyebrow {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--magenta);
  text-shadow: 0 0 10px rgba(255, 43, 214, 0.7);
  margin-bottom: 1rem;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(3.2rem, 14vw, 9rem);
  line-height: 1;
  letter-spacing: 0.08em;
  background: linear-gradient(120deg, #fff 20%, var(--cyan) 60%, var(--magenta));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  max-width: 620px;
  margin: 1.5rem auto 2.2rem;
  color: var(--muted);
  font-size: 1.3rem;
}
.hero-cta { display: flex; gap: 1.2rem; justify-content: center; flex-wrap: wrap; }

.scroll-hint {
  position: absolute;
  bottom: 1.8rem; left: 50%;
  transform: translateX(-50%);
  width: 26px; height: 44px;
  border: 2px solid var(--cyan);
  border-radius: 14px;
}
.scroll-hint span {
  position: absolute;
  top: 8px; left: 50%;
  width: 4px; height: 8px;
  margin-left: -2px;
  background: var(--cyan);
  border-radius: 2px;
  animation: scrollDot 1.6s infinite;
}

/* Glitch */
.glitch { position: relative; }
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  background: inherit;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.glitch::before {
  transform: translate(3px, 0);
  filter: drop-shadow(-3px 0 var(--magenta));
  animation: glitch1 3.2s infinite steps(1);
}
.glitch::after {
  transform: translate(-3px, 0);
  filter: drop-shadow(3px 0 var(--cyan));
  animation: glitch2 2.6s infinite steps(1);
}

/* ---------- Sections ---------- */
.section { padding: 6rem 0; position: relative; }
.section-alt { background: linear-gradient(180deg, transparent, var(--bg-alt) 15%, var(--bg-alt) 85%, transparent); }

.section-title {
  font-family: var(--font-display);
  font-weight: 900;
  text-align: center;
  font-size: clamp(1.8rem, 5vw, 3rem);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.section-title span {
  color: var(--cyan);
  text-shadow: 0 0 16px rgba(0, 240, 255, 0.7);
}
.section-sub {
  text-align: center;
  color: var(--muted);
  margin: 0.6rem auto 3.2rem;
  max-width: 560px;
}

.grid { display: grid; gap: 1.6rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

/* ---------- Cards ---------- */
.card {
  position: relative;
  padding: 2rem 1.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  backdrop-filter: blur(6px);
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.15s;
  transform-style: preserve-3d;
}
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 40%; height: 2px;
  background: linear-gradient(90deg, var(--cyan), transparent);
  transition: width 0.4s;
}
.card:hover {
  border-color: rgba(0, 240, 255, 0.55);
  box-shadow: 0 0 28px rgba(0, 240, 255, 0.18);
}
.card:hover::before { width: 100%; }
.card-icon {
  font-size: 2.2rem;
  width: 62px; height: 62px;
  display: grid; place-items: center;
  margin-bottom: 1.1rem;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 12px;
}
.card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}
.card p { color: var(--muted); }

/* ---------- Games ---------- */
.game {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.15s;
}
.game:hover {
  border-color: var(--c1);
  box-shadow: 0 0 30px color-mix(in srgb, var(--c1) 40%, transparent);
}
.game-art {
  position: relative;
  height: 190px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  overflow: hidden;
}
.game-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.16) 0 2px, transparent 2px 5px);
}
.game-letter {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 7rem;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 0 30px rgba(0, 0, 0, 0.4);
  transition: transform 0.5s;
}
.game:hover .game-letter { transform: scale(1.15) rotate(-4deg); }
.game-badge {
  position: absolute;
  top: 0.9rem; right: 0.9rem;
  z-index: 2;
  font-family: var(--font-display);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.35rem 0.75rem;
  background: rgba(7, 5, 15, 0.8);
  border: 1px solid var(--c1);
  color: var(--c1);
  border-radius: 3px;
}
.game-body { padding: 1.5rem 1.6rem 1.8rem; }
.game-genre {
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--c1);
  font-weight: 600;
}
.game-body h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin: 0.3rem 0 0.6rem;
}
.game-body p:last-child { color: var(--muted); }

/* ---------- Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.6rem;
  text-align: center;
}
.stat {
  padding: 2rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.stat-value {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: var(--cyan);
  text-shadow: 0 0 18px rgba(0, 240, 255, 0.6);
}
.stat-label {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.9rem;
  margin-top: 0.3rem;
}

/* ---------- Form ---------- */
.form {
  display: grid;
  gap: 1.3rem;
  padding: 2.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.field { display: grid; gap: 0.4rem; }
.field label {
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.field input, .field textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.85rem 1rem;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.35);
}
.field textarea { resize: vertical; }
.form .btn { justify-self: start; }

/* ---------- Flash ---------- */
.flash-wrap {
  position: fixed;
  top: 84px; left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  width: min(520px, 92%);
}
.flash {
  padding: 1rem 1.4rem;
  border-radius: 6px;
  margin-bottom: 0.6rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
  animation: slideDown 0.5s ease, fadeOut 0.6s ease 5s forwards;
}
.flash.success { background: rgba(57, 255, 20, 0.14); border: 1px solid #39ff14; color: #b6ffa8; }
.flash.error { background: rgba(255, 43, 100, 0.14); border: 1px solid #ff2b64; color: #ffb3c4; }

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  padding: 2.5rem 4%;
  border-top: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
}
.footer .logo { margin-bottom: 0.4rem; }

/* ---------- Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  transition-delay: var(--delay, 0s);
}
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Keyframes ---------- */
@keyframes gridMove { to { background-position: 0 60px, 0 0; } }
@keyframes drift {
  from { transform: translate(-52%, -52%) rotate(0deg); }
  to   { transform: translate(-48%, -48%) rotate(12deg); }
}
@keyframes scrollDot {
  0% { opacity: 0; transform: translateY(0); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translateY(18px); }
}
@keyframes glitch1 {
  0%, 92%, 100% { clip-path: inset(0 0 0 0); }
  93% { clip-path: inset(10% 0 60% 0); }
  95% { clip-path: inset(55% 0 20% 0); }
  97% { clip-path: inset(30% 0 45% 0); }
}
@keyframes glitch2 {
  0%, 88%, 100% { clip-path: inset(0 0 0 0); }
  89% { clip-path: inset(60% 0 10% 0); }
  92% { clip-path: inset(15% 0 70% 0); }
  95% { clip-path: inset(40% 0 35% 0); }
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: none; } }
@keyframes fadeOut { to { opacity: 0; visibility: hidden; } }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  body { font-size: 1.05rem; }
  .burger { display: block; }
  .nav-links {
    position: fixed;
    top: 0; right: 0;
    height: 100vh; width: min(300px, 80%);
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
    background: rgba(7, 5, 15, 0.97);
    border-left: 1px solid var(--border);
    transform: translateX(100%);
    transition: transform 0.4s ease;
  }
  .nav-links.open { transform: none; }
  .grid-3 { grid-template-columns: 1fr; }
  .section { padding: 4rem 0; }
  .form { padding: 1.4rem; }
  .form .btn { justify-self: stretch; text-align: center; }
}

@media (max-width: 420px) {
  .stats { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
