:root {
  color-scheme: dark;
  --bg: #020407;
  --ink: #ecf6f1;
  --muted: #9fb7bd;
  --aqua: #58d8d8;
  --aqua-deep: #062a33;
  --green: #1eff58;
  --green-deep: #052d16;
  --gold: #d0a33a;
  --red: #d93a2d;
  --steel: #89a9c4;
  --line: rgba(88, 216, 216, 0.25);
  --green-line: rgba(30, 255, 88, 0.24);
  --panel: rgba(3, 13, 18, 0.9);
  --panel-strong: rgba(5, 25, 31, 0.96);
  --shadow: 0 0 0 2px #061015, 0 0 0 6px rgba(88, 216, 216, 0.08), 0 30px 90px rgba(0, 0, 0, 0.72);
  --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;
}

.abyss-bg,
.scanlines,
.bubbles {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.abyss-bg {
  z-index: -3;
  background:
    linear-gradient(90deg, rgba(88, 216, 216, 0.05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(30, 255, 88, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 16% 22%, rgba(88, 216, 216, 0.2), transparent 24%),
    radial-gradient(circle at 80% 76%, rgba(30, 255, 88, 0.12), transparent 22%),
    linear-gradient(145deg, #010203 0%, #031018 43%, #020407 100%);
  background-size: 24px 24px, 24px 24px, auto, auto, auto;
}

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

.bubbles {
  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(2, 4, 7, 0.8);
  border-bottom: 2px solid rgba(88, 216, 216, 0.16);
  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.36), inset 4px 4px 0 rgba(255, 255, 255, 0.08);
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #021016;
  background: var(--aqua);
  border: 2px solid #12444d;
}

.nav-link {
  display: grid;
  min-width: 38px;
  height: 38px;
  place-items: center;
  background: #06161d;
  border: 2px solid var(--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(--aqua);
  color: #021016;
}

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(--aqua);
  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(3rem, 10.8vw, 7.7rem);
  line-height: 0.86;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 8px 8px 0 #061d24, 14px 14px 0 rgba(30, 255, 88, 0.32);
}

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

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(--aqua);
  transform: translate(-5px, 4px);
  clip-path: inset(58% 0 0 0);
  animation: glitch-b 3.8s steps(2, end) infinite;
}

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

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

.ticker-badge {
  padding: 12px 16px;
  background: var(--gold);
  border: 2px solid #4a340b;
  color: #100b02;
  font-size: 1.1rem;
  font-weight: 900;
}

.ticker-note,
.hero-text,
.token-card p,
.depth-item 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(--line);
  background: rgba(4, 20, 26, 0.94);
  color: var(--ink);
  font-weight: 900;
  text-transform: uppercase;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.button-primary {
  border-color: #12444d;
  background: var(--aqua);
  color: #021016;
}

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

.sonar-grid {
  position: absolute;
  width: min(88vw, 520px);
  aspect-ratio: 1;
  background:
    radial-gradient(circle, transparent 0 22%, rgba(88, 216, 216, 0.14) 22% 23%, transparent 23% 42%, rgba(30, 255, 88, 0.12) 42% 43%, transparent 43%),
    linear-gradient(90deg, transparent 49%, rgba(88, 216, 216, 0.2) 49% 51%, transparent 51%),
    linear-gradient(0deg, transparent 49%, rgba(88, 216, 216, 0.2) 49% 51%, transparent 51%);
  clip-path: polygon(8% 0, 92% 0, 100% 8%, 100% 92%, 92% 100%, 8% 100%, 0 92%, 0 8%);
  animation: sonar-spin 18s steps(48) infinite;
}

.character-frame {
  position: relative;
  width: min(82vw, 440px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: rgba(2, 7, 10, 0.94);
  border: 4px solid #10414c;
  box-shadow: var(--shadow);
  clip-path: polygon(6% 0, 94% 0, 100% 6%, 100% 94%, 94% 100%, 6% 100%, 0 94%, 0 6%);
  animation: float-snap 3.5s steps(5, end) infinite;
}

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

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

.status-chip {
  position: absolute;
  padding: 10px 12px;
  border: 2px solid rgba(88, 216, 216, 0.28);
  background: #06161d;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

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

.chip-b {
  top: 22%;
  right: 2%;
  background: var(--gold);
  border-color: #4a340b;
  color: #100b02;
}

.chip-c {
  right: 5%;
  bottom: 12%;
  border-color: rgba(30, 255, 88, 0.38);
}

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

.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(--aqua);
  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,
.depth-board,
.terminal {
  border: 2px solid var(--line);
  background: var(--panel);
  box-shadow: 10px 10px 0 rgba(2, 9, 13, 0.92);
}

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

.large-card h2,
.depth-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(--gold);
  font-size: clamp(2rem, 6vw, 3.8rem);
  line-height: 0.9;
}

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

.depth-items {
  align-content: start;
}

.depth-item {
  flex: 1 1 180px;
  min-height: 180px;
  padding: 18px;
  background: var(--panel-strong);
  border: 2px solid rgba(88, 216, 216, 0.18);
}

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

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

.depth-item.is-active {
  border-color: var(--aqua);
  box-shadow: inset 0 -8px 0 rgba(88, 216, 216, 0.1);
}

.terminal {
  margin-bottom: 44px;
}

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

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

.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(159, 183, 189, 0.76);
}

.terminal-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 14px 8px 8px;
  border: 2px solid rgba(88, 216, 216, 0.22);
  background: rgba(4, 20, 26, 0.94);
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

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

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

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

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

@keyframes sonar-spin {
  to { transform: rotate(1turn); }
}

@keyframes float-snap {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(0, -10px); }
}

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

@media (max-width: 860px) {
  .hero,
  .info-grid,
  .depth-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;
  }

  .sonar-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;
  }
}
