:root {
  --bg: #000000;
  --ink: #f4f4ef;
  --muted: #8f8f86;
  --lime: #dfff00;
  --line: rgba(255, 255, 255, 0.12);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --nav: 76px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Outfit", "Segoe UI", sans-serif;
  font-weight: 300;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

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

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

button, a { -webkit-tap-highlight-color: transparent; }

::selection { background: var(--lime); color: #000; }

.progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  width: 100%;
  height: 2px;
  background: var(--lime);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

.top {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: var(--nav);
  padding: 0 28px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0));
}

.top.solid {
  background: rgba(0, 0, 0, 0.86);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; }

.brand img { height: 34px; width: auto; }

.menu {
  display: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
}

nav { display: flex; gap: 26px; }

nav a {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(244, 244, 239, 0.72);
}

nav a:hover,
nav a[aria-current="page"] { color: var(--lime); }

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: calc(var(--nav) + 24px) 24px 72px;
  overflow: hidden;
  text-align: center;
}

.hero::before {
  content: "";
  position: absolute;
  width: min(980px, 88vw);
  height: 280px;
  background: radial-gradient(ellipse, rgba(223, 255, 0, 0.16), transparent 70%);
  filter: blur(10px);
  pointer-events: none;
}

.hero .logo {
  position: relative;
  width: min(980px, 92vw);
  height: auto;
}

.kicker {
  margin: 28px 0 0;
  color: var(--lime);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.42em;
  text-transform: uppercase;
}

.chapter {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 100vh;
  padding: 22vh 8vw 12vh;
  border-top: 1px solid var(--line);
  overflow: hidden;
}

.ghost {
  position: absolute;
  top: 10vh;
  right: 4vw;
  color: rgba(223, 255, 0, 0.055);
  font-family: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  font-size: clamp(8rem, 28vw, 22rem);
  font-weight: 600;
  line-height: 0.8;
  letter-spacing: -0.04em;
  pointer-events: none;
  user-select: none;
}

.chapter-body { position: relative; max-width: 1100px; }

.chapter .index {
  margin: 0 0 18px;
  color: var(--lime);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

.chapter h2 {
  margin: 0;
  font-family: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  font-size: clamp(5.4rem, 16vw, 13.5rem);
  font-weight: 600;
  line-height: 0.8;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}

.rule {
  display: block;
  width: 0;
  height: 2px;
  margin: 28px 0 22px;
  background: var(--lime);
}

.rule.in { width: min(180px, 22vw); }

.deck {
  max-width: 28ch;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.45rem);
  font-weight: 300;
}

.rail {
  position: fixed;
  top: 50%;
  right: 28px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transform: translateY(-50%);
}

.rail a {
  color: rgba(244, 244, 239, 0.35);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
}

.rail a.on { color: var(--lime); }

.close {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 22vh 24px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.close img { width: min(640px, 78vw); margin: 0 auto 28px; }

.close p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.1rem, 2vw, 1.5rem);
}

.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 8vw 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.foot img { height: 26px; width: auto; }

.foot nav { gap: 18px; }

.plain {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100vh;
  padding: 28vh 8vw 14vh;
}

.plain h1 {
  margin: 12px 0 18px;
  font-family: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  font-size: clamp(4.5rem, 14vw, 11rem);
  font-weight: 600;
  line-height: 0.82;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}

.plain p { margin: 0; color: var(--muted); font-size: 1.15rem; }

.js .reveal {
  opacity: 0;
  transform: translateY(14vh);
  filter: blur(8px);
  transition:
    opacity 1s var(--ease),
    transform 1.05s var(--ease),
    filter 1s var(--ease),
    width 1.1s var(--ease);
}

.js .reveal.d2 { transition-delay: 0.12s; }
.js .reveal.d3 { transition-delay: 0.24s; }
.js .reveal.in { opacity: 1; transform: none; filter: none; }

@media (max-width: 860px) {
  .menu { display: block; }

  nav {
    position: fixed;
    inset: 0;
    z-index: 25;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 8px;
    padding: 12vh 28px 48px;
    background: #000;
    transform: translateY(-102%);
    transition: transform 0.55s var(--ease);
  }

  body.nav-open nav { transform: none; }

  body.nav-open .menu { position: relative; z-index: 26; color: var(--lime); }

  nav a {
    font-family: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
    font-size: clamp(3rem, 14vw, 4.5rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 0.9;
    text-transform: uppercase;
    color: var(--ink);
  }

  .kicker { letter-spacing: 0.22em; }
  body.nav-open .top { background: #000; border-bottom: 0; }
  .rail { display: none; }

  .chapter { padding: 24vh 24px 64px; }

  .foot { flex-direction: column; align-items: flex-start; }
  .foot nav { display: none; }

  .plain { padding: 30vh 24px 72px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; filter: none; transition: none; }
  .rule { width: min(180px, 22vw); }
  nav { transition: none; }
}
