/* ==========================================================================
   Cortex Buddy — marketing site
   Shared stylesheet. Design tokens lifted from the app's Driftwood palette
   and the approved pricing mock (docs/design/pricing/pricing-mock-draft-one.html).

   Rules that are load-bearing here:
   - min font size 12px, everywhere (feedback_min_font_size)
   - no emojis anywhere (feedback_no_emojis_anywhere) — mono-caps labels only
   - three-font system: Roboto Slab display, Roboto Mono labels, IBM Plex Sans body
   - both themes: prefers-color-scheme default + [data-theme] override
   ========================================================================== */

:root {
  --bg: #f6f4ef;
  --surface: #fffdf9;
  --surface-2: #fbf9f3;
  --ink: #24303f;
  --ink-soft: #5b6878;
  --ink-faint: #8a94a3;
  --line: #e2ddd2;
  --mustang: #2563eb;   /* cortex / headers */
  --signal: #3aa6fe;    /* buddy / interactive */
  --tan: #b9a887;
  --meter-track: #e8e3d8;
  --good: #18a05c;
  --shadow: 0 1px 2px rgba(36,48,63,.05), 0 8px 28px rgba(36,48,63,.07);
  --shadow-lg: 0 2px 6px rgba(36,48,63,.06), 0 24px 60px rgba(36,48,63,.10);

  --font-display: 'Roboto Slab', Georgia, serif;
  --font-label: 'Roboto Mono', ui-monospace, monospace;
  --font-body: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --font-logo-cortex: 'Bitcount Single Ink', var(--font-body);
  --font-logo-buddy: 'Beth Ellen', cursive;

  --maxw: 1080px;
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101720; --surface: #18212d; --surface-2: #141c26;
    --ink: #e8ecf2; --ink-soft: #9aa7b8; --ink-faint: #6c7a8c;
    --line: #2a3646; --mustang: #6ba2ff; --signal: #3aa6fe;
    --tan: #8d7f66; --meter-track: #223041; --good: #18c062;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 28px rgba(0,0,0,.35);
    --shadow-lg: 0 2px 6px rgba(0,0,0,.35), 0 24px 60px rgba(0,0,0,.45);
  }
}
:root[data-theme="dark"] {
  --bg: #101720; --surface: #18212d; --surface-2: #141c26;
  --ink: #e8ecf2; --ink-soft: #9aa7b8; --ink-faint: #6c7a8c;
  --line: #2a3646; --mustang: #6ba2ff; --signal: #3aa6fe;
  --tan: #8d7f66; --meter-track: #223041; --good: #18c062;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 28px rgba(0,0,0,.35);
  --shadow-lg: 0 2px 6px rgba(0,0,0,.35), 0 24px 60px rgba(0,0,0,.45);
}
:root[data-theme="light"] {
  --bg: #f6f4ef; --surface: #fffdf9; --surface-2: #fbf9f3;
  --ink: #24303f; --ink-soft: #5b6878; --ink-faint: #8a94a3;
  --line: #e2ddd2; --mustang: #2563eb; --signal: #3aa6fe;
  --tan: #b9a887; --meter-track: #e8e3d8; --good: #18a05c;
  --shadow: 0 1px 2px rgba(36,48,63,.05), 0 8px 28px rgba(36,48,63,.07);
  --shadow-lg: 0 2px 6px rgba(36,48,63,.06), 0 24px 60px rgba(36,48,63,.10);
}

/* ---------- reset / base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { overflow-x: hidden; overscroll-behavior-x: none; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--signal); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: .025em;
  text-wrap: balance;
  margin: 0;
  color: var(--ink);
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.section { padding: 72px 0; }
@media (max-width: 720px) { .section { padding: 52px 0; } }

.eyebrow {
  font-family: var(--font-label);
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-soft);
}
.eyebrow.accent { color: var(--mustang); }

/* ---------- wordmark ---------- */
.wordmark { display: inline-flex; align-items: baseline; line-height: 1; white-space: nowrap; }
.wordmark .cx {
  font-family: var(--font-logo-cortex); color: var(--mustang);
  font-weight: 400; font-size: 1em; line-height: 1;
}
.wordmark .bd {
  font-family: var(--font-logo-buddy); color: var(--signal);
  font-size: .78em; margin-left: .15em; line-height: 1;
}

/* ---------- top nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 18px;
}
.nav .wordmark { font-size: 22px; }
.nav-spacer { flex: 1; }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-link {
  font-family: var(--font-label); font-size: 12px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-soft);
}
.nav-link:hover { color: var(--ink); text-decoration: none; }
@media (max-width: 560px) {
  .nav-links { gap: 14px; }
  .nav-link.hide-sm { display: none; }
}

/* theme toggle — pill track + sliding thumb, no emoji */
.theme-toggle {
  appearance: none; border: 1px solid var(--line); background: var(--surface);
  width: 44px; height: 24px; border-radius: 100px; position: relative;
  cursor: pointer; flex-shrink: 0; padding: 0; transition: background .2s, border-color .2s;
}
.theme-toggle::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--signal); transition: transform .2s cubic-bezier(.4,0,.2,1);
}
:root[data-theme="dark"] .theme-toggle::after { transform: translateX(20px); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle::after { transform: translateX(20px); }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-label); font-size: 13px; letter-spacing: .06em;
  text-transform: uppercase; font-weight: 500;
  padding: 12px 22px; border-radius: 10px; border: 1px solid transparent;
  cursor: pointer; transition: background .18s, color .18s, border-color .18s, transform .18s;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--signal); color: #fff; border-color: var(--signal); }
.btn-primary:hover { background: color-mix(in srgb, var(--signal) 88%, #000); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink-soft); }
.btn-sm { padding: 8px 16px; font-size: 12px; }

/* ---------- hero ---------- */
.hero { padding: 96px 0 64px; position: relative; overflow: hidden; }
@media (max-width: 720px) { .hero { padding: 60px 0 44px; } }
.hero-glow {
  position: absolute; inset: -20% 30% auto -10%; height: 460px;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--signal) 22%, transparent), transparent);
  filter: blur(30px); pointer-events: none; z-index: 0;
}
.hero .wrap { position: relative; z-index: 1; }
.hero h1 {
  font-size: clamp(34px, 6vw, 60px); line-height: 1.05; margin: 16px 0 20px;
  max-width: 18ch;
}
.hero .lede {
  font-size: clamp(17px, 2.4vw, 21px); color: var(--ink-soft);
  max-width: 56ch; margin: 0 0 32px;
}
.hero .lede strong { color: var(--ink); font-weight: 600; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-note {
  margin-top: 18px; font-family: var(--font-label); font-size: 12px;
  letter-spacing: .06em; color: var(--ink-faint); text-transform: uppercase;
}

/* ---------- generic section head ---------- */
.section-head { max-width: 62ch; margin-bottom: 36px; }
.section-head h2 { font-size: clamp(24px, 3.6vw, 34px); margin: 8px 0 12px; }
.section-head p { color: var(--ink-soft); font-size: 17px; margin: 0; }

/* ---------- pillars grid ---------- */
.pillars { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 720px) { .pillars { grid-template-columns: 1fr; } }
.pillar {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px 24px 26px; box-shadow: var(--shadow);
}
.pillar h3 { font-size: 19px; margin: 12px 0 8px; }
.pillar p { color: var(--ink-soft); font-size: 15px; margin: 0; }
.pillar .glyph {
  width: 34px; height: 34px; border-radius: 9px;
  border: 1px solid var(--line); display: grid; place-items: center;
  color: var(--mustang);
}
.pillar .glyph svg { width: 18px; height: 18px; }

/* ---------- feature band (works with your AI tools) ---------- */
.band {
  background: var(--surface); border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.band-grid {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center;
}
@media (max-width: 820px) { .band-grid { grid-template-columns: 1fr; gap: 28px; } }
.band-grid h2 { font-size: clamp(24px, 3.6vw, 32px); margin: 10px 0 14px; }
.band-grid p { color: var(--ink-soft); font-size: 16px; margin: 0 0 14px; }
.tool-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tool-chip {
  font-family: var(--font-label); font-size: 12px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 100px; padding: 7px 14px;
}
/* wiring diagram card */
.wire {
  background: var(--surface-2); border: 1px solid var(--line);
  border-left: 3px solid var(--mustang); border-radius: var(--radius);
  padding: 22px 24px;
}
.wire-row { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
.wire-row:last-child { margin-bottom: 0; }
.wire-node {
  font-family: var(--font-label); font-size: 12px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px;
  background: var(--surface); white-space: nowrap;
}
.wire-arrow { color: var(--ink-faint); font-family: var(--font-label); font-size: 15px; }
.wire-caption { font-size: 14px; color: var(--ink-soft); margin: 4px 0 0; }

/* ---------- privacy story ---------- */
.privacy .section-head h2 { color: var(--ink); }
.privacy-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 8px; }
@media (max-width: 820px) { .privacy-list { grid-template-columns: 1fr; } }
.privacy-item {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 22px 24px;
}
.privacy-item .kicker {
  font-family: var(--font-label); font-size: 12px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--mustang); display: block; margin-bottom: 10px;
}
.privacy-item h3 { font-size: 17px; margin: 0 0 8px; }
.privacy-item p { color: var(--ink-soft); font-size: 15px; margin: 0; }

/* ---------- pricing teaser (landing) ---------- */
.teaser { text-align: center; }
.teaser .families { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 32px 0 28px; text-align: left; }
@media (max-width: 720px) { .teaser .families { grid-template-columns: 1fr; } }
.family-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.family-card h3 { font-size: 20px; margin: 8px 0 8px; }
.family-card p { color: var(--ink-soft); font-size: 15px; margin: 0 0 14px; }
.family-card .from {
  font-family: var(--font-label); font-size: 12px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-faint);
}
.family-card .from b { color: var(--ink); font-weight: 600; }

/* ==========================================================================
   PRICING PAGE — carried over from the approved mock, with the 12px font
   floor enforced (mock used 11–11.5px labels; bumped to 12px here).
   ========================================================================== */

.price-hero { padding: 56px 0 8px; }
.price-hero h1 { font-size: clamp(28px, 5vw, 44px); margin: 8px 0 14px; }
.rule-line { font-size: 18px; color: var(--ink-soft); max-width: 62ch; margin: 0; }
.rule-line strong { color: var(--mustang); font-weight: 600; }

.mcp-banner {
  background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--mustang); border-radius: 8px;
  padding: 16px 20px; margin: 30px 0 0;
}
.mcp-banner p { margin: 6px 0 0; font-size: 15px; color: var(--ink-soft); max-width: 82ch; }

.taxonomy { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 30px 0 8px; }
@media (max-width: 720px) { .taxonomy { grid-template-columns: 1fr; } }
.tax-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 18px 20px;
}
.tax-card .eyebrow { color: var(--mustang); }
.tax-card p { margin: 8px 0 0; font-size: 15px; color: var(--ink-soft); }
.tax-card .who {
  margin-top: 12px; font-family: var(--font-label); font-size: 12px;
  letter-spacing: .06em; color: var(--ink);
  border-top: 1px solid var(--line); padding-top: 10px;
}

.sheet { padding: 56px 0 0; }
.sheet-head { margin-bottom: 24px; max-width: 72ch; }
.sheet-head h2 { font-size: clamp(23px, 3.4vw, 31px); margin: 4px 0 10px; }
.sheet-head p { color: var(--ink-soft); margin: 0; font-size: 16px; }

.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: stretch; }
@media (max-width: 860px) { .tiers { grid-template-columns: 1fr; } }
.tier {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px 24px 24px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; position: relative;
}
.tier.featured { border-color: var(--signal); box-shadow: var(--shadow-lg); }
.tier .tag {
  position: absolute; top: -11px; left: 22px;
  font-family: var(--font-label); font-size: 12px; letter-spacing: .1em;
  background: var(--signal); color: #fff; padding: 3px 10px; border-radius: 4px;
}
.tier h3 { font-size: 21px; }
.tier h3 .qual {
  font-family: var(--font-label); font-size: 12px; letter-spacing: .06em;
  color: var(--ink-soft); font-weight: 400;
}
.price { margin: 10px 0 2px; display: flex; align-items: baseline; gap: 7px; }
.price .amount {
  font-family: var(--font-display); font-size: 36px; font-weight: 500;
  font-variant-numeric: tabular-nums; color: var(--ink);
}
.price .per { font-size: 13.5px; color: var(--ink-soft); }
.annual { font-size: 13px; color: var(--ink-soft); margin-bottom: 16px; }
.tier ul { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 11px; }
.tier li { font-size: 15px; padding-left: 20px; position: relative; color: var(--ink); }
.tier li::before {
  content: ""; position: absolute; left: 2px; top: 9px;
  width: 8px; height: 8px; border-radius: 2px; background: var(--tan);
}
.tier li strong { font-weight: 600; }
.tier li.plus::before { background: var(--signal); }
.plus-note {
  font-family: var(--font-label); font-size: 12px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-soft);
  margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px;
}

.callout {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 24px; margin-top: 26px;
}
.callout h3 { font-size: 17px; margin-bottom: 4px; }
.callout p { font-size: 15px; color: var(--ink-soft); margin: 6px 0 0; max-width: 74ch; }
.callout p.fine { font-size: 13px; }

.free-house {
  background: var(--surface); border: 1px dashed var(--tan);
  border-radius: var(--radius); padding: 18px 22px; margin-bottom: 18px;
}
.free-house p { font-size: 15px; color: var(--ink-soft); margin: 6px 0 0; max-width: 82ch; }

/* meter demo */
.meter-demo {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 24px; margin-top: 26px;
}
.meter-demo h3 { font-size: 17px; margin-bottom: 4px; }
.meter-demo p { font-size: 15px; color: var(--ink-soft); margin: 6px 0 16px; max-width: 72ch; }
.meter-row { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.meter-label {
  font-family: var(--font-label); font-size: 12px; letter-spacing: .08em;
  width: 200px; flex-shrink: 0; color: var(--ink);
}
@media (max-width: 560px) { .meter-label { width: 130px; } }
.meter-track { flex: 1; height: 10px; background: var(--meter-track); border-radius: 5px; overflow: hidden; }
.meter-fill { height: 100%; border-radius: 5px; background: var(--signal); }
.meter-fill.low { background: var(--good); }
.meter-pct {
  font-family: var(--font-label); font-size: 12px; width: 44px; text-align: right;
  color: var(--ink-soft); font-variant-numeric: tabular-nums;
}

/* modes legend */
.modes-legend {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 16px 20px; margin-top: 14px;
}
.modes-legend dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 10px 0 0; }
@media (max-width: 560px) { .modes-legend dl { grid-template-columns: 1fr; gap: 2px 0; } }
.modes-legend dt {
  font-family: var(--font-label); font-size: 12px; letter-spacing: .1em;
  color: var(--ink); padding-top: 2px;
}
.modes-legend dd { margin: 0 0 6px; font-size: 15px; color: var(--ink-soft); }

/* cables */
.cables { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 24px; }
@media (max-width: 860px) { .cables { grid-template-columns: 1fr; } }
.cable {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 18px 20px;
}
.cable .eyebrow { color: var(--mustang); }
.cable h3 { font-size: 17px; margin: 8px 0 0; }
.cable p { font-size: 15px; color: var(--ink-soft); margin: 8px 0 0; }
.cable .sheet-ref {
  margin-top: 12px; font-family: var(--font-label); font-size: 12px;
  letter-spacing: .08em; color: var(--ink);
}

/* ---------- beta capture ---------- */
.beta {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 40px 32px; text-align: center; box-shadow: var(--shadow-lg);
}
.beta h2 { font-size: clamp(24px, 3.6vw, 34px); margin: 0 0 10px; }
.beta p { color: var(--ink-soft); font-size: 17px; margin: 0 auto 24px; max-width: 52ch; }
.beta-form {
  display: flex; gap: 10px; max-width: 480px; margin: 0 auto; flex-wrap: wrap;
  justify-content: center;
}
.beta-form input[type="email"] {
  flex: 1 1 240px; min-width: 0; font-family: var(--font-body); font-size: 16px;
  padding: 13px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink);
}
.beta-form input[type="email"]:focus {
  outline: none; border-color: var(--signal);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal) 22%, transparent);
}
.beta-msg {
  margin-top: 16px; font-family: var(--font-label); font-size: 13px;
  letter-spacing: .04em; min-height: 18px;
}
.beta-msg.ok { color: var(--good); }
.beta-msg.err { color: #d1435b; }
.beta-fine {
  margin-top: 14px; font-family: var(--font-label); font-size: 12px;
  letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint);
}

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--line); margin-top: 8px;
  padding: 40px 0 56px; color: var(--ink-soft);
}
.footer-inner { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; }
.footer .wordmark { font-size: 20px; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: var(--ink-soft); font-family: var(--font-label); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.footer-links a:hover { color: var(--ink); }
.footer-legal {
  width: 100%; font-size: 13px; color: var(--ink-faint);
  border-top: 1px solid var(--line); padding-top: 20px; margin-top: 8px;
}
.footer-legal p { margin: 0 0 6px; max-width: 80ch; }

/* draft ribbon — internal honesty marker; keep until pricing leaves draft */
.draft-note {
  font-family: var(--font-label); font-size: 12px; letter-spacing: .06em;
  color: var(--ink-faint); border: 1px dashed var(--tan);
  border-radius: 6px; padding: 10px 14px; margin-top: 24px; max-width: 80ch;
}

/* utilities */
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.stack-lg > * + * { margin-top: 18px; }
