/* POLYMATH COGNITIVE — site styles. Tokens first; dark theme via prefers-color-scheme. */
:root {
  --ink: #0f1b2d;
  --muted: #4a5568;
  --gold: #b8892f;
  --gold-text: #8a6420; /* darker gold for small text on white (contrast >= 4.5:1) */
  --paper: #ffffff;
  --surface: #f7f5f0;
  --line: #e4dfd3;
  --bg: var(--paper);
  --text: var(--ink);
  --text-muted: var(--muted);
  --accent: var(--gold);
  --accent-text: var(--gold-text);
  --focus: #1d4ed8;
  --radius: 14px;
  --wrap: 72rem;
  --font-head: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1422;
    --surface: #121f33;
    --line: #22324b;
    --text: #eef1f6;
    --text-muted: #a9b4c4;
    --accent: #d3a95a;
    --accent-text: #d9b26a;
    --focus: #93c5fd;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}
h1, h2, h3 { font-family: var(--font-head); font-weight: 700; line-height: 1.2; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 6vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.2rem); }
h3 { font-size: 1.25rem; font-weight: 600; }
p { margin: 0 0 1em; }
a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
ul { padding-left: 1.2em; }
li { margin-bottom: .35em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .wrap { padding: 0 32px; } }

.skip { position: absolute; left: -9999px; top: 0; background: var(--text); color: var(--bg); padding: .6em 1em; z-index: 10; }
.skip:focus { left: 16px; top: 16px; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; padding-top: 1rem; padding-bottom: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; letter-spacing: .12em; white-space: nowrap; }
.brand svg { flex: none; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.nav li { margin: 0; }
.nav a { text-decoration: none; font-size: .95rem; font-weight: 500; color: var(--text-muted); padding: .35rem 0; display: inline-block; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }

/* Sections */
main { display: block; }
.section { padding: 3.5rem 0; }
@media (min-width: 768px) { .section { padding: 5.5rem 0; } }
.section + .section { border-top: 1px solid var(--line); }
.eyebrow { font-size: .78rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--accent-text); margin-bottom: .9rem; }
.lead { font-size: 1.15rem; color: var(--text-muted); max-width: 42rem; }
.muted { color: var(--text-muted); }

.hero { padding: 4rem 0 3.5rem; position: relative; overflow: hidden; }
@media (min-width: 768px) { .hero { padding: 7rem 0 6rem; } }
.hero h1 { max-width: 46rem; }
.hero .rule { width: 64px; height: 2px; background: var(--accent); border: 0; margin: 0 0 1.5rem; }
.hero-mark { position: absolute; right: -60px; top: 50%; transform: translateY(-50%); width: 360px; height: 360px; opacity: .07; pointer-events: none; }
@media (max-width: 1099px) { .hero-mark { display: none; } }

.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
.btn { display: inline-block; padding: .8rem 1.4rem; border-radius: 999px; font-weight: 600; font-size: .95rem; text-decoration: none; border: 1px solid var(--text); transition: background-color .2s, color .2s; }
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--text); color: var(--bg); }

.grid { display: grid; gap: 1.25rem; grid-template-columns: 1fr; margin-top: 2rem; }
@media (min-width: 700px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; display: flex; flex-direction: column; }
.card h3 { margin-bottom: .5em; }
.card .for { font-size: .92rem; color: var(--text-muted); }
.card .card-link { margin-top: auto; padding-top: .75rem; font-weight: 600; font-size: .95rem; }
.card ul { margin: 0 0 1em; }

.product { border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 1.75rem; margin-top: 2rem; background: var(--surface); }
.badge { display: inline-block; font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--line); border-radius: 999px; padding: .2rem .7rem; margin-right: .4rem; color: var(--text-muted); }

.facts { display: grid; grid-template-columns: 1fr; gap: .2rem 1.5rem; margin: 1.5rem 0 0; }
@media (min-width: 640px) { .facts { grid-template-columns: 11rem 1fr; } }
.facts dt { font-weight: 600; font-size: .9rem; color: var(--text-muted); padding-top: .6rem; }
.facts dd { margin: 0; padding: 0 0 .6rem; border-bottom: 1px solid var(--line); }
@media (min-width: 640px) { .facts dd { padding-top: .6rem; } }

/* Policy pages */
.doc { max-width: 46rem; }
.doc h2 { font-size: 1.45rem; margin-top: 2.2rem; }
.doc .note { font-size: .92rem; color: var(--text-muted); border-left: 3px solid var(--accent); padding: .5rem 0 .5rem 1rem; margin-bottom: 2rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 2.5rem 0; font-size: .9rem; color: var(--text-muted); }
.site-footer .wrap { display: grid; gap: 1.5rem; }
@media (min-width: 768px) { .site-footer .wrap { grid-template-columns: 2fr 1fr; } }
.site-footer strong { color: var(--text); letter-spacing: .08em; }
.site-footer address { font-style: normal; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .3rem; }
.site-footer .copy { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 1rem; margin: 0; }

/* Product cards and plans */
.products-lead { margin-top: 3rem; }
@media (min-width: 900px) { .grid-products { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) { .grid-products { grid-template-columns: repeat(3, 1fr); } }
.product-card .badge { margin-bottom: .3rem; }
.plans { list-style: none; padding: 0; margin: auto 0 .75rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.plans li { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: .75rem; margin: 0; padding: .5rem .5rem .5rem .85rem; font-size: .92rem; }
.plans li + li { border-top: 1px solid var(--line); }
.plan-name { color: var(--text-muted); }
.plan-price { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.plan-btn { display: inline-block; font-size: .82rem; font-weight: 600; text-decoration: none; border: 1px solid var(--text); border-radius: 999px; padding: .3rem .8rem; transition: background-color .2s, color .2s; }
.plan-btn:hover { background: var(--text); color: var(--bg); }
.plan-note { font-size: .82rem; color: var(--text-muted); margin: 0; }
.plan-free { margin-top: auto; font-weight: 600; color: var(--accent-text); }
