:root {
  --bg: #030508;
  --deepslate: #111820;
  --deepslate-dark: #080d12;
  --blue: #2caadb;
  --blue-soft: #84ddff;
  --gold: #f4c64b;
  --text: #f4f7fb;
  --muted: rgba(244, 247, 251, 0.48);
  --line: rgba(255, 255, 255, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family: Inter, Arial, sans-serif;
  background: var(--bg);
}

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

button {
  font: inherit;
}

.scroll-progress {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 40;
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.04);
}

.scroll-progress span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--blue-soft));
  box-shadow: 0 0 18px rgba(44, 170, 219, 0.55);
}

.topbar {
  position: fixed;
  top: 28px;
  left: 50%;
  z-index: 30;
  width: min(1160px, calc(100% - 40px));
  transform: translateX(-50%);
}

.menu-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  color: rgba(244, 247, 251, 0.52);
  cursor: pointer;
  background: transparent;
  font-weight: 900;
}

.menu-button span,
.menu-button span::before,
.menu-button span::after {
  display: block;
  width: 17px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.menu-button span {
  position: relative;
}

.menu-button span::before,
.menu-button span::after {
  position: absolute;
  left: 0;
  content: "";
}

.menu-button span::before {
  top: -6px;
}

.menu-button span::after {
  top: 6px;
}

.menu-button:hover {
  color: var(--text);
}

.menu-panel {
  position: absolute;
  top: 50px;
  left: 0;
  display: grid;
  min-width: 170px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(5, 8, 12, 0.86);
  backdrop-filter: blur(18px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.menu-panel.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.menu-panel a {
  padding: 11px 12px;
  border-radius: 10px;
  color: rgba(244, 247, 251, 0.62);
  font-weight: 850;
}

.menu-panel a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.scene {
  position: relative;
  min-height: 100vh;
}

.hero-scene {
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 36%, rgba(44, 170, 219, 0.14), transparent 24rem),
    radial-gradient(circle at 50% 100%, rgba(44, 170, 219, 0.06), transparent 30rem),
    #030508;
}

.hero-scene::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.16) 0 1px, transparent 1.5px);
  background-size: 150px 150px;
  opacity: 0.18;
}

.hero-center {
  position: relative;
  width: min(820px, calc(100% - 32px));
  text-align: center;
}

.eyebrow {
  margin: 0 0 22px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: "Pixelify Sans", Inter, sans-serif;
  font-weight: 700;
  letter-spacing: 0;
}

h1 {
  min-height: 2.15em;
  font-size: clamp(3.2rem, 7vw, 6.6rem);
  line-height: 0.96;
  text-wrap: balance;
}

h1 .accent,
h2 .accent {
  color: var(--blue-soft);
}

h1.typing::after {
  display: inline-block;
  width: 0.08em;
  height: 0.75em;
  margin-left: 0.08em;
  vertical-align: -0.05em;
  background: var(--blue);
  content: "";
  animation: blink 0.8s steps(1) infinite;
}

.microcopy,
.story-copy p:not(.eyebrow) {
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.12rem);
  font-weight: 700;
  line-height: 1.7;
}

.microcopy {
  max-width: 560px;
  margin: 28px auto 0;
}

.story {
  position: relative;
  height: 230vh;
}

.story-sticky {
  position: sticky;
  top: 0;
  min-height: 100vh;
  overflow: hidden;
}

.deepslate-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(44, 170, 219, 0.08), transparent 28rem),
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.035), transparent 20rem),
    linear-gradient(180deg, rgba(3, 5, 8, 0.36), rgba(3, 5, 8, 0.88)),
    linear-gradient(135deg, #171d24 0%, #10161d 28%, #0b1016 62%, #070a0f 100%);
}

.deepslate-bg::before,
.deepslate-bg::after {
  position: absolute;
  inset: 0;
  content: "";
}

.deepslate-bg::before {
  background:
    linear-gradient(30deg, transparent 0 24%, rgba(255,255,255,0.035) 25% 27%, transparent 28% 100%),
    linear-gradient(150deg, transparent 0 30%, rgba(0,0,0,0.2) 31% 34%, transparent 35% 100%),
    linear-gradient(90deg, rgba(255,255,255,0.025), transparent 24%, rgba(0,0,0,0.16) 58%, transparent);
  background-size: 96px 72px, 112px 84px, 160px 120px;
  opacity: 0.32;
}

.deepslate-bg::after {
  background:
    radial-gradient(circle at 18% 24%, rgba(255,255,255,0.045), transparent 7rem),
    radial-gradient(circle at 72% 36%, rgba(0,0,0,0.28), transparent 12rem),
    radial-gradient(circle at 48% 70%, rgba(255,255,255,0.035), transparent 9rem),
    linear-gradient(90deg, rgba(0,0,0,0.62), transparent 28%, transparent 72%, rgba(0,0,0,0.62)),
    linear-gradient(180deg, rgba(0,0,0,0.72), transparent 26%, transparent 62%, rgba(0,0,0,0.78));
  opacity: 0.95;
}

.story-copy {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: min(760px, calc(100% - 32px));
  text-align: center;
  opacity: 0;
  transform: translate(-50%, -42%);
  transition: opacity 0.6s ease, transform 0.6s ease;
  will-change: opacity, transform;
}

.story-copy.active {
  opacity: 1;
  transform: translate(-50%, -50%);
}

h2 {
  font-size: clamp(2.7rem, 6vw, 5.8rem);
  line-height: 0.96;
  text-wrap: balance;
}

.story-copy p:not(.eyebrow) {
  max-width: 560px;
  margin: 28px auto 0;
}

.chapter-tabs {
  position: absolute;
  left: 50%;
  bottom: 13vh;
  z-index: 3;
  display: flex;
  gap: 8px;
  transform: translateX(-50%);
}

.chapter-tabs span {
  padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: rgba(244, 247, 251, 0.38);
  background: rgba(0, 0, 0, 0.18);
  font-size: 0.85rem;
  font-weight: 850;
}

.chapter-tabs .active {
  color: var(--text);
  border-color: rgba(44, 170, 219, 0.45);
  background: rgba(44, 170, 219, 0.12);
  box-shadow: 0 0 22px rgba(44, 170, 219, 0.16);
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@media (max-width: 720px) {
  .topbar {
    top: 18px;
    width: calc(100% - 28px);
  }

  .menu-button strong {
    display: none;
  }

  h1 {
    font-size: clamp(2.8rem, 13vw, 4.6rem);
  }

  .chapter-tabs {
    width: min(100% - 24px, 440px);
    flex-wrap: wrap;
    justify-content: center;
    bottom: 8vh;
  }
}
