/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0a0b;
  --bg-raised: #131316;
  --bg-card: #18181d;
  --border: #26262c;
  --border-strong: #34343c;
  --text: #ececf0;
  --text-dim: #8a8a96;
  --accent: #d4ff4a;
  --accent-fg: #0a0a0b;
  --text-light: #c8c8d0;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Bricolage Grotesque', sans-serif;
  --font-logo: 'Audiowide', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --radius: 6px;
  --radius-sm: 4px;
  --max-w: 1400px;
  --section-pad: clamp(80px, 12vw, 160px);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--text); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent); }
code { font-family: var(--mono); font-size: 0.9em; background: var(--bg-raised); padding: 2px 6px; border-radius: 3px; }
kbd { font-family: var(--mono); font-size: 0.85em; background: var(--bg-card); border: 1px solid var(--border); padding: 2px 6px; border-radius: 4px; color: var(--text); }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 800px; margin: 0 auto; padding: 0 24px; }

/* === Nav === */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 14px 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: var(--font-logo);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.nav-logo:hover { color: var(--text); }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { color: var(--text-dim); font-size: 0.9rem; font-weight: 500; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-github { color: var(--text-dim) !important; padding: 4px 0; }

/* === Hero === */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  position: relative;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.9;
  mask-image: linear-gradient(to bottom, transparent 0%, black 25%, black 75%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 25%, black 75%, transparent 100%);
}
.hero-vignette {
  /* Sits between the canvas (z=0) and hero-content (z=1): darkens the corners
     of the animated rects but leaves the headline / buttons untouched. */
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
    circle at center,
    transparent 0%,
    transparent 10%,
    rgba(0, 0, 0, 0.85) 100%
  );
}
.hero-content { position: relative; max-width: 800px; z-index: 1; }
.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}
.hero h1.hero-logo {
  font-family: var(--font-logo);
  font-size: clamp(5.6rem, 20vw, 14rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  margin-bottom: 16px;
  text-align: center;
  color: var(--text);
}
.hero-acronym {
  font-size: 0.8rem;
  color: #a0a0b0;
  letter-spacing: 0.1em;
  margin-top: -80px;
  margin-bottom: 34px;
}
.hero-acronym .white { color: var(--text);
  text-transform: uppercase;
  font-family: var(--mono);
}
.hero-headline {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.hero-sub {
  font-size: clamp(0.95rem, 1.4vw, 1.05rem);
  color: var(--text-light);
  max-width: 560px;
  margin: 20px auto 36px;
  line-height: 1.6;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-install {
  margin-top: 40px;
  display: inline-flex;
  align-items: center;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.hero-install code { font-family: var(--mono); font-size: 0.9rem; color: var(--text); background: none; padding: 11px 18px; }
.hero-install-label { font-size: 0.8rem; color: var(--text-dim); padding: 11px 18px; background: var(--bg-card); font-family: var(--mono); }
.hero-install-copy {
  background: var(--bg-card);
  border: none;
  border-left: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  padding: 11px 14px;
  font-size: 0.85rem;
  transition: color 0.15s, background 0.15s;
}
.hero-install-copy:hover { color: var(--accent); }

/* === Buttons === */
.btn {
  display: inline-block;
  padding: 11px 20px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  border: 1px solid transparent;
}
.btn:hover { opacity: 1; }
.btn-primary {
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 600;
}
.btn-primary:hover { background: #c4ef3a; color: var(--accent-fg); }
.btn-secondary {
  background: rgba(0, 0, 0, 0.5);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover { border-color: var(--text); color: var(--text); }

/* === Sections === */
.section { padding: var(--section-pad) 24px; }
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: 56px;
  line-height: 1.2;
  color: var(--text);
}

/* Section backgrounds: alternating warm/cool dark tones */
.features-section  { background: #000000; border-top: 2px solid #5a3a1a; }
.how-section       { background: #0e1416; border-top: 2px solid #1a4a5a; }
.cta-section       { background: #16100e; border-top: 2px solid #5a2a1a; }
.dim { color: var(--text-dim); }

/* === Features Grid === */
/* === Features Split === */
.features-split {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 48px;
  align-items: start;
}
.features-list { display: flex; flex-direction: column; }
.features-item {
  padding: 12px 16px;
  border-left: 2px solid var(--border);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.features-item:hover,
.features-item.active {
  border-left-color: var(--accent);
  background: rgba(255,255,255,0.02);
}
.features-item h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-dim);
  transition: color 0.2s;
}
.features-item:hover h3,
.features-item.active h3 { color: var(--text); }
.features-item a { color: var(--text); border-bottom: 1px solid var(--border-strong); }
.features-item a:hover { color: var(--accent); border-color: var(--accent); }
.features-preview {
  position: sticky;
  top: 100px;
  align-self: start;
}
.features-desc {
  margin-top: 16px;
  min-height: 48px;
}
.features-desc p {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1.5;
  text-align: center;
}
.features-desc p[hidden] { display: none; }
.features-preview-inner {
  border-radius: var(--radius);
  overflow: hidden;
}
.features-media { width: 100%; height: 100%; }
.features-media[hidden] { display: none; }
.features-media img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  cursor: pointer;
}
.features-media video {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}

/* === Lightbox === */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  border-radius: var(--radius);
  box-shadow: 0 0 60px rgba(0,0,0,0.5);
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
}
.lightbox-close:hover { color: var(--text); }
@media (max-width: 768px) {
  .features-split { grid-template-columns: 1fr; }
  .features-preview { position: static; margin-top: 24px; }
}

/* === How it Works === */
.how-steps { max-width: 700px; margin: 0 auto; }
.how-step {
  display: flex;
  gap: 24px;
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
}
.how-step:last-child { border-bottom: none; }
.how-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--mono);
  flex-shrink: 0;
  padding-top: 2px;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.how-content h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.how-content p { color: var(--text-dim); line-height: 1.6; font-size: 0.95rem; }

/* === Stats === */
/* === CTA === */
.cta-section { text-align: center; }
.cta-content h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700; margin-bottom: 12px; color: var(--text); letter-spacing: -0.02em; }
.cta-content p { color: var(--text-dim); font-size: 1rem; margin-bottom: 28px; }

/* === Keycap === */
.docs-section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
  margin-top: 80px;
  margin-bottom: 40px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.docs-section-title:first-of-type { margin-top: 0; }

.keycap-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.keycap {
  display: inline-flex;
  flex-direction: column;
  min-width: 72px;
  min-height: 56px;
  padding: 8px 12px;
  background: linear-gradient(180deg, #2a2a30 0%, #1a1a1f 100%);
  border: 1px solid #3a3a42;
  border-bottom: 3px solid #222228;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.05);
}
.keycap-letter {
  font-family: var(--mono);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.keycap-label {
  font-size: 0.6rem;
  color: var(--text-dim);
  margin-top: auto;
  align-self: flex-end;
  line-height: 1;
}
.mouse-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  color: var(--text-dim);
  font-size: 0.9rem;
}
.mouse-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  color: var(--text-dim);
}
.mouse-icon-inline {
  width: 20px;
  height: 20px;
  vertical-align: middle;
  color: var(--text-dim);
}

.footer {
  padding: 40px 24px;
  border-top: 1px solid var(--border);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-brand { font-family: var(--font-logo); font-weight: 700; font-size: 1rem; color: var(--text); }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--text-dim); font-size: 0.9rem; }
.footer-links a:hover { color: var(--text); }
.footer-copy { color: var(--text-dim); font-size: 0.8rem; }

/* === Install / Docs pages === */
.hero-small { min-height: 40vh; padding: 140px 24px 60px; }
.hero-small h1 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 12px; }

.install-block, .docs-block { margin-bottom: 56px; }
.docs-block p + p { margin-top: 12px; }
.install-block h2, .docs-block h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}
.install-list {
  list-style: none;
  padding: 0;
}
.install-list li {
  padding: 6px 0;
  padding-left: 20px;
  position: relative;
  color: var(--text-dim);
  font-size: 0.95rem;
}
.install-list li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--text-dim);
}
.install-list a { color: var(--text); border-bottom: 1px solid var(--border-strong); }
.install-list a:hover { color: var(--accent); border-color: var(--accent); }

/* Code blocks */
.code-block {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-dim);
  font-family: var(--mono);
}
.copy-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 3px 10px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.75rem;
  font-family: var(--mono);
  transition: color 0.15s, border-color 0.15s;
}
.copy-btn:hover { border-color: var(--text); color: var(--text); }
.code-block pre {
  padding: 18px 20px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text);
}

/* Keybindings table */
.keybindings-table { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.keybindings-table table { width: 100%; border-collapse: collapse; }
.keybindings-table th {
  text-align: left;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--text-dim);
  font-family: var(--mono);
}
.keybindings-table td {
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text);
}
.keybindings-table tr:last-child td { border-bottom: none; }
.keybindings-table kbd {
  display: inline-block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 1px 7px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text);
}

/* Docs cards */
.docs-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.docs-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.docs-card h4 { font-weight: 600; margin-bottom: 6px; font-size: 0.95rem; }
.docs-card p { color: var(--text-dim); font-size: 0.9rem; line-height: 1.5; }

/* Deps grid */
.deps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.dep {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.dep h4 { margin-bottom: 4px; font-size: 0.95rem; font-weight: 600; }
.dep h4 a { color: var(--text); }
.dep h4 a:hover { color: var(--accent); }
.dep p { color: var(--text-dim); font-size: 0.85rem; }

/* === Reveal animations === */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* === Responsive === */
@media (max-width: 768px) {
  .features-grid { grid-template-columns: 1fr; }
  .how-step { flex-direction: column; gap: 8px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { flex-direction: column; text-align: center; }
  .nav-links { gap: 16px; }
  .hero-install { flex-direction: column; align-items: stretch; }
  .hero-install-copy { border-left: none; border-top: 1px solid var(--border); }
}
