:root {
  --surface: #ffffff;
  --canvas: #f8fafc;
  --ink: #0f172a;
  --secondary: #475569;
  --muted: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --accent: #c2410c;
  --accent-hover: #9a3412;
  --accent-soft: #fff7ed;
  --accent-border: #fdba74;
  --ok: #15803d;
  --ok-soft: #f0fdf4;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

code,
pre,
.meta-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.num {
  font-variant-numeric: tabular-nums;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.nav-inner {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 8px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

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

.nav-cta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.license-pill {
  font-size: 12px;
  font-weight: 600;
  color: var(--secondary);
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
}

.license-pill.pro {
  color: var(--ok);
  background: var(--ok-soft);
  border-color: #bbf7d0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 15px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 13px;
}

.btn-xs {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-primary {
  background: var(--accent);
  color: var(--surface);
}

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

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

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

.btn-outline.active-chip {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.btn-ghost {
  background: transparent;
  color: var(--secondary);
}

.btn-ghost:hover {
  background: var(--border);
  color: var(--ink);
}

.full-w {
  width: 100%;
}

/* Typography & Hero */
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 4px;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.hero {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 36px 0 32px;
}

.hero-inner {
  max-width: 820px;
}

.hero h1 {
  font-size: clamp(26px, 3.6vw, 38px);
  line-height: 1.18;
  margin-bottom: 10px;
}

.hero-copy {
  margin: 0;
  color: var(--secondary);
  font-size: 15px;
  line-height: 1.6;
}

/* Workbench Grid */
.workbench-section {
  padding: 28px 0 40px;
}

.workbench-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 20px;
  align-items: start;
}

.workbench-left,
.workbench-right {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.panel-head h2 {
  font-size: 17px;
  line-height: 1.3;
}

.meta-mono {
  font-size: 11px;
  font-weight: 700;
  color: var(--secondary);
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  white-space: nowrap;
}

/* Framework Selector */
.input-select,
.input-text,
.draft-textarea,
.ab-textarea {
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  padding: 9px 11px;
}

.input-select:focus,
.input-text:focus,
.draft-textarea:focus,
.ab-textarea:focus {
  outline: 2px solid rgba(194, 65, 12, 0.22);
  border-color: var(--accent);
}

.framework-desc {
  margin: 10px 0 6px;
  font-size: 13px;
  color: var(--secondary);
}

.framework-hint {
  font-size: 12px;
  color: var(--muted);
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.framework-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.fw-pill {
  border: 1px solid var(--border);
  background: var(--canvas);
  color: var(--secondary);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.fw-pill.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

/* Draft Editor */
.draft-textarea {
  resize: vertical;
  min-height: 210px;
  font-size: 14px;
}

.editor-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.stat-chip {
  font-size: 12px;
  color: var(--secondary);
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 9px;
}

/* A/B Hook Duel */
.winner-badge {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  padding: 4px 9px;
  white-space: nowrap;
}

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

.ab-field {
  min-width: 0;
}

.ab-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
  font-size: 13px;
  font-weight: 600;
}

.ab-score-tag {
  font-size: 12px;
  color: var(--accent);
  font-weight: 700;
}

.ab-textarea {
  font-size: 13px;
  resize: vertical;
}

.ab-summary {
  margin: 10px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

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

.clean-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.clean-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--secondary);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-strong);
}

.clean-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
}

.clean-table th.num,
.clean-table td.num {
  text-align: right;
}

.delta-pos {
  color: var(--ok);
  font-weight: 600;
}

.delta-neg {
  color: var(--danger);
  font-weight: 600;
}

/* Score Pill & Tabs */
.score-pill-wrap {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 5px 10px;
  white-space: nowrap;
}

.score-grade {
  font-size: 12px;
  font-weight: 800;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 4px;
  padding: 1px 6px;
}

.score-total {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.score-denom {
  font-size: 12px;
  color: var(--muted);
}

.platform-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.platform-tab {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.platform-tab.active {
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
}

/* Platform Previews */
.preview-stage {
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 16px;
}

.slide-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.preview-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.preview-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--secondary);
}

.meter-badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--ok-soft);
  color: var(--ok);
  border: 1px solid #bbf7d0;
}

.meter-badge.over {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: #fecaca;
}

.meter-badge.warn {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: #fde68a;
}

.preview-body {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13.5px;
  line-height: 1.52;
  color: var(--ink);
}

.linkedin-fold-divider {
  margin: 10px 0;
  border-top: 1px dashed var(--accent);
  position: relative;
  display: flex;
  justify-content: flex-end;
}

.linkedin-fold-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 4px;
  padding: 1px 7px;
  transform: translateY(-50%);
}

.hn-title-line {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}

/* Diagnostics */
.subhead {
  font-size: 13px;
  font-weight: 700;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 10px;
}

.dimension-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.dim-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: var(--canvas);
}

.dim-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 5px;
}

.dim-bar-track {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.dim-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}

.diagnostics-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.flag-list,
.suggestion-list {
  margin: 0;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  color: var(--secondary);
}

.flag-sev-error {
  color: var(--danger);
  font-weight: 600;
}

.flag-sev-warn {
  color: var(--warn);
  font-weight: 600;
}

/* Social Card */
.card-format-switch,
.export-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.card-controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.handle-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--secondary);
}

.card-controls-row .input-text {
  flex: 1 1 140px;
  min-width: 120px;
  padding: 6px 10px;
  font-size: 13px;
}

.social-card-stage {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--canvas);
  padding: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.social-card-stage svg {
  width: 100%;
  max-width: 520px;
  height: auto;
  display: block;
}

/* Exports */
.code-preview {
  margin: 0 0 12px;
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 12px;
  line-height: 1.5;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink);
}

.export-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Frameworks Table & Pricing */
.frameworks-overview,
.pricing {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 40px 0;
}

.frameworks-overview h2,
.pricing h2 {
  font-size: 24px;
  margin-bottom: 18px;
}

.tier-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--canvas);
  color: var(--secondary);
}

.tier-tag.pro {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent-border);
}

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

.price-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  background: var(--canvas);
  display: flex;
  flex-direction: column;
}

.price-card.featured {
  background: var(--surface);
  border-color: var(--accent);
}

.price-tier {
  font-size: 14px;
  font-weight: 700;
  color: var(--secondary);
}

.price-amount {
  font-size: 32px;
  font-weight: 800;
  margin: 6px 0 8px;
}

.price-amount span {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.price-desc {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--secondary);
}

.price-list {
  margin: 0 0 18px;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13.5px;
  color: var(--ink);
  flex: 1;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--canvas);
  padding: 24px 0;
  font-size: 13px;
  color: var(--secondary);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--secondary);
  text-decoration: none;
  font-weight: 500;
}

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

/* Modal */
.modal-backdrop[hidden] {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 60;
}

.modal-dialog {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.modal-copy {
  margin: 0 0 14px;
  font-size: 13.5px;
  color: var(--secondary);
}

.modal-buy-box {
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.modal-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.modal-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.modal-actions-row {
  display: flex;
  gap: 8px;
}

.modal-feedback {
  margin: 10px 0 0;
  font-size: 12.5px;
  color: var(--secondary);
}

/* Legal pages */
.legal-sheet {
  max-width: 760px;
  margin: 32px auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.legal-sheet h1 {
  font-size: 28px;
  margin-bottom: 14px;
}

.legal-sheet h2 {
  font-size: 18px;
  margin: 22px 0 8px;
}

.legal-sheet p,
.legal-sheet li {
  color: var(--secondary);
  font-size: 14.5px;
}

/* Responsive */
@media (max-width: 960px) {
  .workbench-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

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

  .ab-inputs,
  .dimension-list,
  .diagnostics-split,
  .pricing-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .nav-links {
    display: none;
  }
}
