:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-subtle: #f1f5f9;
  --surface-dark: #0d1117;
  --surface-dark-2: #161b22;
  --ink: #0f172a;
  --ink-secondary: #475569;
  --ink-muted: #64748b;
  --ink-on-dark: #e6edf3;
  --ink-on-dark-muted: #8b949e;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-dark: #262d36;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff6ff;
  --accent-border: #bfdbfe;
  --ok: #15803d;
  --ok-soft: #f0fdf4;
  --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --container: 1140px;
}

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

html {
  scroll-behavior: smooth;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: clip;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
}

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

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 3.5vw, 2rem);
}

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

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.brand img {
  width: 26px;
  height: 26px;
  border-radius: 6px;
}

.nav-links {
  display: none;
  align-items: center;
  gap: 1.5rem;
}

.nav-links a {
  font-size: 0.9375rem;
  color: var(--ink-secondary);
  white-space: nowrap;
  transition: color 140ms var(--ease-out);
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.cmd-trigger {
  display: none;
  align-items: center;
  gap: 0.5rem;
  height: 36px;
  padding: 0 0.7rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink-muted);
  font-size: 0.8125rem;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 140ms var(--ease-out), color 140ms var(--ease-out);
}

.cmd-trigger:hover {
  border-color: var(--border-strong);
  color: var(--ink);
}

.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.1rem 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  line-height: 1.2;
  color: var(--ink-secondary);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 4px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 40px;
  padding: 0 1.05rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 140ms var(--ease-out), border-color 140ms var(--ease-out), color 140ms var(--ease-out), transform 100ms var(--ease-out);
}

.btn:active {
  transform: translateY(1px);
}

.btn-sm {
  height: 36px;
  padding: 0 0.875rem;
  font-size: 0.85rem;
}

.btn-lg {
  height: 46px;
  padding: 0 1.35rem;
  font-size: 0.95rem;
}

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

.btn-primary:hover {
  background: #1e293b;
}

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

.btn-accent:hover {
  background: var(--accent-hover);
}

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

.btn-secondary:hover {
  background: var(--surface-subtle);
}

/* Hero */
.hero {
  padding-block: clamp(3rem, 6vw, 5rem) clamp(2.5rem, 5vw, 4rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.75rem, 3vw, 2.5rem);
  align-items: end;
}

.hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 4.6vw, 3.85rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.035em;
  color: var(--ink);
  overflow-wrap: anywhere;
  min-width: 0;
}

.hero-title .accent-word {
  color: var(--accent);
}

.hero-side {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.hero-lead {
  margin: 0;
  font-size: clamp(1.02rem, 1.3vw, 1.125rem);
  line-height: 1.6;
  color: var(--ink-secondary);
  max-width: 52ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.dot-ok {
  background: var(--ok);
}

/* Product Showcase */
.showcase {
  margin-top: clamp(2rem, 4vw, 3rem);
}

.showcase-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.875rem;
}

.view-tabs {
  display: inline-flex;
  padding: 3px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  gap: 2px;
}

.view-tab {
  border: 0;
  background: transparent;
  padding: 0.4rem 0.85rem;
  border-radius: 4px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--ink-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 140ms var(--ease-out), color 140ms var(--ease-out);
}

.view-tab[aria-selected="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.showcase-caption {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.capture-frame {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 18px 48px -28px rgba(15, 23, 42, 0.28);
}

.capture-frame img {
  width: 100%;
  height: auto;
  display: block;
}

.capture-panel[hidden] {
  display: none;
}

/* Fact Strip */
.fact-strip {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.fact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.fact-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}

.fact-item:last-child {
  border-bottom: 0;
}

.fact-label {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.fact-value {
  margin-top: 0.25rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
}

/* Sections */
.section {
  padding-block: clamp(3.5rem, 7vw, 6rem);
}

.section-tight {
  padding-block: clamp(2.5rem, 5vw, 4.25rem);
}

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

.section-dark {
  background: var(--surface-dark);
  color: var(--ink-on-dark);
}

.section-head {
  max-width: 66ch;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 3vw, 2.45rem);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
  min-width: 0;
}

.section-desc {
  margin: 0.85rem 0 0;
  font-size: 1.02rem;
  color: var(--ink-secondary);
}

.section-dark .section-desc {
  color: var(--ink-on-dark-muted);
}

/* Workbench Split Rows */
.workbench-stack {
  display: flex;
  flex-direction: column;
  gap: clamp(3rem, 6vw, 5.5rem);
}

.workbench-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.5rem, 3.5vw, 3rem);
  align-items: center;
}

.workbench-copy h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.workbench-copy p {
  margin: 0.75rem 0 0;
  color: var(--ink-secondary);
}

.detail-list {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
}

.detail-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.25rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9375rem;
}

.detail-key {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
}

.detail-val {
  color: var(--ink-secondary);
}

/* Spec Table (Zero-Knowledge & Architecture) */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.spec-table tr {
  border-top: 1px solid var(--border-dark);
}

.spec-table tr:last-child {
  border-bottom: 1px solid var(--border-dark);
}

.spec-table th,
.spec-table td {
  text-align: left;
  padding: 1rem 0.75rem 1rem 0;
  vertical-align: top;
}

.spec-table th {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: #93c5fd;
  width: 28%;
}

.spec-table td {
  font-size: 0.95rem;
  color: var(--ink-on-dark);
}

.spec-table td.spec-note {
  color: var(--ink-on-dark-muted);
  font-size: 0.88rem;
}

.code-chip {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 0.12rem 0.4rem;
  background: var(--surface-dark-2);
  border: 1px solid var(--border-dark);
  border-radius: 4px;
  color: #e6edf3;
}

/* Pricing */
.pricing-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
}

.plan-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: clamp(1.5rem, 3vw, 2rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
}

.plan-box.plan-pro {
  border-color: var(--accent);
  background: var(--surface);
}

.plan-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.plan-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}

.plan-price {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.plan-sub {
  margin: 0.85rem 0 0;
  font-size: 0.94rem;
  color: var(--ink-secondary);
}

.plan-list {
  margin: 1.15rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-size: 0.92rem;
  color: var(--ink);
}

.plan-list li {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.plan-list li::before {
  content: "—";
  font-family: var(--font-mono);
  color: var(--accent);
  flex-shrink: 0;
}

/* FAQ */
.faq-list {
  border-top: 1px solid var(--border);
  max-width: 78ch;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

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

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

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

.faq-item[open] summary::after {
  content: "−";
  color: var(--accent);
}

.faq-item p {
  margin: 0 0 1.2rem;
  color: var(--ink-secondary);
  font-size: 0.95rem;
  max-width: 68ch;
}

/* Closing Band */
.closing-band {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
}

.closing-band h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.closing-band p {
  margin: 0.45rem 0 0;
  color: var(--ink-secondary);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 1.5rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem 1.5rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
}

.footer-links a {
  white-space: nowrap;
  transition: color 140ms var(--ease-out);
}

.footer-links a:hover {
  color: var(--ink);
}

/* Command Palette Modal */
.cmd-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: start center;
  padding: 12vh 1rem 1rem;
  background: rgba(15, 23, 42, 0.45);
}

.cmd-modal[hidden] {
  display: none;
}

.cmd-panel {
  width: min(520px, 100%);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 24px 64px -20px rgba(15, 23, 42, 0.35);
  overflow: hidden;
}

.cmd-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
}

.cmd-input {
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  outline: none;
}

.cmd-results {
  max-height: 300px;
  overflow-y: auto;
  padding: 0.4rem;
}

.cmd-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 0;
  background: transparent;
  border-radius: var(--radius-sm);
  text-align: left;
  cursor: pointer;
  font-size: 0.9rem;
}

.cmd-item:hover,
.cmd-item[aria-selected="true"] {
  background: var(--accent-soft);
  color: var(--accent);
}

.cmd-item small {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-muted);
}

/* Legal Document Pages */
.prose-page {
  padding-block: clamp(2.5rem, 5vw, 4.5rem);
}

.prose-shell {
  max-width: 72ch;
}

.prose-shell h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3.2vw, 2.5rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.prose-meta {
  margin: 0.6rem 0 2rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.prose-shell h2 {
  margin: 2rem 0 0.6rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: -0.015em;
}

.prose-shell p,
.prose-shell li {
  color: var(--ink-secondary);
  font-size: 0.96rem;
}

.prose-shell ul {
  padding-left: 1.25rem;
}

.prose-shell a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Responsive Breakpoints */
@media (min-width: 44rem) {
  .nav-links {
    display: flex;
  }

  .cmd-trigger {
    display: inline-flex;
  }

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

  .fact-item {
    padding: 1.25rem 1.25rem 1.25rem 0;
  }

  .fact-item:nth-child(even) {
    padding-left: 1.25rem;
    border-left: 1px solid var(--border);
  }

  .fact-item:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

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

  .closing-band {
    flex-direction: row;
    align-items: center;
  }
}

@media (min-width: 60rem) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.95fr);
  }

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

  .fact-item {
    border-bottom: 0;
    border-left: 1px solid var(--border);
    padding: 1.25rem 1.25rem;
  }

  .fact-item:first-child {
    border-left: 0;
    padding-left: 0;
  }

  .workbench-row {
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.28fr);
  }

  .workbench-row.is-reversed .workbench-copy {
    order: 2;
  }

  .workbench-row.is-reversed .workbench-media {
    order: 1;
  }

  .detail-list li {
    grid-template-columns: 11.5rem minmax(0, 1fr);
    gap: 1rem;
  }
}

@media (max-width: 43.99rem) {
  .spec-table,
  .spec-table tbody,
  .spec-table tr,
  .spec-table th,
  .spec-table td {
    display: block;
    width: 100%;
  }

  .spec-table th {
    padding: 0.9rem 0 0.2rem;
  }

  .spec-table td {
    padding: 0.15rem 0;
  }

  .spec-table td.spec-note {
    padding-bottom: 0.9rem;
  }
}

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

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

/* Store availability: one column on phones, two on larger screens. */
#downloads { scroll-margin-top: 6rem; }
.download-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
.download-card { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; padding: clamp(1.25rem, 3vw, 2rem); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.download-card h3 { font: 600 1.5rem/1.3 var(--font-display); margin: 1rem 0 .5rem; }
.download-card p { color: var(--ink-secondary); margin: 0 0 1.5rem; }
.download-card .btn { margin-top: auto; min-height: 48px; white-space: normal; text-align: center; }
.download-card small { display: block; color: var(--ink-muted); margin-top: .75rem; font-size: .8rem; }
.store-status { display: inline-flex; padding: .25rem .65rem; border-radius: 99px; background: var(--surface-subtle); color: var(--ink-secondary); font-size: .75rem; font-weight: 600; }
.store-status-live { background: var(--ok-soft); color: var(--ok); }
@media (min-width: 44rem) { .download-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 43.99rem) { .download-card .btn { width: 100%; } }
