/* Mixture of Policies — BEHAVIOR-1K 2026 project page */
:root {
  --bg: #fcfcfb;
  --surface: #ffffff;
  --ink: #1b1f24;
  --ink-2: #4a525c;
  --ink-3: #6b7480;
  --rule: #e4e6e9;
  --rule-2: #eef0f2;
  --accent: #1f5fae;
  /* source palette (validated: light surface, all-pairs; CVD 6–8 band, so always paired with text labels) */
  --c-gen: #2A78D6;
  --c-full: #16976A;
  --c-lora: #C2549A;
  --c-rsi: #E2622A;
  --c-ok: #16976A;
  --c-miss: #d5d9de;
  --radius: 10px;
  --maxw: 1080px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.62 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, video, svg { max-width: 100%; display: block; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
code { background: var(--rule-2); padding: 1px 5px; border-radius: 4px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(252,252,251,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; height: 56px; overflow-x: auto;
  scrollbar-width: none;
}
.nav-inner::-webkit-scrollbar { display: none; }
.nav-logos { display: flex; align-items: center; gap: 16px; flex: none; }
.nav .b1k { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; letter-spacing: .01em; color: var(--ink); white-space: nowrap; }
.nav .b1k img { height: 26px; width: auto; }
.nav .b1k:hover { color: var(--accent); text-decoration: none; }
.nav .nav-sep { width: 1px; height: 28px; background: var(--rule); }
.nav .amba { display: block; transition: opacity .15s; }
.nav .amba img { height: 42px; width: auto; }
.nav .b1k img, .nav .amba img { transition: opacity .15s; }
.nav .b1k:hover img, .nav .amba:hover img { opacity: .8; }
.nav-links { display: flex; align-items: center; gap: 18px; margin-left: auto; padding-left: 28px; }
.nav a.link { color: var(--ink-2); font-size: 14px; white-space: nowrap; }
.nav a.link:hover, .nav a.link.active { color: var(--accent); text-decoration: none; }

/* ---------- layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
section { padding: 56px 0 8px; }
section > .wrap > h2 {
  font-size: 28px; line-height: 1.25; margin: 0 0 6px; letter-spacing: -.01em;
}
.kicker { color: var(--ink-3); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; margin-bottom: 4px; }
.lead { color: var(--ink-2); font-size: 17px; max-width: 820px; margin: 0 0 24px; }
h3 { font-size: 20px; margin: 36px 0 8px; }
h4 { font-size: 16px; margin: 20px 0 6px; }
p { margin: 0 0 14px; }
.muted { color: var(--ink-3); }
.small { font-size: 14px; }

/* ---------- hero ---------- */
.hero { padding: 56px 0 24px; text-align: center; }
.hero h1 {
  font-size: clamp(28px, 4.2vw, 44px); line-height: 1.15; margin: 0 auto 10px; max-width: 920px;
  letter-spacing: -.02em;
}
.hero .subtitle { font-size: 17px; color: var(--ink-3); margin-bottom: 20px; letter-spacing: .02em; }
.authors { font-size: 17px; margin-bottom: 4px; display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 18px; }
.authors span { white-space: nowrap; }
.affil { color: var(--ink-2); margin-bottom: 22px; }
.btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 30px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 999px; font-size: 15px; font-weight: 600;
  background: var(--ink); color: #fff; border: 1px solid var(--ink);
}
.btn:hover { text-decoration: none; background: #333a43; }
.btn.ghost { background: transparent; color: var(--ink); border-color: #c9ced4; }
.btn.ghost:hover { background: var(--rule-2); }
.btn.disabled { opacity: .5; pointer-events: none; }
.btn svg { width: 16px; height: 16px; }

.teaser { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 0 0 10px; }
.teaser figure { margin: 0; position: relative; }
.teaser video { width: 100%; aspect-ratio: 3/2; object-fit: cover; border-radius: 8px; background: #ddd; }
.teaser figcaption { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; text-align: left; line-height: 1.35; }
.teaser-note { font-size: 13px; color: var(--ink-3); margin-bottom: 26px; }

/* ---------- stat tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 8px 0 0; }
.stat {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 14px 14px 12px; text-align: left;
}
.stat .v { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.stat .l { font-size: 13px; color: var(--ink-2); margin-top: 4px; line-height: 1.35; }

/* ---------- cards / figures ---------- */
.card {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 20px 22px;
}
.fig { margin: 18px 0 26px; }
.fig img, .fig > svg, .fig object {
  width: 100%; border-radius: 8px; background: #fff; border: 1px solid var(--rule);
}
.fig.plain img { border: 0; }
.fig figcaption { font-size: 14px; color: var(--ink-2); margin-top: 8px; line-height: 1.5; }
.fig figcaption b { color: var(--ink); }
.zoomable { cursor: zoom-in; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.pill {
  display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 9px; border-radius: 999px;
  border: 1px solid currentColor; line-height: 1.6; vertical-align: 1px;
}
.method-card { border-top: 4px solid var(--c); }
.method-card h3 { margin-top: 2px; font-size: 18px; }
.method-card ul { padding-left: 18px; margin: 6px 0 0; }
.method-card li { margin-bottom: 4px; font-size: 15px; color: var(--ink-2); }
.method-card .num { font-size: 26px; font-weight: 700; color: var(--ink); }
.method-card .num small { font-size: 14px; font-weight: 500; color: var(--ink-3); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); margin-right: 6px; vertical-align: 0; }

ol.steps { counter-reset: s; list-style: none; padding: 0; margin: 10px 0 18px; }
ol.steps li { counter-increment: s; position: relative; padding: 2px 0 10px 40px; }
ol.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 2px;
  width: 26px; height: 26px; border-radius: 50%; background: var(--c-rsi); color: #fff;
  font-weight: 700; font-size: 14px; display: grid; place-items: center;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 18px; }
.chip { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 8px 12px; font-size: 14px; flex: 1 1 280px; }
.chip b { display: block; font-size: 14.5px; }
.chip span { color: var(--ink-2); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 10px 0 8px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--rule-2); vertical-align: middle; }
thead th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 600; background: #f7f8f9; border-bottom: 1px solid var(--rule); }
tbody tr:last-child td { border-bottom: 0; }
td.n, th.n { text-align: right; }
td.c, th.c { text-align: center; }
tr.hl td { background: #fff6e8; font-weight: 600; }
tr.sep td { border-top: 2px solid var(--rule); }
.tcap { font-size: 14px; color: var(--ink-2); margin: 6px 0 22px; }

/* ---------- ladder chart ---------- */
.ladder { display: grid; gap: 10px; margin: 14px 0 6px; }
.rung { display: grid; grid-template-columns: 210px 1fr 64px; align-items: center; gap: 12px; font-size: 14.5px; }
.rung .lbl { color: var(--ink); }
.rung .lbl small { display: block; color: var(--ink-3); font-size: 12.5px; }
.rung .track { position: relative; height: 26px; background: var(--rule-2); border-radius: 4px; }
.rung .bar { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; display: flex; }
.rung .seg { height: 100%; margin-right: 2px; }
.rung .seg:last-child { margin-right: 0; border-radius: 0 4px 4px 0; }
.rung .val { font-weight: 700; text-align: right; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13.5px; color: var(--ink-2); margin: 8px 0 4px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- videos ---------- */
.case { display: grid; grid-template-columns: 1.05fr 1fr; gap: 22px; align-items: start; margin: 18px 0 30px; }
.case video { width: 100%; border-radius: 8px; background: #000; aspect-ratio: 3/2; }
.case h4 { margin-top: 0; font-size: 18px; }
.case .meta { font-size: 13.5px; color: var(--ink-3); margin-bottom: 8px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 14px; }
.filters .lab { font-size: 13px; color: var(--ink-3); margin-right: 4px; }
.fbtn {
  font: inherit; font-size: 13.5px; padding: 5px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid #c9ced4; background: var(--surface); color: var(--ink-2);
}
.fbtn:hover { border-color: var(--ink-3); }
.fbtn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.fbtn .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 6px; vertical-align: 1px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.vcard { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.vcard video { width: 100%; aspect-ratio: 3/2; background: #000; }
.vcard .body { padding: 9px 12px 11px; }
.vcard .t { font-weight: 600; font-size: 14px; line-height: 1.3; word-break: break-word; }
.vcard .m { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.src { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.src::before { content: ""; width: 9px; height: 9px; border-radius: 2px; background: var(--c); }
.badge-fail { color: #b3261e; font-weight: 600; }
.badge-ok { color: var(--c-ok); font-weight: 600; }

/* ---------- task explorer ---------- */
.explorer-controls { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin: 10px 0 10px; }
.explorer-controls input[type=search] {
  font: inherit; font-size: 14px; padding: 6px 12px; border: 1px solid #c9ced4; border-radius: 8px; min-width: 220px; background: var(--surface);
}
.explorer-controls select { font: inherit; font-size: 14px; padding: 5px 8px; border: 1px solid #c9ced4; border-radius: 8px; background: var(--surface); }
.summary-line { font-size: 14px; color: var(--ink-2); margin: 0 0 8px; }
.summary-line b { color: var(--ink); }
#taskTable td.task { font-weight: 500; word-break: break-word; }
#taskTable td.id { color: var(--ink-3); width: 44px; }
#taskTable th.sortable { cursor: pointer; user-select: none; }
#taskTable th.sortable:hover { color: var(--ink); }
#taskTable th .arr { opacity: .6; font-size: 10px; margin-left: 3px; }
.dots { display: inline-flex; gap: 3px; vertical-align: middle; }
.dots i {
  width: 11px; height: 11px; border-radius: 3px; background: var(--c-miss); display: inline-block; position: relative; cursor: default;
}
.dots i.ok { background: var(--c-ok); }
.dots i:hover { outline: 2px solid var(--ink); outline-offset: 1px; }
.qbar { display: inline-block; width: 64px; height: 6px; background: var(--rule-2); border-radius: 3px; position: relative; vertical-align: middle; margin-right: 8px; }
.qbar b { position: absolute; left: 0; top: 0; bottom: 0; background: #8a94a0; border-radius: 3px; }
.tooltip {
  position: fixed; pointer-events: none; z-index: 50; background: #1b1f24; color: #fff; font-size: 12.5px;
  padding: 6px 9px; border-radius: 6px; line-height: 1.4; box-shadow: 0 4px 14px rgba(0,0,0,.18); opacity: 0; transition: opacity .08s;
  max-width: 260px;
}
.tooltip.on { opacity: 1; }
.tbl-scroll { max-height: 620px; overflow: auto; }
.tbl-scroll thead th { position: sticky; top: 0; z-index: 1; }

/* ---------- misc ---------- */
details.deep { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); margin: 12px 0; }
details.deep > summary { cursor: pointer; padding: 14px 18px; font-weight: 600; font-size: 16.5px; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
details.deep > summary::-webkit-details-marker { display: none; }
details.deep > summary::after { content: "+"; color: var(--ink-3); font-weight: 400; font-size: 20px; line-height: 1; }
details.deep[open] > summary::after { content: "–"; }
details.deep > .inner { padding: 0 18px 8px; }
.callout { border-left: 4px solid var(--c, var(--accent)); background: var(--surface); padding: 12px 16px; border-radius: 0 8px 8px 0; margin: 14px 0 20px; border-top: 1px solid var(--rule); border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.callout p:last-child { margin-bottom: 0; }
pre.bib {
  background: #f3f4f6; border: 1px solid var(--rule); border-radius: 8px; padding: 14px 16px; overflow-x: auto;
  font-size: 13px; line-height: 1.5; position: relative;
}
.copy { position: absolute; top: 8px; right: 8px; font: inherit; font-size: 12px; padding: 3px 10px; border-radius: 6px; border: 1px solid #c9ced4; background: #fff; cursor: pointer; }
footer { margin-top: 56px; padding: 26px 0 40px; border-top: 1px solid var(--rule); color: var(--ink-3); font-size: 13.5px; }

/* lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(15,18,22,.88); display: none; align-items: center; justify-content: center; z-index: 100; padding: 24px; cursor: zoom-out; }
.lightbox.on { display: flex; }
.lightbox img { max-width: 96vw; max-height: 92vh; background: #fff; border-radius: 6px; }

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .teaser { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .grid-2, .case { grid-template-columns: 1fr; }
  .rung { grid-template-columns: 130px 1fr 54px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media (forced-colors: active) { .dots i.ok { forced-color-adjust: none; } }
