:root {
  color-scheme: dark;
  --bg: #050705;
  --ink: #f4f6ef;
  --muted: #bbc5b9;
  --paper: #eef3eb;
  --green: #1eff58;
  --green-deep: #064b1b;
  --red: #f5331f;
  --gold: #ffd447;
  --gray: #9aa39a;
  --line: rgba(238, 243, 235, 0.26);
  --green-line: rgba(30, 255, 88, 0.32);
  --panel: rgba(7, 22, 10, 0.86);
  --panel-strong: rgba(11, 38, 16, 0.94);
  --shadow: 0 0 0 2px #111811, 0 0 0 6px rgba(238, 243, 235, 0.1), 0 28px 80px rgba(0, 0, 0, 0.58);
  --pixel-font: "Courier New", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--pixel-font);
}

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

.matrix-bg,
.scanlines,
.noise-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.matrix-bg {
  z-index: -3;
  background:
    linear-gradient(90deg, rgba(238, 243, 235, 0.055) 1px, transparent 1px),
    linear-gradient(0deg, rgba(238, 243, 235, 0.055) 1px, transparent 1px),
    linear-gradient(135deg, rgba(30, 255, 88, 0.22), transparent 18% 82%, rgba(245, 51, 31, 0.16)),
    linear-gradient(180deg, #070b07 0%, #06190a 54%, #050705 100%);
  background-size: 20px 20px, 20px 20px, auto, auto;
}

.scanlines {
  z-index: 8;
  opacity: 0.13;
  mix-blend-mode: screen;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.2) 0 1px,
    transparent 1px 6px
  );
}

.noise-canvas {
  z-index: -1;
  image-rendering: pixelated;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px clamp(16px, 4vw, 52px);
  background: rgba(5, 7, 5, 0.74);
  border-bottom: 2px solid rgba(238, 243, 235, 0.18);
  backdrop-filter: blur(10px);
}

.brand,
.top-links {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand {
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  font-weight: 900;
  text-transform: uppercase;
}

.brand-mark,
.nav-link,
.button,
.ticker-badge,
.status-chip,
.terminal-link span {
  box-shadow: inset -4px -4px 0 rgba(0, 0, 0, 0.34), inset 4px 4px 0 rgba(255, 255, 255, 0.08);
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #061006;
  background: var(--paper);
  border: 2px solid #2b332c;
}

.nav-link {
  display: grid;
  min-width: 38px;
  height: 38px;
  place-items: center;
  background: #0b2310;
  border: 2px solid var(--green-line);
  color: var(--ink);
  font-weight: 900;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.nav-link:hover,
.button:hover,
.terminal-link:hover {
  transform: translate(-2px, -2px);
  background: var(--paper);
  color: #071007;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  display: grid;
  min-height: calc(100vh - 76px);
  grid-template-columns: minmax(0, 1.03fr) minmax(320px, 0.97fr);
  align-items: center;
  gap: clamp(28px, 6vw, 72px);
  padding: clamp(34px, 6vw, 82px) 0 26px;
}

.eyebrow,
.card-kicker,
.prompt {
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 14px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  position: relative;
  max-width: 820px;
  margin-bottom: 22px;
  font-size: clamp(3.05rem, 10.5vw, 7.8rem);
  line-height: 0.86;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 8px 8px 0 #0a2410, 14px 14px 0 rgba(154, 163, 154, 0.48);
}

h1::before,
h1::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.58;
}

h1::before {
  color: var(--red);
  transform: translate(6px, -3px);
  clip-path: inset(0 0 62% 0);
  animation: glitch-a 3.2s steps(2, end) infinite;
}

h1::after {
  color: var(--paper);
  transform: translate(-5px, 4px);
  clip-path: inset(58% 0 0 0);
  animation: glitch-b 3.8s steps(2, end) infinite;
}

.ticker-row,
.hero-actions,
.signals,
.terminal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.ticker-row {
  align-items: center;
  margin-bottom: 22px;
}

.ticker-badge {
  padding: 12px 16px;
  background: var(--paper);
  border: 2px solid #374138;
  color: #071007;
  font-size: 1.1rem;
  font-weight: 900;
}

.ticker-note,
.hero-text,
.token-card p,
.signal p,
footer {
  color: var(--muted);
  line-height: 1.65;
}

.hero-text {
  max-width: 640px;
  margin-bottom: 28px;
  font-size: clamp(1rem, 2vw, 1.18rem);
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 13px 18px;
  border: 2px solid var(--green-line);
  background: rgba(10, 35, 16, 0.92);
  color: var(--ink);
  font-weight: 900;
  text-transform: uppercase;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.button-primary {
  border-color: #5a3300;
  background: var(--gold);
  color: #171000;
}

.hero-art {
  position: relative;
  min-height: 560px;
  display: grid;
  place-items: center;
}

.signal-grid {
  position: absolute;
  width: min(88vw, 520px);
  aspect-ratio: 1;
  background:
    linear-gradient(90deg, transparent 48%, rgba(238, 243, 235, 0.21) 48% 52%, transparent 52%),
    linear-gradient(0deg, transparent 48%, rgba(30, 255, 88, 0.2) 48% 52%, transparent 52%),
    repeating-conic-gradient(from 45deg, rgba(238, 243, 235, 0.16) 0 10deg, transparent 10deg 20deg);
  clip-path: polygon(8% 0, 92% 0, 100% 8%, 100% 92%, 92% 100%, 8% 100%, 0 92%, 0 8%);
  animation: slow-scan 16s steps(32) infinite;
}

.character-frame {
  position: relative;
  width: min(82vw, 440px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: rgba(6, 8, 6, 0.9);
  border: 4px solid #dfe8dc;
  box-shadow: var(--shadow);
  clip-path: polygon(5% 0, 95% 0, 100% 5%, 100% 95%, 95% 100%, 5% 100%, 0 95%, 0 5%);
  animation: quiet-shake 3.4s steps(6, end) infinite;
}

.character-frame::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 2px dashed rgba(30, 255, 88, 0.28);
}

.character-frame img {
  width: 112%;
  max-width: none;
  image-rendering: pixelated;
  filter: drop-shadow(0 24px 0 rgba(0, 0, 0, 0.24));
}

.status-chip {
  position: absolute;
  padding: 10px 12px;
  border: 2px solid rgba(238, 243, 235, 0.34);
  background: #0a2110;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.chip-a {
  top: 12%;
  left: 0;
}

.chip-b {
  top: 22%;
  right: 2%;
  background: var(--paper);
  border-color: #374138;
  color: #071007;
}

.chip-c {
  right: 3%;
  bottom: 12%;
  border-color: rgba(245, 51, 31, 0.48);
}

.ticker-tape {
  overflow: hidden;
  margin: 4px 0 54px;
  border-top: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
  background: rgba(2, 9, 4, 0.84);
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: tape 19s linear infinite;
}

.ticker-track span {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 0 28px;
  color: var(--paper);
  font-weight: 900;
  text-transform: uppercase;
}

.ticker-track span:nth-child(2n) {
  color: var(--green);
}

.info-grid {
  display: grid;
  grid-template-columns: 1.5fr 0.75fr 0.75fr;
  gap: 16px;
  margin-bottom: 16px;
}

.token-card,
.signal-board,
.terminal {
  border: 2px solid var(--line);
  background: var(--panel);
  box-shadow: 10px 10px 0 rgba(6, 22, 9, 0.88);
}

.token-card {
  min-height: 205px;
  padding: clamp(20px, 4vw, 32px);
}

.large-card h2,
.signal-board h2 {
  max-width: 720px;
  margin: 8px 0 16px;
  font-size: clamp(1.8rem, 5vw, 3.3rem);
  line-height: 1;
  text-transform: uppercase;
}

.stat-card strong {
  display: block;
  margin: 22px 0 12px;
  color: var(--paper);
  font-size: clamp(2rem, 6vw, 3.8rem);
  line-height: 0.9;
}

.signal-board {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 24px;
  margin-bottom: 16px;
  padding: clamp(20px, 4vw, 34px);
}

.signals {
  align-content: start;
}

.signal {
  flex: 1 1 180px;
  min-height: 180px;
  padding: 18px;
  background: var(--panel-strong);
  border: 2px solid rgba(238, 243, 235, 0.2);
}

.signal-index {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--green);
  font-weight: 900;
}

.signal h3 {
  margin-bottom: 10px;
  color: var(--ink);
  text-transform: uppercase;
}

.signal.is-live {
  border-color: var(--paper);
  box-shadow: inset 0 -8px 0 rgba(238, 243, 235, 0.14);
}

.terminal {
  margin-bottom: 44px;
}

.terminal-top {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-bottom: 2px solid var(--line);
  background: #0b110b;
}

.terminal-dot {
  width: 12px;
  height: 12px;
  background: var(--paper);
}

.terminal-dot:nth-child(2) {
  background: var(--green);
}

.terminal-dot:nth-child(3) {
  background: var(--red);
}

.terminal-body {
  padding: clamp(18px, 4vw, 28px);
}

.prompt {
  margin-bottom: 18px;
}

.muted {
  margin: 18px 0 0;
  color: rgba(187, 197, 185, 0.75);
}

.terminal-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 14px 8px 8px;
  border: 2px solid rgba(238, 243, 235, 0.24);
  background: rgba(10, 35, 16, 0.92);
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.terminal-link span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  background: var(--paper);
  color: #071007;
  font-weight: 900;
}

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 22px;
  padding: 28px 16px 34px;
  border-top: 2px solid rgba(238, 243, 235, 0.18);
  text-align: center;
  font-size: 0.86rem;
}

@keyframes glitch-a {
  0%, 88%, 100% { transform: translate(6px, -3px); }
  90% { transform: translate(13px, 0); }
  92% { transform: translate(-7px, -4px); }
}

@keyframes glitch-b {
  0%, 82%, 100% { transform: translate(-5px, 4px); }
  84% { transform: translate(-12px, 4px); }
  87% { transform: translate(9px, 8px); }
}

@keyframes slow-scan {
  to { transform: rotate(-1turn); }
}

@keyframes quiet-shake {
  0%, 100% { transform: translate(0, 0); }
  48% { transform: translate(0, -8px); }
  52% { transform: translate(4px, -8px); }
}

@keyframes tape {
  to { transform: translateX(-50%); }
}

@media (max-width: 860px) {
  .hero,
  .info-grid,
  .signal-board {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-art {
    min-height: 430px;
  }
}

@media (max-width: 520px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-actions .button,
  .terminal-link {
    width: 100%;
  }

  .character-frame {
    width: min(88vw, 360px);
  }

  .status-chip {
    position: static;
    margin: 8px 4px 0;
  }

  .hero-art {
    display: flex;
    min-height: auto;
    flex-wrap: wrap;
    justify-content: center;
    padding: 20px 0;
  }

  .signal-grid {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
