:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface-0: #ffffff;
  --surface-1: #eef2f7;
  --surface-2: #dde4ef;
  --surface-3: #c8d3e4;
  --text: #09111f;
  --muted: #47546a;
  --line: #cbd5e1;
  --line-strong: #8ca0bf;
  --primary: #00992b;
  --primary-strong: #007722;
  --secondary: #007bb4;
  --accent-soft: rgba(0, 153, 43, 0.1);
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
  --shell: min(1180px, calc(100vw - 2rem));
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #060e20;
  --surface-0: #000000;
  --surface-1: #06122d;
  --surface-2: #05183c;
  --surface-3: #00225a;
  --text: #dee5ff;
  --muted: #91aaeb;
  --line: #2b4680;
  --line-strong: #5b74b1;
  --primary: #00e639;
  --primary-strong: #00f13d;
  --secondary: #17a8ec;
  --accent-soft: rgba(0, 230, 57, 0.1);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(23, 168, 236, 0.08), transparent 24%),
    radial-gradient(circle at bottom left, rgba(0, 230, 57, 0.08), transparent 28%),
    var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", sans-serif;
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: 0.08;
  pointer-events: none;
}

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

button {
  font: inherit;
}

.frame-noise {
  position: fixed;
  inset: 0;
  border: 16px solid var(--surface-0);
  opacity: 0.08;
  pointer-events: none;
  z-index: 50;
}

.scanline {
  position: fixed;
  inset-inline: 0;
  height: 96px;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 230, 57, 0.05) 50%,
    rgba(0, 0, 0, 0) 100%
  );
  opacity: 0.22;
  pointer-events: none;
  z-index: 40;
  animation: scanline 8s linear infinite;
}

@keyframes scanline {
  from {
    transform: translateY(-120px);
  }

  to {
    transform: translateY(calc(100vh + 120px));
  }
}

.cursor-mark::after {
  content: "_";
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  from,
  to {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

.shell {
  width: var(--shell);
  margin-inline: auto;
}

.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 2vw, 1.5rem);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 40%, transparent);
  backdrop-filter: blur(16px);
}

.topbar-brand,
.rail-brand h2,
.section-kicker,
.topbar-nav a,
.rail-nav a,
.rail-cta,
.theme-toggle,
.menu-toggle,
.route-foot,
.hero-metrics span,
.game-stats span,
.footer-links a {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.topbar-brand {
  color: var(--primary);
  font-size: 1.05rem;
  font-weight: 700;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 1.6rem;
}

.topbar-nav a {
  color: var(--secondary);
  font-size: 0.78rem;
}

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

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-toggle,
.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  background: var(--surface-1);
  color: var(--primary);
  cursor: pointer;
}

.theme-toggle-icon,
.menu-toggle {
  font-size: 0.8rem;
}

.theme-toggle-icon {
  width: 1rem;
  height: 1rem;
  display: inline-flex;
}

.theme-toggle-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.menu-toggle {
  display: none;
}

.mobile-drawer {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 35;
  width: min(80vw, 320px);
  padding: 1.25rem;
  background: var(--surface-1);
  border-right: 1px solid var(--line);
  transform: translateX(-100%);
  transition: transform 220ms ease;
}

.mobile-drawer.is-open {
  transform: translateX(0);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 34;
  background: rgba(0, 0, 0, 0.42);
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  color: var(--primary);
  font-family: "Space Grotesk", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.drawer-nav {
  display: grid;
  gap: 0.8rem;
}

.drawer-nav a {
  padding: 0.9rem 1rem;
  border-left: 3px solid transparent;
  background: var(--surface-2);
  color: var(--secondary);
  font-family: "Space Grotesk", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.drawer-nav a:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.siderail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: 244px;
  padding: 6rem 0 1.5rem;
  background: var(--surface-1);
  border-right: 1px solid color-mix(in srgb, var(--line) 50%, transparent);
  display: flex;
  flex-direction: column;
}

.rail-brand {
  padding: 0 1.5rem 2rem;
}

.rail-badge {
  width: 2.8rem;
  height: 2.8rem;
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
  border: 1px solid var(--primary);
  background: var(--surface-3);
  color: var(--primary);
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
}

.rail-brand h2 {
  margin: 0;
  color: var(--primary);
  font-size: 1rem;
}

.rail-brand p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.rail-nav {
  display: grid;
}

.rail-nav a {
  padding: 1rem 1.5rem;
  color: var(--muted);
  font-size: 0.78rem;
  border-left: 4px solid transparent;
}

.rail-nav a:hover,
.rail-nav a.is-active {
  color: var(--primary);
  border-left-color: var(--primary);
  background: var(--surface-2);
}

.rail-cta {
  display: block;
  margin: auto 1.5rem 0;
  padding: 0.8rem 1rem;
  background: var(--primary);
  color: var(--surface-0);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
}

main {
  margin-left: 244px;
  padding: 6rem 0 4rem;
}

.hero,
.bento,
.socials {
  margin-bottom: 1.5rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.9fr);
  gap: 1.5rem;
}

.hero-panel,
.terminal-panel,
.panel {
  background: var(--surface-1);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(1.5rem, 4vw, 3rem);
  border-left: 8px solid var(--primary);
}

.hero-glyph {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  color: color-mix(in srgb, var(--text) 10%, transparent);
  width: clamp(3rem, 9vw, 6rem);
  height: clamp(3rem, 9vw, 6rem);
}

.hero-glyph svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.section-kicker {
  margin: 0 0 0.85rem;
  color: var(--secondary);
  font-size: 0.72rem;
  font-weight: 700;
}

.hero h1,
.links-panel h2,
.signature-panel h2,
.socials h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.95;
}

.hero h1 {
  max-width: 10ch;
  font-size: clamp(3.2rem, 9vw, 6.3rem);
}

.hero h1 span {
  color: var(--primary);
}

.hero-lede {
  position: relative;
  z-index: 1;
  max-width: 60ch;
  min-height: 3.3rem;
  margin: 1.2rem 0 0;
  color: var(--muted);
  font-size: 1.1rem;
}

.hero-metrics {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.hero-metrics span {
  padding: 0.7rem 0.9rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 0.74rem;
  font-weight: 700;
}

.hero-quicklinks {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.95rem;
  margin-top: 1.2rem;
}

.quicklinks-block {
  padding: 0.95rem 1rem;
  background: color-mix(in srgb, var(--surface-2) 72%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}

.quicklinks-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.quicklinks-row a {
  padding: 0.7rem 0.85rem;
  background: var(--surface-0);
  border: 1px solid var(--line);
  color: var(--primary);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.quicklinks-row a:hover {
  background: var(--surface-1);
  border-color: var(--line-strong);
}

.terminal-panel {
  padding: 1rem;
}

.terminal-bar,
.window-lights {
  display: flex;
  gap: 0.35rem;
}

.terminal-bar {
  margin-bottom: 1rem;
}

.terminal-bar span,
.window-lights span {
  width: 0.72rem;
  height: 0.72rem;
  background: var(--primary);
  opacity: 0.75;
}

.terminal-list {
  display: grid;
  gap: 1rem;
  margin: 0;
}

.terminal-list div {
  padding-bottom: 0.9rem;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}

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

.terminal-list dt {
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.terminal-list dd {
  margin: 0;
  font-weight: 600;
}

.bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1.5rem;
}

.panel {
  position: relative;
  overflow: hidden;
  padding: 1.4rem;
}

.panel::before,
.panel::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: var(--primary);
  pointer-events: none;
}

.panel::before {
  top: 0;
  left: 0;
  border-top: 1px solid;
  border-left: 1px solid;
}

.panel::after {
  right: 0;
  bottom: 0;
  border-right: 1px solid;
  border-bottom: 1px solid;
}

.telemetry-panel {
  grid-column: span 7;
}

.links-panel {
  grid-column: span 5;
  border-left: 4px solid var(--secondary);
}

.signature-panel,
.game-panel {
  grid-column: span 6;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.micro-status {
  padding: 0.4rem 0.65rem;
  border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent);
  background: var(--accent-soft);
  color: var(--primary);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.telemetry-list {
  display: grid;
  gap: 0.95rem;
  margin: 1.4rem 0;
}

.telemetry-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 80px 78px;
  gap: 0.8rem;
  align-items: center;
}

.telemetry-row > span:first-child,
.process-log span,
.process-log strong,
.game-stats,
.signature-actions button,
.signature-status > span {
  font-family: "Space Grotesk", sans-serif;
  text-transform: uppercase;
}

.telemetry-row > span:first-child {
  color: var(--muted);
  font-size: 0.8rem;
}

.telemetry-row div {
  height: 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.telemetry-row div span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 420ms ease;
}

.telemetry-row strong {
  color: var(--primary);
  font-size: 0.82rem;
  text-align: right;
}

.telemetry-row em {
  color: var(--muted);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.72rem;
  font-style: normal;
  letter-spacing: 0.12em;
  text-align: right;
  text-transform: uppercase;
}

.process-log {
  display: grid;
  gap: 0.45rem;
  padding-top: 1rem;
  border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}

.process-log div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.process-log span {
  color: var(--muted);
  font-size: 0.8rem;
}

.process-log strong {
  color: var(--primary);
  font-size: 0.8rem;
}

.process-log strong.is-warn {
  color: var(--secondary);
}

.process-log strong.is-hot {
  color: #ff8d6b;
}

.links-panel h2,
.signature-panel h2 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin-bottom: 1.2rem;
}

.route-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.route-list a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1rem;
  background: var(--surface-0);
  border: 1px solid var(--line);
}

.route-list a:hover {
  background: var(--surface-2);
}

.route-list span {
  color: var(--primary);
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
}

.route-list strong {
  color: var(--text);
  font-size: 0.92rem;
}

.route-foot {
  margin: 1.2rem 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.stack-card {
  margin-top: 1.2rem;
  padding: 1rem;
  background: color-mix(in srgb, var(--surface-2) 72%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}

.stack-card-label {
  margin: 0 0 0.8rem;
  color: var(--secondary);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stack-card-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.7rem;
}

.stack-card-list li {
  position: relative;
  padding-left: 1rem;
  color: var(--text);
  font-size: 0.92rem;
}

.stack-card-list li::before {
  content: "";
  position: absolute;
  top: 0.45rem;
  left: 0;
  width: 0.4rem;
  height: 0.4rem;
  background: var(--primary);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--secondary) 35%, transparent);
}

.link-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.link-grid a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: var(--surface-0);
  border: 1px solid var(--line);
}

.link-grid a:hover {
  background: var(--surface-1);
  border-color: var(--line-strong);
}

.link-grid span,
.link-grid strong {
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.link-grid span {
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
}

.link-grid strong {
  color: var(--muted);
  font-size: 0.66rem;
  text-align: right;
}

.signature-panel {
  border: 4px double var(--line-strong);
}

.signature-block {
  min-height: 7.6rem;
  margin: 1rem 0;
  padding: 1rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.68rem;
  line-height: 1.6;
}

.signature-block.is-busy {
  color: var(--primary);
}

.signature-actions {
  display: flex;
  gap: 0.8rem;
}

.signature-actions button {
  flex: 1;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.signature-actions button:last-child {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--surface-0);
}

.signature-status {
  margin-top: 1rem;
}

.signature-status > span {
  display: inline-block;
  margin-bottom: 0.8rem;
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.signature-flow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.signature-flow li {
  padding: 0.85rem 1rem;
  background: var(--surface-0);
  border: 1px solid var(--line);
  position: relative;
}

.signature-flow li.is-current {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--surface-0) 60%, var(--accent-soft));
}

.signature-flow li.is-current::after {
  content: "verifying";
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--secondary);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.autoplay-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 0.35rem;
  max-width: 240px;
  margin-inline: auto;
  margin-top: 1rem;
}

.autoplay-grid span {
  aspect-ratio: 1;
  background: var(--surface-2);
  border: 1px solid var(--line);
  transition: background 180ms ease, transform 180ms ease;
}

.autoplay-grid span.is-active {
  background: var(--secondary);
  transform: scale(0.92);
}

.autoplay-grid span.is-target {
  background: color-mix(in srgb, var(--primary) 26%, transparent);
}

.autoplay-grid span.was-visited {
  background: color-mix(in srgb, var(--surface-3) 70%, transparent);
}

.game-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1.6rem;
}

.game-stats div {
  text-align: center;
}

.game-stats span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.game-stats strong {
  color: var(--primary);
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.3rem;
}

.socials {
  padding-bottom: 1rem;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.section-title h2 {
  color: var(--secondary);
  font-size: clamp(2rem, 5vw, 2.6rem);
  text-transform: uppercase;
}

.section-title span {
  height: 1px;
  flex: 1;
  background: var(--line);
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1rem;
}

.social-grid a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  min-height: 126px;
  padding: 1rem;
  background: var(--surface-1);
  border: 1px solid var(--line);
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.social-grid a:hover {
  border-color: var(--primary);
  background: var(--surface-2);
  transform: translateY(-2px);
}

.social-grid svg {
  width: 2rem;
  height: 2rem;
  fill: currentColor;
}

.social-grid span {
  color: var(--muted);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

.site-footer {
  margin-left: 244px;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem 1.5rem 2.5rem;
  border-top: 1px solid color-mix(in srgb, var(--line) 50%, transparent);
  color: var(--muted);
}

.site-footer p {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

@media (max-width: 1100px) {
  .social-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .siderail {
    display: none;
  }

  main,
  .site-footer {
    margin-left: 0;
  }

  .topbar-nav {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .telemetry-panel,
  .links-panel,
  .signature-panel,
  .game-panel {
    grid-column: span 12;
  }
}

@media (max-width: 720px) {
  .social-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .route-list a,
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .signature-actions,
  .game-stats {
    flex-direction: column;
  }

  .telemetry-row {
    grid-template-columns: 1fr;
  }

  .telemetry-row strong {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
