:root {
  --red: #ff1f1f;
  --red-dim: #8a0b0b;
  --red-dark: #2a0303;
  --bg: #050000;
  --bg-2: #0d0101;
  --glow: 0 0 6px rgba(255, 31, 31, 0.8), 0 0 18px rgba(255, 31, 31, 0.35);
  --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:
    linear-gradient(rgba(255, 31, 31, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 31, 31, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
}
a { color: inherit; }
::selection { background: var(--red); color: #000; }

/* ---------- FX layers ---------- */
#rain {
  position: fixed; inset: 0; z-index: 0;
  opacity: 0.18; 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.25) 2px 3px);
  mix-blend-mode: multiply;
}
.scanlines::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.75) 100%);
}

/* ---------- 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%;
}

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(5, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  border-bottom: 1px dashed var(--red-dim);
}
.logo { font-family: var(--pixel); font-size: 28px; text-decoration: none; text-shadow: var(--glow); }
.logo span { color: #fff; }
.nav nav { display: flex; gap: 22px; }
.nav nav a { text-decoration: none; opacity: .8; }
.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 {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(24px, 4vw, 64px);
  align-items: center;
  padding: clamp(40px, 7vw, 100px) clamp(16px, 4vw, 48px);
  max-width: 1300px; margin: 0 auto;
}
.path { font-size: 14px; opacity: .75; }
.cursor { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.glitch {
  position: relative;
  font-family: var(--pixel);
  font-size: clamp(110px, 18vw, 230px);
  line-height: .9; color: var(--red);
  text-shadow: var(--glow);
  margin: 10px 0 6px;
}
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; left: 0; top: 0; width: 100%;
  overflow: hidden;
}
.glitch::before { color: #fff; opacity: .7; animation: glitch-a 2.8s infinite linear alternate-reverse; }
.glitch::after { color: var(--red-dim); animation: glitch-b 1.9s 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(-6px, 0); }
  93% { clip-path: inset(60% 0 15% 0); transform: translate(5px, 0); }
  96% { clip-path: inset(40% 0 40% 0); transform: translate(-3px, 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(7px, 2px); }
  87% { clip-path: inset(10% 0 70% 0); transform: translate(-7px, -2px); }
}

.sub { font-family: var(--pixel); font-size: clamp(28px, 3.4vw, 42px); font-weight: 400; letter-spacing: 1px; }
.flash { background: var(--red); color: #000; padding: 0 8px; animation: blink 1.2s steps(1) infinite; }
.tagline { margin: 14px 0 26px; max-width: 520px; color: #ffb3b3; }
.tagline strong { color: #fff; font-size: 17px; }
.triad { list-style: none; margin: -12px 0 26px; font-family: var(--pixel); font-size: clamp(24px, 2.6vw, 32px); 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);
  max-width: 100%;
}
.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 40px rgba(255, 31, 31, .35), 10px 10px 0 var(--red-dark);
  background: #000;
  animation: float 6s ease-in-out infinite;
}
.window-bar, .panel-bar {
  display: flex; justify-content: space-between;
  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; }
@keyframes float { 50% { transform: translateY(-10px); } }

/* ---------- 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; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.panel { border: 1px solid var(--red-dim); background: rgba(13, 1, 1, .85); }
.code-panel pre { padding: 18px; overflow-x: auto; font-size: 14px; line-height: 1.7; }
.code-panel .c { color: #fff; }
.code-panel .m { color: var(--red-dim); }
.code-panel .k { color: #ff6b6b; font-weight: 700; }
.code-panel .s { color: #ffb3b3; }
.code-panel .f { color: var(--red); font-weight: 700; }
.text-panel { padding: 24px; color: #ffcccc; }
.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: var(--red); }
.warn { color: var(--red) !important; font-size: 13px; border-left: 3px solid var(--red); padding-left: 10px; }

.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: 14px; line-height: 1.5;
}

.steps { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.steps li {
  display: flex; gap: 16px; padding: 22px;
  border: 1px solid var(--red-dim); background: rgba(13, 1, 1, .85);
  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: 36px; line-height: 1; text-shadow: var(--glow); }
.steps h4 { font-size: 17px; color: #fff; margin-bottom: 4px; }
.steps p { color: #ffcccc; font-size: 14px; }

/* ---------- terminal ---------- */
.hint { margin-bottom: 14px; color: #ffcccc; }
.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: 34px clamp(16px, 4vw, 48px);
  border-top: 1px dashed var(--red-dim); text-align: center; font-size: 13px;
}
.disclaimer { max-width: 760px; margin: 10px auto 0; opacity: .55; font-size: 12px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-img { order: -1; max-width: 460px; margin: 0 auto; }
  .grid-2, .steps { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .nav nav { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
