:root {
  --bg: #05070f;
  --surface: #0b1126;
  --surface-2: #11183a;
  --neon: #39ff14;
  --neon-soft: rgba(57, 255, 20, 0.35);
  --neon-edge: rgba(57, 255, 20, 0.25);
  --cyan: #00e5ff;
  --cyan-soft: rgba(0, 229, 255, 0.35);
  --text: #e6f1ff;
  --muted: #9fb3d1;
  --radius: 14px;
  --shadow-glow: 0 0 0 1px var(--neon), 0 0 24px var(--neon-soft);
  --shadow-glow-cyan: 0 0 0 1px var(--cyan), 0 0 24px var(--cyan-soft);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 20% -10%, rgba(57, 255, 20, 0.08), transparent 60%),
    radial-gradient(ellipse at 90% 110%, rgba(0, 229, 255, 0.07), transparent 60%),
    url('assets/circuit.svg');
  background-size: auto, auto, cover;
  background-repeat: no-repeat;
  background-position: top left, bottom right, center center;
  background-attachment: fixed;
  line-height: 1.5;
  min-height: 100vh;
}

/* ---------- focus ---------- */
:focus-visible {
  outline: 2px solid var(--neon);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 5rem 1.5rem 4rem;
  overflow: hidden;
  border-bottom: 1px solid var(--neon-edge);
}

.hero::before {
  content: "";
  position: absolute;
  inset: -40% -10%;
  background-image:
    linear-gradient(var(--neon-edge) 1px, transparent 1px),
    linear-gradient(90deg, var(--neon-edge) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.15;
  transform: perspective(600px) rotateX(60deg);
  transform-origin: 50% 100%;
  animation: gridPan 12s linear infinite;
  pointer-events: none;
  mask-image: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0.1) 70%, transparent);
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0.1) 70%, transparent);
}

@keyframes gridPan {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 0 60px, 60px 0; }
}

.hero-eyebrow {
  display: inline-block;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  color: var(--cyan);
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid var(--cyan-soft);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 6vw, 4.25rem);
  letter-spacing: 0.04em;
  margin: 0 0 1rem;
  line-height: 1.05;
  position: relative;
  z-index: 1;
  text-shadow: 0 0 24px rgba(57, 255, 20, 0.25);
}

.hero h1 .accent {
  color: var(--neon);
  text-shadow: 0 0 18px var(--neon-soft);
}

.hero .subtitle {
  max-width: 60ch;
  color: var(--muted);
  font-size: clamp(1rem, 1.7vw, 1.15rem);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.hero-cta a {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  text-decoration: none;
  color: var(--text);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  padding: 0.7rem 1.2rem;
  border: 1px solid var(--neon-edge);
  border-radius: 8px;
  background: rgba(57, 255, 20, 0.04);
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}

.hero-cta a:hover {
  background: rgba(57, 255, 20, 0.12);
  border-color: var(--neon);
  color: var(--neon);
}

/* ---------- sections ---------- */
.game-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 4.5rem 1.5rem 1rem;
  scroll-margin-top: 1.5rem;
}

.game-section h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  letter-spacing: 0.06em;
  margin: 0 0 0.5rem;
  font-weight: 700;
}

.game-section h2 .slashes {
  color: var(--cyan);
  margin-right: 0.5rem;
  text-shadow: 0 0 12px var(--cyan-soft);
}

.section-blurb {
  color: var(--muted);
  margin: 0 0 2rem;
  font-size: 1rem;
  max-width: 60ch;
}

/* ---------- card grid ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* ---------- card ---------- */
.game-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--neon-edge);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.game-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  pointer-events: none;
  box-shadow: inset 0 -40px 40px -20px rgba(0, 229, 255, 0.06);
}

.game-card:hover,
.game-card:focus-within {
  transform: translateY(-4px);
  border-color: var(--neon);
  box-shadow: var(--shadow-glow);
}

.card-thumb {
  display: block;
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface-2);
  border-bottom: 1px solid var(--neon-edge);
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}

.game-card:hover .card-thumb img,
.game-card:focus-within .card-thumb img {
  transform: scale(1.04);
}

.thumb-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(5, 7, 15, 0.7), transparent 50%),
    repeating-linear-gradient(
      to bottom,
      rgba(57, 255, 20, 0.04) 0,
      rgba(57, 255, 20, 0.04) 1px,
      transparent 1px,
      transparent 3px
    );
  pointer-events: none;
}

.card-body {
  padding: 1.1rem 1.2rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.student-name {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  color: var(--cyan);
  margin: 0;
  text-transform: uppercase;
}

.controls {
  color: var(--muted);
  margin: 0;
  font-size: 0.95rem;
  flex: 1;
}

/* ---------- play button (arcade) ---------- */
.play-btn {
  --btn-lift: 0px;
  align-self: flex-start;
  margin-top: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  text-decoration: none;
  color: #02120a;
  background: linear-gradient(180deg, #5cff42 0%, #2ecc0e 100%);
  padding: 0.7rem 1.2rem 0.6rem;
  border-radius: 10px;
  border: 1px solid #1aa800;
  box-shadow:
    0 4px 0 0 #0e6a00,
    0 0 0 1px var(--neon-edge),
    0 0 18px rgba(57, 255, 20, 0.45);
  transform: translateY(var(--btn-lift));
  transition: transform .12s ease, box-shadow .18s ease, filter .18s ease;
}

.play-btn .arrow {
  display: inline-block;
  transition: transform .18s ease;
}

.play-btn:hover {
  --btn-lift: -2px;
  filter: brightness(1.08);
  box-shadow:
    0 6px 0 0 #0e6a00,
    0 0 0 1px var(--neon),
    0 0 26px rgba(57, 255, 20, 0.65);
}

.play-btn:hover .arrow {
  transform: translateX(2px);
}

.play-btn:active {
  --btn-lift: 2px;
  box-shadow:
    0 0 0 0 #0e6a00,
    0 0 0 1px var(--neon),
    0 0 14px rgba(57, 255, 20, 0.55);
}

/* ---------- footer ---------- */
.site-footer {
  margin-top: 5rem;
  padding: 2rem 1.5rem;
  text-align: center;
  border-top: 1px solid var(--neon-edge);
  color: var(--muted);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
}

.site-footer .dot {
  color: var(--neon);
  margin: 0 0.6rem;
}

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  .hero {
    min-height: 40vh;
    padding: 3rem 1.25rem 2.5rem;
  }
  .game-section { padding: 3rem 1.25rem 0.5rem; }
  .card-grid { gap: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .hero::before { animation: none; }
  * { transition: none !important; }
}
