:root {
  --bg: #05030a;
  --fg: #f4f1ff;
  --muted: #a39cc4;
  --pink: #ff3d9a;
  --cyan: #38d6ff;
  --display: 'Syne', 'Arial Black', sans-serif;
  --text: 'Space Grotesk', system-ui, sans-serif;
}

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

html { scroll-behavior: auto; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  /* click-and-drag drives the effects, so never select text */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

body:not(.loaded) { overflow: hidden; }

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

#gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

/* ---------- loader ---------- */
#loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: clip-path 1.1s cubic-bezier(.77, 0, .18, 1);
  clip-path: inset(0 0 0 0);
}
body.loaded #loader { clip-path: inset(0 0 100% 0); }

.loader-count {
  font-family: var(--display);
  font-size: clamp(64px, 16vw, 200px);
  line-height: 1;
  background: linear-gradient(90deg, var(--pink), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.loader-label {
  font-size: 13px;
  letter-spacing: .35em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- cursor ---------- */
.cursor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  mix-blend-mode: difference;
}
.cursor-dot, .cursor-ring {
  position: fixed;
  left: 0;
  top: 0;
  border-radius: 50%;
  will-change: transform;
  transform: translate3d(-200px, -200px, 0);
}
.cursor-dot {
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  background: #fff;
}
.cursor-ring {
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border: 1.5px solid #fff;
  transition: width .35s, height .35s, margin .35s, background-color .35s;
}
.cursor.hover .cursor-ring {
  width: 96px;
  height: 96px;
  margin: -48px 0 0 -48px;
  background: #fff;
}
.cursor.down .cursor-ring {
  width: 140px;
  height: 140px;
  margin: -70px 0 0 -70px;
}

@media (pointer: fine) {
  body, a, button { cursor: none; }
}
@media (pointer: coarse) {
  .cursor { display: none; }
}

/* ---------- nav ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px clamp(16px, 4vw, 48px);
  mix-blend-mode: difference;
  pointer-events: none;
}
.nav > * { pointer-events: auto; }
.logo {
  font-family: var(--display);
  font-size: 22px;
  display: inline-block;
  padding: 8px;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-btn {
  font: inherit;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #fff;
  background: transparent;
  border: 1.5px solid #fff;
  border-radius: 999px;
  padding: 8px 14px;
  transition: background-color .3s, color .3s;
  will-change: transform;
}
.nav-btn:hover, .nav-btn.active { background: #fff; color: #000; }
.nav-btn:focus-visible, .logo:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.nav-hint {
  font-size: 12px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #fff;
  opacity: .7;
}

/* ---------- panels ---------- */
main { position: relative; z-index: 2; }

.panel {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 clamp(16px, 7vw, 120px);
  pointer-events: none;
}
.panel a { pointer-events: auto; }
.panel.right { align-items: flex-end; text-align: right; }
.panel.tall { height: 200vh; justify-content: flex-start; padding-top: 38vh; }

.kicker {
  font-size: 13px;
  letter-spacing: .35em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 18px;
}

h2 {
  font-family: var(--display);
  font-size: clamp(40px, 9vw, 140px);
  line-height: .9;
  letter-spacing: -.02em;
  max-width: 12ch;
  text-shadow: 0 0 40px rgba(5, 3, 10, .8);
}

.body {
  margin-top: 22px;
  max-width: 34ch;
  font-size: clamp(16px, 1.6vw, 20px);
  line-height: 1.5;
  color: var(--muted);
}

/* ---------- hero ---------- */
.hero { align-items: flex-start; perspective: 900px; }
.hero-title {
  font-family: var(--display);
  font-size: clamp(76px, 21vw, 340px);
  line-height: .8;
  letter-spacing: -.04em;
  color: #fff;
  mix-blend-mode: difference;
  transform-style: preserve-3d;
  will-change: transform;
}
.hero-title .line { display: block; }

/* letters are split into spans so they can fall, bounce and get shoved */
.word { display: inline-block; white-space: nowrap; }
.ch { display: inline-block; will-change: transform; }
.hero-title .line:nth-child(2) { padding-left: .35em; }

.scroll-cue {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: .35em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.scroll-cue span {
  width: 1px;
  height: 48px;
  background: linear-gradient(var(--fg), transparent);
  animation: cue 1.8s ease-in-out infinite;
  transform-origin: top;
}
@keyframes cue {
  0% { transform: scaleY(0); }
  50% { transform: scaleY(1); }
  100% { transform: scaleY(1); opacity: 0; }
}

/* ---------- contact ---------- */
.contact { align-items: center; text-align: center; }
.contact h2 { max-width: none; }
.contact .body { margin-left: auto; margin-right: auto; }
.body strong { color: var(--fg); font-weight: 500; }
.contact footer {
  position: absolute;
  bottom: 24px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .1em;
}
.contact { position: relative; }
.konami { opacity: .35; letter-spacing: .15em; }

/* ---------- reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s ease, transform 1s cubic-bezier(.2, .8, .2, 1);
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- OMG ---------- */
.omg {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: clamp(120px, 38vw, 560px);
  letter-spacing: -.05em;
  pointer-events: none;
  background: linear-gradient(90deg, var(--pink), #ffd23d, var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0;
  transform: scale(.2) rotate(-12deg);
}
.omg.on { animation: omg 1.6s cubic-bezier(.2, 1.6, .3, 1) forwards; }
@keyframes omg {
  0% { opacity: 0; transform: scale(.2) rotate(-12deg); }
  20% { opacity: 1; transform: scale(1.1) rotate(4deg); }
  70% { opacity: 1; transform: scale(1) rotate(0); }
  100% { opacity: 0; transform: scale(2.4) rotate(0); filter: blur(20px); }
}

.noscript {
  position: fixed;
  inset: auto 16px 16px;
  z-index: 200;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 700px) {
  .panel.right { align-items: flex-start; text-align: left; }
  .hero-title .line:nth-child(2) { padding-left: 0; }
  .nav-hint { display: none; }
  .nav-btn { font-size: 10px; padding: 7px 10px; letter-spacing: .08em; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none; opacity: 1; transform: none; }
  .scroll-cue span { animation: none; }
}
