/* The Calibrated CEO — site styles. Tokens and components are lifted from app/simulator-template.html
   so the learning site and the simulator read as one product. */
:root {
  --ground: #F2F3F0;
  --surface: #FFFFFF;
  --surface-2: #E9ECE7;
  --ink: #17212B;
  --ink-muted: #5A6670;
  --line: #D6DBD3;
  --accent: #14646A;
  --accent-ink: #FFFFFF;
  --needle: #C4801E;
  --needle-soft: rgba(196,128,30,0.14);
  --accent-soft: rgba(20,100,106,0.10);
  --danger: #A3352B;
  --danger-soft: rgba(163,53,43,0.10);
  --shadow: 0 1px 2px rgba(23,33,43,0.06), 0 8px 24px rgba(23,33,43,0.06);
  --serif: "Spectral", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --max: 720px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #10161C; --surface: #18212A; --surface-2: #1F2A34; --ink: #E8ECEA; --ink-muted: #9AA6AE;
    --line: #2A343D; --accent: #4FB2B8; --accent-ink: #0E1A1C; --needle: #E0A24A;
    --needle-soft: rgba(224,162,74,0.16); --accent-soft: rgba(79,178,184,0.14);
    --danger: #E07B6F; --danger-soft: rgba(224,123,111,0.14);
    --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #10161C; --surface: #18212A; --surface-2: #1F2A34; --ink: #E8ECEA; --ink-muted: #9AA6AE;
  --line: #2A343D; --accent: #4FB2B8; --accent-ink: #0E1A1C; --needle: #E0A24A;
  --needle-soft: rgba(224,162,74,0.16); --accent-soft: rgba(79,178,184,0.14);
  --danger: #E07B6F; --danger-soft: rgba(224,123,111,0.14);
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.3); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--sans); font-size: 17px; line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-wrap: break-word; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.2; margin: 0; text-wrap: balance; }
h1 { font-size: 32px; }
h2 { font-size: 24px; }
h3 { font-size: 19px; }
h4 { font-size: 17px; }
@media (max-width: 480px) { h1 { font-size: 28px; } h2 { font-size: 22px; } }
p { margin: 0; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
button { font: inherit; color: inherit; }
img, svg { max-width: 100%; height: auto; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); }
.muted { color: var(--ink-muted); }
.small { font-size: 15px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--needle); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header / footer */
.topbar { position: sticky; top: 0; z-index: 10; background: var(--ground); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: var(--max); margin: 0 auto; padding: 10px 18px 0; }
.topbar-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: inherit; }
.brand .name { font-family: var(--serif); font-size: 19px; font-weight: 600; white-space: nowrap; }
.brand .sub { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
@media (max-width: 520px) { .brand .sub { display: none; } .brand .name { font-size: 17px; } }
.theme-btn { background: none; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); cursor: pointer; white-space: nowrap; }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 8px 0 8px; margin: 0 -18px; padding-left: 18px; padding-right: 18px; }
.nav::-webkit-scrollbar { display: none; }
.nav a { white-space: nowrap; text-decoration: none; border: 1px solid transparent; border-radius: 999px; padding: 5px 12px; font-size: 14.5px; font-weight: 600; color: var(--ink-muted); }
.nav a[aria-current="page"] { color: var(--accent); border-color: var(--line); background: var(--surface); }
.nav a:hover { color: var(--accent); }

main { max-width: var(--max); margin: 0 auto; padding: 24px 18px 80px; }
.view { display: flex; flex-direction: column; gap: 26px; }

footer.site-foot { border-top: 1px solid var(--line); background: var(--surface); }
.foot-inner { max-width: var(--max); margin: 0 auto; padding: 24px 18px 40px; display: flex; flex-direction: column; gap: 14px; color: var(--ink-muted); font-size: 14px; }
.legend { display: flex; flex-direction: column; gap: 6px; }
.legend .row { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.foot-links a { color: var(--ink-muted); }

/* ---------- atoms lifted from the simulator */
.lede { font-family: var(--serif); font-size: 21px; line-height: 1.4; }
.lede em { color: var(--accent); font-style: italic; }
.eyebrow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 8px; border-radius: 4px; background: var(--surface-2); color: var(--ink-muted); white-space: nowrap; text-decoration: none; }
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip.needle { background: var(--needle-soft); color: var(--needle); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
a.chip:hover { text-decoration: underline; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow); }
.card h3 { font-size: 20px; margin-bottom: 8px; }
.card .sub { color: var(--ink-muted); font-size: 15px; margin-bottom: 12px; }
.card-plain { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.constraint, .callout { border-left: 3px solid var(--needle); background: var(--needle-soft); padding: 12px 14px; border-radius: 0 8px 8px 0; }
.callout .k, .constraint .k { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--needle); margin-bottom: 4px; }
.callout.accent { border-color: var(--accent); background: var(--accent-soft); }
.callout.accent .k { color: var(--accent); }
.callout.danger { border-color: var(--danger); background: var(--danger-soft); }
.callout.danger .k { color: var(--danger); }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 10px; padding: 12px 18px; font-size: 16px; font-weight: 600; cursor: pointer; background: var(--accent); color: var(--accent-ink); text-decoration: none; }
.btn.secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn.small { padding: 8px 14px; font-size: 14.5px; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.field { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 520px) { .field { grid-template-columns: 1fr; gap: 4px; } }
.field .k { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); padding-top: 4px; }
.field .v { font-size: 16px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 14px; }
@media (max-width: 480px) { .facts { grid-template-columns: repeat(2, 1fr); } }
.fact .k { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); }
.fact .v { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.foot { color: var(--ink-muted); font-size: 13.5px; border-top: 1px solid var(--line); padding-top: 14px; }
.empty { color: var(--ink-muted); font-size: 15.5px; }
.stat-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15.5px; }
.stat-row:last-child { border-bottom: 0; }
.stat-row .n { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* epistemic labels */
.label { display: inline-block; font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 6px; border-radius: 3px; background: var(--surface-2); color: var(--ink-muted); white-space: nowrap; vertical-align: 2px; margin-right: 4px; }
.label.RESEARCH_FINDING { background: var(--accent-soft); color: var(--accent); }
.label.FRAMEWORK { background: var(--needle-soft); color: var(--needle); }
.label.FACT { background: var(--ink); color: var(--ground); }
.label.HYPOTHESIS { background: transparent; border: 1px dashed var(--ink-muted); }
.label.INTERPRETATION { background: var(--surface-2); color: var(--ink-muted); }
.label-note { font-style: italic; color: var(--ink-muted); }

/* dial (identical markup to the simulator) */
.dial { display: grid; grid-template-columns: 1fr; gap: 4px; }
.dial .ends { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-muted); }
.dial .track { position: relative; height: 10px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line); }
.dial .track::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--line); }
.dial .needle { position: absolute; top: -4px; width: 3px; height: 16px; border-radius: 2px; background: var(--needle); transform: translateX(-50%); transition: left .4s ease; }
.dial .needle.faint { background: var(--ink-muted); opacity: .5; }
.dial .n { font-family: var(--mono); font-size: 11px; color: var(--ink-muted); text-align: right; }
.dial.big .track { height: 14px; }
.dial.big .needle { height: 22px; top: -5px; }
.dials { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
@media (max-width: 480px) { .dials { grid-template-columns: 1fr; } }
.dials-big { display: flex; flex-direction: column; gap: 16px; }

/* ---------- prose (rendered markdown) */
.prose { display: flex; flex-direction: column; gap: 12px; }
.prose > * { max-width: 66ch; }
.prose p { font-size: 17px; }
.prose h3 { font-size: 20px; margin-top: 10px; }
.prose h4 { font-size: 17px; font-family: var(--sans); font-weight: 600; margin-top: 6px; }
.prose ul, .prose ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.prose li > ul, .prose li > ol { margin-top: 6px; }
.prose blockquote { margin: 0; border-left: 3px solid var(--line); padding: 4px 14px; color: var(--ink-muted); font-family: var(--serif); font-size: 18px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.prose code { font-family: var(--mono); font-size: 14px; background: var(--surface-2); padding: 1px 5px; border-radius: 3px; }
.prose .table-wrap { overflow-x: auto; max-width: 100%; }
.prose table { border-collapse: collapse; font-size: 15px; min-width: 100%; }
.prose th, .prose td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); }
.prose strong { font-weight: 600; }

/* ---------- lists of things */
.list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.list-row { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: start; padding: 14px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.list-row:hover { background: var(--accent-soft); }
.list-row .num { font-family: var(--mono); font-size: 13px; color: var(--ink-muted); padding-top: 4px; }
.list-row .title { font-family: var(--serif); font-size: 19px; font-weight: 500; display: block; }
.list-row .meta { color: var(--ink-muted); font-size: 15px; margin-top: 2px; display: block; }
.list-row .status { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; padding-top: 6px; color: var(--ink-muted); white-space: nowrap; }
.list-row.nonum { grid-template-columns: 1fr auto; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }
a.tile { display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; text-decoration: none; color: inherit; box-shadow: var(--shadow); }
a.tile:hover { border-color: var(--accent); }
a.tile h3 { font-size: 20px; }
a.tile .sub { color: var(--ink-muted); font-size: 15px; }
a.tile .count { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.section { display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 110px; }
.section > h2 { border-bottom: 2px solid var(--ink); padding-bottom: 6px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-bottom: 2px solid var(--ink); padding-bottom: 6px; }
.toc { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 14.5px; }
.toc a { color: var(--ink-muted); text-decoration: none; border-bottom: 1px solid var(--line); }
.toc a:hover { color: var(--accent); border-color: var(--accent); }
.pagenav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; border-top: 1px solid var(--line); padding-top: 18px; }
.pagenav a { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 2px; }
.pagenav a.next { text-align: right; }
.pagenav a .k { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); }
.pagenav a .t { font-family: var(--serif); font-size: 18px; color: var(--accent); }
.anchor { scroll-margin-top: 110px; }
.anchor:target { outline: 2px solid var(--needle); outline-offset: 4px; border-radius: 12px; }
.cite { color: var(--ink-muted); font-size: 14px; }
.cite a { word-break: break-all; }
.refs { display: flex; flex-direction: column; gap: 10px; padding-left: 0; margin: 0; list-style: none; }
.refs li { display: grid; grid-template-columns: auto 1fr; gap: 10px; font-size: 15.5px; }
.refs li .id { font-family: var(--mono); font-size: 12px; color: var(--ink-muted); padding-top: 3px; white-space: nowrap; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags .chip { white-space: normal; max-width: 100%; line-height: 1.4; }
.terms { columns: 2; column-gap: 24px; font-size: 15.5px; }
@media (max-width: 520px) { .terms { columns: 1; } }
.terms a { display: block; break-inside: avoid; padding: 3px 0; text-decoration: none; }
.terms a:hover { text-decoration: underline; }

/* ---------- filters */
.filters { display: flex; flex-direction: column; gap: 8px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.filter-row .k { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); margin-right: 4px; }
.fbtn { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px; font-size: 14px; cursor: pointer; color: var(--ink-muted); }
.fbtn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
select.fsel { font: inherit; font-size: 14.5px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; max-width: 100%; }
.filter-count { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); }

/* ---------- knowledge check */
.quiz { display: flex; flex-direction: column; gap: 18px; }
.q { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.q .q-text { font-family: var(--serif); font-size: 18px; }
.q .q-n { font-family: var(--mono); font-size: 12px; color: var(--ink-muted); margin-right: 8px; }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt { display: grid; grid-template-columns: 32px 1fr; gap: 10px; align-items: start; width: 100%; text-align: left; background: var(--ground); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; font-size: 16px; }
.opt:hover { border-color: var(--accent); }
.opt .key { font-family: var(--serif); font-size: 19px; font-weight: 600; color: var(--accent); line-height: 1.1; }
.opt[disabled] { cursor: default; opacity: .6; }
.opt.chosen { opacity: 1; border-color: var(--danger); background: var(--danger-soft); }
.opt.correct { opacity: 1; border-color: var(--accent); background: var(--accent-soft); }
.q-answer { border-top: 1px solid var(--line); padding-top: 10px; font-size: 15.5px; display: flex; flex-direction: column; gap: 6px; }
.q-answer .verdict { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.q-answer .verdict.miss { color: var(--danger); }

/* ---------- assessment */
.progress { height: 6px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); transition: width .2s ease; }
.item { display: flex; flex-direction: column; gap: 16px; }
.item .stem { font-family: var(--serif); font-size: 21px; line-height: 1.35; }
.item .stem.sjt { font-size: 18px; font-family: var(--sans); }
.likert { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.likert button { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 14px 0; font-size: 18px; font-weight: 600; cursor: pointer; }
.likert button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.likert-ends { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-muted); }
.fc { display: flex; flex-direction: column; gap: 12px; }
.fc .stmt { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.fc .stmt p { font-size: 16.5px; }
.fc .stmt .row { display: flex; gap: 8px; flex-wrap: wrap; }
.fc .stmt button, .sjt-opt button { border: 1px solid var(--line); background: var(--ground); border-radius: 999px; padding: 7px 13px; font-size: 14.5px; cursor: pointer; }
.fc .stmt button[aria-pressed="true"], .sjt-opt button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.fc .or { text-align: center; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
.sjt { display: flex; flex-direction: column; gap: 10px; }
.sjt-opt { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.sjt-opt p { font-size: 16px; }
.sjt-opt .row { display: flex; gap: 8px; }
.sjt-opt button[disabled] { opacity: .35; cursor: default; }
.sjt-opt button.most[aria-pressed="true"] { border-color: var(--accent); }
.sjt-opt button.least[aria-pressed="true"] { border-color: var(--needle); background: var(--needle-soft); color: var(--needle); }
.item-nav { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar { display: grid; grid-template-columns: 170px 1fr auto; gap: 10px; align-items: center; font-size: 15px; }
@media (max-width: 520px) { .bar { grid-template-columns: 1fr; gap: 3px; } .bar .band { text-align: left; } }
.bar .name { font-weight: 600; }
.bar .name small { display: block; font-weight: 400; color: var(--ink-muted); font-size: 12.5px; }
.bar .track { position: relative; height: 12px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.bar .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 6px; }
.bar .fill.vh { background: var(--needle); }
.bar .band { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); text-align: right; white-space: nowrap; }
.bar .note { grid-column: 1 / -1; font-size: 13.5px; color: var(--ink-muted); }
.result-block { display: flex; flex-direction: column; gap: 10px; }
.result-block ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.result-block .links { font-size: 14px; color: var(--ink-muted); }
.banner { border-left: 3px solid var(--danger); background: var(--danger-soft); padding: 12px 14px; border-radius: 0 8px 8px 0; font-size: 15.5px; }
@media (prefers-reduced-motion: reduce) { .dial .needle, .progress > div { transition: none; } html { scroll-behavior: auto; } }
