:root {
  --bg: #090908;
  --ink: #f3ece0;
  --muted: #8a867e;
  --line: rgba(243, 236, 224, 0.12);
  --spot: #3dff6e;
  --live: #8dffb8;
  --font: "Sora", "Avenir Next", "Segoe UI", sans-serif;
  --display: "Unbounded", "Sora", sans-serif;
  --pad: clamp(20px, 5vw, 80px);
  --header: 72px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--spot);
  outline-offset: 4px;
}

::selection {
  background: var(--spot);
  color: #03140a;
}

.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--live);
}

/* Header */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header);
  padding: env(safe-area-inset-top) var(--pad) 0;
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.site-header.is-scrolled {
  background: rgba(9, 9, 8, 0.78);
  border-bottom-color: var(--line);
  backdrop-filter: blur(14px) saturate(1.4);
}

.brand img {
  height: 30px;
  width: auto;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.site-header.is-scrolled .brand img {
  opacity: 1;
  transform: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
}

.nav a {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.2s ease;
}

.nav a:hover {
  color: var(--ink);
}

.x-link {
  display: inline-flex;
  color: var(--muted);
  letter-spacing: 0;
  transition: color 0.2s ease;
}

.x-link:hover {
  color: var(--ink);
}

.x-link svg {
  display: block;
  width: 14px;
  height: 14px;
}

/* Hero */

.hero {
  --mx: 50%;
  --my: 45%;
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: var(--header) var(--pad);
  overflow: hidden;
  isolation: isolate;
}

.hero-sky {
  position: absolute;
  inset: 0;
  z-index: -3;
  background: radial-gradient(52% 38% at 50% 60%, rgba(61, 255, 110, 0.2), transparent 70%);
  filter: blur(12px);
  animation: sky 18s ease-in-out infinite alternate;
}

.hero-floor {
  position: absolute;
  left: -50%;
  right: -50%;
  bottom: 0;
  height: 46%;
  z-index: -2;
  perspective: 340px;
  perspective-origin: 50% 0%;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 35%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 35%);
}

.hero-grid {
  position: absolute;
  inset: 0 0 -60%;
  transform: rotateX(62deg);
  transform-origin: 50% 0%;
  background-image:
    linear-gradient(to right, rgba(243, 236, 224, 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(243, 236, 224, 0.07) 1px, transparent 1px);
  background-size: 72px 72px;
  animation: grid-run 9s linear infinite;
}

.hero-spot {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(
    420px circle at var(--mx) var(--my),
    rgba(255, 255, 255, 0.09),
    transparent 70%
  );
}

.hero-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transform: translateY(-4vh);
}

.hero-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0 0 clamp(1.6rem, 3vw, 2.4rem);
  animation: rise 1s var(--ease) 0.2s both;
}

.shutter {
  width: 46px;
  height: 46px;
  flex: none;
  overflow: visible;
  color: var(--ink);
}

.shutter-flare {
  fill: var(--spot);
  opacity: 0.4;
  animation: flare 8.5s ease-in-out infinite;
}

.shutter-core {
  fill: #e8ffe9;
  opacity: 0.85;
}

.blade {
  fill: #100e0c;
  stroke: rgba(243, 236, 224, 0.34);
  stroke-width: 0.7;
  stroke-linejoin: round;
  transform-box: view-box;
  animation: swing 8.5s cubic-bezier(0.65, 0, 0.25, 1) infinite;
}

.shutter-ring {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
}

.shutter-ticks {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-dasharray: 1.15 6.43;
  stroke-dashoffset: 1.9;
  opacity: 0.45;
}

.shutter-index {
  fill: none;
  stroke: var(--spot);
  stroke-width: 1.6;
  stroke-linecap: butt;
}

.hero-mark-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.22rem;
  text-align: left;
}

.hero-serial {
  color: var(--spot);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.28em;
}

.hero-role {
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.logo-shine {
  position: relative;
  margin: 0;
  width: min(820px, 86vw);
  filter: drop-shadow(0 22px 36px rgba(0, 0, 0, 0.45));
  animation: reveal 1.6s var(--ease) both;
}

.logo-shine::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 42%,
    rgba(220, 255, 230, 0.15) 47%,
    rgba(236, 255, 244, 0.95) 50%,
    rgba(61, 255, 110, 0.5) 53%,
    transparent 58%
  );
  background-size: 300% 100%;
  -webkit-mask: url("../assets/logo-white.png") center / contain no-repeat;
  mask: url("../assets/logo-white.png") center / contain no-repeat;
  animation: shine 5s ease-in-out 1.4s infinite;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
  margin-top: clamp(2rem, 4vw, 3rem);
  animation: rise 1s var(--ease) 0.6s both;
}

.btn {
  padding: 0.95rem 1.5rem;
  border: 1px solid rgba(245, 243, 238, 0.25);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.25s var(--ease), background 0.25s ease, box-shadow 0.25s ease;
}

.btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.1);
}

.btn-solid {
  border-color: transparent;
  background: var(--ink);
  color: #000;
  box-shadow: none;
}

.btn-solid:hover {
  background: #fff;
  box-shadow: 0 14px 36px -14px rgba(61, 255, 110, 0.7);
}

.scroll-cue {
  position: absolute;
  bottom: calc(28px + env(safe-area-inset-bottom));
  left: 50%;
  width: 24px;
  height: 38px;
  margin-left: -12px;
  border: 1px solid rgba(245, 243, 238, 0.35);
  border-radius: 12px;
}

.scroll-cue span {
  position: absolute;
  top: 7px;
  left: 50%;
  width: 3px;
  height: 7px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--ink);
  animation: cue 1.8s ease-in-out infinite;
}

/* Statement */

.statement {
  scroll-margin-top: var(--header);
  padding: clamp(6rem, 14vw, 11rem) var(--pad);
  max-width: 1400px;
}

.statement-label,
.games-count {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.statement-text {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.9rem, 4.6vw, 4.2rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.statement-text .w {
  color: rgba(245, 243, 238, 0.14);
  transition: color 0.35s ease;
}

.statement-text .w.on {
  color: var(--ink);
}

.statement-text .w.on.accent {
  color: var(--spot);
}

/* Games */

.games {
  scroll-margin-top: var(--header);
  padding: clamp(2rem, 4vw, 3rem) var(--pad) clamp(5rem, 10vw, 8rem);
}

.games-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: clamp(1.75rem, 3vw, 2.75rem);
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.games-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.6rem, 7vw, 6rem);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.05em;
}

.games-count {
  margin: 0;
}

.games-meta {
  display: flex;
  align-items: baseline;
  gap: clamp(0.85rem, 2vw, 1.5rem);
}

.games-meta a {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.games-meta a:hover {
  color: var(--ink);
}

.games-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr);
  gap: clamp(16px, 2vw, 28px);
}

.game {
  position: relative;
  display: block;
  perspective: 1200px;
  color: inherit;
  text-decoration: none;
}

.game-glow {
  position: absolute;
  inset: 8% 4% -2%;
  z-index: -1;
  overflow: hidden;
  border-radius: 40px;
  filter: blur(60px) saturate(1.6);
  opacity: 0.55;
  transition: opacity 0.4s ease;
}

.game-glow img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game:hover .game-glow {
  opacity: 0.85;
}

.game-card {
  --rx: 0deg;
  --ry: 0deg;
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  background: #0c0c10;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.5s var(--ease), border-color 0.3s ease;
}

.game:hover .game-card {
  border-color: rgba(245, 243, 238, 0.28);
}

.game-art {
  display: block;
  flex: 1;
  overflow: hidden;
}

.game-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease);
}

.game:hover .game-art img {
  transform: scale(1.04);
}

.game-info {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.35rem 1rem;
  padding: 1.25rem 1.5rem 1.4rem;
}

.game-info .chip {
  grid-column: 1 / -1;
  justify-self: start;
}

.game-info h3 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.3rem, 2.2vw, 1.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.game-info p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid rgba(61, 255, 110, 0.32);
  border-radius: 999px;
  color: var(--live);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.chip .dot {
  width: 6px;
  height: 6px;
}

.chip-muted {
  border-color: var(--line);
  color: var(--muted);
}

.next-screen {
  position: relative;
  flex: 1;
  min-height: 220px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(243, 236, 224, 0.04) 0 1px,
      transparent 1px 4px
    ),
    #0c0b0a;
}

.next-screen::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 30%;
  background: linear-gradient(to bottom, transparent, rgba(61, 255, 110, 0.12), transparent);
  animation: scan 3.2s linear infinite;
}

.next-num {
  font-family: var(--display);
  font-size: clamp(5rem, 11vw, 9rem);
  font-weight: 800;
  letter-spacing: -0.06em;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(245, 243, 238, 0.3);
  animation: flicker 4s steps(1) infinite;
}

.loader {
  grid-column: 1 / -1;
  height: 3px;
  margin-top: 0.6rem;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.loader span {
  display: block;
  width: 40%;
  height: 100%;
  border-radius: inherit;
  background: var(--spot);
  animation: load 2.6s var(--ease) infinite;
}

/* Footer */

.footer {
  position: relative;
  overflow: hidden;
  padding: clamp(2.5rem, 6vw, 4rem) var(--pad) 0;
  border-top: 1px solid var(--line);
}

.footer-logo {
  width: min(220px, 46vw);
  height: auto;
  margin: 0 auto;
  opacity: 0.07;
}

.colophon {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.5rem 0 calc(1.5rem + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 0.75rem;
}

.colophon-links {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

/* Reveal on scroll */

[data-reveal] {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

[data-reveal].in {
  opacity: 1;
  transform: none;
}

/* Keyframes */

@keyframes reveal {
  from {
    opacity: 0;
    filter: blur(16px);
    transform: scale(0.94);
  }
  to {
    opacity: 1;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes shine {
  0% { background-position: 100% 0; }
  45%, 100% { background-position: 0% 0; }
}

@keyframes grid-run {
  to { background-position: 0 72px; }
}

@keyframes sky {
  from { transform: translateX(-3%) scale(1); }
  to { transform: translateX(3%) scale(1.08); }
}

@keyframes cue {
  0% { opacity: 0; transform: translateY(0); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translateY(12px); }
}

@keyframes scan {
  from { top: -30%; }
  to { top: 100%; }
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: 0.3; }
  95% { opacity: 1; }
  96% { opacity: 0.5; }
}

@keyframes load {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(260%); }
}

@keyframes swing {
  0%, 64%, 100% { transform: rotate(0deg); }
  76%, 86% { transform: rotate(-28deg); }
}

@keyframes flare {
  0%, 70%, 92%, 100% { opacity: 0.28; }
  80% { opacity: 1; }
}

@media (max-width: 760px) {
  .games-head {
    flex-wrap: wrap;
    row-gap: 0.85rem;
  }

  .games-meta {
    flex: 1 0 100%;
    justify-content: space-between;
  }

  .games-grid {
    grid-template-columns: 1fr;
  }

  .game-card {
    border-radius: 16px;
  }

  .next-screen {
    min-height: 180px;
  }

  .hero-grid {
    background-size: 44px 44px;
  }
}

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

  [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .statement-text .w {
    color: var(--ink);
  }
}
