/* ═══════════════════════════════════════════════════════════════
   LEARNIX PUBLIC SITE (Nov 2026)
   Shared by the landing page, /ai, /apcsa, the comparison pages,
   /contact, the legal pages and 404. White, calm, one accent.

   Same fonts as the app: Space Grotesk headings, Inter body,
   JetBrains Mono code. Accent is the app's amber-700.
   Radius rule: controls 10px, boxes 14px, chips are pills.
   Printing a legal page: css/legal-print.css.
   ═══════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #ffffff;
  --bg-soft: #f7f6f4;
  --text: #1c1917;
  --text-2: #44403c;
  --text-3: #6b6560;
  --line: #e7e5e4;
  --line-2: #d6d3d1;
  --border: #8b8580;            /* form fields: 3:1+ on white */
  --ink: #1c1917;
  --ink-hover: #3a3532;
  --accent: #b45309;            /* amber-700, same as the app (5:1 on white) */
  --accent-hover: #92400e;
  --accent-soft: #fdf4e8;
  --r-ctl: 10px;
  --r-box: 14px;
  --shadow: 0 1px 2px rgba(28,25,23,.05), 0 22px 44px -22px rgba(28,25,23,.28);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', monospace;
  --wrap: 1600px;                               /* widest the content gets */
  --gutter: clamp(16px, 4.5vw, 96px);           /* side space, grows with the screen; the navbar uses it too */
  color-scheme: light;
}
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font); font-size: 16px; line-height: 1.6;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; }
[hidden] { display: none !important; }
.wrap { max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 880px; }
main section[id] { scroll-margin-top: 80px; }
#nav-sentinel { position: absolute; top: 0; left: 0; width: 1px; height: 1px; pointer-events: none; }

/* ── Buttons ── */
.btn-hero, .btn-hero-ghost, .btn-nav-login, .btn-nav-signup, .btn-primary, .btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 .95rem/1 var(--font); border-radius: var(--r-ctl); cursor: pointer;
  text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s, transform .1s;
}
.btn-hero, .btn-primary { height: 48px; padding: 0 22px; background: var(--ink); color: #fff; border: 1px solid var(--ink); }
.btn-hero:hover, .btn-primary:hover { background: var(--ink-hover); border-color: var(--ink-hover); }
.btn-hero-ghost, .btn-secondary { height: 48px; padding: 0 22px; background: #fff; color: var(--text); border: 1px solid var(--line-2); }
.btn-hero-ghost:hover, .btn-secondary:hover { border-color: var(--text-3); }
.btn-nav-login { height: 38px; padding: 0 14px; background: transparent; color: var(--text-2); border: 0; font-size: .92rem; font-weight: 500; }
.btn-nav-login:hover { color: var(--text); }
.btn-nav-signup { height: 38px; padding: 0 16px; background: var(--ink); color: #fff; border: 1px solid var(--ink); font-size: .9rem; }
.btn-nav-signup:hover { background: var(--ink-hover); border-color: var(--ink-hover); }
.btn-hero:active, .btn-hero-ghost:active, .btn-primary:active, .btn-secondary:active, .btn-nav-signup:active { transform: translateY(1px); }
.btn-primary:disabled, .btn-secondary:disabled { opacity: .55; cursor: not-allowed; }
.text-link { color: var(--accent); font-weight: 600; text-decoration: none; }
.text-link:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }

/* ── Navbar ── */
.navbar {
  position: sticky; top: 0; z-index: 50; height: 64px;
  display: flex; align-items: center; gap: 28px;
  padding: 0 var(--gutter);                      /* logo and buttons sit at the window edges */
  background: rgba(255,255,255,.88);
  -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.navbar.scrolled, .navbar.ruled { border-bottom-color: var(--line); }
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.nav-logo { width: 28px; height: 28px; }
.nav-brand-name { font-family: var(--display); font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; }
.nav-links { display: flex; gap: 2px; }
.nav-link { padding: 8px 12px; border-radius: 8px; font-size: .92rem; font-weight: 500; color: var(--text-2); text-decoration: none; }
.nav-link:hover { color: var(--text); background: var(--bg-soft); }
.nav-link[aria-current="page"] { color: var(--text); background: var(--bg-soft); }
.nav-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
/* Signed in (js/site.js sets data-auth): swap Log in / Get started for the dashboard. */
html[data-auth="in"] .nav-guest { display: none; }
html:not([data-auth="in"]) .nav-user { display: none; }

/* ── Sections ── */
.sec { padding: 112px 0; }
.sec-tight { padding: 80px 0; }
.sec-soft { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sec-head { max-width: 46rem; margin-bottom: 56px; }
.h1 { font-family: var(--display); font-weight: 600; color: var(--text); font-size: clamp(2.3rem, 4.4vw, 3.4rem); line-height: 1.06; letter-spacing: -.035em; max-width: 21ch; }
.h2 { font-family: var(--display); font-weight: 600; font-size: clamp(1.9rem, 3.3vw, 2.65rem); line-height: 1.1; letter-spacing: -.03em; color: var(--text); }
.h3 { font-family: var(--display); font-weight: 600; font-size: 1.2rem; letter-spacing: -.015em; line-height: 1.3; color: var(--text); }
.h1, .h2, .page-title { text-wrap: balance; }
.h1 sup, .h2 sup, .h3 sup, .page-title sup { font-size: .42em; line-height: 0; vertical-align: super; margin-left: .04em; }
.lead { margin-top: 16px; font-size: 1.08rem; color: var(--text-2); max-width: 40rem; }
.label { display: block; font-size: .88rem; font-weight: 600; color: var(--accent); margin-bottom: 12px; }

/* Page header for inner pages */
.page-head { padding: 64px 0 56px; border-bottom: 1px solid var(--line); }
.page-head .lead { margin-top: 18px; font-size: 1.12rem; max-width: 44rem; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: .88rem; color: var(--text-3); margin-bottom: 18px; }
.crumbs a { color: var(--text-3); text-decoration: none; }
.crumbs a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.page-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

/* Feature grid: plain text blocks on a hairline, no cards */
.feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 56px; }
.feature-grid > div { padding-top: 20px; border-top: 1px solid var(--line-2); }
.feature-grid h3 { font-family: var(--display); font-size: 1.15rem; font-weight: 600; letter-spacing: -.01em; margin-bottom: 6px; }
.feature-grid p { color: var(--text-2); }
.feature-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Side-by-side comparison table */
.vs-wrap { overflow-x: auto; }
.vs-table { width: 100%; border-collapse: collapse; font-size: .97rem; min-width: 560px; }
.vs-table th, .vs-table td { text-align: left; vertical-align: top; padding: 16px 20px 16px 0; border-bottom: 1px solid var(--line); }
.vs-table thead th { font-size: .88rem; font-weight: 600; color: var(--text-3); border-bottom-color: var(--line-2); padding-top: 0; }
.vs-table thead th.us { color: var(--text); }
.vs-table td:first-child { width: 24%; font-weight: 600; color: var(--text); }
.vs-table td.us { color: var(--text); }
.vs-table td.them { color: var(--text-2); }

/* FAQ */
.faq-grid { display: grid; grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr); gap: 64px; align-items: start; }
.faq-side p { margin-top: 14px; color: var(--text-2); }
.faq-list { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary { list-style: none; cursor: pointer; padding: 20px 0; font-weight: 600; font-size: 1.02rem; display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: ''; flex-shrink: 0; width: 10px; height: 10px; margin-top: 6px; border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3); transform: rotate(45deg); transition: transform .2s; }
.faq-item[open] summary::after { transform: rotate(-135deg); margin-top: 10px; }
.faq-item summary:hover { color: var(--accent); }
.faq-body { padding: 0 0 22px; color: var(--text-2); font-size: .98rem; max-width: 62ch; }
.faq-body a { color: var(--accent); font-weight: 600; }

/* Closing call to action */
.final { padding: 96px 0; background: var(--bg-soft); border-top: 1px solid var(--line); }
.final-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.final .lead { margin-top: 10px; }
.cta-btns { display: flex; gap: 12px; flex-wrap: wrap; }

/* Example panel (code + Learnix AI reply, or a sample question) */
.ai-demo { border: 1px solid var(--line); border-radius: var(--r-box); background: #fff; box-shadow: var(--shadow); overflow: hidden; }
.ai-file { display: flex; justify-content: space-between; gap: 12px; font: .76rem var(--mono); color: var(--text-3); padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--bg-soft); }
.ai-file span + span { font-family: var(--font); font-weight: 600; color: var(--accent); }
.ai-demo pre { font: .82rem/1.75 var(--mono); padding: 14px 16px; color: var(--text); overflow-x: auto; }
.ai-demo pre .k { color: #1d4ed8; }
.ai-demo .hl { background: #fde4e4; border-radius: 3px; box-shadow: 0 0 0 2px #fde4e4; }
.ai-err { font: .76rem/1.5 var(--mono); color: #b91c1c; background: #fef2f2; border-top: 1px solid #fecaca; padding: 10px 16px; }
.ai-reply { padding: 18px 16px 6px; }
.ai-who { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .86rem; margin-bottom: 6px; }
.ai-who img { width: 20px; height: 20px; }
.ai-reply p { font-size: .95rem; color: var(--text-2); }
.ai-reply code { font: .84em var(--mono); background: var(--bg-soft); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; color: var(--text); }
.ai-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px 18px; }
.ai-chips span { font-size: .8rem; border: 1px solid var(--line-2); border-radius: 999px; padding: 5px 12px; color: var(--text-2); }
.ai-chips span:first-child { border-color: var(--text-3); color: var(--text); }

/* Split page hero (copy left, example right) */
.hero-split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 64px; align-items: center; padding-top: 72px; padding-bottom: 88px; }
.hero-split .lead { font-size: 1.14rem; }
@media (max-width: 960px) { .hero-split { grid-template-columns: minmax(0, 1fr); gap: 40px; padding-top: 48px; padding-bottom: 64px; } }

.block-gap { margin-top: 36px; }
.block-gap-sm { margin-top: 14px; }

/* Small link list (other comparisons, related pages) */
.link-row { display: flex; flex-wrap: wrap; gap: 10px 28px; }
.link-row a { color: var(--text-2); text-decoration: none; font-weight: 500; }
.link-row a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* ── Footer ── */
footer { padding: 64px 0 36px; border-top: 1px solid var(--line); font-size: .92rem; background: #fff; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(4, minmax(0, 1fr)); gap: 32px; }
@media (max-width: 1100px) { .foot-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .foot-grid > :first-child { grid-column: 1 / -1; } }
.footer-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.footer-brand img { width: 26px; height: 26px; }
.footer-name { font-family: var(--display); font-weight: 700; font-size: 1.08rem; }
.foot-about { margin-top: 12px; color: var(--text-3); max-width: 22rem; }
.foot-col h2 { font-family: var(--font); font-size: .86rem; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.foot-col a { display: block; padding: 4px 0; color: var(--text-3); text-decoration: none; }
.foot-col a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.foot-bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 32px; color: var(--text-3); font-size: .84rem; }
.foot-bottom > span:first-child { max-width: 46rem; }
.foot-legal { display: flex; gap: 18px; flex-shrink: 0; }
.foot-legal a { color: var(--text-3); text-decoration: none; }
.foot-legal a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

/* ── Legal documents (privacy, terms, accessibility, legal/*) ── */
.legal-shell { max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 56px var(--gutter) 104px; display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 72px; align-items: start; }
.legal-shell.single { grid-template-columns: minmax(0, 1fr); max-width: 860px; }
.legal-main { min-width: 0; max-width: 760px; }
.page-label { font-size: .88rem; font-weight: 600; color: var(--accent); margin-bottom: 10px; }
.page-title { font-family: var(--display); font-weight: 600; color: var(--text); font-size: clamp(2.1rem, 4vw, 2.9rem); line-height: 1.08; letter-spacing: -.03em; margin-bottom: 10px; }
.page-date { font-size: .9rem; color: var(--text-3); margin-bottom: 30px; }
.legal-main .lede { font-size: 1.1rem; line-height: 1.65; color: var(--text-2); margin-bottom: 20px; }
.legal-main { line-height: 1.7; }
.legal-main p { color: var(--text-2); margin-bottom: 16px; }
.legal-main ul, .legal-main ol { color: var(--text-2); padding-left: 22px; margin-bottom: 16px; }
.legal-main li { margin-bottom: 7px; }
.legal-main strong { color: var(--text); font-weight: 600; }
.legal-main a { color: var(--accent); text-underline-offset: 2px; }
.legal-main section[id] { scroll-margin-top: 88px; margin-bottom: 44px; }
.legal-main h2 { font-family: var(--display); font-size: 1.4rem; font-weight: 600; letter-spacing: -.015em; line-height: 1.3; margin: 0 0 14px; color: var(--text); }
.legal-main h2 .sec-num { color: var(--text-3); font-variant-numeric: tabular-nums; margin-right: 8px; }
.legal-main h3 { font-size: 1.02rem; font-weight: 600; margin: 26px 0 10px; color: var(--text); }
.callout { border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--bg-soft); border-radius: 0 10px 10px 0; padding: 18px 22px; margin: 26px 0; }
.callout-title { display: block; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.callout p:last-child { margin-bottom: 0; }
.emph { text-transform: uppercase; letter-spacing: .02em; font-size: .84rem; font-weight: 600; color: var(--text); }
.data-table { width: 100%; border-collapse: collapse; margin: 16px 0 22px; font-size: .9rem; line-height: 1.55; }
.data-table th, .data-table td { text-align: left; padding: 10px 12px; border: 1px solid var(--line); vertical-align: top; color: var(--text-2); }
.data-table th { color: var(--text); font-weight: 600; background: var(--bg-soft); }
.to-top { display: inline-block; margin-top: 6px; font-size: .86rem; color: var(--text-3); text-decoration: none; }
.to-top:hover { color: var(--text); }
.toc { position: sticky; top: 88px; max-height: calc(100vh - 112px); overflow-y: auto; }
.toc-title { font-size: .84rem; font-weight: 600; color: var(--text); margin: 0 0 10px 14px; }
.toc ol { list-style: none; }
.toc a { display: block; font-size: .86rem; line-height: 1.4; color: var(--text-3); text-decoration: none; padding: 6px 12px; border-left: 2px solid var(--line); }
.toc a:hover { color: var(--text); }
.toc a.active { color: var(--text); font-weight: 500; border-left-color: var(--ink); }
.toc summary { cursor: pointer; font-size: .9rem; font-weight: 600; color: var(--text); list-style: none; display: flex; justify-content: space-between; align-items: center; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: ''; width: 8px; height: 8px; border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3); transform: rotate(45deg); margin: -4px 4px 0 0; transition: transform .2s; }
.toc details[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
@media (min-width: 901px) { .toc summary { display: none; } .toc .toc-inner { display: block !important; } }

/* ── Cookie banner + preferences (js/cookie-banner.js) in the light design ── */
html body #lx-cookie-banner { background: rgba(255,255,255,.97); color: var(--text); border-color: var(--line-2); box-shadow: 0 24px 60px -20px rgba(28,25,23,.35); }
html body #lx-cookie-banner .lx-cb-body { color: var(--text-2); }
html body #lx-cookie-banner .lx-cb-body a { color: var(--accent); }
html body #lx-cookie-banner .lx-cb-customize { color: var(--text-3); }
html body #lx-cookie-banner .lx-cb-customize:hover { color: var(--text); }
html body #lx-cookie-banner .lx-cb-accept,
html body #lx-cookie-modal .lx-cm-acceptall { background: var(--ink); box-shadow: none; }
html body #lx-cookie-banner .lx-cb-accept:hover,
html body #lx-cookie-modal .lx-cm-acceptall:hover { background: var(--ink-hover); box-shadow: none; transform: none; }
html body #lx-cookie-overlay { background: rgba(28,25,23,.42); }
html body #lx-cookie-modal { background: #fff; color: var(--text); border-color: var(--line); box-shadow: 0 30px 80px -20px rgba(28,25,23,.35); }
html body #lx-cookie-modal .lx-cm-intro { color: var(--text-2); }
html body #lx-cookie-modal .lx-cm-intro a { color: var(--accent); }
html body #lx-cookie-modal .lx-cm-row { border-top-color: var(--line); }
html body #lx-cookie-modal .lx-cm-row p, html body #lx-cookie-modal .lx-cm-badge { color: var(--text-3); }
html body #lx-cookie-modal .lx-cm-switch { background: #15803d; }
html body #lx-cookie-modal .lx-cm-switch[aria-checked="false"] { background: var(--line-2); }
html body #lx-cookie-modal .lx-cm-save { color: var(--text-2); border-color: var(--line-2); }
html body #lx-cookie-modal .lx-cm-save:hover { color: var(--text); background: var(--bg-soft); }

/* ── "Ask about this document" (js/legal-ai.js) in the light design ── */
html body #lxl-fab { background: #fff; color: var(--text); border-color: var(--line-2); box-shadow: 0 12px 30px -12px rgba(28,25,23,.35); }
html body #lxl-fab .o, html body #lxl-panel .h .o { background: var(--ink); }
html body #lxl-panel { background: #fff; color: var(--text); border-color: var(--line); box-shadow: 0 24px 60px -20px rgba(28,25,23,.35); }
html body #lxl-panel .h, html body #lxl-form { border-color: var(--line); }
html body #lxl-panel .x { color: var(--text-3); }
html body #lxl-log .intro, html body #lxl-log .note, html body #lxl-fine { color: var(--text-3); }
html body #lxl-log .me { background: var(--bg-soft); border: 1px solid var(--line); }
html body #lxl-log .ai blockquote { border-left-color: var(--accent); background: var(--accent-soft); color: var(--text-2); }
html body #lxl-log .ai .find { color: var(--accent); }
html body #lxl-log .err { color: #b91c1c; }
html body #lxl-log .dots i { background: var(--text-3); }
html body #lxl-q { background: #fff; border-color: var(--border); color: var(--text); }
html body #lxl-send { background: var(--ink); }

/* ── Responsive ── */
@media (max-width: 960px) {
  .nav-links { display: none; }
  .sec { padding: 80px 0; }
  .faq-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .feature-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .legal-shell { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 32px 16px 72px; }
  .toc { position: static; max-height: none; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
  .toc-title { display: none; }
  .toc .toc-inner { margin-top: 12px; }
}
@media (max-width: 760px) {
  .feature-grid, .feature-grid.three { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-grid > :first-child { grid-column: 1 / -1; }
  .foot-bottom { flex-direction: column; }
}
@media (max-width: 640px) {
  /* Comparison table: one stacked block per row */
  .vs-table { min-width: 0; }
  .vs-table thead { display: none; }
  .vs-table tr { display: block; padding: 16px 0; border-bottom: 1px solid var(--line); }
  .vs-table td { display: block; border: 0; padding: 3px 0; }
  .vs-table td:first-child { width: auto; margin-bottom: 4px; }
  .vs-table td[data-label]::before { content: attr(data-label) ": "; font-weight: 600; color: var(--text); }
  .wrap { padding: 0 16px; }
  .navbar { padding: 0 16px; gap: 12px; }
  .btn-nav-login { padding: 0 8px; }
  .sec { padding: 64px 0; }
  .sec-head { margin-bottom: 36px; }
  .page-head { padding: 40px 0 40px; }
  .page-cta > *, .cta-btns > * { flex: 1 1 auto; }
  .final { padding: 64px 0; }
}
