/* Night mode, loaded last. Set by data-theme="dark" on <html> (the page follows the system setting until the reader
   uses the switch). The page, its cards, charts and drawn diagrams turn dark. Pictures that were rendered on white
   (the paper's two figures and the 3D clip) stay on white plates inside the dark cards. */

html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #171615;
  --card: #22211f;
  --ink: #f3f1ea;
  --ink-2: #b9b6ab;
  --ink-3: #8f8c82;
  --cream: #2d2c29;
  --tile: #2d2c29;
  --line: #4a4843;
  --line-soft: #33322e;
  --accent: #f08a45;
  --clay: #f08a45;
  --clay-deep: #f08a45;
  --clay-ink: #ffb07a;
  --peach: #6b3f22;
  --peach-soft: #3d2718;
}

/* ---------- page ---------- */
html[data-theme="dark"] ::selection { background: #6b3f22; color: #fff; }
html[data-theme="dark"] .blog-body a { text-decoration-color: #6b6861; }
html[data-theme="dark"] .blog-body a:hover { text-decoration-color: var(--ink); }
html[data-theme="dark"] .blog-body .btn.solid:hover { background: #d9d6cc; border-color: #d9d6cc; }
html[data-theme="dark"] .totop { background: rgba(34, 33, 31, .92); }
html[data-theme="dark"] .modes a[aria-current] { background: #403f3b; box-shadow: none; }
html[data-theme="dark"] .blog-body .seg button[aria-selected="true"] { background: #403f3b; box-shadow: none; }
html[data-theme="dark"] .blog-body .cite-box,
html[data-theme="dark"] .blog-body figure > .fx-wrap { background: var(--card); }
html[data-theme="dark"] .blog-body .tab { border-top-color: #3d3c38; color: #8f8c82; }
html[data-theme="dark"] .blog-body .tab:hover, html[data-theme="dark"] .blog-body .tab[aria-selected="true"] { color: var(--ink); }
html[data-theme="dark"] .blog-body .tab::before { background: var(--clay); }
html[data-theme="dark"] .blog-body .tab[aria-selected="true"] b, html[data-theme="dark"] .blog-body .panel .kicker,
html[data-theme="dark"] .blog-body #eva-fig ~ .tabs .tab[aria-selected="true"] { color: var(--clay); }

/* ---------- charts ---------- */
html[data-theme="dark"] .blog-body .chart-svg .axis, html[data-theme="dark"] .blog-body .chart-svg .grid.v { stroke: var(--ink); }
html[data-theme="dark"] .blog-body .chart-svg .grid { stroke: #3a3936; }
html[data-theme="dark"] .blog-body .chart-svg .tick { fill: #8f8c82; }
html[data-theme="dark"] .blog-body .chart-svg .l-vla { stroke: var(--ink); }
html[data-theme="dark"] .blog-body .chart-svg .l-wam { stroke: #8f8c82; }
html[data-theme="dark"] .blog-body .chart-svg .l-agentic { stroke: var(--clay); }
html[data-theme="dark"] .blog-body .chart-svg .dot { fill: var(--card); }
html[data-theme="dark"] .blog-body .chart-svg .dot.l-agentic { fill: var(--clay); stroke: var(--card); filter: drop-shadow(0 0 3px #a8551f); }
html[data-theme="dark"] .blog-body .chart-svg text.end { fill: var(--ink-2); }
html[data-theme="dark"] .blog-body .chart-svg text.end.l-vla .num { fill: var(--ink); }
html[data-theme="dark"] .blog-body .chart-svg text.end.l-wam .num { fill: var(--ink-2); }
html[data-theme="dark"] .blog-body .chart-svg text.end.l-agentic .num { fill: var(--clay); }
html[data-theme="dark"] .blog-body .chart-svg .lead { stroke: #4a4843; }
html[data-theme="dark"] .blog-body .trend-head { stroke: #8f8c82; }
html[data-theme="dark"] .blog-body .trend-date { fill: var(--ink); }
html[data-theme="dark"] .blog-body .bar .name span { color: #8f8c82; }
html[data-theme="dark"] .blog-body .bar .track { background: #33322e; }
html[data-theme="dark"] .blog-body .bar.two .track { background: none; }
html[data-theme="dark"] .blog-body .bar .fill { background: var(--clay); }
html[data-theme="dark"] .blog-body .bar .fill.alt { background: #d9d6cc; }
html[data-theme="dark"] .blog-body .legend span:first-child i { background: var(--clay) !important; }
html[data-theme="dark"] .blog-body .legend span:last-child i { background: #d9d6cc !important; }

/* ---------- drawn diagrams: light lines on dark boxes, the same orange ---------- */
html[data-theme="dark"] .fx { --or: #f08a45; --fink: #f3f1ea; }
html[data-theme="dark"] .fx-box .face { fill: #191817; }
html[data-theme="dark"] .fx-box .halo, html[data-theme="dark"] .tl-think .halo { fill: #6b3f22; }
html[data-theme="dark"] .fx-sub, html[data-theme="dark"] .fx-ps, html[data-theme="dark"] .fx-band text { fill: #b9b6ab; }
html[data-theme="dark"] .fx-box.soft .face { stroke: #5a5852; }
html[data-theme="dark"] .fx-box.on .face { fill: #40291a; }
html[data-theme="dark"] .fx-panel rect, html[data-theme="dark"] .fx-band rect, html[data-theme="dark"] .fx-chip { fill: #2d2c29; }
html[data-theme="dark"] .fx-chip-t { fill: #d9d6cc; }
html[data-theme="dark"] .fx-lab.note { fill: #8f8c82; }
html[data-theme="dark"] .fx-dot circle:first-child { fill: #6b3f22; }
html[data-theme="dark"] .fx-dot circle:last-child { stroke: #22211f; }
html[data-theme="dark"] .fx-arr.ink .fx-dot circle:first-child { fill: #5a5852; }
html[data-theme="dark"] .fx-icon rect, html[data-theme="dark"] .fx-icon path, html[data-theme="dark"] .fx-icon polygon, html[data-theme="dark"] .fx-icon circle { stroke: #f3f1ea; }
html[data-theme="dark"] .fx-icon .core { stroke: none; }
html[data-theme="dark"] .fx-icon .hot, html[data-theme="dark"] .fx-icon.gear circle { stroke: #f08a45; }
html[data-theme="dark"] .tl-brace.ink { stroke: #8f8c82; }

/* the timeline */
html[data-theme="dark"] .tl-does, html[data-theme="dark"] .tl-wait, html[data-theme="dark"] .tl-paused text, html[data-theme="dark"] .tl-tick { fill: #8f8c82; }
html[data-theme="dark"] .tl-think .face { fill: #191817; }
html[data-theme="dark"] .tl-act rect, html[data-theme="dark"] .tl-runs rect { fill: #40291a; }
html[data-theme="dark"] #tl-hatch rect { fill: #2d2c29; }
html[data-theme="dark"] #tl-hatch line { stroke: #3a3936; }
html[data-theme="dark"] .tl-bar { fill: #2d2c29; }
html[data-theme="dark"] #tl-heat stop:nth-child(1) { stop-color: #3d2718; }
html[data-theme="dark"] #tl-heat stop:nth-child(2) { stop-color: #5a3519; }
html[data-theme="dark"] #tl-heat stop:nth-child(3) { stop-color: #8a4a1c; }
html[data-theme="dark"] .tl-real { fill: #ffb07a; }
html[data-theme="dark"] .tl-real.b { fill: #ffc79a; }
html[data-theme="dark"] .tl-boil { fill: #ffc79a; }
html[data-theme="dark"] .tl-rule { stroke: #4a4843; }
html[data-theme="dark"] .tl.live .tl-think.on .face { fill: #40291a; }
html[data-theme="dark"] .tl.live .tl-act.on rect, html[data-theme="dark"] .tl.live .tl-runs.on rect { fill: #f08a45; }
html[data-theme="dark"] .tl.live .tl-act.on text, html[data-theme="dark"] .tl.live .tl-runs.on text { fill: #191817; }
html[data-theme="dark"] .tl.live .tl-paused.on rect { stroke: #8f8c82; }

/* ---------- pictures rendered on white keep a white plate ---------- */
html[data-theme="dark"] .f1-t, html[data-theme="dark"] .f1-h { fill: #141413; }
html[data-theme="dark"] .f1-t .to { fill: #87867f; }
html[data-theme="dark"] .blog-body .paper-fig .f1-wrap, html[data-theme="dark"] .blog-body .eva-stage, html[data-theme="dark"] .blog-body .duo { background: #fff; }

/* ---------- the switch itself ---------- */
.modes .theme { display: grid; place-items: center; width: 30px; margin-left: 2px; border-radius: 7px; color: var(--ink-2); transition: color .2s, background .2s; }
.modes .theme:hover { color: var(--ink); }
.modes .theme svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.modes .theme .sun { display: none; }
html[data-theme="dark"] .modes .theme .sun { display: block; }
html[data-theme="dark"] .modes .theme .moon { display: none; }

/* the chart's end labels are text, not lines: they take the line's colour as fill only */
.blog-body .chart-svg text.end, html[data-theme="dark"] .blog-body .chart-svg text.end { stroke: none; }

html[data-theme="dark"] .blog-body .chart-svg .trend-zoom { fill: #2a2927; }

html[data-theme="dark"] .fx-group { stroke: #6b6861; }
