/* Brainontic — Design System
   DM Serif Display (≥28px only) · DM Sans (everything <28px) */

:root {
  /* Warm system (decision D-BRAND-WARM, 2026-06-22). Token NAMES are
     historical; VALUES are the canonical warm palette — a mirror of
     cortex/brand_tokens.py, pinned equal by tests/test_brand_tokens_drift.py
     (a static .css cannot import the Python SSOT). --forest/--amber now hold
     terracotta (the sole accent); --dusk holds ink; --canvas/--parchment hold
     paper/surface. */
  --forest: #B26A3D;
  --grove: #8F5430;
  --canvas: #F4EFE6;
  --parchment: #FBF8F2;
  --linen: #D8D0C2;
  --stone: #8A8175;
  --amber: #B26A3D;
  --dusk: #2B2620;

  --max: 1200px;
  --gutter: clamp(20px, 4vw, 56px);

  --serif: "DM Serif Display", Georgia, serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;

  --t-fast: 180ms ease-out;
  --t-med: 280ms ease-out;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Warm-dark variant (ink ground, paper text, lightened terracotta). */
    --canvas: #2B2620;
    --parchment: #353029;
    --linen: #3D3833;
    --stone: #9A9080;
    --dusk: #F4EFE6;
    --forest: #C77F50;
    --grove: #D6925F;
    --amber: #C77F50;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--canvas);
  color: var(--dusk);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

a { color: var(--forest); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--grove); }

/* ---------- Type scale ---------- */
.display, .h1, .h2, .h3, .pull {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}
.display { font-size: clamp(44px, 7vw, 64px); line-height: 1.05; }
.h1      { font-size: clamp(36px, 5vw, 48px); line-height: 1.10; }
.h2      { font-size: clamp(28px, 3.6vw, 36px); line-height: 1.20; }
.h3      { font-size: 28px; line-height: 1.25; }
.pull    { font-size: clamp(26px, 3vw, 32px); line-height: 1.35; font-style: italic; }

.h4 { font-family: var(--sans); font-weight: 500; font-size: 20px; line-height: 1.30; margin: 0; }
.body-lg { font-size: 18px; line-height: 1.65; }
.body { font-size: 16px; line-height: 1.70; }
.body-sm { font-size: 14px; line-height: 1.65; }
.label { font-size: 13px; line-height: 1.40; font-weight: 500; }
.caption { font-size: 12px; line-height: 1.50; font-weight: 300; color: var(--stone); }
.overline {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--forest);
  margin: 0 0 16px 0;
}

p { margin: 0 0 1em 0; }
p:last-child { margin-bottom: 0; }

/* ---------- Layout ---------- */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
section { padding: clamp(64px, 9vw, 120px) 0; }
.divider { border: 0; height: 1px; background: var(--linen); margin: 0; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--canvas) 92%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--linen);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--gutter);
  max-width: var(--max);
  margin: 0 auto;
  gap: 24px;
}
.brand {
  font-family: var(--serif);
  font-size: 24px;
  color: var(--dusk);
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--dusk); }
/* ring-with-core logomark before every wordmark (nav + footer). CSS
   background so all .brand lockups get it without per-template markup;
   dark-mode swaps to a paper ring so it stays visible on the ink ground. */
.brand::before {
  content: "";
  display: inline-block;
  width: 1.05em;
  height: 1.05em;
  margin-right: 0.42em;
  vertical-align: -0.16em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 96'%3E%3Ccircle cx='48' cy='48' r='32' fill='none' stroke='%232B2620' stroke-width='7'/%3E%3Ccircle cx='48' cy='48' r='10' fill='%23B26A3D'/%3E%3C/svg%3E") no-repeat center / contain;
}
@media (prefers-color-scheme: dark) {
  .brand::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 96'%3E%3Ccircle cx='48' cy='48' r='32' fill='none' stroke='%23F4EFE6' stroke-width='7'/%3E%3Ccircle cx='48' cy='48' r='10' fill='%23C77F50'/%3E%3C/svg%3E");
  }
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.nav-links a {
  font-size: 14px;
  color: var(--dusk);
  font-weight: 500;
}
.nav-links a.is-active { color: var(--forest); }
.nav-links a:hover { color: var(--forest); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  padding: 14px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
  white-space: nowrap;
}
.btn-primary {
  background: var(--forest);
  color: var(--canvas);
}
.btn-primary:hover { background: var(--grove); color: var(--canvas); transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--dusk);
  border-color: var(--linen);
}
.btn-ghost:hover { border-color: var(--forest); color: var(--forest); }
.btn-arrow::after { content: "→"; display: inline-block; transition: transform var(--t-fast); }
.btn:hover .btn-arrow::after, a.btn:hover::after { transform: translateX(3px); }
.text-link {
  font-size: 14px;
  color: var(--stone);
  font-weight: 500;
}
.text-link:hover { color: var(--forest); }

/* ---------- Hero ---------- */
.hero {
  padding: clamp(80px, 12vw, 160px) 0 clamp(64px, 9vw, 120px);
}
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
.hero .display + .h1 { margin-top: 32px; }
.hero .body-lg {
  max-width: 60ch;
  color: color-mix(in oklab, var(--dusk) 80%, transparent);
  margin-top: 24px;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  margin-top: 36px;
}

/* ---------- Dot motif: BRAIN · ON · TIC ---------- */
.dotmark {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--stone);
}
.dotmark span + span::before {
  content: " · ";
  color: var(--stone);
  margin: 0 4px;
}

/* ---------- Two-col section ---------- */
.cols-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
}
@media (min-width: 880px) {
  .cols-2 { grid-template-columns: 1fr 1.4fr; }
}

/* ---------- Step flow ---------- */
.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: 56px;
  border-top: 1px solid var(--linen);
}
.step {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 28px;
  padding: 32px 0;
  border-bottom: 1px solid var(--linen);
  align-items: start;
}
.step-num {
  font-family: var(--serif);
  font-size: 36px;
  color: var(--forest);
  line-height: 1;
}
.step h3 { font-family: var(--sans); font-weight: 500; font-size: 20px; margin: 0 0 8px 0; }
.step p { color: color-mix(in oklab, var(--dusk) 75%, transparent); margin: 0; }
@media (min-width: 720px) {
  .step { grid-template-columns: 120px 1fr 1fr; gap: 48px; }
}

/* ---------- Pillars ---------- */
.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-top: 56px;
}
.pillar {
  background: var(--parchment);
  border: 1px solid var(--linen);
  padding: 32px 28px;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 240px;
  transition: border-color var(--t-fast), transform var(--t-fast);
}
.pillar:hover { border-color: var(--forest); transform: translateY(-2px); }
.pillar-name {
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1;
  color: var(--forest);
}
.pillar p { font-size: 15px; color: color-mix(in oklab, var(--dusk) 78%, transparent); margin: 0; }

/* ---------- Logos row (typographic only — no branded marks) ---------- */
.logos {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: var(--linen);
  border: 1px solid var(--linen);
  border-radius: 16px;
  overflow: hidden;
}
.logo-cell {
  background: var(--canvas);
  padding: 32px 16px;
  text-align: center;
  font-family: var(--serif);
  font-size: 22px;
  color: var(--dusk);
  letter-spacing: -0.01em;
}
.logo-cell small {
  display: block;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--stone);
  margin-top: 8px;
}

/* ---------- Personas ---------- */
.personas {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: 48px;
  border-top: 1px solid var(--linen);
}
.persona {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding: 36px 0;
  border-bottom: 1px solid var(--linen);
}
@media (min-width: 880px) {
  .persona { grid-template-columns: 280px 1fr 1fr; gap: 48px; }
}
.persona-meta { display: flex; flex-direction: column; gap: 6px; }
.persona-tag {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--amber);
}
.persona-name {
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1.15;
  color: var(--dusk);
}
.persona-block h4 {
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--stone);
  margin: 0 0 8px 0;
}
.persona-block p { font-size: 16px; color: color-mix(in oklab, var(--dusk) 82%, transparent); margin: 0; }

.not-for {
  margin-top: 56px;
  padding: 32px;
  background: var(--parchment);
  border: 1px solid var(--linen);
  border-radius: 18px;
}
.not-for h3 { font-family: var(--sans); font-weight: 500; font-size: 18px; margin: 0 0 16px 0; }
.not-for ul { margin: 0; padding-left: 18px; color: color-mix(in oklab, var(--dusk) 75%, transparent); }
.not-for li { margin-bottom: 6px; font-size: 15px; }

/* ---------- Closing CTA ---------- */
.closing {
  background: var(--forest);
  color: var(--canvas);
  text-align: center;
  padding: clamp(80px, 12vw, 140px) var(--gutter);
}
.closing .pull { color: var(--canvas); max-width: 22ch; margin: 0 auto 32px; }
.closing .btn-primary { background: var(--canvas); color: var(--forest); }
.closing .btn-primary:hover { background: var(--parchment); color: var(--forest); }
.closing .dotmark { color: color-mix(in oklab, var(--canvas) 60%, transparent); margin-bottom: 24px; }

/* ---------- Footer ---------- */
.footer {
  padding: 48px var(--gutter);
  background: var(--canvas);
  border-top: 1px solid var(--linen);
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
}
.footer .brand { font-size: 20px; }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a { font-size: 13px; color: var(--stone); font-weight: 500; }
.footer-links a:hover { color: var(--forest); }
.footer .caption { margin: 0; }

/* ---------- Pricing ---------- */
.pricing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 56px;
}
/* 2-up on tablets, then all four tiers side by side in one desktop row. */
@media (min-width: 640px) {
  .pricing-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1080px) {
  .pricing-grid { grid-template-columns: repeat(4, 1fr); gap: 18px; }
}
.price-card {
  background: var(--parchment);
  border: 1px solid var(--linen);
  border-radius: 22px;
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: relative;
  transition: border-color var(--t-med), transform var(--t-med);
}
.price-card:hover { border-color: var(--forest); transform: translateY(-3px); }
.price-card.featured {
  background: var(--canvas);
  border: 1.5px solid var(--forest);
}
.price-card.featured .price-tag-amount { color: var(--forest); }
.price-badge {
  position: absolute;
  top: -12px;
  right: 24px;
  background: var(--amber);
  color: var(--dusk);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
}
.price-tier-name {
  font-family: var(--serif);
  font-size: 32px;
  line-height: 1;
  color: var(--dusk);
}
.price-tag {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.price-tag-amount {
  font-family: var(--serif);
  font-size: 48px;
  line-height: 1;
  color: var(--dusk);
}
.price-tag-unit { font-size: 14px; color: var(--stone); }
.price-best-for {
  font-size: 14px;
  color: var(--stone);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--linen);
}
.price-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-grow: 1;
}
.price-features li {
  font-size: 15px;
  color: color-mix(in oklab, var(--dusk) 80%, transparent);
  padding-left: 22px;
  position: relative;
  line-height: 1.45;
}
.price-features li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--forest);
}
.price-card .btn { width: 100%; justify-content: center; margin-top: 8px; }

/* 4-up density — keep all four cards comfortable in a single desktop row. */
@media (min-width: 1080px) {
  .price-card { padding: 30px 26px; gap: 20px; }
  .price-tier-name { font-size: 28px; }
  .price-tag-amount { font-size: 40px; }
}

/* ---------- FAQ ---------- */
.faq {
  margin-top: 80px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid var(--linen);
}
.faq-item {
  border-bottom: 1px solid var(--linen);
  padding: 0;
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 28px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 500;
  color: var(--dusk);
  transition: color var(--t-fast);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-family: var(--serif);
  font-size: 28px;
  color: var(--forest);
  transition: transform var(--t-med);
  line-height: 1;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item summary:hover { color: var(--forest); }
.faq-item .faq-body {
  padding: 0 0 28px 0;
  font-size: 16px;
  color: color-mix(in oklab, var(--dusk) 78%, transparent);
  max-width: 70ch;
}

/* ---------- Use-case cards (how it works) ---------- */
.usecases {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 48px;
}
@media (min-width: 880px) {
  .usecases { grid-template-columns: 1fr 1fr; }
}
.usecase {
  background: var(--parchment);
  border: 1px solid var(--linen);
  border-radius: 22px;
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.usecase-flow {
  font-family: "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  color: var(--forest);
  letter-spacing: 0.04em;
  background: var(--canvas);
  border: 1px solid var(--linen);
  padding: 16px 20px;
  border-radius: 12px;
  line-height: 1.8;
}
.usecase h3 {
  font-family: var(--serif);
  font-size: 28px;
  margin: 0;
  color: var(--dusk);
}

.callout {
  margin-top: 64px;
  padding: 32px;
  background: var(--canvas);
  border: 1px solid var(--linen);
  border-left: 3px solid var(--amber);
  border-radius: 8px;
}
.callout p { margin: 0; font-size: 17px; max-width: 70ch; }
.callout .overline { color: var(--amber); }

/* ---------- Manifest (long-form essay) ---------- */
.essay {
  max-width: 680px;
  margin: 0 auto;
  padding: clamp(64px, 10vw, 140px) var(--gutter);
}
.essay .dotmark { display: block; text-align: center; margin-bottom: 40px; }
.essay h1.display { text-align: center; margin-bottom: 16px; }
.essay .essay-lead {
  text-align: center;
  font-size: 18px;
  color: var(--stone);
  margin-bottom: 80px;
}
.essay h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 32px;
  line-height: 1.2;
  color: var(--dusk);
  margin: 80px 0 24px 0;
  text-wrap: balance;
}
.essay p {
  font-size: 18px;
  line-height: 1.75;
  color: color-mix(in oklab, var(--dusk) 88%, transparent);
  margin: 0 0 1.2em 0;
}
.essay .pull {
  margin: 56px 0;
  padding: 0 0 0 28px;
  border-left: 3px solid var(--forest);
  color: var(--forest);
}
.essay .essay-end {
  text-align: center;
  margin-top: 100px;
  padding-top: 64px;
  border-top: 1px solid var(--linen);
}
.essay .essay-end .pull {
  border: 0;
  padding: 0;
  color: var(--dusk);
  margin: 0 0 32px 0;
  text-align: center;
}

/* ---------- Utility ---------- */
.muted { color: color-mix(in oklab, var(--dusk) 70%, transparent); }
.center { text-align: center; }
.mt-sm { margin-top: 16px; }
.mt-md { margin-top: 32px; }
.mt-lg { margin-top: 56px; }

@media (max-width: 640px) {
  .nav-links { gap: 16px; }
  .nav-links li.nav-hide-sm { display: none; }
}
