:root {
  color-scheme: dark;
  --bg: #0a0a0f;
  --bg-soft: #12121a;
  --panel: #101119;
  --text: #e9e4da;
  --muted: #7f8795;
  --amber: #f0b429;
  --cyan: #38bdf8;
  --green: #4ade80;
  --danger: #f87171;
  --line: rgba(224, 221, 212, 0.18);
  --line-strong: rgba(240, 180, 41, 0.55);
  --max-width: 1200px;
  --content-width: 70ch;
  --font: 'JetBrains Mono', 'Berkeley Mono', 'Fira Code', 'IBM Plex Mono', ui-monospace, monospace;
  --section-space: clamp(5rem, 8vw, 8rem);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at top, rgba(56, 189, 248, 0.05), transparent 28%),
    linear-gradient(180deg, #0a0a0f 0%, #11121a 50%, #0a0a0f 100%);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
}

a,
button,
code {
  font-family: inherit;
}

a {
  color: var(--cyan);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  color: var(--amber);
}

button {
  color: inherit;
  cursor: pointer;
}

pre,
code {
  font-family: var(--font);
}

pre {
  margin: 0;
  white-space: pre;
  line-height: 1;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--bg);
  color: var(--text);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 4px;
}

.rain-layer {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.rain-char {
  position: absolute;
  top: -10vh;
  color: rgba(156, 163, 175, 0.08);
  font-size: 0.9rem;
  animation: rain-fall linear infinite;
}

@keyframes rain-fall {
  from {
    transform: translateY(-12vh);
  }
  to {
    transform: translateY(115vh);
  }
}

.site-header,
.section,
.site-footer {
  position: relative;
  z-index: 1;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: none;
  background: rgba(10, 10, 15, 0.7);
}

.site-header.is-scrolled {
  background: rgba(10, 10, 15, 0.96);
}

.site-nav,
.section,
.site-footer {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
}

.site-nav {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 1rem;
  min-height: 4.5rem;
}

.nav-brand {
  color: var(--amber);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.nav-links,
.nav-meta,
.install-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-links {
  justify-content: center;
}

.nav-links a,
.nav-meta a {
  color: var(--text);
}

.nav-links a.is-active {
  color: var(--amber);
}

.nav-toggle {
  display: none;
  padding: 0.4rem 0.65rem;
  border: 0;
  background: transparent;
  font-size: 1rem;
}

.nav-rule,
.footer-rule {
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
}

.mobile-nav {
  position: fixed;
  inset: 0;
  padding: 1.5rem;
  background: rgba(10, 10, 15, 0.98);
}

.mobile-nav-box {
  max-width: 32rem;
  margin: 3rem auto 0;
}

.mobile-nav-line {
  color: var(--muted);
}

.mobile-nav-links,
.mobile-nav-meta {
  display: grid;
  gap: 1rem;
  padding: 1.25rem 1rem;
}

.mobile-nav-links a,
.mobile-nav-meta a {
  color: var(--text);
}

.section {
  padding: var(--section-space) 0;
}

.hero {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding-top: 5rem;
}

.hero-shell {
  display: grid;
  gap: 1.5rem;
  width: 100%;
  justify-items: center;
  text-align: center;
}

.hero-logo-wrap {
  display: grid;
  gap: 1rem;
  justify-items: center;
}

.hero-logo {
  color: var(--amber);
  font-size: clamp(0.6rem, 1.45vw, 1.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  min-height: 6lh;
}

.hero-logo-mobile {
  display: none;
}

.hero-sublogo {
  color: var(--cyan);
  opacity: 0.8;
}

.hero-tagline {
  display: grid;
  gap: 0.35rem;
}

.hero-kicker,
.hero-copy {
  margin: 0;
  min-height: 1.5em;
}

.hero-kicker {
  color: var(--amber);
  font-size: clamp(1rem, 1.8vw, 1.3rem);
}

.hero-copy {
  color: var(--text);
  font-size: clamp(1rem, 1.5vw, 1.1rem);
}

.cursor {
  color: var(--amber);
  animation: blink 1.1s steps(1) infinite;
}

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

.copy-terminal {
  width: min(100%, 36rem);
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.copy-frame {
  display: block;
  width: 100%;
  overflow: hidden;
  color: var(--text);
  transition: color 100ms ease;
}

.copy-terminal.is-copied .copy-frame,
.copy-terminal:hover .copy-frame,
.copy-terminal:focus-visible .copy-frame {
  color: var(--amber);
}

.hero-cta-note,
.install-note,
.footer-note {
  margin: 0;
  color: var(--muted);
}

.section-intro {
  display: grid;
  gap: 0.65rem;
  max-width: var(--content-width);
  margin-bottom: 2rem;
}

.section-intro h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 1.05;
}

.section-intro p {
  margin: 0;
  color: var(--muted);
}

.section-kicker,
.feature-category {
  color: var(--cyan);
}

.info-panel,
.step-card,
.feature-card,
.adapter-card {
  background: linear-gradient(180deg, rgba(16, 17, 25, 0.95), rgba(12, 13, 20, 0.95));
}

.info-panel,
.step-card,
.feature-card,
.adapter-card,
.table-shell,
.parser-strip {
  padding: 1.25rem;
}

.ascii-box-top,
.ascii-box-sep,
.ascii-box-bottom {
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
}

.ascii-box-body {
  padding: 0.9rem 0;
}

.what-copy {
  max-width: var(--content-width);
  color: var(--text);
}

.what-bullets {
  display: grid;
  gap: 0.4rem;
  margin-top: 1rem;
}

.what-bullets span {
  color: var(--text);
}

.steps-grid,
.adapter-grid {
  display: grid;
  gap: 1.5rem;
}

.steps-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.step-caption {
  margin-top: 0.85rem;
  color: var(--muted);
}

.feature-list {
  display: grid;
  gap: 2rem;
}

.feature-card {
  display: grid;
  gap: 1rem;
}

.feature-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  flex-wrap: wrap;
}

.feature-card h3 {
  margin: 0;
  color: var(--amber);
  font-size: clamp(1.2rem, 2vw, 1.6rem);
}

.feature-badge {
  color: var(--amber);
}

.feature-badge.is-danger,
.feature-category.is-danger {
  color: var(--danger);
}

.feature-layout {
  display: grid;
  grid-template-columns: minmax(16rem, 28rem) 1fr;
  gap: 1.5rem;
  align-items: start;
}

.feature-card.is-reversed .feature-layout {
  grid-template-columns: 1fr minmax(16rem, 28rem);
}

.feature-card.is-reversed .feature-ascii {
  order: 2;
}

.feature-card.is-reversed .feature-content {
  order: 1;
}

.feature-ascii {
  display: grid;
  gap: 0.85rem;
}

.feature-figure {
  color: var(--text);
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.feature-card:hover .ascii-box-top,
.feature-card:hover .ascii-box-sep,
.feature-card:hover .ascii-box-bottom,
.feature-card:focus-within .ascii-box-top,
.feature-card:focus-within .ascii-box-sep,
.feature-card:focus-within .ascii-box-bottom {
  color: var(--amber);
}

.feature-body {
  display: grid;
  gap: 0.85rem;
}

.feature-body p,
.feature-body ul {
  margin: 0;
}

.feature-body ul {
  padding-left: 1.2rem;
  color: var(--muted);
}

.feature-body li + li {
  margin-top: 0.45rem;
}

.feature-extra {
  color: var(--muted);
}

.feature-extra pre {
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.budget-gauge .gauge-bar {
  color: var(--green);
}

.budget-gauge .gauge-thresholds {
  color: var(--muted);
}

.table-shell,
.parser-strip {
  overflow-x: auto;
}

.ascii-table,
.parser-strip pre {
  min-width: fit-content;
}

.adapter-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.adapter-card h3 {
  margin: 0 0 1rem;
  color: var(--amber);
}

.adapter-card pre {
  color: var(--text);
}

.site-footer {
  padding: 1.5rem 0 3rem;
  text-align: center;
}

.site-footer p {
  margin: 0.8rem 0;
  color: var(--muted);
}

.reveal-section .reveal-group,
.reveal-item {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 420ms ease,
    transform 420ms ease;
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal-section.is-visible .reveal-group,
.reveal-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

  .rain-layer,
  .cursor {
    display: none;
  }

  .reveal-section .reveal-group,
  .reveal-item {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .rain-char {
    animation: none;
  }
}

@media (max-width: 1023px) {
  .feature-layout,
  .feature-card.is-reversed .feature-layout {
    grid-template-columns: 1fr;
  }

  .feature-card.is-reversed .feature-ascii,
  .feature-card.is-reversed .feature-content {
    order: initial;
  }

  .adapter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  body {
    font-size: 13px;
  }

  .section {
    padding: 4rem 0;
  }

  .site-nav {
    grid-template-columns: auto auto auto;
  }

  .nav-links,
  .nav-meta {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
    justify-self: end;
  }

  .hero-logo-desktop {
    display: none;
  }

  .hero-logo-mobile {
    display: block;
    font-size: 0.78rem;
  }

  .hero-sublogo {
    font-size: 0.85rem;
  }

  .hero-kicker,
  .hero-copy {
    min-height: auto;
  }

  .steps-grid,
  .adapter-grid {
    grid-template-columns: 1fr;
  }

  .section,
  .site-nav,
  .site-footer {
    width: min(calc(100% - 1.25rem), var(--max-width));
  }

  .copy-terminal {
    width: 100%;
  }

  .copy-frame {
    font-size: 0.82rem;
  }

  .info-panel,
  .step-card,
  .feature-card,
  .adapter-card,
  .table-shell,
  .parser-strip {
    padding: 1rem;
  }

  .ascii-box-top,
  .ascii-box-sep,
  .ascii-box-bottom {
    text-align: center;
  }

  .feature-figure,
  .feature-extra pre,
  .adapter-card pre,
  .step-card pre {
    font-size: 0.82rem;
  }

  .feature-card {
    gap: 0.75rem;
  }

  .feature-layout {
    gap: 1rem;
  }
}
