/* Clientrail — brand tokens from BRAND.md */
:root {
  --primary: #0F172A;
  --accent: #2563EB;
  --accent-hover: #1D4ED8;
  --soft-bg: #F8FAFC;
  --success: #059669;
  --warning: #D97706;
  --text: #334155;
  --muted: #94A3B8;
  --border: #E2E8F0;
  --white: #FFFFFF;
  --max: 720px;
  --wide: 960px;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 4px 16px rgba(15, 23, 42, 0.04);
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: Georgia, "Source Serif 4", "Times New Roman", serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

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

.container {
  width: min(100% - 2rem, var(--wide));
  margin-inline: auto;
}

.container-narrow {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

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

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  flex-wrap: wrap;
}

.logo {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--primary);
  letter-spacing: -0.02em;
  text-decoration: none;
}

.logo:hover { text-decoration: none; color: var(--accent); }

.logo span { color: var(--accent); }

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}

.nav-links a {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
}

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

.nav-cta {
  display: inline-block;
  background: var(--accent);
  color: var(--white) !important;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none !important;
}

.nav-cta:hover { background: var(--accent-hover); }

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.35rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none !important;
  border: none;
  cursor: pointer;
  line-height: 1.3;
}

.btn-primary {
  background: var(--accent);
  color: var(--white) !important;
}

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

.btn-secondary {
  background: var(--soft-bg);
  color: var(--primary) !important;
  border: 1px solid var(--border);
}

.btn-secondary:hover { border-color: var(--muted); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Hero */
.hero {
  padding: 4rem 0 3.5rem;
  background: linear-gradient(180deg, var(--soft-bg) 0%, var(--white) 100%);
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.85rem, 4vw, 2.65rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--primary);
  max-width: 18ch;
}

.hero-lead {
  font-size: 1.15rem;
  color: var(--text);
  max-width: 42rem;
  margin: 0;
}

.note {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 1rem;
}

/* Sections */
.section {
  padding: 3.25rem 0;
}

.section-alt {
  background: var(--soft-bg);
}

.section h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.4rem, 3vw, 1.75rem);
  color: var(--primary);
  letter-spacing: -0.02em;
}

.section-intro {
  margin: 0 0 1.75rem;
  max-width: 40rem;
  color: var(--text);
}

/* Cards */
.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  color: var(--primary);
}

.card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
}

.card ul {
  margin: 0.5rem 0 0;
  padding-left: 1.15rem;
  font-size: 0.95rem;
}

.card li { margin-bottom: 0.35rem; }

/* Lists */
.check-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.check-list li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 0.65rem;
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45rem;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--success);
  box-shadow: inset 0 0 0 2px var(--white), 0 0 0 1px var(--success);
}

/* CTA band */
.cta-band {
  background: var(--primary);
  color: #CBD5E1;
  padding: 3rem 0;
  text-align: center;
}

.cta-band h2 {
  color: var(--white);
  margin: 0 0 0.75rem;
}

.cta-band p {
  margin: 0 auto 1.5rem;
  max-width: 32rem;
}

.cta-band .note { color: #64748B; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

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

/* Page header (inner) */
.page-header {
  padding: 2.75rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--soft-bg);
}

.page-header h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  color: var(--primary);
  letter-spacing: -0.02em;
}

.page-header p {
  margin: 0;
  max-width: 40rem;
}

/* Product / content */
.prose {
  padding: 2.5rem 0 3.5rem;
}

.prose h2 {
  margin: 2.25rem 0 0.75rem;
  color: var(--primary);
  font-size: 1.35rem;
  letter-spacing: -0.01em;
}

.prose h3 {
  margin: 1.5rem 0 0.5rem;
  color: var(--primary);
  font-size: 1.1rem;
}

.prose p { margin: 0 0 1rem; }

.prose ul, .prose ol {
  margin: 0 0 1.25rem;
  padding-left: 1.25rem;
}

.prose li { margin-bottom: 0.4rem; }

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
  overflow-x: auto;
  display: block;
}

.prose th, .prose td {
  border: 1px solid var(--border);
  padding: 0.55rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

.prose th {
  background: var(--soft-bg);
  color: var(--primary);
  font-weight: 600;
}

.prose pre {
  background: var(--primary);
  color: #E2E8F0;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0 0 1.25rem;
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
}

.prose :not(pre) > code {
  background: var(--soft-bg);
  border: 1px solid var(--border);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  color: var(--primary);
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.prose blockquote {
  margin: 0 0 1.25rem;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--accent);
  background: var(--soft-bg);
  color: var(--text);
}

.prompt-box {
  background: var(--soft-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 0 0 1.5rem;
}

.prompt-box h3 {
  margin-top: 0;
}

.prompt-meta {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.75rem;
}

.draft-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  background: #FEF3C7;
  color: #92400E;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  margin-left: 0.35rem;
  vertical-align: middle;
}

/* Blog */
.blog-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.blog-list li {
  border-bottom: 1px solid var(--border);
  padding: 1.35rem 0;
}

.blog-list a.title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

.blog-list a.title:hover { color: var(--accent); }

.blog-list .excerpt {
  margin: 0.4rem 0 0;
  color: var(--text);
  font-size: 0.98rem;
}

.blog-list .meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

.article-body {
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.75;
}

.article-body h2,
.article-body h3 {
  font-family: var(--font);
}

.article-cta {
  margin-top: 2.5rem;
  padding: 1.5rem;
  background: var(--soft-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.article-cta h3 {
  margin: 0 0 0.5rem;
  font-family: var(--font);
  color: var(--primary);
}

.back-link {
  display: inline-block;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  font-family: var(--font);
}

.legal {
  font-size: 0.98rem;
}

.legal h2 { margin-top: 2rem; }

@media (max-width: 640px) {
  .hero { padding: 2.75rem 0 2.25rem; }
  .hero h1 { max-width: none; }
  .nav { gap: 0.75rem; }
  .nav-links { gap: 0.5rem 0.85rem; }
}

/* —— Site upgrade: mocks, prompts, positioning —— */

.problem-grid .problem-card h3 {
  font-size: 1rem;
}

.rail-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 0.5rem;
  counter-reset: rail;
  max-width: 40rem;
}

.rail-steps li {
  position: relative;
  padding: 0.85rem 0 0.85rem 3rem;
  border-bottom: 1px solid var(--border);
  counter-increment: rail;
}

.rail-steps li:last-child { border-bottom: none; }

.rail-steps li::before {
  content: counter(rail);
  position: absolute;
  left: 0;
  top: 0.75rem;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 8px;
  background: var(--accent);
  color: var(--white);
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Notion-like mocks */
.mock-stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.mock-board {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.mock-chrome {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  background: var(--soft-bg);
  border-bottom: 1px solid var(--border);
}

.mock-dots {
  width: 42px;
  height: 10px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 5px 5px, #F87171 4px, transparent 5px),
    radial-gradient(circle at 21px 5px, #FBBF24 4px, transparent 5px),
    radial-gradient(circle at 37px 5px, #34D399 4px, transparent 5px);
  flex-shrink: 0;
}

.mock-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary);
  letter-spacing: -0.01em;
}

.mock-view {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

.mock-table {
  display: block;
  overflow-x: auto;
}

.mock-tr {
  display: grid;
  grid-template-columns: minmax(140px, 1.4fr) minmax(90px, 0.7fr) minmax(140px, 1.2fr) minmax(100px, 0.8fr);
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  align-items: center;
}

.mock-tr:last-child { border-bottom: none; }

.mock-th {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: #F1F5F9;
}

.mock-muted { color: var(--muted); font-size: 0.85rem; }

.pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.pill-good {
  background: #D1FAE5;
  color: #065F46;
}

.pill-warn {
  background: #FEF3C7;
  color: #92400E;
}

.mock-kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 0.75rem;
  padding: 1rem;
  overflow-x: auto;
}

.mock-kanban-tight {
  grid-template-columns: repeat(4, minmax(140px, 1fr));
}

.mock-col h4 {
  margin: 0 0 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.mock-card-item {
  background: var(--soft-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
}

.mock-card-item strong {
  display: block;
  color: var(--primary);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.mock-meta {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.mock-card-won {
  border-color: #A7F3D0;
  background: #ECFDF5;
}

/* Expandable sample prompts */
.prompt-details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  background: var(--white);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.prompt-details summary {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.15rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--primary);
  list-style: none;
}

.prompt-details summary::-webkit-details-marker { display: none; }

.prompt-details summary::after {
  content: "+";
  margin-left: auto;
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1;
  flex-shrink: 0;
}

.prompt-details[open] summary::after { content: "−"; }

.prompt-details summary:hover {
  background: var(--soft-bg);
}

.prompt-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  height: 1.75rem;
  border-radius: 6px;
  background: var(--primary);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.prompt-summary-text {
  flex: 1;
  padding-top: 0.2rem;
  font-size: 0.98rem;
  line-height: 1.4;
}

.prompt-body {
  padding: 0 1.15rem 1.15rem;
  border-top: 1px solid var(--border);
}

.prompt-body pre {
  background: var(--primary);
  color: #E2E8F0;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.55;
  margin: 1rem 0 0.5rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.prompt-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.prompt-body .prompt-meta {
  margin: 0.5rem 0 0;
}

/* Positioning */
.positioning-card ul {
  margin-top: 0.75rem;
}

.x-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.x-list li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 0.65rem;
}

.x-list li::before {
  content: "×";
  position: absolute;
  left: 0.15rem;
  top: 0;
  color: var(--muted);
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.4;
}

.positioning-quote {
  margin: 2rem 0 0;
  padding: 1.25rem 1.5rem;
  border-left: 3px solid var(--accent);
  background: var(--white);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--primary);
  font-size: 1.05rem;
  max-width: 40rem;
}

.positioning-quote cite {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  font-style: normal;
  color: var(--muted);
}

/* Deliverables checklist on product page */
.deliverables {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

.deliverables li {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr;
  gap: 0.75rem 1.25rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.deliverables li:last-child { border-bottom: none; }

.deliverables .del-path {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  word-break: break-word;
}

.deliverables .del-desc {
  color: var(--text);
  margin: 0;
}

@media (max-width: 720px) {
  .mock-kanban,
  .mock-kanban-tight {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
  .deliverables li {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}

@media (max-width: 480px) {
  .mock-kanban,
  .mock-kanban-tight {
    grid-template-columns: 1fr;
  }
  .mock-tr {
    grid-template-columns: 1fr 1fr;
  }
  .mock-tr span:nth-child(3),
  .mock-tr span:nth-child(4) {
    grid-column: span 1;
  }
}
