:root {
  --bg: #05080a;
  --bg-mid: #0a1218;
  --phosphor: #3dff8a;
  --phosphor-dim: #1a8f4a;
  --cyan: #5cf0ff;
  --hot: #ff2d7b;
  --foam: #c8ffe0;
  --font-display: "Orbitron", sans-serif;
  --font-mono: "Share Tech Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--foam);
  font-family: var(--font-mono);
  background:
    radial-gradient(ellipse 90% 60% at 50% -10%, rgba(61, 255, 138, 0.18), transparent 55%),
    radial-gradient(ellipse 50% 40% at 85% 70%, rgba(92, 240, 255, 0.08), transparent 50%),
    radial-gradient(ellipse 40% 35% at 10% 80%, rgba(255, 45, 123, 0.1), transparent 45%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-mid) 55%, #020405 100%);
  overflow-x: hidden;
}

.scanlines,
.vignette {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 50;
}

.scanlines {
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.18) 0,
    rgba(0, 0, 0, 0.18) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: multiply;
  opacity: 0.55;
  animation: flicker 6s infinite;
}

.vignette {
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.75) 100%);
}

.stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem 1.25rem 4rem;
  gap: 0.85rem;
}

.callsign {
  margin: 0;
  font-size: clamp(0.7rem, 1.6vw, 0.9rem);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--cyan);
  opacity: 0;
  animation: boot-in 0.6s ease 0.2s forwards;
}

.callsign::before {
  content: "> ";
  color: var(--phosphor-dim);
}

.brand {
  position: relative;
  margin: 0;
  max-width: 16ch;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 9vw, 5.5rem);
  line-height: 0.95;
  letter-spacing: 0.04em;
  color: var(--phosphor);
  text-shadow:
    0 0 12px rgba(61, 255, 138, 0.55),
    0 0 40px rgba(61, 255, 138, 0.25);
  opacity: 0;
  animation: boot-in 0.7s ease 0.45s forwards, glitch-skew 4.5s ease-in-out 1.5s infinite;
}

.brand::before,
.brand::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0.7;
  clip-path: inset(0 0 0 0);
}

.brand::before {
  color: var(--cyan);
  transform: translate(-2px, 0);
  animation: glitch-left 3.2s infinite linear alternate-reverse;
}

.brand::after {
  color: var(--hot);
  transform: translate(2px, 0);
  animation: glitch-right 2.4s infinite linear alternate-reverse;
}

.tagline {
  margin: 0.4rem 0 0;
  min-height: 1.4em;
  max-width: 36rem;
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  color: var(--foam);
  opacity: 0;
  animation: boot-in 0.5s ease 0.9s forwards;
}

.tagline::after {
  content: "█";
  margin-left: 2px;
  color: var(--phosphor);
  animation: blink 1s step-end infinite;
}

.leak {
  margin: 0.25rem 0 0;
  font-size: clamp(0.85rem, 2vw, 1rem);
  letter-spacing: 0.12em;
  text-transform: lowercase;
  color: var(--hot);
  text-shadow: 0 0 10px rgba(255, 45, 123, 0.45);
  opacity: 0;
  animation: boot-in 0.5s ease 1.2s forwards, drip 3s ease-in-out 2s infinite;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.5rem;
  opacity: 0;
  animation: boot-in 0.5s ease 1.45s forwards;
}

.btn {
  appearance: none;
  border: 1px solid var(--phosphor);
  background: rgba(61, 255, 138, 0.08);
  color: var(--phosphor);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  text-decoration: none;
  padding: 0.7rem 1.25rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover,
.btn:focus-visible {
  background: var(--phosphor);
  color: var(--bg);
  box-shadow: 0 0 20px rgba(61, 255, 138, 0.4);
  outline: none;
}

.btn-ghost {
  border-color: var(--cyan);
  color: var(--cyan);
  background: transparent;
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  background: var(--cyan);
  color: var(--bg);
  box-shadow: 0 0 20px rgba(92, 240, 255, 0.35);
}

.gibson {
  position: relative;
  z-index: 1;
  padding: 0 1.25rem 4rem;
  max-width: 52rem;
  margin: 0 auto;
}

.terminal {
  border: 1px solid rgba(61, 255, 138, 0.35);
  background: rgba(2, 6, 8, 0.85);
  box-shadow:
    0 0 0 1px rgba(92, 240, 255, 0.08),
    0 20px 60px rgba(0, 0, 0, 0.55);
}

.terminal-bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid rgba(61, 255, 138, 0.25);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  color: var(--cyan);
}

.terminal-body {
  margin: 0;
  padding: 1rem 0.9rem 1.25rem;
  min-height: 10rem;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: clamp(0.8rem, 1.8vw, 0.95rem);
  line-height: 1.45;
  color: var(--phosphor);
}

.foot {
  position: relative;
  z-index: 1;
  padding: 0 1.25rem 2.5rem;
  text-align: center;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--phosphor-dim);
}

.blink {
  animation: blink 1.2s step-end infinite;
}

@keyframes boot-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes flicker {
  0%,
  95%,
  100% {
    opacity: 0.55;
  }
  96% {
    opacity: 0.35;
  }
  97% {
    opacity: 0.65;
  }
  98% {
    opacity: 0.4;
  }
}

@keyframes glitch-skew {
  0%,
  90%,
  100% {
    transform: none;
  }
  91% {
    transform: skewX(-2deg) translateX(-2px);
  }
  93% {
    transform: skewX(1deg) translateX(1px);
  }
}

@keyframes glitch-left {
  0%,
  80%,
  100% {
    clip-path: inset(0 0 100% 0);
    opacity: 0;
  }
  81% {
    clip-path: inset(12% 0 65% 0);
    opacity: 0.8;
  }
  83% {
    clip-path: inset(55% 0 20% 0);
    opacity: 0.6;
  }
  85% {
    clip-path: inset(0 0 100% 0);
    opacity: 0;
  }
}

@keyframes glitch-right {
  0%,
  70%,
  100% {
    clip-path: inset(0 0 100% 0);
    opacity: 0;
  }
  71% {
    clip-path: inset(40% 0 35% 0);
    opacity: 0.75;
  }
  74% {
    clip-path: inset(10% 0 70% 0);
    opacity: 0.5;
  }
  76% {
    clip-path: inset(0 0 100% 0);
    opacity: 0;
  }
}

@keyframes drip {
  0%,
  100% {
    opacity: 0.85;
    filter: blur(0);
  }
  50% {
    opacity: 1;
    filter: blur(0.3px);
    text-shadow: 0 8px 12px rgba(255, 45, 123, 0.25);
  }
}

/* —— compact inner pages (same language as home) —— */

.stage-compact {
  min-height: auto;
  padding-top: 4rem;
  padding-bottom: 2.5rem;
}

.brand-sm {
  max-width: 18ch;
  font-size: clamp(1.8rem, 6vw, 3.2rem);
}

.tagline-static {
  min-height: 0;
  opacity: 1;
  animation: boot-in 0.5s ease 0.9s forwards;
}

.tagline-static::after {
  content: none;
}

.terminal-link {
  color: var(--hot);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 45, 123, 0.45);
}

.terminal-link:hover,
.terminal-link:focus-visible {
  color: var(--foam);
  outline: none;
}

.guide-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.guide-body article h2 {
  margin: 0 0 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
}

.guide-body ol {
  margin: 0;
  padding-left: 1.15rem;
  line-height: 1.5;
  color: var(--phosphor);
}

.guide-body li {
  margin-bottom: 0.3rem;
}

.guide-body li::marker {
  color: var(--phosphor-dim);
}

.guide-body .dim {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
  color: var(--phosphor-dim);
}

.guide-rule {
  margin: 0;
  color: var(--hot);
  letter-spacing: 0.04em;
}

.guide-rule-end {
  margin-top: 0.25rem;
  color: var(--phosphor-dim);
}

.guide-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(61, 255, 138, 0.2);
}

.guide-toc a {
  color: var(--cyan);
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}

.guide-toc a:hover,
.guide-toc a:focus-visible {
  color: var(--phosphor);
  outline: none;
}

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

  .callsign,
  .brand,
  .tagline,
  .tagline-static,
  .leak,
  .cta {
    opacity: 1;
  }

  .tagline::after {
    content: none;
  }
}
