:root {
  --void: #0a0904;
  --void-soft: #100e08;
  --neon: #f5edb0;
  --neon-bright: #fffbd6;
  --blood: #c92f2f;
  --paper: rgba(245, 237, 176, 0.82);
  --paper-dim: rgba(245, 237, 176, 0.5);
  --line: rgba(245, 237, 176, 0.14);
  --font-display: "Bebas Neue", sans-serif;
  --font-body: "IBM Plex Sans", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--paper);
  background: var(--void);
  line-height: 1.6;
  overflow-x: hidden;
}

::selection {
  background: var(--blood);
  color: var(--neon-bright);
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: rgba(245, 237, 176, 0.08);
  border: 1px solid var(--line);
  padding: 0.1em 0.45em;
  color: var(--neon);
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- ambiance ---------- */

.noise {
  pointer-events: none;
  position: fixed;
  inset: -50%;
  z-index: 1000;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}

@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-2%, 2%); }
  50% { transform: translate(2%, -2%); }
  75% { transform: translate(-2%, -2%); }
}

.vignette {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: radial-gradient(ellipse 90% 80% at 50% 45%, transparent 50%, rgba(0, 0, 0, 0.6) 100%);
}

.flashlight {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 998;
  background: radial-gradient(
    circle 300px at var(--fx, 50vw) var(--fy, 40vh),
    rgba(255, 250, 200, 0.07),
    transparent 70%
  );
  mix-blend-mode: screen;
  will-change: background;
}

/* ---------- nav ---------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.2rem clamp(1.5rem, 5vw, 3.5rem);
  transition: background 0.4s var(--ease);
}

.nav.is-scrolled {
  background: rgba(10, 9, 4, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav__brand {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.14em;
  color: var(--neon);
}

.nav__links {
  display: flex;
  gap: 1.75rem;
}

.nav__links a {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper-dim);
  transition: color 0.25s var(--ease), text-shadow 0.25s var(--ease);
}

.nav__links a:hover {
  color: var(--neon-bright);
  text-shadow: 0 0 12px rgba(245, 237, 176, 0.6);
}

.nav__cta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  border: 1px solid rgba(245, 237, 176, 0.4);
  color: var(--neon);
  padding: 0.55rem 1.1rem;
  transition: all 0.25s var(--ease);
}

.nav__cta:hover {
  background: var(--neon);
  color: var(--void);
  box-shadow: 0 0 24px rgba(245, 237, 176, 0.4);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  padding: 1.05rem 1.9rem;
  border: 1px solid var(--neon);
  transition: all 0.3s var(--ease);
}

.btn--primary {
  background: var(--neon);
  color: var(--void);
}

.btn--primary:hover {
  background: var(--neon-bright);
  box-shadow: 0 0 32px rgba(245, 237, 176, 0.45), 0 0 90px rgba(245, 237, 176, 0.15);
  transform: translateY(-2px);
}

.btn.is-disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 6rem clamp(1.5rem, 5vw, 3.5rem) 5rem;
  overflow: hidden;
}

.hero__atmosphere {
  position: absolute;
  inset: 0;
}

.hero__walls {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(201, 184, 74, 0.14) 0%, rgba(201, 184, 74, 0.04) 35%, transparent 75%),
    repeating-linear-gradient(
      90deg,
      rgba(201, 184, 74, 0.09) 0,
      rgba(201, 184, 74, 0.09) 72px,
      rgba(143, 126, 42, 0.12) 72px,
      rgba(143, 126, 42, 0.12) 74px,
      rgba(201, 184, 74, 0.06) 74px,
      rgba(201, 184, 74, 0.06) 146px,
      rgba(143, 126, 42, 0.12) 146px,
      rgba(143, 126, 42, 0.12) 148px
    );
}

.hero__lights {
  position: absolute;
  top: 6vh;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  padding: 0 8vw;
}

.tube {
  display: block;
  width: clamp(110px, 16vw, 240px);
  height: 9px;
  background: var(--neon-bright);
  border-radius: 3px;
  box-shadow:
    0 0 18px rgba(255, 251, 214, 0.9),
    0 0 60px rgba(245, 237, 176, 0.45),
    0 40px 120px 30px rgba(245, 237, 176, 0.15);
  animation: hum 7s ease-in-out infinite;
}

.tube--dying {
  animation: dying 4.2s linear infinite;
}

@keyframes hum {
  0%, 100% { opacity: 1; }
  48% { opacity: 1; }
  49% { opacity: 0.8; }
  50% { opacity: 1; }
}

@keyframes dying {
  0%, 100% { opacity: 1; }
  9% { opacity: 0.2; }
  11% { opacity: 1; }
  42% { opacity: 0.95; }
  44% { opacity: 0.3; }
  46% { opacity: 1; }
  79% { opacity: 0.15; }
  82% { opacity: 0.9; }
}

.hero__carpet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 26%;
  background: linear-gradient(to top, #050402, transparent);
}

.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  animation: rise 1.2s var(--ease) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.34em;
  color: var(--paper-dim);
  margin-bottom: 1.25rem;
}

.hero__brand {
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 16vw, 12rem);
  line-height: 0.9;
  letter-spacing: 0.05em;
  color: var(--neon);
  text-shadow: 0 0 24px rgba(245, 237, 176, 0.45), 0 0 100px rgba(245, 237, 176, 0.2);
  margin-bottom: 1.5rem;
}

.glitch {
  position: relative;
  display: inline-block;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0;
}

.glitch::before {
  color: var(--blood);
  z-index: -1;
  animation: glitch-a 7s steps(1) infinite;
}

.glitch::after {
  color: #4a9a8f;
  z-index: -2;
  animation: glitch-b 7s steps(1) infinite;
}

@keyframes glitch-a {
  0%, 93%, 100% { opacity: 0; transform: none; }
  94% { opacity: 0.8; transform: translate(-5px, 2px); clip-path: inset(15% 0 60% 0); }
  95% { opacity: 0.8; transform: translate(4px, -2px); clip-path: inset(60% 0 10% 0); }
  96% { opacity: 0; }
}

@keyframes glitch-b {
  0%, 93%, 100% { opacity: 0; transform: none; }
  94% { opacity: 0.7; transform: translate(5px, -2px); clip-path: inset(55% 0 20% 0); }
  96% { opacity: 0.6; transform: translate(-4px, 2px); clip-path: inset(10% 0 70% 0); }
  97% { opacity: 0; }
}

.hero__lead {
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  color: var(--paper-dim);
  margin-bottom: 2.5rem;
}

/* ---------- strip ---------- */

.strip {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--void-soft);
}

.strip__items {
  list-style: none;
  max-width: 62rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.strip__items li {
  padding: 2.25rem 1.5rem;
  text-align: center;
  transition: background 0.3s var(--ease);
}

.strip__items li:hover {
  background: rgba(245, 237, 176, 0.03);
}

.strip__items li + li {
  border-left: 1px solid var(--line);
}

.strip__code {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--blood);
  display: block;
  margin-bottom: 0.5rem;
}

.strip__items p {
  font-size: 0.95rem;
  color: var(--paper);
}

/* ---------- sections ---------- */

.section {
  padding: clamp(5rem, 13vh, 8rem) clamp(1.5rem, 5vw, 3.5rem);
}

.section__inner {
  position: relative;
  z-index: 2;
  max-width: 26rem;
  margin: 0 auto;
  text-align: center;
}

.section__head {
  max-width: 62rem;
  margin: 0 auto 3rem;
  text-align: center;
}

.section__title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 4rem);
  letter-spacing: 0.06em;
  color: var(--neon);
  text-shadow: 0 0 30px rgba(245, 237, 176, 0.2);
  margin-bottom: 1rem;
}

.section__sub {
  color: var(--paper-dim);
  font-size: 1rem;
}

/* ---------- level 1 feature ---------- */

.section--level {
  padding-top: clamp(4rem, 10vh, 6rem);
}

.level-feature {
  max-width: 68rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.level-feature__media {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 16 / 11;
  background: #120f08;
}

.level-feature__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(1.05) contrast(1.05);
  transition: transform 1.1s var(--ease);
}

.level-feature__media:hover img {
  transform: scale(1.04);
}

.level-feature__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 55%, rgba(10, 9, 4, 0.55) 100%),
    linear-gradient(180deg, rgba(10, 9, 4, 0.15) 0%, transparent 30%, rgba(10, 9, 4, 0.45) 100%);
  pointer-events: none;
}

.level-feature__badge {
  position: absolute;
  left: 1.1rem;
  bottom: 1.1rem;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  color: var(--void);
  background: var(--neon);
  padding: 0.45rem 0.75rem;
}

.level-feature__tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  color: var(--blood);
  display: block;
  margin-bottom: 0.75rem;
}

.level-feature__copy .section__title {
  text-align: left;
  margin-bottom: 1.1rem;
}

.level-feature__lead {
  color: var(--paper-dim);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 28rem;
}

.level-feature__facts {
  list-style: none;
  border-top: 1px solid var(--line);
}

.level-feature__facts li {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
  color: var(--paper);
}

.level-feature__facts span {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  color: var(--paper-dim);
  min-width: 5.5rem;
}

/* ---------- scroll entity ---------- */

.scroll-entity {
  position: fixed;
  right: -12px;
  bottom: 4vh;
  z-index: 50;
  width: clamp(120px, 17vw, 210px);
  pointer-events: none;
  user-select: none;
  opacity: var(--entity-opacity, 0);
  /* clings to the right edge: hidden offscreen, hauls itself in on scroll.
     Movement is eased in JS (lerp), so no CSS transition here. */
  transform: translateX(var(--entity-peek, 105%)) rotate(-20deg);
  transform-origin: 85% 12%;
  will-change: transform, opacity;
}

.scroll-entity__img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 22px rgba(245, 237, 176, 0.25)) drop-shadow(0 12px 24px rgba(0, 0, 0, 0.55));
  /* hangs from its claws hooked on the screen edge, swinging slowly */
  animation: entity-hang 3.8s ease-in-out infinite;
  transform-origin: 85% 8%;
}

@keyframes entity-hang {
  0%, 100% { transform: rotate(-3deg) translateY(0); }
  50% { transform: rotate(4deg) translateY(7px); }
}

/* ---------- install ---------- */

.section--install {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--line);
  background:
    radial-gradient(ellipse 50% 80% at 50% 30%, rgba(201, 184, 74, 0.05), transparent 70%),
    var(--void);
}

.steps {
  list-style: none;
  margin-bottom: 2.75rem;
  text-align: left;
}

.steps li {
  display: flex;
  align-items: baseline;
  gap: 1.1rem;
  padding: 0.95rem 0.25rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.98rem;
}

.steps li:first-child {
  border-top: 1px solid var(--line);
}

.steps li span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--blood);
  letter-spacing: 0.1em;
}

/* ---------- footer ---------- */

.footer {
  border-top: 1px solid var(--line);
  padding: 2rem clamp(1.5rem, 5vw, 3.5rem);
  text-align: center;
  background: #050402;
}

.footer p {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--paper-dim);
}

.footer__whisper {
  opacity: 0.45;
  font-style: italic;
}

/* ---------- reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* staggered cascade for grouped items */
.strip__items li:nth-child(2),
.steps li:nth-child(2) { transition-delay: 0.12s; }
.strip__items li:nth-child(3),
.steps li:nth-child(3) { transition-delay: 0.24s; }
.steps li:nth-child(4) { transition-delay: 0.36s; }
.download { transition-delay: 0.45s; }
.level-feature__copy { transition-delay: 0.18s; }

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .nav__links { display: none; }

  .level-feature {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .level-feature__copy .section__title {
    text-align: center;
  }

  .level-feature__copy {
    text-align: center;
  }

  .level-feature__lead {
    margin-left: auto;
    margin-right: auto;
  }

  .level-feature__facts li {
    justify-content: center;
  }

  .scroll-entity {
    width: clamp(70px, 22vw, 110px);
    bottom: 3vh;
  }

  .strip__items,
  .stats__items {
    grid-template-columns: 1fr;
  }

  .strip__items li + li {
    border-left: none;
    border-top: 1px solid var(--line);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .reveal { opacity: 1; transform: none; }
  .scroll-entity { transition: none; }
}
