:root {
  --lime: #c6ff00;
  --olive: #9cb410;
  --ink: #0d0d0d;
  --mono: 'Space Mono', ui-monospace, monospace;
  --black: 'Archivo Black', 'Arial Black', sans-serif;
}

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

body {
  background: var(--lime);
  color: var(--ink);
  font-family: var(--mono);
  overflow-x: hidden;
}

/* ============ HERO ============ */

.hero {
  min-height: 100vh;
  min-height: 100dvh; /* mobile browser chrome */
  padding: 48px 4.5vw 120px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.35em;
  position: relative;
  z-index: 10; /* above the 3D canvas — nav must never be occluded */
}

.nav span { margin: 0 2px; }
.nav em { font-style: normal; margin: 0 6px; }

.rule {
  border: none;
  border-top: 1px solid rgba(13, 13, 13, 0.55);
  margin-top: 18px;
  position: relative;
  z-index: 10;
}

.hero-copy {
  position: relative;
  z-index: 3;
  max-width: 52vw;
}

.title {
  margin-top: 7vh;
  font-family: var(--black);
  font-weight: 400;
  text-transform: uppercase;
  line-height: 0.88;
  letter-spacing: -0.015em;
  font-size: clamp(40px, 7.4vw, 138px);
  user-select: none;
}

.title .ln { display: block; }
.title .black { color: var(--ink); }
.title .olive {
  color: var(--olive);
  font-size: 0.58em;
  line-height: 0.96;
}

.cta {
  margin-top: 7vh;
  display: inline-block;
  background: var(--ink);
  color: var(--lime);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.35em;
  padding: 26px 40px;
  transition: transform 0.15s ease;
}

.cta:hover { transform: translate(3px, -3px); }
.cta .arrow { letter-spacing: 0; }

.footnote {
  position: absolute;
  bottom: 64px;
  left: 4.5vw;
  font-size: 10px;
  letter-spacing: 0.3em;
  opacity: 0.65;
  z-index: 3;
  max-width: 46vw;
  line-height: 1.8;
}

/* ============ THE NOOB STAGE ============ */

.stage {
  position: absolute;
  top: 0;
  right: 0;
  width: 56vw;
  height: 100vh;
  height: 100dvh;
  z-index: 5; /* the noob is the main character — he stands on top of the type */
  pointer-events: none;
}

.stage canvas { display: block; }

/* floating OOF! chips on click */
.oof-layer {
  position: fixed; /* viewport-anchored so chips land at the pointer even when scrolled */
  inset: 0;
  z-index: 6;
  pointer-events: none;
  overflow: hidden;
}

.oof {
  position: absolute;
  font-family: var(--black);
  font-size: 28px;
  color: var(--ink);
  background: transparent;
  letter-spacing: 0.02em;
  animation: oof-pop 0.9s ease-out forwards;
  text-shadow: 3px 3px 0 rgba(156, 180, 16, 0.8);
}

@keyframes oof-pop {
  0% { transform: translateY(0) scale(0.6) rotate(-6deg); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translateY(-110px) scale(1.25) rotate(6deg); opacity: 0; }
}

/* ============ MARQUEE ============ */

.marquee {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--ink);
  color: var(--lime);
  overflow: hidden;
  z-index: 40;
  border-top: 1px solid var(--lime);
}

.marquee-track {
  display: inline-block;
  white-space: nowrap;
  padding: 12px 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  animation: scroll 40s linear infinite;
}

.marquee-track em {
  font-style: normal;
  opacity: 0.4;
  margin: 0 18px;
}

@keyframes scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ============ 8-BIT SPEECH BUBBLE ============ */

.speech {
  position: absolute;
  z-index: 7;
  background: #fff;
  color: #141414;
  font-family: 'Press Start 2P', 'Space Mono', monospace;
  font-size: 10px;
  line-height: 2;
  padding: 16px 18px;
  width: 290px;
  border: 4px solid #141414;
  box-shadow: 0 0 0 4px #fff, 6px 8px 0 4px rgba(0, 0, 0, 0.3);
  transform: translate(-50%, calc(-100% - 26px));
  opacity: 0;
  pointer-events: none;
}

.speech.show { animation: bubble-pop 0.3s steps(4) forwards; }

@keyframes bubble-pop {
  from { opacity: 1; transform: translate(-50%, calc(-100% - 26px)) scale(0.3); }
  to { opacity: 1; transform: translate(-50%, calc(-100% - 26px)) scale(1); }
}

.speech.hide { transition: opacity 0.7s steps(3); opacity: 0 !important; }

.speech .tail {
  position: absolute;
  bottom: -12px;
  left: 48px;
  width: 20px;
  height: 8px;
  background: #fff;
  border-left: 4px solid #141414;
  border-right: 4px solid #141414;
}

.speech .tail::after {
  content: '';
  position: absolute;
  top: 8px;
  left: 4px;
  width: 8px;
  height: 6px;
  background: #fff;
  border: 4px solid #141414;
  border-top: none;
}

/* ============ SKIP INTRO ============ */

.skip-btn {
  position: fixed;
  bottom: 26px;
  right: 5vw;
  z-index: 8;
  font-family: 'Press Start 2P', 'Space Mono', monospace;
  font-size: 9px;
  padding: 12px 16px;
  background: #fff;
  color: #141414;
  border: 4px solid #141414;
  box-shadow: 0 0 0 3px #fff, 4px 5px 0 3px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  animation: skip-in 0.3s steps(4);
}

.skip-btn:hover { background: #141414; color: #fff; }

@keyframes skip-in { from { opacity: 0; transform: translateY(10px); } }

/* ============ WORLD NAV BUTTONS (revealed by the tour) ============ */

.world-nav {
  position: absolute;
  right: 5vw;
  top: 32vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  z-index: 7;
}

.wbtn {
  font-family: 'Press Start 2P', 'Space Mono', monospace;
  font-size: 11px;
  background: #fff;
  color: #141414;
  border: 4px solid #141414;
  box-shadow: 0 0 0 4px #fff, 5px 6px 0 4px rgba(0, 0, 0, 0.3);
  padding: 15px 20px;
  text-decoration: none;
  text-align: center;
  min-width: 120px;
  opacity: 0;
  transform: scale(0);
  pointer-events: none;
}

.wbtn.pop {
  animation: wbtn-pop 0.3s steps(4) forwards;
  pointer-events: auto;
}

.wbtn:hover { background: #141414; color: #fff; }

@keyframes wbtn-pop {
  from { opacity: 1; transform: scale(0.3); }
  to { opacity: 1; transform: scale(1); }
}

/* ============ ENTERING THE WORLD ============ */

.cta, .marquee { transition: opacity 1.4s ease; }

body.entered .cta,
body.entered .marquee {
  opacity: 0;
  pointer-events: none;
}

/* the scene becomes the page background: full-bleed, behind the type */
body.entered .stage {
  width: 100vw;
  z-index: 2;
}

/* ============ RESPONSIVE ============ */

@media (max-width: 860px) {
  .hero { padding: 28px 24px 120px; }
  .hero-copy { max-width: 100%; }
  .title { font-size: clamp(44px, 11vw, 90px); }
  .stage { width: 100vw; opacity: 0.55; z-index: 1; }
  .footnote { left: 24px; max-width: 80vw; }
}
