:root {
  --bg: #f6f3ed;
  --bg-elevated: #fdfbf7;
  --panel: #ffffff;
  --panel2: #f0ebe3;
  --line: #ddd5c8;
  --text: #1f1c18;
  --muted: #6f665c;
  --accent: #0f766e;
  --accent-light: #14b8a6;
  --accent2: #c2410c;
  --accent2-light: #ea580c;
  --high: #047857;
  --med: #b45309;
  --low: #78716c;
  --danger: #b91c1c;
  --on-accent: #ffffff;
  --shadow: rgba(31, 28, 24, 0.08);
  --max: 1120px;
  --radius: 12px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

.container {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

/* Nav */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--line);
  background: rgba(253, 251, 247, 0.88);
  backdrop-filter: blur(12px);
}

.site-nav .inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  font-size: 15px;
  color: var(--text);
  text-decoration: none;
}

.logo:hover {
  text-decoration: none;
}

.logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--on-accent);
}

.nav-links {
  display: flex;
  gap: 20px;
  margin-left: 12px;
}

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

.nav-links a:hover {
  color: var(--text);
  text-decoration: none;
}

.nav-cta {
  margin-left: auto;
  display: flex;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}

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

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.25);
}

.btn-primary:hover {
  background: #0d6b64;
}

.btn-secondary {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
}

/* Hero */
.hero {
  padding: 88px 0 72px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto;
  height: 70%;
  background:
    radial-gradient(ellipse at 30% 0%, rgba(20, 184, 166, 0.12), transparent 55%),
    radial-gradient(ellipse at 85% 15%, rgba(234, 88, 12, 0.1), transparent 50%);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
  position: relative;
}

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent2);
  margin-bottom: 16px;
}

.hero h1 {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 0 0 20px;
  font-weight: 700;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  font-size: 18px;
  color: var(--muted);
  max-width: 540px;
  margin: 0 0 28px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.hero-note {
  font-size: 13px;
  color: var(--muted);
}

/* Preview panel */
.preview {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 20px 60px var(--shadow), 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.preview-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--muted);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
}

.dot.red { background: #ef4444; }
.dot.yellow { background: #eab308; }
.dot.green { background: var(--high); }

.candidate {
  display: flex;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg-elevated);
  margin-bottom: 8px;
}

.candidate:last-child {
  margin-bottom: 0;
}

.badges {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 52px;
}

.badge {
  display: inline-block;
  min-width: 28px;
  text-align: center;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
}

.b-high { background: rgba(4, 120, 87, 0.12); color: var(--high); }
.b-med { background: rgba(180, 83, 9, 0.12); color: var(--med); }
.b-low { background: rgba(120, 113, 108, 0.12); color: var(--low); }

.candidate-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}

.candidate-meta {
  font-size: 11px;
  color: var(--muted);
}

.candidate.strategic {
  border-color: rgba(194, 65, 12, 0.35);
  background: rgba(234, 88, 12, 0.06);
}

.candidate.generic {
  opacity: 0.65;
}

.tag {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
}

.tag-bet {
  background: rgba(194, 65, 12, 0.12);
  color: var(--accent2);
}

.tag-generic {
  background: rgba(185, 28, 28, 0.1);
  color: var(--danger);
}

/* Sections */
section {
  padding: 72px 0;
}

section.alt {
  background: var(--bg-elevated);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-head {
  max-width: 640px;
  margin-bottom: 48px;
}

.section-head h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}

.section-head p {
  color: var(--muted);
  margin: 0;
  font-size: 17px;
}

/* Problem */
.problem-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.problem-card {
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
}

.problem-card.bad {
  border-color: rgba(185, 28, 28, 0.2);
  background: rgba(185, 28, 28, 0.03);
}

.problem-card.good {
  border-color: rgba(4, 120, 87, 0.25);
  background: rgba(4, 120, 87, 0.05);
}

.problem-card h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.problem-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
}

.problem-card li {
  margin: 6px 0;
}

/* Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.step {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  position: relative;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(15, 118, 110, 0.12);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 14px;
}

.step h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.step p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

/* Features */
.features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.feature {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.feature-icon {
  font-size: 22px;
  margin-bottom: 12px;
  color: var(--accent);
}

.feature h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.feature p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.feature code {
  font-size: 12px;
  background: var(--panel2);
  padding: 1px 5px;
  border-radius: 4px;
}

/* Adaptation — six equal cards in a 3×2 grid */
.adaptation-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.adaptation-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.adaptation-card.primary {
  border-color: rgba(15, 118, 110, 0.35);
  background: rgba(15, 118, 110, 0.05);
}

.adaptation-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.adaptation-card p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.adaptation-label {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent2);
  margin-bottom: 10px;
}

.adaptation-card.primary .adaptation-label {
  color: var(--accent);
}

/* Audience */
.audience-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.audience-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.audience-card.primary {
  border-color: rgba(15, 118, 110, 0.35);
  background: rgba(15, 118, 110, 0.05);
}

.audience-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.audience-card p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.audience-label {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

/* CTA */
.cta {
  text-align: center;
  padding: 80px 0;
}

.cta-box {
  padding: 48px 32px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel), var(--bg-elevated));
  box-shadow: 0 12px 40px var(--shadow);
}

.cta h2 {
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.cta p {
  color: var(--muted);
  max-width: 520px;
  margin: 0 auto 24px;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 24px;
}

.code-block {
  display: inline-block;
  text-align: left;
  background: var(--text);
  border: 1px solid #3d3832;
  border-radius: 8px;
  padding: 16px 20px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 13px;
  color: #a8a29e;
  margin-top: 20px;
}

.code-block code {
  color: #ecfdf5;
}

/* Footer */
footer {
  border-top: 1px solid var(--line);
  padding: 32px 0;
  background: var(--bg-elevated);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
}

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

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

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

/* Responsive */
@media (max-width: 900px) {
  .hero-grid,
  .problem-grid,
  .steps,
  .features,
  .adaptation-grid,
  .audience-grid {
    grid-template-columns: 1fr;
  }

  .nav-links {
    display: none;
  }

  .hero {
    padding-top: 56px;
  }
}

@media (max-width: 600px) {
  .nav-cta .btn-secondary {
    display: none;
  }
}

/* Builder guide (markdown doc page) */
.doc-page {
  padding: 48px 0 72px;
}

.doc-head {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.doc-back {
  display: inline-block;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 500;
}

.doc-head h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.doc-lead {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  max-width: 52rem;
}

.doc-content {
  max-width: 52rem;
  font-size: 16px;
  line-height: 1.65;
}

.doc-content h2 {
  margin: 36px 0 12px;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.doc-content h2:first-child {
  margin-top: 0;
}

.doc-content p {
  margin: 0 0 14px;
}

.doc-content ul,
.doc-content ol {
  margin: 0 0 16px;
  padding-left: 1.4rem;
}

.doc-content li {
  margin: 6px 0;
}

.doc-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 20px;
  font-size: 15px;
}

.doc-content th,
.doc-content td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.doc-content th {
  background: var(--panel2);
  font-weight: 600;
}

.doc-content strong {
  font-weight: 650;
}

.doc-loading,
.doc-error {
  color: var(--muted);
}
