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

:root {
  --ink: #1b1f23;
  --paper: #f2f0e9;
  --panel: #ffffff;
  --line: #d8d3c4;
  --muted: #6b6960;
  --accent: #2d5c4e;
  --accent-dim: #e4ece9;
  --amber: #c98a3e;
  --danger: #a4432f;
  --radius: 3px;
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Sans", -apple-system, sans-serif;
  line-height: 1.5;
}

h1, h2, h3, .display {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 0.4em;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; color: var(--ink); }
p.lead { color: var(--muted); font-size: 1.05rem; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.mono { font-family: "IBM Plex Mono", monospace; }

.muted { color: var(--muted); }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 28px;
}

.narrow { max-width: 480px; margin: 0 auto; padding: 0 24px; }

/* --- Nav --- */
.site-nav {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.brand .mark {
  display: inline-block;
  width: 9px;
  height: 9px;
  background: var(--accent);
  border-radius: 50%;
  transform: translateY(-2px);
}
.nav-links { display: flex; align-items: center; gap: 24px; font-size: 0.95rem; }
.nav-links a { color: var(--ink); }
.nav-links a:hover { color: var(--accent); text-decoration: none; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { background: var(--accent); border-color: var(--accent); text-decoration: none; }
.btn.secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { background: var(--panel); border-color: var(--ink); }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: var(--danger); color: #fff; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.small { padding: 7px 14px; font-size: 0.85rem; }

/* --- Hero --- */
.hero { padding: 88px 0 64px; border-bottom: 1px solid var(--line); }
.hero .eyebrow-line { color: var(--muted); font-size: 0.95rem; margin-bottom: 18px; max-width: 34ch; }
.hero h1 { font-size: clamp(2.2rem, 4.4vw, 3.4rem); max-width: 16ch; }
.hero .sub { font-size: 1.1rem; color: var(--muted); max-width: 52ch; margin-top: 18px; }
.hero .actions { display: flex; gap: 14px; margin-top: 32px; }

/* --- Billing toggle --- */
.billing-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  background: var(--panel);
}
.billing-toggle button {
  border: none;
  background: transparent;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-family: "IBM Plex Sans", sans-serif;
  cursor: pointer;
  color: var(--muted);
}
.billing-toggle button.active { background: var(--ink); color: var(--paper); }
.billing-toggle .save-tag { font-size: 0.75rem; color: var(--accent); margin-left: 6px; }

/* --- Product ledger --- */
.ledger { border-top: 1px solid var(--line); margin-top: 8px; }
.ledger-row {
  display: grid;
  grid-template-columns: 4px 1.4fr 1fr auto;
  gap: 28px;
  align-items: start;
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
}
.ledger-row .bar { align-self: stretch; border-radius: 2px; }
.ledger-row .tech-badge {
  display: inline-block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 9px;
  margin-left: 10px;
  vertical-align: middle;
}
.ledger-row h3 { font-size: 1.5rem; margin-bottom: 6px; }
.ledger-row .tagline { color: var(--muted); margin-bottom: 14px; }
.feature-list { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 20px; }
.feature-list li {
  font-size: 0.9rem;
  color: var(--ink);
  padding: 4px 0 4px 14px;
  position: relative;
  break-inside: avoid;
}
.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  width: 5px;
  height: 1px;
  background: var(--muted);
}
.price-block { text-align: left; }
.price { font-family: "IBM Plex Mono", monospace; font-size: 1.7rem; }
.price .unit { font-size: 0.8rem; color: var(--muted); display: block; margin-top: 2px; }
.ledger-row .cta { margin-top: 14px; }

/* --- Sections --- */
.section { padding: 64px 0; }
.section-head { max-width: 60ch; margin-bottom: 40px; }
.section.alt { background: var(--panel); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* --- Forms --- */
.form-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px;
  margin: 56px auto;
}
label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 6px; margin-top: 16px; }
label:first-of-type { margin-top: 0; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="url"], textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 0.95rem;
  color: var(--ink);
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { resize: vertical; min-height: 70px; }
.field-note { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }
.error-box {
  background: #f7e9e5;
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  margin-top: 16px;
  display: none;
}
.error-box.show { display: block; }
.success-box {
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  margin-top: 16px;
  display: none;
}
.success-box.show { display: block; }

/* --- Dashboard / admin cards --- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 20px;
}
.panel-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.panel-row:last-child { border-bottom: none; }
.badge {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.badge.active { color: var(--accent); border-color: var(--accent); }
.badge.inactive { color: var(--danger); border-color: var(--danger); }

/* --- Admin table / editor --- */
.admin-grid { display: grid; grid-template-columns: 320px 1fr; gap: 24px; align-items: start; }
.admin-list { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.admin-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  font-size: 0.92rem;
}
.admin-list-item:last-child { border-bottom: none; }
.admin-list-item:hover { background: var(--accent-dim); }
.admin-list-item.selected { background: var(--ink); color: var(--paper); }
.admin-list-item .dot { width: 8px; height: 8px; border-radius: 50%; margin-right: 10px; display: inline-block; }
.feature-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.feature-row input { flex: 1; }
.chip-remove { cursor: pointer; color: var(--danger); font-family: "IBM Plex Mono", monospace; font-size: 0.9rem; padding: 4px 8px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

footer.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 0;
  margin-top: 40px;
  color: var(--muted);
  font-size: 0.85rem;
}

.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--muted);
}

@media (max-width: 760px) {
  .ledger-row { grid-template-columns: 4px 1fr; }
  .ledger-row .price-block { grid-column: 2; }
  .feature-list { columns: 1; }
  .admin-grid { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
}
