:root {
  --bg: #0d1117;
  --bg-elevated: #161b22;
  --bg-panel: #010409;
  --border: #30363d;
  --border-muted: #21262d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --text-dim: #6e7681;
  --green: #2ea44f;
  --green-dim: #238636;
  --green-glow: rgba(46, 164, 79, 0.45);
  --red: #ff6b6b;
  --yellow: #d29922;
  --blue: #58a6ff;
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", "Fira Code", Consolas, monospace;
  --radius: 12px;
  --max: 960px;
  --max-wide: 1080px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(46, 164, 79, 0.08), transparent 55%),
    radial-gradient(circle at 100% 80%, rgba(88, 166, 255, 0.04), transparent 40%),
    var(--bg);
  line-height: 1.6;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

a {
  color: inherit;
}

/* ── Shell ── */
.site {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.container-wide {
  max-width: var(--max-wide);
}

/* ── Top bar ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border-muted);
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(12px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.9375rem;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand-mark {
  font-size: 1.125rem;
}

.daemon-status {
  display: none;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--border-muted);
  border-radius: 999px;
  background: var(--bg-elevated);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.daemon-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green-glow);
  animation: pulse 2s ease-in-out infinite;
}

.daemon-status.ready .daemon-dot {
  animation: none;
}

.daemon-status.ready .daemon-text {
  color: var(--green);
}

@keyframes pulse {
  50% { opacity: 0.5; transform: scale(0.9); }
}

.topnav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.topnav a {
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}

.topnav a:hover {
  color: var(--text);
}

.prelaunch-banner {
  border-bottom: 1px solid var(--border-muted);
  background: rgba(46, 164, 79, 0.08);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.prelaunch-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.65rem 1.25rem;
}

.prelaunch-banner strong {
  color: var(--green);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.6875rem;
}

.prelaunch-banner a {
  color: var(--blue);
}

.btn-muted {
  opacity: 0.85;
  border-color: var(--border);
}

html[data-prelaunch="true"] .topnav a[data-demo-link] {
  /* label stays "Gate proof" in static prelaunch */
}

.topnav a.btn:hover,
.topnav a.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.04);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

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

.btn-green {
  background: linear-gradient(180deg, var(--green), var(--green-dim));
  color: #fff;
  border-color: var(--green-dim);
}

.btn-green:hover {
  box-shadow: 0 6px 20px rgba(46, 164, 79, 0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text-dim);
}

/* ── Hero ── */
.hero {
  padding: 3rem 0 2rem;
  text-align: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border-muted);
  border-radius: 999px;
  background: var(--bg-elevated);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.hero h1 {
  margin: 0 0 0.85rem;
  font-size: clamp(1.85rem, 5.5vw, 2.85rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  max-width: 18ch;
  margin-left: auto;
  margin-right: auto;
}

.hero-lead {
  margin: 0 auto 1.5rem;
  max-width: 36rem;
  font-size: clamp(0.9375rem, 2.2vw, 1.0625rem);
  color: var(--text-muted);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  margin-bottom: 2rem;
}

/* ── Trust strip ── */
.trust-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  margin-bottom: 2rem;
}

.trust-badge {
  padding: 0.75rem 0.6rem;
  border: 1px solid var(--border-muted);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  text-align: center;
}

.trust-badge-icon {
  display: block;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.trust-badge-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.trust-badge-desc {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.625rem;
  color: var(--text-dim);
  line-height: 1.35;
}

/* ── Terminal ── */
.terminal-block {
  margin-bottom: 2.5rem;
}

.terminal {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  overflow: hidden;
  text-align: left;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.terminal-chrome {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border-muted);
  background: var(--bg-elevated);
}

.t-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.t-dot.red { background: #ff5f57; }
.t-dot.yellow { background: #febc2e; }
.t-dot.green { background: #28c840; }

.terminal-title {
  flex: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.terminal-body {
  padding: 1rem 1.1rem 1.15rem;
  font-family: var(--font-mono);
  font-size: clamp(0.6875rem, 1.8vw, 0.8125rem);
  line-height: 1.65;
  overflow-x: auto;
}

.t-line {
  opacity: 0;
  animation: fade-up 0.35s ease forwards;
}

.t-line.cmd { color: var(--text); }
.t-line.info { color: var(--blue); }
.t-line.warn { color: var(--yellow); }
.t-line.alert { color: var(--red); }
.t-line.fail { color: var(--red); font-weight: 600; }
.t-line.ok { color: var(--green); }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

.terminal-caption {
  margin-top: 0.55rem;
  font-size: 0.6875rem;
  color: var(--text-dim);
  text-align: center;
}

/* ── Sections ── */
.section {
  padding: 2.5rem 0;
}

.section-head {
  text-align: center;
  margin-bottom: 1.5rem;
}

.section-head h2 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-head p {
  margin: 0 auto;
  max-width: 32rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Problem / solution */
.dual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.panel {
  padding: 1.15rem;
  border: 1px solid var(--border-muted);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}

.panel.problem {
  border-color: rgba(255, 107, 107, 0.22);
}

.panel.solution {
  border-color: rgba(46, 164, 79, 0.28);
}

.panel h3 {
  margin: 0 0 0.65rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.panel.problem h3 { color: var(--red); }
.panel.solution h3 { color: var(--green); }

.panel ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.panel li {
  position: relative;
  padding: 0.3rem 0 0.3rem 1rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.panel li::before {
  position: absolute;
  left: 0;
  font-weight: 700;
}

.panel.problem li::before { content: "×"; color: var(--red); }
.panel.solution li::before { content: "✓"; color: var(--green); }

/* Proof metrics */
.proof-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  overflow: hidden;
}

.proof-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border-muted);
  background: var(--bg-elevated);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-dim);
}

.gate-pill {
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(46, 164, 79, 0.15);
  color: var(--green);
  font-weight: 600;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.metric {
  padding: 0.9rem 0.5rem;
  border-right: 1px solid var(--border-muted);
  border-bottom: 1px solid var(--border-muted);
  text-align: center;
}

.metric:nth-child(3n) { border-right: none; }
.metric:nth-last-child(-n + 3) { border-bottom: none; }

.metric-val {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--green);
}

.metric-lbl {
  font-size: 0.625rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.proof-meta {
  margin-top: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--text-dim);
  text-align: center;
}

/* Pricing */
.pricing-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}

.pricing-card {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  border: 1px solid var(--border-muted);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}

.pricing-card.featured {
  border-color: rgba(46, 164, 79, 0.4);
  background: linear-gradient(180deg, rgba(46, 164, 79, 0.06), var(--bg-elevated));
}

.pricing-label {
  margin: 0 0 0.15rem;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.pricing-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.125rem;
}

.pricing-price {
  margin: 0 0 0.85rem;
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 600;
}

.pricing-price small {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--text-dim);
}

.pricing-note {
  margin: -0.35rem 0 0.65rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.pricing-features {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  flex: 1;
}

.pricing-features li {
  position: relative;
  padding: 0.28rem 0 0.28rem 1rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.pricing-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--green);
  font-size: 0.75rem;
}

.pricing-features li.service::before {
  content: "◆";
  color: var(--yellow);
}

.feat-tag {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}

.feat-tag.software {
  background: rgba(46, 164, 79, 0.15);
  color: var(--green);
}

.feat-tag.service {
  background: rgba(210, 153, 34, 0.15);
  color: var(--yellow);
}

.pricing-cta {
  display: block;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}

.pricing-cta:hover {
  border-color: var(--green-dim);
  background: rgba(46, 164, 79, 0.06);
}

.pricing-cta.primary {
  border-color: var(--green-dim);
  background: linear-gradient(180deg, var(--green), var(--green-dim));
  color: #fff;
}

/* Waitlist */
.waitlist-box {
  max-width: 28rem;
  margin: 0 auto;
}

.waitlist-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.input-row {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  overflow: hidden;
}

.input-row:focus-within {
  border-color: var(--green-dim);
  box-shadow: 0 0 0 3px rgba(46, 164, 79, 0.12);
}

.input-row.invalid {
  border-color: var(--red);
}

.input-prefix {
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--green);
  border-right: 1px solid var(--border-muted);
  background: rgba(46, 164, 79, 0.05);
}

.waitlist-input {
  flex: 1;
  min-width: 0;
  padding: 0.8rem 0.9rem;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  outline: none;
}

.waitlist-input::placeholder {
  color: var(--text-dim);
}

.btn-slot {
  width: 100%;
  padding: 0.85rem;
  border: none;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--green), var(--green-dim));
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.btn-slot:disabled {
  opacity: 0.6;
  cursor: wait;
}

.waitlist-note {
  margin: 0.65rem 0 0;
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: center;
}

.waitlist-msg {
  min-height: 1.2rem;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  text-align: center;
}

.waitlist-msg.ok { color: var(--green); }
.waitlist-msg.err { color: var(--red); }

/* Footer */
.site-footer {
  margin-top: auto;
  padding: 2rem 0;
  border-top: 1px solid var(--border-muted);
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--green);
}

.footer-loc {
  margin-top: 0.35rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pricing-cta.primary:hover {
  box-shadow: 0 6px 20px rgba(46, 164, 79, 0.3);
}

/* ── Standalone community page ── */
.page-centered {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
}

.page-centered .back-link {
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
}

.page-centered .back-link:hover {
  color: var(--green);
}

.page-centered .pricing-card {
  width: 100%;
  max-width: 320px;
}

.page-centered .cli-hint {
  margin-top: 1.25rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

.page-centered .cli-hint code {
  color: var(--text);
}

.page-centered .cli-note {
  margin-top: 1rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

.page-centered .cli-note a {
  color: var(--accent-green);
}

.page-centered .cli-install {
  width: 100%;
  max-width: 520px;
}

.signin-note {
  margin: 0 0 var(--space-4);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

@media (min-width: 768px) {
  .daemon-status {
    display: inline-flex;
  }
}

@media (max-width: 768px) {
  .topnav a:not(.btn) {
    display: none;
  }

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

  .dual-grid,
  .pricing-grid {
    grid-template-columns: 1fr;
  }

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

  .metric:nth-child(3n) {
    border-right: 1px solid var(--border-muted);
  }

  .metric:nth-child(2n) {
    border-right: none;
  }
}

@media (max-width: 480px) {
  .input-prefix {
    display: none;
  }

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

  .metric {
    border-right: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .daemon-dot,
  .t-line {
    animation: none;
    opacity: 1;
  }
}
