/* BrainLLM — landing site
   Derived from the Wonder file "BrainLLM" (branch main).
   Hand-rolled rather than Tailwind-via-CDN: no runtime dependency, no flash of
   unstyled content, and the whole sheet is smaller than the CDN's bootstrap. */

:root {
  --bg: #0a0a0f;
  --bg-raised: #12121a;
  --bg-pill: #1a1a24;
  --text: #fafafa;
  --text-muted: #a1a1aa;
  --text-dim: #52525b;
  --text-soft: #d4d4d8;
  --accent: #f59e0b;
  --accent-glow: rgba(245, 158, 11, 0.3);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --max: 1160px;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
code, pre { font-family: var(--font-mono); }

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

/* ── Navigation ─────────────────────────────────────────────────────────── */

.nav {
  position: sticky; top: 0; z-index: 50;
  height: 72px; display: flex; align-items: center;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; gap: 24px; width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark { display: grid; grid-template-columns: repeat(3, 4px); gap: 3px; }
.brand-mark i { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); display: block; }
.brand-mark i.off { background: #3f3f46; }
.brand-name { font-family: var(--font-display); font-size: 19px; font-weight: 700; letter-spacing: -0.475px; }

.nav-links { display: flex; align-items: center; justify-content: center; flex: 1; gap: 36px; }
/* nowrap: a two-line "How it / works" in a 72px bar looks broken, and the
   links are hidden below 900px anyway — this stops the wrap in the band
   between the design width and that breakpoint. */
.nav-links a { color: var(--text-muted); font-size: 14px; white-space: nowrap; transition: color .15s; }
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); font-weight: 500; }
.nav-gh { display: inline-flex; align-items: center; gap: 6px; }
.nav-cta { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 600; border-radius: 11px;
  padding: 13px 22px; border: 1px solid transparent;
  cursor: pointer; transition: transform .12s, box-shadow .2s, background .2s;
}
.btn-sm { padding: 9px 16px; font-size: 14px; border-radius: 9px; }
.btn-primary { background: var(--accent); color: #0a0a0f; box-shadow: 0 0 40px var(--accent-glow); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 0 56px rgba(245,158,11,.42); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); font-weight: 500; }
.btn-ghost:hover { background: rgba(255,255,255,.04); }

/* ── Hero ───────────────────────────────────────────────────────────────── */

.hero {
  position: relative; text-align: center;
  padding: 88px 24px 64px;
  background-image: radial-gradient(circle at 50% 0%, rgba(245,158,11,.07) 0%, rgba(0,0,0,0) 60%);
}
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 10px; border-radius: 999px;
  background: rgba(26,26,36,.6); border: 1px solid rgba(255,255,255,.1);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .24px; color: var(--text-soft);
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px rgba(245,158,11,.8); }

h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(38px, 6.2vw, 64px); line-height: 1.04; letter-spacing: -0.03em;
  margin: 20px auto 0; max-width: 880px;
}
h1 .muted { color: var(--text-dim); }
h1 .accent { color: var(--accent); }

.lede { max-width: 620px; margin: 22px auto 0; color: var(--text-muted); font-size: 18px; line-height: 1.6; }
.hero-cta { display: flex; justify-content: center; gap: 14px; margin-top: 30px; flex-wrap: wrap; }

/* ── Sections ───────────────────────────────────────────────────────────── */

section { padding: 88px 0; }
.section-head { max-width: 720px; margin-bottom: 44px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.eyebrow { font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
h2 { font-family: var(--font-display); font-weight: 700; font-size: clamp(28px, 3.4vw, 40px); line-height: 1.12; letter-spacing: -0.025em; margin: 0; }
h3 { font-family: var(--font-display); font-weight: 600; font-size: 19px; line-height: 1.3; letter-spacing: -0.01em; margin: 0 0 8px; }
.section-head p { color: var(--text-muted); font-size: 17px; margin: 14px 0 0; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: 14px; padding: 26px;
}
.card p { color: var(--text-muted); font-size: 15px; margin: 0; }
.card .k { font-family: var(--font-mono); font-size: 12px; color: var(--accent); display: block; margin-bottom: 14px; }

.band { background: var(--bg-raised); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.principle { text-align: center; max-width: 820px; margin: 0 auto; }
.principle blockquote {
  font-family: var(--font-display); font-size: clamp(24px, 3.2vw, 34px); font-weight: 700;
  line-height: 1.25; letter-spacing: -0.02em; margin: 0; color: var(--text);
}
.principle blockquote .accent { color: var(--accent); }
.principle p { color: var(--text-muted); margin-top: 20px; font-size: 17px; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; text-align: center; }
.stat .n { font-family: var(--font-display); font-size: 42px; font-weight: 700; color: var(--accent); line-height: 1; letter-spacing: -0.02em; }
.stat .l { color: var(--text-muted); font-size: 14px; margin-top: 8px; }

/* code / terminal */
pre.term {
  background: #08080c; border: 1px solid var(--border); border-radius: 14px;
  padding: 22px; overflow-x: auto; font-size: 13.5px; line-height: 1.75; color: var(--text-soft); margin: 0;
}
pre.term .c { color: #6b7280; }
pre.term .a { color: var(--accent); }
pre.term .g { color: #4ade80; }

/* tree */
.tree { font-family: var(--font-mono); font-size: 13.5px; line-height: 1.9; color: var(--text-soft); }
.tree .area { color: var(--accent); }
.tree .note { color: var(--text-dim); }

/* lists */
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.checks li { display: flex; gap: 12px; color: var(--text-muted); font-size: 15px; }
.checks li::before { content: "✓"; color: var(--accent); font-weight: 700; flex-shrink: 0; }

/* pricing */
.price-card { display: flex; flex-direction: column; }
.price-card.featured { border-color: rgba(245,158,11,.4); box-shadow: 0 0 60px rgba(245,158,11,.08); }
.price { font-family: var(--font-display); font-size: 40px; font-weight: 700; letter-spacing: -0.02em; margin: 6px 0 2px; }
.price small { font-size: 15px; color: var(--text-muted); font-weight: 400; letter-spacing: 0; }
.price-card .btn { margin-top: auto; justify-content: center; }
.price-card ul { margin: 20px 0 24px; }

/* faq */
.faq { border-top: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); padding: 20px 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 17px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-weight: 400; font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq p { color: var(--text-muted); margin: 14px 0 0; font-size: 15.5px; max-width: 780px; }

/* docs */
.docs-layout { display: grid; grid-template-columns: 232px 1fr; gap: 56px; align-items: start; }
.docs-nav { position: sticky; top: 96px; }
.docs-nav strong { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-dim); margin: 22px 0 10px; font-family: var(--font-mono); }
.docs-nav strong:first-child { margin-top: 0; }
.docs-nav a { display: block; color: var(--text-muted); font-size: 14.5px; padding: 5px 0; }
.docs-nav a:hover { color: var(--accent); }
.docs-body h2 { margin-top: 8px; scroll-margin-top: 96px; }
.docs-body h3 { margin-top: 34px; scroll-margin-top: 96px; }
.docs-body p { color: var(--text-muted); }
.docs-body table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 14.5px; }
.docs-body th, .docs-body td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.docs-body th { color: var(--text); font-weight: 600; }
.docs-body td { color: var(--text-muted); }
.docs-body td code, .docs-body p code, li code { background: rgba(255,255,255,.06); padding: 2px 6px; border-radius: 5px; font-size: .9em; color: var(--text-soft); }

/* use cases */
.uc { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: center; padding: 44px 0; border-bottom: 1px solid var(--border); }
.uc:last-child { border-bottom: 0; }
.uc.flip > div:first-child { order: 2; }

/* cta */
.final { text-align: center; padding: 96px 24px; background-image: radial-gradient(circle at 50% 100%, rgba(245,158,11,.08) 0%, rgba(0,0,0,0) 62%); }
.final h2 { max-width: 720px; margin: 0 auto; }
.final p { color: var(--text-muted); max-width: 560px; margin: 18px auto 0; font-size: 17px; }

/* footer */
footer { border-top: 1px solid var(--border); padding: 48px 0 60px; }
.foot { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; align-items: flex-start; }
.foot p { color: var(--text-dim); font-size: 14px; margin: 12px 0 0; max-width: 380px; }
.foot-links { display: flex; gap: 56px; flex-wrap: wrap; }
.foot-links div strong { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-dim); margin-bottom: 12px; font-family: var(--font-mono); }
.foot-links a { display: block; color: var(--text-muted); font-size: 14.5px; padding: 4px 0; }
.foot-links a:hover { color: var(--accent); }

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 980px) {
  /* Hide the link row before it has room to wrap. The brand is the home
     affordance and the primary CTA stays, so nothing becomes unreachable —
     every page is one tap away from the footer's full link list. */
  .nav-links { display: none; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .docs-layout { grid-template-columns: 1fr; gap: 32px; }
  /* Stacked, the sidebar put twelve links and four group labels between the
     top of the page and the first word of documentation. Collapse it into a
     wrapped chip row instead: same destinations, one screen shorter. */
  .docs-nav { position: static; display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
  .docs-nav strong { display: none; }
  .docs-nav a {
    padding: 7px 13px; border: 1px solid var(--border); border-radius: 999px;
    font-size: 13.5px; color: var(--text-muted); background: var(--bg-raised);
  }
  .uc, .uc.flip > div:first-child { grid-template-columns: 1fr; order: 0; }
}
@media (max-width: 720px) {
  .grid-2, .grid-4 { grid-template-columns: 1fr; }
  section { padding: 60px 0; }
  .hero { padding-top: 60px; }
  .foot-links { gap: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
