:root {
  --bg: #050805;
  --bg-2: #0a120a;
  --panel: rgba(8, 18, 8, 0.78);
  --line: rgba(57, 255, 20, 0.22);
  --green: #39ff14;
  --green-2: #00c853;
  --green-dim: #7dbb6f;
  --text: #d9f5d0;
  --muted: #8fae87;
  --red: #ff3b3b;
  --orange: #e8933a;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --pixel: "VT323", var(--mono);
  --radius: 4px;
  --glow: 0 0 12px rgba(57, 255, 20, 0.55), 0 0 32px rgba(57, 255, 20, 0.2);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
b { color: var(--green); font-weight: 600; }
code { color: var(--green); background: rgba(57, 255, 20, 0.08); padding: 0 6px; border-radius: 3px; }
::selection { background: var(--green); color: #000; }

#matrix {
  position: fixed; inset: 0; z-index: -2;
  width: 100%; height: 100%;
  opacity: 0.32;
}
.scanlines {
  position: fixed; inset: 0; z-index: 50; pointer-events: none;
  background: repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0, 0, 0, 0.18) 2px 3px);
  mix-blend-mode: multiply;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(0, 0, 0, 0.85) 100%);
}

/* NAV */
.nav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 24px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(5, 8, 5, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: 0.08em; }
.brand img { border-radius: 50%; border: 1px solid var(--green); box-shadow: var(--glow); }
.links { display: flex; gap: 22px; margin-left: auto; font-size: 14px; }
.links a { color: var(--muted); transition: color .2s; }
.links a:hover { color: var(--green); }
.links a::before { content: "./"; opacity: 0; color: var(--green); transition: opacity .2s; }
.links a:hover::before { opacity: 1; }
.burger { display: none; }

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 24px;
  font-family: var(--mono); font-weight: 800; font-size: 15px; letter-spacing: 0.04em;
  color: #000; background: var(--green);
  border: 1px solid var(--green); border-radius: var(--radius);
  box-shadow: var(--glow);
  transition: transform .15s, box-shadow .2s, background .2s;
  cursor: pointer;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 0 18px rgba(57,255,20,.8), 0 0 48px rgba(57,255,20,.35); }
.btn-ghost { background: transparent; color: var(--green); box-shadow: none; }
.btn-ghost:hover { background: rgba(57, 255, 20, 0.1); }
.btn-sm { padding: 9px 16px; font-size: 13px; }
.btn-lg { padding: 18px 34px; font-size: 18px; }

/* HERO */
.hero {
  min-height: calc(100vh - 70px);
  display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: clamp(24px, 5vw, 72px);
  padding: 48px clamp(16px, 6vw, 96px);
  max-width: 1400px; margin: 0 auto;
}
.kicker { font-size: 13px; color: var(--green-dim); text-transform: uppercase; letter-spacing: 0.12em; display: flex; align-items: center; gap: 10px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: var(--glow); animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .2; } }

.glitch {
  position: relative;
  font-family: var(--pixel);
  font-size: clamp(64px, 11vw, 150px);
  line-height: .9;
  margin: 18px 0 6px;
  color: var(--green);
  text-shadow: var(--glow);
  letter-spacing: 0.02em;
}
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute; left: 0; top: 0; width: 100%;
  overflow: hidden;
}
.glitch::before { color: #ff2fd0; left: 2px; text-shadow: none; animation: glitch-a 3s infinite linear alternate-reverse; opacity: .7; }
.glitch::after { color: #00e5ff; left: -2px; text-shadow: none; animation: glitch-b 2.4s infinite linear alternate-reverse; opacity: .7; }
@keyframes glitch-a {
  0%, 86% { clip-path: inset(100% 0 0 0); }
  88% { clip-path: inset(10% 0 70% 0); transform: translate(-4px, 0); }
  92% { clip-path: inset(55% 0 20% 0); transform: translate(4px, 0); }
  96% { clip-path: inset(80% 0 5% 0); transform: translate(-2px, 0); }
  100% { clip-path: inset(100% 0 0 0); }
}
@keyframes glitch-b {
  0%, 80% { clip-path: inset(100% 0 0 0); }
  84% { clip-path: inset(30% 0 50% 0); transform: translate(3px, 0); }
  90% { clip-path: inset(70% 0 10% 0); transform: translate(-3px, 0); }
  100% { clip-path: inset(100% 0 0 0); }
}
.ticker { font-size: clamp(22px, 3vw, 34px); font-weight: 800; color: var(--orange); letter-spacing: .06em; }
.typed { min-height: 3.4em; margin: 18px 0 28px; font-size: clamp(15px, 1.4vw, 18px); color: var(--text); max-width: 560px; }
.caret { color: var(--green); animation: blink 1s steps(1) infinite; }
.ca {
  display: flex; align-items: center; gap: 10px;
  max-width: 560px; margin: -6px 0 24px;
  padding: 8px 8px 8px 14px;
  background: var(--panel); border: 1px dashed var(--green);
  border-radius: var(--radius);
}
.ca-label { color: var(--orange); font-weight: 800; font-size: 14px; flex-shrink: 0; }
.ca-addr {
  flex: 1; min-width: 0; background: none; padding: 0;
  font-size: 14px; color: #fff;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ca-copy {
  flex-shrink: 0; cursor: pointer;
  font-family: var(--mono); font-weight: 800; font-size: 12px; letter-spacing: .06em;
  padding: 8px 12px; border-radius: 3px;
  color: #000; background: var(--green); border: 0;
  transition: background .2s;
}
.ca-copy:hover { background: #7dff5c; }
.ca-copy.copied { background: var(--orange); }
.cta { display: flex; flex-wrap: wrap; gap: 14px; }
.badges { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 30px; font-size: 12px; color: var(--green-dim); letter-spacing: .08em; }

.hero-art { display: flex; justify-content: center; }
.frame {
  position: relative; width: min(100%, 520px);
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  animation: float 6s ease-in-out infinite;
}
.frame img { width: 100%; aspect-ratio: 1; object-fit: cover; filter: saturate(1.05) contrast(1.05); }
.corner { position: absolute; width: 22px; height: 22px; border: 2px solid var(--green); filter: drop-shadow(0 0 6px var(--green)); }
.tl { top: -2px; left: -2px; border-right: 0; border-bottom: 0; }
.tr { top: -2px; right: -2px; border-left: 0; border-bottom: 0; }
.bl { bottom: -2px; left: -2px; border-right: 0; border-top: 0; }
.br { bottom: -2px; right: -2px; border-left: 0; border-top: 0; }
.frame-label { margin-top: 12px; font-size: 12px; color: var(--green-dim); letter-spacing: .06em; }
@keyframes float { 50% { transform: translateY(-10px); } }

/* MARQUEE */
.marquee { overflow: hidden; border-block: 1px solid var(--line); background: rgba(57, 255, 20, 0.06); padding: 14px 0; }
.marquee-track { display: flex; gap: 48px; width: max-content; animation: scroll 32s linear infinite; }
.marquee span { font-family: var(--pixel); font-size: 28px; color: var(--green); white-space: nowrap; }
.marquee span::after { content: " ◆"; color: var(--orange); margin-left: 48px; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* SECTIONS */
.section { padding: clamp(72px, 10vw, 130px) clamp(16px, 6vw, 96px); max-width: 1300px; margin: 0 auto; }
.section-head { text-align: center; margin-bottom: 56px; }
.path { font-size: 13px; color: var(--green-dim); margin-bottom: 10px; }
h2 { font-family: var(--pixel); font-size: clamp(48px, 7vw, 84px); line-height: 1; color: var(--green); text-shadow: var(--glow); font-weight: 400; }
.lead { color: var(--muted); margin-top: 14px; }
h3 { font-size: clamp(20px, 2.2vw, 26px); color: #fff; margin-bottom: 12px; line-height: 1.25; }

/* LORE */
.chapters { display: flex; flex-direction: column; gap: clamp(56px, 8vw, 110px); }
.chapter { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 64px); align-items: center; }
.chapter:nth-child(even) .chapter-img { order: 2; }
.chapter-img { position: relative; border: 1px solid var(--line); padding: 10px; background: var(--panel); }
.chapter-img::after {
  content: ""; position: absolute; inset: 10px; pointer-events: none;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.55);
}
.chapter-img img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: transform .5s, filter .5s; filter: saturate(.95); }
.chapter:hover .chapter-img img { transform: scale(1.015); filter: saturate(1.1); }
.chapter-body { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--green); padding: clamp(22px, 3vw, 36px); }
.file { display: inline-block; font-size: 12px; letter-spacing: .12em; color: #000; background: var(--green); padding: 3px 10px; margin-bottom: 16px; font-weight: 800; }
.chapter-body p { color: var(--text); }

/* MANIFESTO */
.manifesto {
  max-width: 860px; margin: 0 auto;
  background: var(--panel); border: 1px solid var(--line);
  padding: clamp(28px, 5vw, 56px);
}
.manifesto h2 { margin-bottom: 28px; }
.rules { list-style: none; display: grid; gap: 16px; }
.rules li { display: flex; gap: 18px; font-size: clamp(15px, 1.6vw, 19px); color: #fff; align-items: baseline; }
.rules span { color: var(--orange); font-weight: 800; flex-shrink: 0; }
.sig { margin-top: 28px; color: var(--green-dim); font-size: 14px; }

/* TOKENOMICS */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.stat {
  background: var(--panel); border: 1px solid var(--line);
  padding: 28px 22px; display: flex; flex-direction: column; gap: 6px;
  transition: border-color .2s, transform .2s;
}
.stat:hover { border-color: var(--green); transform: translateY(-4px); }
.stat-label { font-size: 12px; color: var(--green-dim); letter-spacing: .1em; }
.stat-value { font-family: var(--pixel); font-size: clamp(40px, 4.4vw, 58px); color: var(--green); text-shadow: var(--glow); line-height: 1; word-break: break-all; }
.stat-sub { font-size: 13px; color: var(--muted); }
.network {
  margin-top: 18px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 40px;
  border: 1px dashed var(--line); padding: 18px; font-size: 14px; color: var(--muted);
}

/* STEPS */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.step { background: var(--panel); border: 1px solid var(--line); padding: 28px 24px; position: relative; }
.step-n { font-family: var(--pixel); font-size: 56px; color: var(--orange); line-height: 1; display: block; margin-bottom: 10px; }
.step p { color: var(--muted); font-size: 14px; }
.center { text-align: center; margin-top: 48px; }

/* TERMINAL */
.term {
  max-width: 900px; margin: 0 auto;
  background: rgba(2, 6, 2, 0.94); border: 1px solid var(--green);
  box-shadow: var(--glow);
  border-radius: 6px; overflow: hidden;
}
.term-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: #0d1a0d; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #2a4a2a; }
.term-bar i:first-child { background: var(--red); }
.term-bar span { margin-left: 10px; }
.term-out { height: 340px; overflow-y: auto; padding: 18px; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.term-out .cmd { color: #fff; }
.term-out .cmd::before { content: "guest@hackinu:~$ "; color: var(--green); }
.term-out .ok { color: var(--green); }
.term-out .warn { color: var(--orange); }
.term-out .err { color: var(--red); }
.term-in { display: flex; gap: 10px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); }
.term-in label { color: var(--green); font-size: 14px; white-space: nowrap; }
.term-in input {
  flex: 1; min-width: 0; background: transparent; border: 0; outline: 0;
  color: #fff; font-family: var(--mono); font-size: 15px; caret-color: var(--green);
}

/* FOOTER */
.footer { border-top: 1px solid var(--line); padding: 48px clamp(16px, 6vw, 96px); text-align: center; background: rgba(5, 8, 5, .9); }
.footer-brand { display: inline-flex; align-items: center; gap: 14px; text-align: left; margin-bottom: 22px; }
.footer-brand img { border-radius: 50%; border: 1px solid var(--green); }
.footer-brand strong { display: block; letter-spacing: .1em; color: var(--green); }
.footer-brand span { font-size: 13px; color: var(--muted); }
.disclaimer { max-width: 760px; margin: 0 auto 16px; font-size: 12px; color: var(--muted); }
.copy { font-size: 12px; color: var(--green-dim); }

/* REVEAL */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* RESPONSIVE */
@media (max-width: 1000px) {
  .stats, .steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding-top: 28px; min-height: auto; }
  .hero-art { order: -1; }
  .frame { width: min(78%, 380px); }
  .kicker, .cta, .badges { justify-content: center; }
  .typed, .ca { margin-inline: auto; }
  .ca { text-align: left; }
  .chapter { grid-template-columns: 1fr; }
  .chapter:nth-child(even) .chapter-img { order: 0; }
  .nav .btn-sm { margin-left: auto; }
  .burger {
    display: flex; flex-direction: column; gap: 6px; justify-content: center;
    width: 40px; height: 40px; background: transparent; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; padding: 0 9px;
  }
  .burger span { height: 2px; background: var(--green); transition: transform .2s; }
  .nav.open .burger span:first-child { transform: translateY(4px) rotate(45deg); }
  .nav.open .burger span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0; margin: 0;
    background: rgba(5, 8, 5, .97); border-bottom: 1px solid var(--line);
    max-height: 0; overflow: hidden; transition: max-height .3s;
  }
  .links a { padding: 14px 24px; border-top: 1px solid rgba(57,255,20,.08); font-size: 15px; }
  .nav.open .links { max-height: 400px; }
}
@media (max-width: 520px) {
  .stats, .steps { grid-template-columns: 1fr; }
  .brand span { display: none; }
  .term-out { height: 300px; font-size: 13px; }
  .term-in label { display: none; }
  .rules li { gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
