:root {
  --red: #ff1f1f;
  --red-hot: #ff3b3b;
  --red-dim: #8a0b0b;
  --red-dark: #2a0303;
  --bg: #030000;
  --bg-2: #0b0101;
  --pale: #ffc2c2;
  --glow: 0 0 6px rgba(255, 31, 31, 0.85), 0 0 22px rgba(255, 31, 31, 0.45);
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --pixel: "VT323", var(--mono);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--red);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
  background-image:
    radial-gradient(circle, rgba(255, 31, 31, 0.09) 1px, transparent 1.5px);
  background-size: 6px 6px;
}
a { color: inherit; }
::selection { background: var(--red); color: #000; }

/* ---------- FX layers ---------- */
#rain { position: fixed; inset: 0; z-index: 0; opacity: 0.16; pointer-events: none; }
.scanlines {
  position: fixed; inset: 0; z-index: 50; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0 2px, rgba(0,0,0,0.28) 2px 3px);
}
.scanlines::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.8) 100%);
  animation: flicker 6s infinite;
}
@keyframes flicker { 0%, 96%, 100% { opacity: 1; } 97% { opacity: .6; } 98% { opacity: 1; } 99% { opacity: .75; } }

/* ---------- boot ---------- */
#boot {
  position: fixed; inset: 0; z-index: 100;
  background: #000; padding: 24px;
  display: flex; align-items: flex-end;
  transition: opacity .5s ease;
}
#boot.done { opacity: 0; pointer-events: none; }
#boot-log { font-family: var(--pixel); font-size: 22px; line-height: 1.25; text-shadow: var(--glow); white-space: pre-wrap; width: 100%; }

/* ---------- alert bar ---------- */
.alert {
  position: relative; z-index: 41;
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  padding: 6px clamp(16px, 4vw, 48px);
  background: var(--red); color: #000; font-size: 12px; font-weight: 700;
  animation: alarm 1.6s steps(1) infinite;
}
.alert-tag { background: #000; color: var(--red); padding: 1px 8px; }
@keyframes alarm { 50% { background: var(--red-dim); color: #fff; } }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px clamp(16px, 4vw, 48px);
  background: rgba(3, 0, 0, 0.88);
  backdrop-filter: blur(6px);
  border-bottom: 1px dashed var(--red-dim);
}
.logo { font-family: var(--pixel); font-size: 30px; text-decoration: none; text-shadow: var(--glow); letter-spacing: 1px; }
.logo span { color: #000; background: var(--red); margin-left: 8px; padding: 0 6px; text-shadow: none; }
.nav nav { display: flex; gap: 22px; }
.nav nav a { text-decoration: none; opacity: .75; }
.nav nav a:hover { opacity: 1; text-shadow: var(--glow); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; cursor: pointer;
  font-family: var(--pixel); font-size: 24px; letter-spacing: 1px;
  padding: 8px 22px; text-decoration: none;
  background: var(--red); color: #000;
  border: 2px solid var(--red);
  box-shadow: 0 0 18px rgba(255, 31, 31, .45);
  transition: transform .1s, box-shadow .2s, background .2s, color .2s;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--red-dim), 0 0 28px rgba(255,31,31,.7); }
.btn:active { transform: translate(0, 0); }
.btn-ghost { background: transparent; color: var(--red); }
.btn-ghost:hover { background: var(--red); color: #000; }
.btn-sm { font-size: 20px; padding: 4px 14px; }
.btn-big { font-size: 34px; padding: 12px 36px; }

main { position: relative; z-index: 1; }

/* ---------- hero ---------- */
.hero { max-width: 1320px; margin: 0 auto; padding: clamp(28px, 5vw, 70px) clamp(16px, 4vw, 48px) 40px; }
.path { font-size: 14px; opacity: .8; }
.cursor { animation: blink 1s steps(1) infinite; }
.blink { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.title {
  position: relative;
  display: flex; flex-wrap: wrap; justify-content: center; column-gap: .25em;
  font-family: var(--pixel); font-weight: 400;
  font-size: clamp(84px, 15.5vw, 230px);
  line-height: .85; text-align: center;
  margin: 18px 0 70px;
  color: var(--red-hot);
  text-shadow: var(--glow), 0 0 60px rgba(255, 31, 31, .35);
}
.glitch { position: relative; display: inline-block; }
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; left: 0; top: 0; width: 100%; overflow: hidden;
}
.glitch::before { color: #fff; opacity: .65; animation: glitch-a 3.1s infinite linear alternate-reverse; }
.glitch::after { color: var(--red-dim); animation: glitch-b 2.2s infinite linear alternate-reverse; }
@keyframes glitch-a {
  0%, 88%, 100% { clip-path: inset(0 0 100% 0); transform: none; }
  90% { clip-path: inset(20% 0 55% 0); transform: translate(-8px, 0); }
  93% { clip-path: inset(60% 0 15% 0); transform: translate(6px, 0); }
  96% { clip-path: inset(40% 0 40% 0); transform: translate(-4px, 0); }
}
@keyframes glitch-b {
  0%, 80%, 100% { clip-path: inset(0 0 100% 0); transform: none; }
  83% { clip-path: inset(70% 0 5% 0); transform: translate(8px, 2px); }
  87% { clip-path: inset(10% 0 70% 0); transform: translate(-8px, -2px); }
}

/* blood drips (generated in script.js) */
.drips { position: absolute; left: 0; right: 0; bottom: 4px; height: 0; pointer-events: none; }
.drip {
  position: absolute; top: 0; width: 6px; border-radius: 0 0 4px 4px;
  background: linear-gradient(var(--red-hot), var(--red));
  box-shadow: 0 0 8px rgba(255,31,31,.7);
  transform-origin: top; animation: drip ease-in infinite;
}
.drip::after {
  content: ""; position: absolute; left: 50%; bottom: -7px; width: 10px; height: 11px;
  transform: translateX(-50%); border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: var(--red-hot); box-shadow: 0 0 8px rgba(255,31,31,.8);
}
@keyframes drip {
  0% { transform: scaleY(.15); opacity: 1; }
  70% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1.05); opacity: 0; }
}

.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 64px); align-items: center; }
.ticker-name { font-size: 15px; color: var(--pale); }
.tag { font-family: var(--pixel); font-size: 26px; color: #000; background: var(--red); padding: 0 8px; margin-right: 4px; }
.ticker-name strong { color: var(--red); }
.tagline { margin: 16px 0 14px; max-width: 540px; }
.tagline strong { color: #fff; font-size: 18px; font-weight: 700; }
.triad { list-style: none; margin: 0 0 26px; font-family: var(--pixel); font-size: clamp(26px, 2.8vw, 34px); line-height: 1.15; }
.triad span { color: #000; background: var(--red); padding: 0 6px; margin-right: 6px; }
.triad li:last-child span { animation: blink 1.2s steps(1) infinite; }

.ca {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border: 1px dashed var(--red); padding: 10px 14px;
  background: rgba(255, 31, 31, .05);
}
.ca-label { font-family: var(--pixel); font-size: 22px; }
#ca { font-size: 13px; color: #fff; word-break: break-all; flex: 1; min-width: 0; }
.ca .btn { font-size: 18px; padding: 2px 14px; }

.cta { display: flex; gap: 14px; margin: 22px 0 18px; flex-wrap: wrap; }
.cta.center { justify-content: center; margin-top: 40px; }
.socials { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; }
.socials a { text-decoration: none; opacity: .75; }
.socials a:hover { opacity: 1; text-shadow: var(--glow); }

.window {
  border: 2px solid var(--red);
  box-shadow: 0 0 50px rgba(255, 31, 31, .35), 10px 10px 0 var(--red-dark);
  background: #000;
}
.window-bar, .panel-bar {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 12px; padding: 4px 10px;
  border-bottom: 1px solid var(--red-dim);
  background: var(--bg-2);
}
.window img { display: block; width: 100%; height: auto; }

/* ---------- ticker ---------- */
.ticker {
  overflow: hidden; white-space: nowrap;
  background: var(--red); color: #000;
  font-family: var(--pixel); font-size: 26px;
  border-block: 2px solid #000;
  transform: rotate(-1.2deg); margin: 20px -10px;
}
.ticker-track { display: inline-block; animation: scroll 30s linear infinite; }
.ticker-track span { padding: 0 26px; }
.ticker-track span::after { content: "☠"; padding-left: 52px; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
.section { max-width: 1200px; margin: 0 auto; padding: clamp(60px, 8vw, 110px) clamp(16px, 4vw, 48px) 0; }
.section-title {
  font-family: var(--pixel); font-weight: 400;
  font-size: clamp(40px, 5vw, 64px);
  text-shadow: var(--glow); margin-bottom: 30px;
}
.section-title span { color: #000; background: var(--red); padding: 0 10px; margin-right: 12px; text-shadow: none; }

.panel { border: 1px dashed var(--red); background: rgba(8, 0, 0, .88); }

/* incident dashboard */
.dash { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.dash .panel-bar { font-size: 13px; font-weight: 700; }
.dash .panel-bar span:last-child { color: #fff; }
.log { list-style: none; height: 230px; overflow: hidden; padding: 10px 12px; font-size: 13px; line-height: 1.75; display: flex; flex-direction: column; justify-content: flex-end; }
.log li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: in .3s ease-out; }
.log li::before { content: "[+] "; color: var(--red-dim); }
.log li.new { color: #fff; }
@keyframes in { from { opacity: 0; transform: translateX(-6px); } }

.meter { margin-top: 26px; }
.meter-label { display: flex; justify-content: space-between; font-family: var(--pixel); font-size: 28px; }
.meter-bar { height: 26px; border: 2px solid var(--red); padding: 3px; margin-top: 4px; }
.meter-fill {
  height: 100%; width: 0;
  background: repeating-linear-gradient(90deg, var(--red) 0 10px, transparent 10px 13px);
  box-shadow: var(--glow); transition: width .6s ease;
}
.meter-note { font-size: 12px; opacity: .6; margin-top: 6px; }

/* lore */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.code-panel pre { padding: 18px; overflow-x: auto; font-size: 14px; line-height: 1.7; color: var(--pale); }
.code-panel .c { color: var(--red); }
.code-panel .m { color: var(--red-dim); }
.code-panel .k { color: #ff6b6b; font-weight: 700; }
.code-panel .s { color: #ffb3b3; }
.code-panel .f { color: #fff; font-weight: 700; text-shadow: var(--glow); }
.text-panel { padding: 24px; color: var(--pale); }
.text-panel p + p { margin-top: 14px; }
.text-panel code, .hint code { color: var(--red); background: var(--red-dark); padding: 1px 6px; }
.text-panel strong { color: #fff; }
.verdict { font-family: var(--pixel); font-size: 28px; color: var(--red) !important; line-height: 1.2; }
.verdict span { color: #000; background: var(--red); padding: 0 6px; }

/* tokenomics */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.stat {
  border: 1px solid var(--red); padding: 22px 18px; text-align: center;
  background: rgba(255, 31, 31, .04);
  transition: background .2s, transform .2s;
}
.stat:hover { background: rgba(255, 31, 31, .12); transform: translateY(-4px); }
.stat-label { font-size: 13px; opacity: .7; }
.stat-value { font-family: var(--pixel); font-size: clamp(30px, 3.4vw, 44px); color: #fff; text-shadow: var(--glow); }
.dump {
  margin-top: 28px; padding: 20px; overflow-x: auto;
  border: 1px dashed var(--red-dim); background: #000;
  font-size: 13px; line-height: 1.7; color: var(--pale);
}
.dump .w { color: #fff; }
.dump .hl { color: #000; background: var(--red); padding: 0 4px; }

/* steps */
.steps { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.steps li {
  display: flex; gap: 16px; padding: 22px;
  border: 1px dashed var(--red-dim); background: rgba(8, 0, 0, .88);
  transition: border-color .2s, box-shadow .2s;
}
.steps li:hover { border-color: var(--red); box-shadow: 0 0 22px rgba(255,31,31,.25); }
.step-n { font-family: var(--pixel); font-size: 30px; line-height: 1; text-shadow: var(--glow); }
.steps h4 { font-size: 17px; color: #fff; margin-bottom: 4px; }
.steps p { color: var(--pale); font-size: 14px; }

/* terminal */
.hint { margin-bottom: 14px; color: var(--pale); }
.terminal { border: 2px solid var(--red); background: #000; box-shadow: 0 0 30px rgba(255,31,31,.25); }
.term-body { height: 340px; overflow-y: auto; padding: 14px 16px; font-size: 14px; cursor: text; }
#term-out div { white-space: pre-wrap; word-break: break-word; }
#term-out .muted { color: var(--red-dim); }
#term-out .white { color: #fff; }
.term-line { display: flex; gap: 10px; }
.prompt { color: #fff; white-space: nowrap; }
#term-in { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--red); font: inherit; caret-color: var(--red); }

/* ---------- footer ---------- */
.footer {
  position: relative; z-index: 1;
  margin-top: 110px; padding: 40px clamp(16px, 4vw, 48px);
  border-top: 1px dashed var(--red-dim); text-align: center; font-size: 13px;
}
.footer-big { font-family: var(--pixel); font-size: clamp(56px, 10vw, 120px); line-height: 1; text-shadow: var(--glow); margin-bottom: 10px; }
.disclaimer { max-width: 760px; margin: 10px auto 0; opacity: .55; font-size: 12px; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .dash { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-img { order: -1; max-width: 520px; margin: 0 auto; }
  .grid-2, .steps { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .nav nav { display: none; }
}
@media (max-width: 560px) {
  .dash { grid-template-columns: 1fr; }
  .log { height: 190px; }
  .alert-text { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .drip { transform: none; }
}

@media (max-width: 700px) {
  #boot-log { font-size: 11px; }
}
