:root {
  --bg: #060812;
  --bg-elevated: #0c1120;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-strong: rgba(255, 255, 255, 0.055);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --fg: #eef0f8;
  --fg-dim: #9aa1b8;
  --fg-faint: #6b7288;
  --blue: #5b8cff;
  --purple: #a06bff;
  --teal: #3fe0c5;
  --red: #ff6d7e;
  --amber: #f5b45b;
  --sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: "Sora", var(--sans);
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Terminal mockup only: mirrors the app's real palette in
     internal/ui/theme/theme.go 1:1 (not the site's own --blue/--purple/
     --teal brand tokens above), so the hero mockup matches what the TUI
     actually looks like today. Keep these in sync if theme.go changes. */
  --term-bg: #070b14;
  --term-border: #242c42;
  --term-title: #e2e8f0;
  --term-accent: #38bdf8;
  --term-muted: #64748b;
  --term-text: #cbd5e1;
  --term-selected-bg: #13384d;
  --term-selected-fg: #f8fafc;
  --term-status-ok: #2dd4bf;
  --term-status-warn: #f59e0b;
  --term-status-bad: #f87171;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  line-height: 1.65;
  position: relative;
  overflow-x: hidden;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}

.glow-a {
  top: -220px;
  left: 50%;
  width: 780px;
  height: 520px;
  transform: translateX(-58%);
  background: radial-gradient(closest-side, rgba(91, 140, 255, 0.34), transparent 70%);
}

.glow-b {
  top: 120px;
  left: 50%;
  width: 640px;
  height: 480px;
  transform: translateX(10%);
  background: radial-gradient(closest-side, rgba(160, 107, 255, 0.26), transparent 70%);
}

h1, h2, h3 {
  font-family: var(--display);
  color: #fff;
  font-weight: 700;
  text-wrap: balance;
  margin: 0;
}

a {
  color: var(--blue);
}

kbd {
  font-family: var(--mono);
}

/* Hero */

.hero {
  position: relative;
  padding: 108px 0 84px;
  z-index: 1;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 56px;
  align-items: center;
}

.eyebrow, .section-eyebrow {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0 0 16px;
}

.hero h1 {
  font-size: 4rem;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 20px;
  background: linear-gradient(100deg, #fff 30%, var(--blue) 78%, var(--purple) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  font-size: 1.2rem;
  color: var(--fg-dim);
  max-width: 46ch;
  margin: 0 0 28px;
}

.mono-accent {
  font-family: var(--mono);
  color: var(--teal);
}

.hero-meta {
  display: flex;
  gap: 10px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.8rem;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--fg-dim);
}

.pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 8px var(--teal);
}

.pill-ghost {
  color: var(--fg-faint);
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
}

.hero-anchor {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 0.92rem;
  text-decoration: none;
  color: var(--fg);
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 3px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.hero-anchor:hover {
  color: var(--teal);
  border-color: var(--teal);
}

/* Terminal mockup */

.terminal {
  border-radius: 14px;
  background: var(--term-bg);
  border: 1px solid var(--term-border);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.02);
  overflow: hidden;
  font-family: var(--mono);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: var(--term-bg);
  border-bottom: 1px solid var(--term-border);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot-r { background: #ff5f57; }
.dot-y { background: #febc2e; }
.dot-g { background: #28c840; }

.terminal-title {
  margin-left: 8px;
  font-size: 0.78rem;
  color: var(--term-muted);
}

.terminal-shot {
  display: block;
  width: 100%;
  height: auto;
}

.card-key {
  background: var(--surface-strong);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 2px 7px;
  color: var(--teal);
  font-size: 0.76rem;
}

/* Sections */

.section {
  position: relative;
  padding: 88px 0;
  z-index: 1;
}

.section-alt {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section h2 {
  font-size: 2.1rem;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.section-intro {
  color: var(--fg-dim);
  max-width: 60ch;
  font-size: 1.05rem;
  margin: 0 0 44px;
}

/* Keybinding cards */

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 44px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.card-key {
  display: inline-block;
  font-size: 0.95rem;
  padding: 4px 10px;
  margin-bottom: 16px;
}

.card h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.card p {
  color: var(--fg-dim);
  font-size: 0.92rem;
  margin: 0;
}

/* Feature blocks */

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 44px;
}

.feature h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.feature p {
  color: var(--fg-dim);
  font-size: 0.95rem;
  margin: 0;
}

/* Get started guide */

.guide {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 36px 28px;
  margin-top: 44px;
}

.guide-step-install {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.guide-step-install p {
  margin-bottom: 0;
}

.guide-step-install .install-cmd {
  margin: 12px 0 14px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow-x: auto;
}

/* Download counter (js/downloads.js): hidden until the GitHub API answers.
   The explicit rule is needed because .pill sets display: inline-flex,
   which would otherwise override the hidden attribute. */
[data-downloads][hidden] {
  display: none;
}

.guide-step-install .install-downloads {
  margin: -4px 0 14px;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--fg-faint);
}

.guide-step-install .install-cmd code {
  font-family: var(--mono);
  font-size: 0.88rem;
  color: var(--teal);
  white-space: pre;
}

.guide-step p kbd {
  background: var(--surface-strong);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--teal);
  font-size: 0.85em;
}

.guide-num {
  display: block;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--fg-faint);
  margin-bottom: 8px;
}

.guide-step h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.guide-step p {
  color: var(--fg-dim);
  font-size: 0.92rem;
  margin: 0 0 18px;
}

.guide-shot {
  display: block;
  width: 100%;
  height: auto;
  max-height: 240px;
  object-fit: cover;
  object-position: top;
  border-radius: 10px;
  border: 1px solid var(--term-border);
  box-shadow: 0 20px 50px -24px rgba(0, 0, 0, 0.65);
}

/* Roadmap */

.roadmap-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px 48px;
  margin-top: 44px;
}

.roadmap-col-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.1rem;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.roadmap-col-title-shipped {
  color: var(--teal);
}

.roadmap-col-title-planned {
  color: var(--fg-dim);
}

.roadmap-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.roadmap-list li {
  position: relative;
  padding-left: 26px;
  color: var(--fg-dim);
  font-size: 0.92rem;
  line-height: 1.55;
}

.roadmap-list li::before {
  position: absolute;
  left: 0;
  font-family: var(--mono);
}

.roadmap-list-shipped li::before {
  content: "✓";
  color: var(--teal);
}

.roadmap-list-planned li {
  color: var(--fg-faint);
}

.roadmap-list-planned li::before {
  content: "→";
  color: var(--fg-faint);
}

/* Footer */

.footer {
  position: relative;
  z-index: 1;
  padding: 40px 0;
  color: var(--fg-faint);
  font-size: 0.85rem;
  font-family: var(--mono);
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

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

  .features {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .guide {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .roadmap-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

@media (max-width: 640px) {
  .hero {
    padding: 76px 0 56px;
  }

  .hero h1 {
    font-size: 2.8rem;
  }

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

@media (prefers-reduced-motion: reduce) {
  .card {
    transition: none;
  }
}
