@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@400;500&display=swap');

/* ── Brand tokens ────────────────────────────────────────────── */
:root {
  /* palette */
  --bg:          #0f1311;
  --bg-panel:    #161b18;
  --border:      #2b322c;
  --text:        #d9dfdb;
  --text-muted:  #8a938c;
  --primary:     #3fb950;
  --primary-bright: #56d364;
  --warn:        #d29922;
  --danger:      #f85149;

  /* typography */
  --font-display: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-body:    'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* spacing & radius */
  --radius:     0px;
  --space:      4px;

  /* derived spacing */
  --space-2: calc(var(--space) * 2);   /* 8px  */
  --space-3: calc(var(--space) * 3);   /* 12px */
  --space-4: calc(var(--space) * 4);   /* 16px */
  --space-6: calc(var(--space) * 6);   /* 24px */
  --space-8: calc(var(--space) * 8);   /* 32px */
  --space-12: calc(var(--space) * 12); /* 48px */
}

/* ── Light theme ─────────────────────────────────────────────── */
[data-theme="light"] {
  --bg:          #f4f5f3;
  --bg-panel:    #ecedeb;
  --border:      #d0d4d1;
  --text:        #1a1d1a;
  --text-muted:  #6b726b;
  --primary:     #2d8a3b;
  --primary-bright: #3fb950;
  --warn:        #b8860b;
  --danger:      #c53030;
}

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

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ── Shared nav ──────────────────────────────────────────────── */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-4);
  height: 48px;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
}
.site-logo img { display: block; }
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  list-style: none;
}
.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: color 0.08s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); }
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 2px 8px;
  cursor: pointer;
  border-radius: 0;
  transition: color 0.08s, border-color 0.08s;
  line-height: 1.6;
}
.theme-toggle:hover { color: var(--text); border-color: var(--text); }

/* ── Shared footer ───────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: var(--space-12);
  padding: var(--space-8) var(--space-4);
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
}
.footer-links {
  display: flex;
  gap: var(--space-4);
  list-style: none;
}
.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8125rem;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.footer-links a:hover { color: var(--text); }
.footer-copy {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: var(--font-mono);
}

/* ── Layout ──────────────────────────────────────────────────── */
.page-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

/* Content section: single ~72ch column for prose */
.content-section {
  max-width: 72ch;
  padding: var(--space-8) 0;
  border-top: 1px solid var(--border);
}
.content-section:first-of-type { border-top: none; }

/* Section eyebrow */
.section-eyebrow {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.section-eyebrow .num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--primary);
  letter-spacing: 0.05em;
}
.section-eyebrow .label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* Two-column work surface */
.work-surface {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 0;
  border-top: 1px solid var(--border);
  margin-top: var(--space-6);
}
.work-surface .input-rail {
  border-right: 1px solid var(--border);
  padding: var(--space-4);
  background: var(--bg-panel);
}
.work-surface .results-area {
  padding: var(--space-4);
  overflow-x: auto;
}

/* ── Headings ────────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.3;
  color: var(--text);
}
h1 {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
h2 {
  font-size: 1.2rem;
  margin-bottom: var(--space-3);
}
h3 {
  font-size: 1rem;
  margin-bottom: var(--space-2);
}

/* ── Hero split layout ───────────────────────────────────────── */
.hero-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  padding: var(--space-12) 0;
  align-items: start;
}
.hero-left h1 {
  margin-bottom: var(--space-4);
  font-size: 2rem;
}
.hero-left p {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: var(--space-6);
  max-width: 42ch;
  line-height: 1.7;
}
.hero-left .hero-cta {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

/* ── Inline figure ───────────────────────────────────────────── */
.product-figure {
  width: 100%;
  max-width: 520px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  padding: var(--space-4);
}
.product-figure svg {
  display: block;
  width: 100%;
  height: auto;
}

/* ── Hero screenshot ─────────────────────────────────────────── */
.hero-screenshot {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  text-decoration: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  transition: background 0.08s, color 0.08s, border-color 0.08s;
  white-space: nowrap;
}
.btn:hover { background: var(--border); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary {
  background: var(--primary);
  color: var(--bg);
  border-color: var(--primary);
  font-weight: 600;
}
.btn-primary:hover { background: var(--primary-bright); border-color: var(--primary-bright); }
.btn-danger {
  border-color: var(--danger);
  color: var(--danger);
}
.btn-danger:hover { background: var(--danger); color: var(--bg); }

/* Compound control (split button) */
.compound {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--border);
}
.compound .btn {
  border: none;
  border-radius: 0;
}
.compound .btn + .btn { border-left: 1px solid var(--border); }
.compound .copy-btn {
  padding: var(--space-2) var(--space-3);
  font-size: 0.7rem;
  color: var(--text-muted);
}
.compound .copy-btn:hover { color: var(--text); }
.compound .copy-btn.copied { color: var(--primary); }

/* ── Forms ───────────────────────────────────────────────────── */
.form-group { margin-bottom: var(--space-4); }
.form-group label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}
input[type="text"],
input[type="number"] {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.08s;
}
input[type="text"]:focus,
input[type="number"]:focus { border-color: var(--primary); }
input::placeholder { color: var(--text-muted); opacity: 0.6; }
.input-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--space-1);
  font-family: var(--font-mono);
}
.error-text {
  font-size: 0.78rem;
  color: var(--danger);
  font-family: var(--font-mono);
  margin-top: var(--space-1);
  display: none;
}
.error-text.visible { display: block; }

/* ── Tables ──────────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
thead th {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: var(--space-2) var(--space-2);
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: var(--bg-panel);
}
tbody td {
  padding: var(--space-2) var(--space-2);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  white-space: nowrap;
}
tbody tr:hover { background: var(--bg-panel); }
tbody tr:last-child td { border-bottom: none; }

/* Status flags in tables */
.overflow-row { color: var(--danger); }
.overflow-badge {
  display: inline-block;
  background: var(--danger);
  color: var(--bg);
  font-size: 0.65rem;
  font-family: var(--font-mono);
  font-weight: 500;
  padding: 1px 5px;
  margin-left: var(--space-1);
  letter-spacing: 0.06em;
}

/* Subnet request table rows */
#subnet-table td input[type="text"] {
  padding: var(--space-1) var(--space-2);
  font-size: 0.8rem;
}
.row-error {
  font-size: 0.72rem;
  color: var(--danger);
  font-family: var(--font-mono);
  display: none;
}
.size-hint {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  display: block;
  margin-top: 2px;
}

/* ── Summary / gaps ──────────────────────────────────────────── */
.summary-bar {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--border);
  margin-bottom: var(--space-4);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text);
}
.summary-bar .warn { color: var(--danger); }

.gaps-section {
  margin-top: var(--space-4);
  border-top: 1px solid var(--border);
  padding-top: var(--space-3);
}
.gaps-section h3 {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--warn);
  margin-bottom: var(--space-2);
}
.gap-item {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 2px 0;
}
.no-gaps {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--primary);
}

/* ── Subnet request actions ──────────────────────────────────── */
.subnet-actions, .result-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
  flex-wrap: wrap;
}

/* ── Pricing ─────────────────────────────────────────────────── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin: var(--space-8) 0;
}
.pricing-card {
  border: 1px solid var(--border);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
}
.pricing-card.featured {
  border-color: var(--primary);
  position: relative;
}
.pricing-card .plan-name {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}
.pricing-card .plan-price {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 500;
  margin-bottom: var(--space-4);
}
.pricing-card .plan-price .currency { font-size: 1rem; color: var(--text-muted); }
.pricing-card .plan-price .period { font-size: 0.8rem; color: var(--text-muted); }
.pricing-card ul {
  list-style: none;
  margin-bottom: var(--space-6);
  flex: 1;
}
.pricing-card li {
  padding: var(--space-1) 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}
.pricing-card li:last-child { border-bottom: 1px solid var(--border); }
.pricing-card li .check { color: var(--primary); }
.pricing-card li .na { color: var(--text-muted); opacity: 0.4; }
.pricing-card .btn { margin-top: auto; }

/* Checkout form (demo) */
.checkout-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.checkout-modal-overlay.open { display: flex; }
.checkout-modal {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  padding: var(--space-6);
  max-width: 400px;
  width: 90%;
}
.checkout-modal h2 {
  font-family: var(--font-display);
  margin-bottom: var(--space-4);
  font-size: 1rem;
}
.checkout-modal .form-group { margin-bottom: var(--space-3); }
.checkout-modal .demo-notice {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--warn);
  margin-bottom: var(--space-4);
  padding: var(--space-2);
  border: 1px solid var(--warn);
  text-align: center;
}
.checkout-success {
  display: none;
  text-align: center;
  padding: var(--space-8) 0;
}
.checkout-success.visible { display: block; }
.checkout-success .check-icon {
  font-family: var(--font-mono);
  font-size: 2rem;
  color: var(--primary);
  display: block;
  margin-bottom: var(--space-3);
}

/* ── Legal pages ─────────────────────────────────────────────── */
.legal-page { max-width: 72ch; margin: 0 auto; padding: var(--space-8) 0; }
.legal-page h1 {
  font-size: 1.5rem;
  margin-bottom: var(--space-6);
}
.legal-page h2 {
  font-size: 1rem;
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}
.legal-page p, .legal-page li {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: var(--space-3);
}
.legal-page ul { padding-left: var(--space-6); }
.legal-page li { margin-bottom: var(--space-2); }
.legal-page .missing-entity {
  padding: var(--space-3);
  border: 1px solid var(--warn);
  margin-bottom: var(--space-6);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--warn);
}

/* ── Proof strip ─────────────────────────────────────────────── */
.proof-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0;
  border-top: 1px solid var(--border);
  margin: var(--space-8) 0;
}
.proof-cell {
  padding: var(--space-4) var(--space-3);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.proof-cell:last-child { border-right: none; }
.proof-cell .big-num {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--primary);
  display: block;
  margin-bottom: 2px;
}
.proof-cell .caption {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Feature list (hairline-separated, not cards) ────────────── */
.feature-list {
  list-style: none;
  max-width: 72ch;
}
.feature-list li {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.feature-list li:last-child { border-bottom: 1px solid var(--border); }
.feature-list li strong {
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 500;
  min-width: 6em;
}

/* ── No-appeal / honesty callout ─────────────────────────────── */
.honesty-callout {
  border: 1px solid var(--warn);
  padding: var(--space-4);
  margin: var(--space-6) 0;
  max-width: 72ch;
}
.honesty-callout p {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--warn);
  line-height: 1.6;
}



/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero-split {
    grid-template-columns: 1fr;
    gap: var(--space-6);
    padding: var(--space-8) 0;
  }
  .hero-left h1 { font-size: 1.5rem; }
  .work-surface {
    grid-template-columns: 1fr;
  }
  .work-surface .input-rail {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .pricing-grid {
    grid-template-columns: 1fr;
  }
  .header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: var(--space-2) var(--space-4);
    gap: var(--space-2);
  }
  .nav-links {
    gap: var(--space-3);
    order: 3;
    width: 100%;
    justify-content: center;
    padding-top: var(--space-2);
    border-top: 1px solid var(--border);
  }
  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
  .proof-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  html { font-size: 15px; }
  .hero-left h1 { font-size: 1.3rem; }
  .header-inner { padding: var(--space-2) var(--space-3); }
  .nav-links a { font-size: 0.68rem; }
  .pricing-card { padding: var(--space-4); }
}