/* Docs Playbook - marketing site
   Handcrafted. No framework. No build step.
   Brand palette echoes FreeDocStore, layout is distinct. */

:root {
  --bg: #0b0d13;
  --bg-raised: #12151e;
  --surface: #181b24;
  --border: #23273a;
  --text: #e7e9f1;
  --text-muted: #8b90a0;
  --text-dim: #5c6274;
  --accent: #06f4b1;
  --accent-dim: #0ab882;
  --accent-ghost: rgba(6, 244, 177, 0.08);
  --max: 1120px;
  --radius: 10px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Menlo", "Cascadia Mono", Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dim); }
::selection { background: var(--accent); color: #000; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* ─── Nav ─────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 13, 19, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); font-weight: 600; font-size: 15px;
}
.nav-brand { font-size: 17px; letter-spacing: -0.01em; }
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a { color: var(--text-muted); font-size: 14px; font-weight: 500; }
.nav-links a:hover { color: var(--text); }
.nav-links .nav-cta {
  color: #000; background: var(--accent);
  padding: 8px 14px; border-radius: 6px;
  font-weight: 600;
}
.nav-links .nav-cta:hover { background: var(--accent-dim); color: #000; }

/* ─── Hero ────────────────────────────────────────── */
.hero {
  padding: 120px 0 100px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(circle at 20% 20%, rgba(6, 244, 177, 0.08), transparent 40%),
    radial-gradient(circle at 80% 10%, rgba(6, 244, 177, 0.04), transparent 50%);
}
.hero-eyebrow {
  display: inline-block;
  font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--accent); font-weight: 600;
  margin-bottom: 22px;
  padding: 6px 12px;
  background: var(--accent-ghost);
  border: 1px solid rgba(6, 244, 177, 0.2);
  border-radius: 100px;
}
.hero h1 {
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 700;
  max-width: 900px;
  margin-bottom: 24px;
}
.hero h1 .accent { color: var(--accent); }
.hero-sub {
  font-size: clamp(17px, 2vw, 20px);
  color: var(--text-muted);
  max-width: 680px;
  line-height: 1.55;
  margin-bottom: 40px;
}
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 22px;
  border-radius: 8px;
  font-size: 15px; font-weight: 600;
  transition: transform 0.1s ease, background 0.15s ease;
  cursor: pointer; border: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover { background: var(--accent-dim); color: #000; }
.btn-secondary {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--text-muted); color: var(--text); }
.btn.compact { padding: 9px 12px; font-size: 13px; }

/* ─── Section base ────────────────────────────────── */
section { padding: 100px 0; border-bottom: 1px solid var(--border); }
section:last-of-type { border-bottom: none; }
.section-eyebrow {
  font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin-bottom: 14px;
}
.section-title {
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -0.01em;
  font-weight: 700;
  margin-bottom: 18px;
  max-width: 720px;
  line-height: 1.15;
}
.section-lede {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 680px;
  line-height: 1.6;
  margin-bottom: 56px;
}

/* ─── Problem / positioning ───────────────────────── */
.problem-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 40px;
}
.problem-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.problem-card h3 {
  font-size: 18px; font-weight: 600; margin-bottom: 10px;
  color: var(--text);
}
.problem-card p { color: var(--text-muted); font-size: 15px; line-height: 1.6; }
.problem-card .stat {
  display: block; color: var(--accent);
  font-family: var(--font-mono); font-size: 13px; margin-bottom: 12px;
  letter-spacing: 0.5px;
}

/* ─── Published KBs ───────────────────────────────── */
.book-hero {
  padding: 72px 0 48px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.book-kicker {
  display: inline-block;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.book-hero h1 {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  max-width: 860px;
  margin-bottom: 18px;
}
.book-hero p {
  color: var(--text-muted);
  font-size: 18px;
  max-width: 760px;
}
.book-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  padding: 48px 24px 72px;
}
.book-sidebar {
  position: sticky;
  top: 88px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
  padding: 16px;
}
.book-sidebar-title {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.book-sidebar a {
  display: block;
  color: var(--text-muted);
  font-size: 14px;
  padding: 7px 8px;
  border-radius: 6px;
}
.book-sidebar a:hover,
.book-sidebar a.active {
  color: var(--text);
  background: var(--surface);
}
.book-content {
  max-width: 840px;
}
.book-content section {
  padding: 0 0 44px;
  margin-bottom: 44px;
}
.book-content h2 {
  font-size: 28px;
  line-height: 1.2;
  margin-bottom: 16px;
}
.book-content h3 {
  color: var(--accent);
  font-size: 19px;
  margin: 24px 0 10px;
}
.book-content p,
.book-content li {
  color: var(--text-muted);
}
.book-content strong {
  color: var(--text);
}
.book-content ul,
.book-content ol {
  margin: 12px 0 18px 22px;
}
.book-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin: 18px 0;
}
.book-card.highlight {
  border-color: rgba(6, 244, 177, 0.38);
  background: var(--accent-ghost);
}
.book-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.score-band {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.score-band:last-child { border-bottom: 0; }
.score-band strong {
  color: var(--accent);
  font-family: var(--font-mono);
}
.book-table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 14px;
}
.book-table th,
.book-table td {
  border-bottom: 1px solid var(--border);
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
}
.book-table th {
  color: var(--text);
  background: var(--surface);
}
.book-table td {
  color: var(--text-muted);
}
.book-pill {
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 12px;
  padding: 3px 9px;
}
.book-pill.good { color: var(--accent); border-color: rgba(6, 244, 177, 0.45); }
.book-pill.warn { color: #fbbf24; border-color: rgba(251, 191, 36, 0.45); }
.book-pill.bad { color: #f87171; border-color: rgba(248, 113, 113, 0.45); }

/* ─── Pillars ─────────────────────────────────────── */
.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.pillar { padding: 8px 0; }
.pillar-icon {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: var(--accent-ghost);
  border: 1px solid rgba(6, 244, 177, 0.25);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  margin-bottom: 18px;
  font-family: var(--font-mono); font-weight: 700;
}
.pillar h3 { font-size: 19px; font-weight: 600; margin-bottom: 10px; }
.pillar p { color: var(--text-muted); font-size: 15px; line-height: 1.65; }

/* ─── Code / how it works ─────────────────────────── */
.how {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.how-steps { list-style: none; display: flex; flex-direction: column; gap: 28px; }
.how-step { display: flex; gap: 18px; }
.how-num {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent-ghost);
  border: 1px solid rgba(6, 244, 177, 0.25);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 14px;
}
.how-step h4 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.how-step p { color: var(--text-muted); font-size: 15px; line-height: 1.6; }

.code-frame {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.7);
}
.code-frame-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  display: flex; align-items: center; gap: 10px;
}
.code-frame-bar .dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--border);
}
.code-frame-bar .path {
  margin-left: 6px;
  font-family: var(--font-mono); font-size: 12px; color: var(--text-muted);
}
.code-frame pre {
  margin: 0;
  padding: 20px 22px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  overflow-x: auto;
}
.code-frame .tk-tag { color: #f87171; }
.code-frame .tk-attr { color: #fbbf24; }
.code-frame .tk-str { color: var(--accent); }
.code-frame .tk-cmt { color: var(--text-dim); font-style: italic; }

/* ─── CTA block ───────────────────────────────────── */
.cta-block {
  text-align: center;
  padding: 80px 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(6, 244, 177, 0.08), transparent 60%),
    var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin: 80px auto;
}
.cta-block h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}
.cta-block p {
  font-size: 17px;
  color: var(--text-muted);
  margin-bottom: 32px;
  max-width: 560px; margin-left: auto; margin-right: auto;
}
.cta-block .hero-ctas { justify-content: center; }

/* ─── Footer ──────────────────────────────────────── */
footer {
  padding: 56px 0 40px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 14px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}
.footer-logo { height: 18px; display: block; margin-bottom: 14px; }
.footer-wordmark {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}
.footer-brand p { max-width: 300px; font-size: 14px; color: var(--text-muted); }
.footer-col h5 {
  font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--text); margin-bottom: 14px; font-weight: 600;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { color: var(--text-muted); }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: var(--text-dim);
}
.footer-bottom a { color: var(--text-muted); }

/* ─── AI editor ───────────────────────────────────── */
.editor-ctas { margin-top: 32px; }
.editor-page { min-height: 100vh; }
.editor-shell section { padding: 0; }
.editor-hero {
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(circle at 18% 16%, rgba(6, 244, 177, 0.08), transparent 38%),
    var(--bg);
}
.editor-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 36px;
  align-items: end;
  padding-top: 80px;
  padding-bottom: 48px;
}
.editor-hero h1 {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  max-width: 820px;
  margin-bottom: 22px;
}
.editor-rule {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.editor-rule strong {
  display: block;
  color: var(--accent);
  margin-bottom: 8px;
}
.editor-rule p {
  color: var(--text-muted);
  font-size: 14px;
}
.editor-workbench { padding: 40px 0 72px !important; }
.editor-grid {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.editor-panel {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.editor-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  margin-bottom: 20px;
}
.editor-panel h2 {
  font-size: 20px;
  line-height: 1.2;
  margin-bottom: 6px;
}
.editor-panel p {
  color: var(--text-muted);
  font-size: 14px;
}
.status-pill {
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--text-muted);
  font-size: 12px;
  font-family: var(--font-mono);
}
.status-pill[data-tone="busy"] { color: #fbbf24; border-color: rgba(251, 191, 36, 0.45); }
.status-pill[data-tone="ok"] { color: var(--accent); border-color: rgba(6, 244, 177, 0.45); }
.status-pill[data-tone="error"] { color: #f87171; border-color: rgba(248, 113, 113, 0.5); }
.editor-config {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.editor-config label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}
.field-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
}
.editor-config input,
.editor-config textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0f121a;
  color: var(--text);
  padding: 11px 12px;
  font: inherit;
  font-size: 14px;
}
.editor-config textarea {
  resize: vertical;
  min-height: 150px;
}
.editor-config input:focus,
.editor-config textarea:focus {
  outline: none;
  border-color: rgba(6, 244, 177, 0.65);
  box-shadow: 0 0 0 3px rgba(6, 244, 177, 0.1);
}
.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}
.proposal-summary {
  min-height: 70px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0f121a;
  padding: 14px;
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 16px;
}
.proposal-summary strong {
  display: block;
  color: var(--text);
  margin-bottom: 6px;
}
.review-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border);
}
.review-tab {
  appearance: none;
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  color: var(--text-muted);
  padding: 9px 12px;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  font-weight: 600;
}
.review-tab.active {
  background: #0f121a;
  border-color: var(--border);
  color: var(--text);
}
.review-output {
  min-height: 520px;
  max-height: 640px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  padding: 18px;
  background: #0f121a;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
}
button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

/* ─── Responsive ──────────────────────────────────── */
@media (max-width: 820px) {
  .problem-grid, .pillars, .how { grid-template-columns: 1fr; gap: 20px; }
  .how { gap: 40px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { gap: 16px; }
  .nav-links a:not(.nav-cta) { display: none; }
  section { padding: 72px 0; }
  .hero { padding: 80px 0 64px; }
  .editor-hero-inner, .editor-grid, .field-row { grid-template-columns: 1fr; }
  .editor-hero-inner { padding-top: 56px; }
  .review-output { min-height: 360px; }
  .book-shell { grid-template-columns: 1fr; gap: 28px; padding-top: 28px; }
  .book-sidebar { position: static; }
  .book-grid { grid-template-columns: 1fr; }
  .score-band { grid-template-columns: 1fr; gap: 4px; }
}
