:root {
  --bg: #141416;
  --bg-raised: #1c1c20;
  --bg-elevated: #232329;
  --border: #2c2c34;
  --border-strong: #3b3b46;
  --ink: #ececf1;
  --ink-muted: #b4b4bf;
  --accent: #818cf8;
  --btn-bg: #4f46e5;
  --btn-bg-hover: #4338ca;
  --terminal-green: #7ee787;
  --page-bg: #ffffff;
  --page-ink: #18181b;
  --page-muted: #52525b;
  --page-border: #e4e4e7;
  --page-th-bg: #f4f4f5;
  --font-sans: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 1120px;
}

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

html {
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  min-width: 320px;
}

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

[hidden] {
  display: none !important;
}

.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;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  background: var(--btn-bg);
  color: #ffffff;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  min-width: 0;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(20, 20, 22, 0.92);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  min-height: 64px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

.brand-mark {
  display: block;
  flex-shrink: 0;
}

.header-inner nav {
  min-width: 0;
  max-width: 100%;
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.nav-list a {
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 150ms ease;
}

.nav-list a:hover {
  color: var(--ink);
}

/* Hero */
.hero {
  padding: 80px 0 56px;
}

.hero-inner {
  width: 100%;
  max-width: 780px;
  min-width: 0;
  margin: 0;
}

h1 {
  margin: 0 0 20px;
  font-size: clamp(2.25rem, 5vw, 3.625rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 700;
  color: var(--ink);
}

.hero-sub {
  margin: 0 0 32px;
  font-size: clamp(1.0625rem, 2vw, 1.25rem);
  line-height: 1.55;
  color: var(--ink-muted);
  max-width: 660px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.btn-primary {
  background-color: var(--btn-bg);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--btn-bg-hover);
}

.btn-secondary {
  background-color: var(--bg-raised);
  color: var(--ink);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background-color: var(--bg-elevated);
  border-color: var(--ink-muted);
}

.brew-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 100%;
  width: fit-content;
  min-width: 0;
  overflow-x: auto;
  background-color: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 8px 8px 14px;
  margin-bottom: 16px;
}

.brew-box code {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--ink);
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
}

.brew-box-compact {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-top: 16px;
  margin-bottom: 14px;
}

.copy-btn {
  flex-shrink: 0;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background-color: var(--bg-elevated);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.copy-btn:hover {
  border-color: var(--accent);
}

.copy-btn.is-copied {
  border-color: var(--accent);
  color: var(--accent);
}

.small-print {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

/* Before / after demo */
.demo-section {
  padding: 16px 0 64px;
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}

.panel {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background-color: var(--bg-raised);
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.terminal-bar,
.doc-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background-color: var(--bg-elevated);
  min-height: 50px;
  min-width: 0;
}

.terminal-dots {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.terminal-dots span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background-color: #3f3f4a;
}

.terminal-dots span:nth-child(1) {
  background-color: #ef4444;
  opacity: 0.8;
}

.terminal-dots span:nth-child(2) {
  background-color: #eab308;
  opacity: 0.8;
}

.terminal-dots span:nth-child(3) {
  background-color: #22c55e;
  opacity: 0.8;
}

.panel-label,
.doc-bar-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-muted);
}

.terminal-body {
  padding: 20px;
  overflow-x: auto;
  flex: 1;
  display: flex;
  align-items: center;
  background-color: #101013;
  min-width: 0;
  max-width: 100%;
}

.terminal-pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--terminal-green);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
}

.terminal-pre code {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
}

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  max-width: 100%;
  padding: 3px;
  background-color: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  gap: 2px;
}

.seg-btn {
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

.seg-btn:hover {
  color: var(--ink);
}

.seg-btn[aria-pressed="true"] {
  background-color: var(--btn-bg);
  color: #ffffff;
}

.doc-page {
  background-color: var(--page-bg);
  color: var(--page-ink);
  padding: 24px;
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

.doc-view {
  min-width: 0;
  max-width: 100%;
}

.doc-view h3 {
  margin: 0 0 12px;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--page-ink);
  letter-spacing: -0.01em;
}

.broken-paste {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--page-muted);
  overflow-wrap: anywhere;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
}

.clean-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  text-align: left;
}

.clean-table th,
.clean-table td {
  padding: 9px 12px;
  border: 1px solid var(--page-border);
}

.clean-table th {
  background-color: var(--page-th-bg);
  font-weight: 600;
  color: var(--page-ink);
}

.clean-table td {
  color: var(--page-ink);
}

/* Shared section spacing */
.section {
  padding: 56px 0;
  border-top: 1px solid var(--border);
}

.section h2 {
  margin: 0 0 28px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* How it works */
.steps-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.step-card {
  background-color: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  min-width: 0;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background-color: rgba(129, 140, 248, 0.16);
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.step-card p {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.55;
}

.step-card code,
kbd {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  padding: 2px 6px;
  color: var(--ink);
}

/* Works with */
.works-rows {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.works-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  min-width: 0;
}

.works-label {
  min-width: 96px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 0;
  max-width: 100%;
}

.chip {
  padding: 7px 14px;
  border-radius: 999px;
  background-color: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 500;
  max-width: 100%;
}

/* Features */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.feature-card {
  background-color: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  min-width: 0;
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background-color: rgba(129, 140, 248, 0.14);
  color: var(--accent);
  margin-bottom: 14px;
}

.feature-card h3 {
  margin: 0 0 8px;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--ink);
}

.feature-card p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--ink-muted);
  line-height: 1.55;
}

/* Download */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 28px;
  min-width: 0;
}

.section-head h2 {
  margin: 0;
}

.version-tag {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--accent);
  background-color: rgba(129, 140, 248, 0.14);
  border: 1px solid rgba(129, 140, 248, 0.28);
  border-radius: 999px;
  padding: 2px 10px;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.download-card {
  background-color: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  min-width: 0;
}

.download-card h3 {
  margin: 0 0 4px;
  font-size: 1.25rem;
  font-weight: 600;
}

.download-meta {
  margin: 0 0 18px;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.download-note {
  margin: 16px 0 0;
  font-size: 0.875rem;
  color: var(--ink-muted);
  line-height: 1.5;
}

/* FAQ */
.faq-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 780px;
  min-width: 0;
}

.faq-item {
  background-color: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 20px;
  min-width: 0;
  max-width: 100%;
}

.faq-item summary {
  padding: 18px 0;
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 1.125rem;
  color: var(--accent);
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item p {
  margin: 0 0 18px;
  color: var(--ink-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 48px;
}

.footer-inner p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--ink-muted);
}

.footer-inner a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
}

.footer-inner a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* Responsive */
@media (max-width: 900px) {
  .demo-grid,
  .steps-grid,
  .features-grid,
  .download-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .container {
    padding: 0 16px;
  }

  .header-inner {
    min-height: 56px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .nav-list {
    gap: 8px 14px;
  }

  .nav-list a {
    font-size: 0.875rem;
  }

  .hero {
    padding: 52px 0 40px;
  }

  .section {
    padding: 40px 0;
  }

  .doc-bar {
    flex-wrap: wrap;
  }

  .doc-page {
    padding: 18px;
  }

  .download-card {
    padding: 20px;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
