/* Theoryscope: Vector Lab family style (cream paper, serif). Petrol-blue accent. Light default; dark via prefers-color-scheme or html[data-theme="dark"]. */
:root {
  --bg: #f6f2e9;
  --surface: #fffdf8;
  --surface-alt: #efe7d8;
  --ink: #141518;
  --muted: #5b5d66;
  --accent: #2a4a7f;
  --accent-hover: #1e3a66;
  --accent-text: #27446f;
  --on-accent: #fff;
  --rule: #e2d9c8;
  --ok: #2f6b4f;
  --shadow: 0 1px 2px rgba(20,21,24,.04), 0 8px 28px rgba(20,21,24,.06);
  --serif: "Source Serif 4", Georgia, "Iowan Old Style", serif;
  --display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --mono: "IBM Plex Mono", "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0b12; --surface: #171320; --surface-alt: #201a2c;
    --ink: #f3f1e8; --muted: #a39aa8; --accent: #8fb0dc; --accent-hover: #a9c3e4;
    --accent-text: #9fbee0; --on-accent: #0d0b12; --rule: #2c2436;
    --ok: #7fc9a3; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0b12; --surface: #171320; --surface-alt: #201a2c;
  --ink: #f3f1e8; --muted: #a39aa8; --accent: #8fb0dc; --accent-hover: #a9c3e4;
  --accent-text: #9fbee0; --on-accent: #0d0b12; --rule: #2c2436;
  --ok: #7fc9a3; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--serif); line-height: 1.6; font-size: 18px; -webkit-font-smoothing: antialiased; }
.wrap { width: 100%; max-width: 1060px; margin: 0 auto; padding-inline: 24px; }
a { color: var(--accent-text); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; display: block; }
code, .mono { font-family: var(--mono); font-size: .92em; }

/* Header */
header.site { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 12px; }
.brand { font-family: var(--mono); font-weight: 500; letter-spacing: .02em; font-size: 16px; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 9px; }
.brand .dot { width: 11px; height: 11px; border-radius: 2px; background: linear-gradient(135deg, #cfe0f0, #5a89b8 55%, var(--accent)); box-shadow: 0 0 0 1px rgba(0,0,0,.06); }
.site-nav { display: flex; align-items: center; gap: 20px; }
.site-nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent-text); }
.site-nav a[aria-current="page"] { border-bottom: 1px solid var(--accent); }
.theme-toggle { background: none; border: 1px solid var(--rule); border-radius: 8px; color: var(--muted); width: 36px; height: 34px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.theme-toggle:hover { color: var(--accent-text); border-color: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; }
:root:not([data-theme="dark"]) .icon-sun, :root[data-theme="light"] .icon-sun { display: none; }
.icon-moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .icon-moon { display: block; } :root:not([data-theme="light"]) .icon-sun { display: none; } }
:root[data-theme="dark"] .icon-moon { display: block; } :root[data-theme="dark"] .icon-sun { display: none; }
@media (max-width: 640px) { .hide-sm { display: none; } }

/* Hero */
.hero { border-bottom: 1px solid var(--rule); }
.hero .wrap { padding-block: 72px 60px; display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.eyebrow { font-family: var(--mono); font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-text); margin: 0 0 14px; }
h1 { font-family: var(--display); font-weight: 600; font-size: clamp(52px, 9vw, 92px); line-height: .96; margin: 0 0 18px; letter-spacing: -.01em; }
h1 em { font-style: italic; color: var(--accent); }
.lede { font-size: 20px; color: var(--ink); margin: 0 0 12px; max-width: 34ch; }
.sub { color: var(--muted); margin: 0 0 26px; max-width: 42ch; font-size: 16.5px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 14px; padding: 11px 17px; border-radius: 9px; border: 1px solid var(--rule); color: var(--ink); text-decoration: none; background: var(--surface); transition: border-color .15s, color .15s, transform .05s; }
.btn:hover { border-color: var(--accent); color: var(--accent-text); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.hero-fig { margin: 0; }
.hero-fig a { display: block; border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.hero-fig img { width: 100%; }
.band { height: 8px; border-radius: 99px; margin-top: 14px; background: linear-gradient(90deg, #f8f6ec, #c7d9ea 22%, #7fa0c7 50%, #3b5f94 78%, #1a2d4e); }
.band-key { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 5px; text-transform: uppercase; letter-spacing: .08em; }

/* Page header (interior pages, no hero) */
.pagehead { border-bottom: 1px solid var(--rule); padding-block: 56px 40px; }
.pagehead .eyebrow { margin-bottom: 10px; }
.pagehead h1 { font-size: clamp(38px, 6vw, 60px); }
.pagehead .lede { font-size: 19px; max-width: 56ch; }

/* Sections */
section { padding-block: 60px; border-bottom: 1px solid var(--rule); }
section:last-of-type { border-bottom: none; }
.num { font-family: var(--mono); font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-text); margin: 0 0 10px; }
h2 { font-family: var(--display); font-weight: 600; font-size: clamp(30px, 5vw, 42px); line-height: 1.08; margin: 0 0 22px; max-width: 24ch; text-wrap: balance; }
h3 { font-family: var(--display); font-weight: 600; font-size: 25px; margin: 24px 0 6px; }
.prose p { max-width: 68ch; }
.prose p + p { margin-top: 1em; }
.prose ul, .prose ol { max-width: 68ch; padding-left: 22px; }
.prose li + li { margin-top: .35em; }
.lead-in { color: var(--muted); max-width: 70ch; margin: 0 0 26px; font-size: 17px; }

/* Mode blocks */
.mode { display: grid; grid-template-columns: 1fr 1.1fr; gap: 34px; align-items: start; padding-block: 30px; border-top: 1px dashed var(--rule); }
.mode:first-of-type { border-top: none; }
.mode.flip { grid-template-columns: 1.1fr 1fr; }
.mode.flip .mode-copy { order: 2; }
.mode-copy .tag { font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.mode-copy p { color: var(--muted); font-size: 16.5px; max-width: 46ch; margin: 8px 0 0; }
figure { margin: 0; }
figure a { display: block; border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }
figcaption { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 8px; }
.thumbs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 10px; }
@media (max-width: 760px) { .thumbs { grid-template-columns: 1fr; } }

/* Figure placeholder */
.placeholder { aspect-ratio: 16 / 10; display: grid; place-items: center; background: var(--surface-alt); color: var(--muted); font-family: var(--mono); font-size: 12px; text-align: center; padding: 24px; border-radius: 10px; border: 1px dashed var(--rule); }

/* Setup / provider cards */
.providers { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 8px; }
@media (max-width: 720px) { .providers { grid-template-columns: 1fr; } }
.prov { background: var(--surface); border: 1px solid var(--rule); border-radius: 11px; padding: 16px 18px; box-shadow: var(--shadow); }
.prov h4 { margin: 0 0 4px; font-family: var(--display); font-size: 21px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pill { font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--rule); color: var(--muted); text-transform: uppercase; }
.pill.yes { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, var(--rule)); }
.pill.no { color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 35%, var(--rule)); }
.prov p { margin: 8px 0 0; font-size: 15px; color: var(--muted); }
.prov .key { font-family: var(--mono); font-size: 12.5px; color: var(--ink); background: var(--surface-alt); border-radius: 6px; padding: 1px 6px; }
.prov a { font-size: 14px; }
.note { border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 10px 10px 0; padding: 14px 18px; margin: 22px 0; box-shadow: var(--shadow); }
.note strong { color: var(--accent-text); }
.note p { margin: 0; }
.note p + p { margin-top: .6em; }
pre { background: var(--ink); color: #f3f1e8; border-radius: 10px; padding: 16px 18px; overflow-x: auto; font-family: var(--mono); font-size: 13.5px; line-height: 1.5; margin: 14px 0; }
:root[data-theme="dark"] pre, :root:not([data-theme="light"]) pre { background: #060509; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) pre { background: #1b1720; } }
kbd { font-family: var(--mono); font-size: .85em; background: var(--surface-alt); border: 1px solid var(--rule); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; }

/* Numbered steps */
ol.steps { padding-left: 0; list-style: none; counter-reset: s; margin: 10px 0 0; }
ol.steps > li { counter-increment: s; position: relative; padding-left: 42px; margin-bottom: 20px; max-width: 70ch; }
ol.steps > li::before { content: counter(s); position: absolute; left: 0; top: -1px; width: 28px; height: 28px; border-radius: 7px; background: var(--accent); color: var(--on-accent); font-family: var(--mono); font-size: 14px; display: grid; place-items: center; }
ol.steps h3 { margin-top: 0; font-size: 22px; }
ol.steps figure { margin-top: 12px; }

/* Trouble entries */
.trouble { padding-block: 20px; border-top: 1px dashed var(--rule); }
.trouble:first-of-type { border-top: none; padding-top: 0; }
.trouble h3 { margin: 0 0 6px; }
.trouble p { max-width: 70ch; margin: 0; color: var(--muted); font-size: 16.5px; }
.trouble p + p { margin-top: .6em; }

/* Simple tables */
table.spec { width: 100%; border-collapse: collapse; margin: 10px 0 0; font-size: 16px; }
table.spec th, table.spec td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.spec th { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); width: 32%; font-weight: 500; }

:root { --vl-c1: #1a1aff; --vl-c2: #4a2aff; --vl-c3: #1a6aff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --vl-c1: #8a90ff; --vl-c2: #a68aff; --vl-c3: #80b0ff; } }
:root[data-theme="dark"] { --vl-c1: #8a90ff; --vl-c2: #a68aff; --vl-c3: #80b0ff; }
a:has(.vl-mark) { white-space: nowrap; }
.vl-mark { display: inline-block; width: 0.9em; height: 0.9em; vertical-align: -0.12em; margin-right: 0.35em; }
.vl-mark svg { width: 100%; height: 100%; display: block; }

footer.site { padding-block: 40px 56px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 28px; justify-content: space-between; align-items: center; }
footer a { color: var(--muted); text-decoration: none; font-family: var(--mono); font-size: 14px; }
footer a:hover { color: var(--accent-text); }
.foot-note { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }

@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 32px; padding-block: 48px 40px; }
  .mode, .mode.flip { grid-template-columns: 1fr; gap: 20px; }
  .mode.flip .mode-copy { order: 0; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
