:root {
  color-scheme: dark;
  --bg: #050506;
  --panel: #0b0c0d;
  --panel-2: #111315;
  --text: #f4f1eb;
  --muted: #a5a197;
  --line: #24272a;
  --accent: #d8ff6b;
  --accent-2: #8cf7ff;
  --warm: #ffb86b;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 72% 8%, rgba(216, 255, 107, 0.09), transparent 28%),
    radial-gradient(circle at 16% 32%, rgba(140, 247, 255, 0.055), transparent 30%),
    linear-gradient(180deg, #090a0a 0%, var(--bg) 48%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

img {
  max-width: 100%;
}

.hero > *,
.memory-console,
.install pre,
.security-list,
.benchmark-list,
.contributor-panel,
.handoff-card,
.graph-content,
.graph-viz {
  min-width: 0;
  max-width: 100%;
}

.cli-banner > div {
  min-width: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(5, 5, 6, 0.82);
  backdrop-filter: blur(18px);
}

.brand {
  flex: 0 0 auto;
  min-width: 0;
}

.brand,
nav,
.hero-actions,
.badge-row,
footer,
.footer-links {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand img {
  width: clamp(132px, 18vw, 172px);
  height: auto;
  display: block;
}

.nav-toggle,
.nav-toggle-label {
  display: none;
}

nav {
  color: var(--muted);
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
  max-width: 100%;
}

nav a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

nav a:hover,
.footer-links a:hover {
  color: var(--accent);
}

main {
  overflow: hidden;
}

.hero {
  min-height: calc(100vh - 70px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  align-items: center;
  gap: 42px;
  padding: 54px clamp(20px, 5vw, 72px) 36px;
}

.eyebrow,
.tag {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 820px;
  font-size: clamp(46px, 6vw, 92px);
  line-height: 0.95;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

h2 {
  max-width: 920px;
  font-size: clamp(34px, 5vw, 70px);
  line-height: 1;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

h3 {
  font-size: 24px;
}

.lead,
article p,
.handoff p,
.security p,
.ownership p,
.contribute p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.lead {
  max-width: 760px;
  margin: 24px 0 30px;
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid var(--line);
  font-weight: 700;
}

.button.primary {
  background: var(--accent);
  color: #111;
  border-color: var(--accent);
}

.button.secondary {
  color: var(--text);
}

.badge-row {
  flex-wrap: wrap;
  margin-top: 26px;
}

.memory-console,
.install pre {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
}

.memory-console {
  min-height: 540px;
  align-self: stretch;
  display: flex;
  flex-direction: column;
}

.console-top {
  height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.console-top span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--line);
}

.console-top strong {
  margin-left: auto;
  font-size: 12px;
  font-weight: 500;
}

pre {
  margin: 0;
  padding: 24px;
  white-space: pre-wrap;
  color: #dbd8ce;
  font-size: 15px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.terminal-script {
  padding: 26px;
  color: #dbd8ce;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 15px;
  line-height: 1.85;
  min-width: 0;
  overflow-wrap: anywhere;
}

.cli-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  padding: 16px;
  border: 1px solid rgba(216, 255, 107, 0.32);
  background:
    linear-gradient(135deg, rgba(216, 255, 107, 0.09), rgba(140, 247, 255, 0.04)),
    rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 0 40px rgba(216, 255, 107, 0.035);
}

.cli-banner strong,
.cli-banner small {
  display: block;
}

.cli-banner strong {
  color: var(--text);
  font-size: 16px;
}

.cli-banner small {
  color: var(--muted);
  margin-top: 2px;
}

.banner-mark {
  display: grid;
  place-items: center;
  min-width: 34px;
  width: 42px;
  height: 34px;
  color: var(--accent);
  border: 1px solid rgba(216, 255, 107, 0.42);
  background: rgba(216, 255, 107, 0.07);
  box-shadow: 0 0 26px rgba(216, 255, 107, 0.2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.term-line {
  min-height: 28px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.term-line.typing {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  border-right: 0;
  animation: typeIn 1.6s steps(30, end) both;
}

.term-gap {
  height: 16px;
}

.indent {
  padding-left: 24px;
}

.prompt {
  color: var(--accent);
  text-shadow: 0 0 18px rgba(216, 255, 107, 0.35);
}

.cmd {
  color: #8cf7ff;
}

.pkg,
.subcmd {
  color: #f4f1eb;
}

.arg {
  color: #ffb86b;
}

.flag {
  color: #b89cff;
}

.value,
.quote {
  color: #ffd479;
}

.slash {
  color: var(--muted);
}

.ok {
  color: #7dff9b;
}

.path {
  color: #8cf7ff;
}

.success {
  color: #c9ffc8;
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 1.2em;
  margin-left: 4px;
  vertical-align: -0.2em;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(216, 255, 107, 0.55);
  animation: blink 0.9s steps(1, end) infinite;
}

@keyframes typeIn {
  from {
    width: 0;
  }
  to {
    width: 52ch;
  }
}

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

.ownership,
.security,
.benchmarks,
.handoff,
.install,
.contribute {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 36px;
  align-items: center;
  padding: clamp(56px, 8vw, 112px) clamp(20px, 5vw, 72px);
}

.ownership {
  grid-template-columns: minmax(220px, 0.45fr) 1fr;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #070808;
}

.ownership img {
  width: min(100%, 320px);
  border: 1px solid var(--line);
}

.signal-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
}

.signal-strip div {
  padding: 26px clamp(20px, 5vw, 72px);
  border-right: 1px solid var(--line);
}

.signal-strip strong {
  display: block;
  font-size: 32px;
}

.signal-strip span {
  color: var(--muted);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}

.feature-grid article {
  min-height: 360px;
  padding: clamp(28px, 4.5vw, 54px);
  background: var(--bg);
}

.feature-grid h2 {
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.05;
}

.security {
  border-bottom: 1px solid var(--line);
}

.security-list,
.contributor-panel {
  border: 1px solid var(--line);
  background: var(--panel);
}

.security-list div {
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.security-list div:last-child {
  border-bottom: 0;
}

.security-list strong,
.security-list span {
  display: block;
}

.security-list span {
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.55;
}

.handoff-card {
  min-height: 430px;
  border: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    var(--panel);
  background-size: 34px 34px;
  padding: 34px;
  display: grid;
  align-content: center;
}

.node {
  width: min(100%, 360px);
  padding: 18px 20px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  font-weight: 700;
}

.node.active {
  border-color: var(--accent);
  color: var(--accent);
}

.wire {
  width: 2px;
  height: 42px;
  margin-left: 28px;
  background: linear-gradient(var(--accent), var(--accent-2));
}

.handoff-memory {
  margin-top: 28px;
  padding: 22px;
  border: 1px solid rgba(216, 255, 107, 0.35);
  background: rgba(216, 255, 107, 0.06);
}

.handoff-memory span {
  display: block;
  color: var(--muted);
  margin-bottom: 6px;
}

.install,
.contribute {
  border-top: 1px solid var(--line);
  background: #080909;
}

.install-commands {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 24px 70px rgba(0, 0, 0, 0.36);
}

.install-commands code {
  display: block;
}

.contributor-panel {
  padding: 28px;
}

.contributor-panel ol {
  margin: 20px 0 26px;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.8;
}

footer {
  justify-content: space-between;
  padding: 26px clamp(20px, 5vw, 72px);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

footer strong,
footer span {
  display: block;
}

footer strong {
  color: var(--text);
  margin-bottom: 6px;
}

@media (max-width: 980px) {
  footer,
  .hero-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header {
    position: sticky;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 100vw;
    padding: 12px 18px;
    overflow: visible;
  }

  .brand {
    width: auto;
    padding: 0;
  }

  .brand img {
    width: 150px;
    max-width: calc(100vw - 36px);
  }

  .nav-toggle {
    position: absolute;
    opacity: 0;
    pointer-events: none;
  }

  .nav-toggle-label {
    width: 42px;
    height: 38px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.035);
    cursor: pointer;
  }

  .nav-toggle-label span {
    width: 18px;
    height: 2px;
    display: block;
    background: var(--text);
    transition: transform 180ms ease, opacity 180ms ease;
  }

  .nav-toggle:checked + .nav-toggle-label span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .nav-toggle:checked + .nav-toggle-label span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle:checked + .nav-toggle-label span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  nav {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 100vw;
    max-height: 0;
    gap: 0;
    justify-content: flex-start;
    overflow: hidden;
    padding: 0;
    border: 0;
    opacity: 0;
    transition: max-height 220ms ease, opacity 160ms ease, border-color 160ms ease;
  }

  .nav-toggle:checked ~ nav {
    max-height: 320px;
    opacity: 1;
    border: 1px solid var(--line);
  }

  nav a {
    width: 100%;
    min-height: 42px;
    justify-content: space-between;
    padding: 0 14px;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.02);
    font-size: 14px;
  }

  nav a:last-child {
    border-bottom: 0;
  }

  .hero,
  .ownership,
  .security,
  .benchmarks,
  .handoff,
  .install,
  .contribute,
  .feature-grid,
  .signal-strip {
    grid-template-columns: 1fr;
  }

  .memory-console {
    min-height: 380px;
  }

  .signal-strip div,
  .feature-grid article {
    border-right: 0;
  }
}

@media (max-width: 520px) {
  .site-header {
    padding: 10px 14px;
  }

  .hero {
    padding: 50px 24px 36px;
  }

  h1 {
    font-size: 36px;
    line-height: 1.05;
    text-wrap: auto;
  }

  h2 {
    font-size: 32px;
    line-height: 1.08;
    text-wrap: auto;
  }

  .lead,
  article p,
  .handoff p,
  .security p,
  .ownership p,
  .contribute p,
  .graph-content p {
    font-size: 16px;
    line-height: 1.65;
  }

  .hero-actions {
    width: 100%;
  }

  .brand {
    padding: 0;
  }

  .brand img {
    width: 132px;
    max-width: calc(100vw - 28px);
  }

  nav {
    width: 100%;
  }

  nav a {
    font-size: 13px;
  }

  .memory-console {
    min-height: auto;
  }

  .terminal-script {
    padding: 20px;
    font-size: 12px;
  }

  .cli-banner {
    align-items: flex-start;
    padding: 14px;
  }
}

/* Graph Section Styles */
.graph-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  padding: clamp(56px, 8vw, 112px) clamp(20px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background: radial-gradient(circle at 75% 50%, rgba(140, 247, 255, 0.05), transparent 40%), var(--bg);
}

.graph-content p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.graph-stats {
  display: flex;
  gap: 32px;
  margin-top: 32px;
}

.graph-stats strong {
  display: block;
  font-size: 32px;
  color: var(--accent-2);
}

.graph-stats span {
  color: var(--muted);
  font-size: 14px;
}

.graph-viz {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  max-width: 500px;
  margin: 0 auto;
}

.g-node {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(140, 247, 255, 0.4);
  background: rgba(140, 247, 255, 0.05);
  backdrop-filter: blur(8px);
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--text);
  font-size: 13px;
  font-family: ui-monospace, monospace;
  z-index: 2;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 20px rgba(140, 247, 255, 0.1);
  transition: all 0.3s ease;
}

.g-node:hover {
  border-color: var(--accent-2);
  background: rgba(140, 247, 255, 0.15);
  box-shadow: 0 0 30px rgba(140, 247, 255, 0.3);
  transform: translate(-50%, -50%) scale(1.05);
}

.g-node.center {
  top: 50%;
  left: 50%;
  border-color: var(--accent);
  background: rgba(216, 255, 107, 0.1);
  color: var(--accent);
  box-shadow: 0 0 40px rgba(216, 255, 107, 0.2);
}

.g-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transform: translate(-50%, -50%);
  z-index: -1;
  animation: pulseNode 3s infinite;
}

.g-node.n1 { top: 10%; left: 15%; animation: float 6s ease-in-out infinite; }
.g-node.n2 { top: 20%; left: 85%; animation: float 7s ease-in-out infinite 1s; }
.g-node.n3 { top: 85%; left: 80%; animation: float 5s ease-in-out infinite 2s; }
.g-node.n4 { top: 90%; left: 20%; animation: float 8s ease-in-out infinite 0.5s; }
.g-node.n5 { top: 5%; left: 60%; animation: float 6s ease-in-out infinite 1.5s; }

.g-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.g-lines line {
  stroke: rgba(140, 247, 255, 0.2);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
  animation: march 20s linear infinite;
}

/* Benchmarks Section */
.benchmarks {
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}

.benchmark-list {
  border: 1px solid var(--line);
  background: var(--panel);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 1px;
  background: var(--line); /* acts as border for grid items */
}

.benchmark-list > div {
  background: var(--panel);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-value {
  font-size: 42px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 12px;
}

.benchmark-list span {
  color: var(--muted);
  line-height: 1.6;
}

@keyframes pulseNode {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
  100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

@keyframes float {
  0%, 100% { margin-top: 0; }
  50% { margin-top: -10px; }
}

@keyframes march {
  from { stroke-dashoffset: 100; }
  to { stroke-dashoffset: 0; }
}

@media (max-width: 980px) {
  .graph-section {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .graph-viz {
    max-width: 400px;
  }
}

@media (max-width: 640px) {
  .graph-stats {
    flex-direction: column;
    gap: 18px;
  }

  .graph-viz {
    max-width: 320px;
  }

  .g-node {
    padding: 7px 10px;
    font-size: 11px;
  }

  .benchmark-list > div {
    padding: 26px 20px;
  }

  .stat-value {
    font-size: 34px;
  }
}
