*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink: #201d1d;
  --ink-deep: #0f0000;
  --canvas: #fdfcfc;
  --surface-soft: #f8f7f7;
  --surface-card: #f1eeee;
  --surface-dark: #201d1d;
  --hairline: rgba(15, 0, 0, 0.12);
  --hairline-strong: #646262;
  --accent: #007aff;
  --accent-hover: #0056b3;
  --accent-active: #004085;
  --success: #30d158;
  --warning: #ff9f0a;
  --danger: #ff3b30;
  --on-dark: #fdfcfc;
  --on-dark-mute: #9a9898;
  --body: #424245;
  --mute: #646262;
  --radius-sm: 4px;
  --radius-full: 9999px;
  --font: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Monaco, Consolas, monospace;
  --section: 96px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--canvas);
  color: var(--ink);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.1; letter-spacing: 0; }

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

/* ---- Nav ---- */
.primary-nav {
  background: var(--canvas);
  border-bottom: 1px solid var(--hairline);
  height: 56px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 24px;
}
.nav-brand {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0;
}
.nav-links {
  display: flex;
  gap: 16px;
  list-style: none;
}
.nav-links a {
  font-weight: 500;
  font-size: 16px;
  padding: 8px 16px;
  transition: color 0.1s;
}
.nav-links a:hover { color: var(--accent); }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 16px;
  cursor: pointer;
  padding: 8px;
  color: var(--ink);
}

/* ---- Buttons ---- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: var(--on-dark);
  font-family: var(--font);
  font-weight: 500;
  font-size: 16px;
  line-height: 2;
  padding: 4px 20px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: background 0.1s;
}
.btn-primary:hover { background: var(--ink-deep); }
.btn-primary:active { background: var(--accent-active); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 500;
  font-size: 16px;
  line-height: 2;
  padding: 4px 20px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--hairline-strong);
  cursor: pointer;
  transition: background 0.1s;
}
.btn-secondary:hover { background: var(--surface-soft); }
.btn-secondary:active { background: var(--surface-card); }

/* ---- Hero ---- */
.hero {
  background: var(--surface-dark);
  padding: 64px 24px;
  color: var(--on-dark);
}
.hero-tui {
  max-width: 960px;
  margin: 0 auto;
}
.tui-wordmark {
  font-weight: 700;
  font-size: 38px;
  line-height: 1.5;
  letter-spacing: 0;
  margin-bottom: 24px;
}
.tui-prompt {
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 4px;
}
.pipe { color: var(--accent); }
.tui-keybind {
  font-size: 14px;
  color: var(--on-dark-mute);
  margin-top: 16px;
  line-height: 2;
}
.tui-status {
  font-size: 14px;
  color: var(--on-dark-mute);
  margin-top: 8px;
  line-height: 2;
}
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: var(--radius-full);
  margin-right: 8px;
  vertical-align: middle;
}
.hero-stats {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  gap: 32px;
  padding-top: 48px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.stat-block {
  display: flex;
  flex-direction: column;
}
.stat-num {
  font-weight: 700;
  font-size: 24px;
  line-height: 1.2;
  color: var(--on-dark);
}
.stat-label {
  font-size: 14px;
  color: var(--on-dark-mute);
  line-height: 2;
}

/* ---- Sections ---- */
.section {
  padding: var(--section) 24px;
  max-width: 960px;
  margin: 0 auto;
}
.section + .section {
  border-top: 1px solid var(--hairline);
}
.section-label {
  font-weight: 700;
  font-size: 16px;
  line-height: 1.5;
  display: block;
  margin-bottom: 8px;
}
.section-title {
  font-weight: 700;
  font-size: clamp(24px, 5vw, 38px);
  line-height: 1.1;
  margin-bottom: 16px;
}
.section-desc {
  font-size: 16px;
  color: var(--body);
  line-height: 1.5;
  margin-bottom: 24px;
}

/* ---- Content Rows ---- */
.content-row {
  font-size: 16px;
  color: var(--body);
  line-height: 1.5;
  margin-bottom: 12px;
}
.content-row + .content-row {
  padding-top: 8px;
}

/* ---- Feature List ---- */
.feature-list {
  list-style: none;
  margin-top: 24px;
}
.feature-list li {
  font-size: 16px;
  line-height: 1.5;
  padding: 8px 0;
  color: var(--body);
}
.bullet { color: var(--accent); font-weight: 500; }

/* ---- List Rows ---- */
.list-rows {
  list-style: none;
  margin-top: 24px;
}
.list-row {
  font-size: 16px;
  line-height: 1.5;
  padding: 8px 0;
  color: var(--body);
  display: flex;
  align-items: baseline;
  gap: 8px;
  border-bottom: 1px solid var(--hairline);
}
.list-row strong { color: var(--ink); }
.list-row .tag {
  font-size: 14px;
  line-height: 2;
  padding: 2px 8px;
  background: var(--surface-card);
  border-radius: var(--radius-sm);
  color: var(--mute);
  white-space: nowrap;
}

/* ---- Dark Section ---- */
.section-dark {
  background: var(--surface-dark);
  color: var(--on-dark);
  padding: var(--section) 24px;
}
.section-dark .section-title { color: var(--on-dark); }
.section-dark .section-desc { color: var(--on-dark-mute); }
.section-dark .section-label { color: var(--on-dark-mute); }
.section-dark .cta-row { margin-top: 24px; }
.section-dark .cta-row .btn-primary { background: var(--on-dark); color: var(--ink); }
.section-dark .cta-row .btn-primary:hover { background: var(--surface-card); }
.section-dark .cta-row .btn-secondary { border-color: rgba(255,255,255,0.2); color: var(--on-dark); }
.section-dark .cta-row .btn-secondary:hover { background: rgba(255,255,255,0.05); }

/* ---- Testimonials ---- */
.testimonial-rows {
  list-style: none;
  margin-top: 24px;
}
.testimonial-row {
  font-size: 16px;
  line-height: 1.5;
  padding: 16px 20px;
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.testimonial-row p { color: var(--body); margin-bottom: 8px; }
.testimonial-row .quote { color: var(--accent); font-weight: 500; }
.testimonial-row .author { font-weight: 500; font-size: 14px; color: var(--mute); line-height: 2; }

/* ---- CTA Row ---- */
.cta-row {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---- Footer ---- */
.footer {
  border-top: 1px solid var(--hairline);
  padding: var(--section) 24px;
}
.footer-grid {
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
}
.footer-grid .nav-brand { font-size: 16px; }
.footer-grid p {
  font-size: 14px;
  color: var(--mute);
  line-height: 2;
}
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 4px; }
.footer-links a { font-size: 14px; color: var(--mute); line-height: 2; }
.footer-links a:hover { color: var(--accent); }
.footer-social { display: flex; gap: 12px; margin-top: 12px; }
.footer-bottom {
  max-width: 960px;
  margin: 32px auto 0;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
}
.footer-bottom .rule { display: block; margin-bottom: 8px; }
.footer-bottom p { font-size: 14px; color: var(--mute); line-height: 2; }

/* ---- Animations ---- */
.animate-in { opacity: 0; transform: translateY(8px); }
.animate-in.visible { opacity: 1; transform: translateY(0); transition: opacity 0.3s ease, transform 0.3s ease; }

/* ---- Mobile Nav ---- */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .nav-open .nav-links {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--canvas);
    border-bottom: 1px solid var(--hairline);
    padding: 16px 24px;
    z-index: 101;
  }
  .hero-stats { flex-direction: column; gap: 16px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .list-row { flex-direction: column; gap: 4px; }
  .hero { padding: 48px 24px; }
}
@media (max-width: 480px) {
  .section { padding: 64px 16px; }
  .hero-stats { gap: 16px; }
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--canvas); }
::-webkit-scrollbar-thumb { background: var(--ink); border-radius: 4px; }