:root {
  color-scheme: dark;
  --bg: #050806;
  --panel: rgba(8, 20, 14, 0.84);
  --panel-solid: #09120d;
  --line: rgba(119, 255, 182, 0.28);
  --line-strong: rgba(119, 255, 182, 0.58);
  --green: #69ff9f;
  --mint: #9cffd6;
  --cyan: #5de7ff;
  --amber: #ffca6a;
  --red: #ff6d7a;
  --text: #e8fff1;
  --muted: #9cb5a5;
  --black: #020403;
  --shadow: rgba(0, 0, 0, 0.62);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 22% 18%, rgba(93, 231, 255, 0.14), transparent 28rem),
    radial-gradient(circle at 78% 10%, rgba(255, 202, 106, 0.10), transparent 26rem),
    linear-gradient(180deg, #020403 0%, #06100a 46%, #020403 100%);
  color: var(--text);
  font-family: "IBM Plex Mono", Consolas, monospace;
  line-height: 1.55;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(105, 255, 159, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(105, 255, 159, 0.04) 1px, transparent 1px);
  background-size: 18px 18px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.88), rgba(0,0,0,0.14));
  z-index: -2;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.035),
    rgba(255,255,255,0.035) 1px,
    transparent 1px,
    transparent 4px
  );
  mix-blend-mode: overlay;
  opacity: 0.24;
  z-index: 10;
}

#matrix {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.22;
  pointer-events: none;
  z-index: -1;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(105, 255, 159, 0.2);
  background: rgba(2, 4, 3, 0.78);
  backdrop-filter: blur(16px);
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0;
  min-width: 0;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid var(--green);
  color: var(--black);
  background: var(--green);
  box-shadow: 4px 4px 0 rgba(93, 231, 255, 0.28);
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 28px);
  color: var(--muted);
  font-size: 14px;
  min-width: 0;
}

.nav a:hover, .top-action:hover { color: var(--green); }

.top-action {
  padding: 8px 12px;
  border: 1px solid var(--line);
  color: var(--mint);
  background: rgba(105, 255, 159, 0.06);
}

main {
  position: relative;
  min-width: 0;
}

.shell-section, .grid-section, .panel-section, .backend-section, .start-section {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  min-width: 0;
}

.hero {
  min-height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(420px, 1.08fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  padding: 58px 0 72px;
}

.hero-copy { min-width: 0; }

.eyebrow, .section-kicker {
  color: var(--green);
  text-transform: uppercase;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
}

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

h1 {
  max-width: 780px;
  margin-bottom: 22px;
  font-family: "Press Start 2P", "IBM Plex Mono", monospace;
  font-size: clamp(30px, 5.5vw, 68px);
  line-height: 1.12;
  letter-spacing: 0;
  text-shadow: 0 0 24px rgba(105, 255, 159, 0.28);
  overflow-wrap: anywhere;
}

h2 {
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.1;
  letter-spacing: 0;
  margin-bottom: 16px;
}

h3 {
  font-size: 18px;
  margin-bottom: 10px;
  color: var(--mint);
}

.lede {
  max-width: 680px;
  color: #c8e7d1;
  font-size: clamp(17px, 2vw, 21px);
}

.hero-actions, .link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.button, .link-row a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line-strong);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.48);
  font-weight: 700;
}

.button.primary {
  background: var(--green);
  color: #021107;
}

.button.ghost, .link-row a {
  background: rgba(8, 20, 14, 0.74);
  color: var(--mint);
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.status-row span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.24);
  color: var(--muted);
}

.status-row strong { color: var(--amber); }

.terminal-card, .format-panel, .format-example, .feature-card, .command-grid pre {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(8, 20, 14, 0.94), rgba(3, 8, 5, 0.96));
  box-shadow: 0 22px 70px var(--shadow), inset 0 0 0 1px rgba(255,255,255,0.035);
}

.terminal-card {
  min-width: 0;
  overflow: hidden;
  transform: perspective(1200px) rotateY(-4deg) rotateX(2deg);
}

.terminal-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(105, 255, 159, 0.08);
}

.led { width: 10px; height: 10px; display: inline-block; }
.led.red { background: var(--red); }
.led.amber { background: var(--amber); }
.led.green { background: var(--green); }
.terminal-title { margin-left: 8px; color: var(--muted); font-size: 13px; }

pre {
  margin: 0;
  overflow: auto;
  white-space: pre;
}

.terminal-card pre { padding: 20px; }
code { color: #dfffe8; font-family: "IBM Plex Mono", Consolas, monospace; font-size: 14px; }
.dim { color: #6d8c77; }

.signal-strip {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(105, 255, 159, 0.06);
}

.signal-strip div {
  padding: 16px clamp(14px, 3vw, 42px);
  border-right: 1px solid var(--line);
  color: var(--mint);
  font-weight: 700;
}

.signal-strip div:last-child { border-right: 0; }
.signal-strip span { color: var(--amber); margin-right: 8px; }

.grid-section, .panel-section, .backend-section, .start-section {
  padding: clamp(76px, 9vw, 124px) 0;
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 28px;
  align-items: end;
  margin-bottom: 28px;
}

.section-head p, .format-panel p, .backend-section p { color: var(--muted); font-size: 17px; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.feature-card {
  min-height: 220px;
  padding: 20px;
}

.feature-card p { color: var(--muted); }
.feature-card code {
  display: block;
  margin-top: 18px;
  color: var(--amber);
  white-space: normal;
  overflow-wrap: anywhere;
}

.panel-section {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(320px, 0.72fr);
  gap: 18px;
  align-items: stretch;
}

.format-panel { padding: clamp(24px, 5vw, 42px); }

.format-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.format-list span {
  padding: 9px 12px;
  border: 1px solid var(--line);
  color: var(--mint);
  background: rgba(0,0,0,0.24);
}

.format-example {
  min-width: 0;
  overflow: hidden;
}

.example-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--line);
}

.example-tabs span {
  padding: 12px 14px;
  color: var(--mint);
  background: rgba(105,255,159,0.08);
  font-weight: 700;
}

.example-tabs span + span { border-left: 1px solid var(--line); }

.format-example pre {
  padding: 18px;
  overflow: auto;
}

.format-example pre + pre {
  border-top: 1px solid rgba(105,255,159,0.16);
}

.format-example code {
  display: block;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.byte-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, auto);
  gap: 18px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(105,255,159,0.13);
}
.byte-line:last-child { border-bottom: 0; }
.byte-line span:first-child { color: var(--green); }
.byte-line span:last-child { color: var(--muted); text-align: right; }

.backend-section { text-align: center; }
.backend-section h2 { max-width: 780px; margin-left: auto; margin-right: auto; }

.pipeline {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  margin: 34px 0 26px;
}

.pipe-node {
  min-height: 70px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: rgba(8,20,14,0.72);
  color: var(--mint);
  font-weight: 700;
}

.pipe-node.highlight { color: #031108; background: var(--green); }
.pipe-arrow { color: var(--amber); font-weight: 700; }

.backend-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  text-align: left;
}

.backend-grid div {
  padding: 18px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.22);
}
.backend-grid strong { display: block; color: var(--mint); margin-bottom: 6px; }
.backend-grid span { color: var(--muted); }

.start-section h2 { max-width: 700px; }
.command-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.command-grid pre { padding: 20px; }
.command-grid code {
  display: block;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 24px clamp(18px, 4vw, 56px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: rgba(0,0,0,0.38);
}

@media (max-width: 980px) {
  .hero, .panel-section, .section-head { grid-template-columns: 1fr; }
  .hero { padding-top: 42px; }
  .terminal-card { transform: none; }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipeline { grid-template-columns: 1fr; }
  .pipe-arrow { transform: rotate(90deg); }
}

@media (max-width: 720px) {
  .topbar { align-items: flex-start; flex-wrap: wrap; }
  .nav { order: 3; width: 100%; overflow-x: auto; padding-bottom: 2px; }
  .top-action { margin-left: auto; }
  .signal-strip, .feature-grid, .backend-grid, .command-grid { grid-template-columns: 1fr; }
  .signal-strip div { border-right: 0; border-bottom: 1px solid var(--line); }
  .signal-strip div:last-child { border-bottom: 0; }
  h1 { font-size: clamp(26px, 9vw, 40px); }
  .byte-line { grid-template-columns: 1fr; gap: 4px; }
  .byte-line span:last-child { text-align: left; }
}
