/* The dark theme (owner's pick 2026-11-20: v2b in light and dark). Every rule here is v2b-dark's
   (site/variants/v2b-dark/public/assets/site/dark.css and its edits to v2b.css and site.css), scoped to
   html[data-theme="dark"], which the inline script in each page's head sets before the first paint from the
   visitor's choice or the device (render.mjs THEME). Loaded last, after v2b.css. Colours only. */

:root[data-theme="dark"] { color-scheme: dark; }

/* ---------------------------------------------------------------- the band
   The statistics band and the footer were the dark band on v2b's paper. Here they are one step lighter
   than the ground (#1c2129 on #0e1217), with a hairline at each edge so the step reads on any screen.
   The kit darkens a footer on a dark page (html[data-tone=dark] .footer--dark); this keeps it the band. */
html[data-theme="dark"] .footer.footer--dark.ground-inverse {
  --bg: var(--p-inv-bg); --surface: var(--p-inv-surface); --ink: var(--p-inv-ink); --muted: var(--p-inv-muted);
  --accent: var(--p-inv-accent); --accent-ink: var(--p-inv-accent-ink); --action: var(--p-inv-action); --action-ink: var(--p-inv-action-ink);
}
html[data-theme="dark"] .ground-inverse { border-block: 1px solid color-mix(in oklab, var(--p-ink) 9%, transparent); }
html[data-theme="dark"] .footer.ground-inverse { border-bottom: 0; }

/* ---------------------------------------------------------------- no black shadows on ink
   A shadow does not show on #0e1217; edges come from the surface steps and hairlines instead */
html[data-theme="dark"] .card { box-shadow: none; }
html[data-theme="dark"] .card--plan:focus-within, html[data-theme="dark"] .card--plan:hover { box-shadow: none; }
html[data-theme="dark"] .card--plan:not(.is-featured):is(:hover, html[data-theme="dark"] :focus-within) { border-color: color-mix(in oklab, var(--ink) 40%, transparent); }
html[data-theme="dark"] .card--plan.is-featured:is(:hover, html[data-theme="dark"] :focus-within) { box-shadow: inset 0 0 0 1px var(--action); }

/* ---------------------------------------------------------------- the app frame stays paper
   The app itself is light, so its window is shown as it is: a paper sheet on the dark desk, with v2b's
   light tokens inside it. No shadow; the paper edge is the frame. */
html[data-theme="dark"] .app.ui {
  --fx-bg: #f3f4f1; --fx-surface: #e8eae5; --fx-ink: #0e1217; --fx-muted: #545a62; --fx-accent: #f2d13a; --fx-accent-ink: #0e1217;
  --bg: #f3f4f1; --surface: #e8eae5; --ink: #0e1217; --muted: #545a62; --action: #0e1217; --action-ink: #f3f4f1;
  --line: color-mix(in oklab, #0e1217 11%, transparent); --line-strong: color-mix(in oklab, #0e1217 20%, transparent);
  --u-shadow: none; box-shadow: none; border-color: transparent; color-scheme: light;
}

/* ---------------------------------------------------------------- focus on paper
   The kit's ring is the action colour, paper here. Inside a sheet or the app window that would vanish,
   so a control there gets an ink ring (17:1 on the sheet) */
html[data-theme="dark"] .kv-sheet :focus-visible, html[data-theme="dark"] .app :focus-visible { outline-color: #0e1217; }

/* ---------------------------------------------------------------- the hero's pause disc
   An ink disc with a paper sign. On the desktop it sits on a paper sheet (the clock, the verdict, the
   slowest list); on a phone on the dark ground, where its paper edge (40 %) gives it 3.6:1. Focus: a
   paper ring hugging it and an ink ring outside, so one of the two shows on either ground. */
html[data-theme="dark"] .ly-collage[data-kv-story] > .loop-pause.loop-pause {
  background: #0e1217; color: #f3f4f1; border-color: color-mix(in oklab, #f3f4f1 40%, transparent); box-shadow: none; opacity: 1;
}
html[data-theme="dark"] .ly-collage[data-kv-story] > .loop-pause.loop-pause:is(:hover, html[data-theme="dark"] :focus-visible) { border-color: #f3f4f1; }
html[data-theme="dark"] .ly-collage[data-kv-story] > .loop-pause.loop-pause:focus-visible { outline: 2px solid #0e1217; outline-offset: 2px; box-shadow: 0 0 0 2px #f3f4f1; }

/* ---------------------------------------------------------------- marks that were ink on paper
   On the dark ground the highlighter reads (12.5:1 on the ground, 11.3:1 on the surface), so the marks
   v2b had to draw in ink go back to it */

/* the 40-point line on the scale: the highlighter itself, its label still ink on the highlighter */
html[data-theme="dark"] .kv-scale__mark--accent { border-left-color: var(--accent); }
@media (hover: hover) and (pointer: fine) {
  html[data-theme="dark"] .kv-scale__bar > span:hover { background-color: color-mix(in oklab, var(--accent) 12%, var(--surface)); border-color: var(--accent); }
}

/* "10 point fordelt": the Figurer cells need no ink edge on the dark frame */
html[data-theme="dark"] .kv-weigh__row + .kv-weigh__row .kv-weigh__cells > i { box-shadow: none; }

/* the comparison table: a pale paper tint on the plan column under the pointer, its head in the highlighter
   (a yellow tint on ink turned olive) */
html[data-theme="dark"] .kv-cmp[data-col="1"] tr > :nth-child(2), html[data-theme="dark"] .kv-cmp[data-col="2"] tr > :nth-child(3), html[data-theme="dark"] .kv-cmp[data-col="3"] tr > :nth-child(4) {
  background-color: color-mix(in oklab, var(--ink) 6%, transparent); }
html[data-theme="dark"] .kv-cmp[data-col="1"] thead th:nth-child(2), html[data-theme="dark"] .kv-cmp[data-col="2"] thead th:nth-child(3), html[data-theme="dark"] .kv-cmp[data-col="3"] thead th:nth-child(4) { color: var(--accent); }

/* faq's word highlight: v2b kept the words ink with a highlighter stroke under them; paper text on the
   highlighter would be 1.3:1, so the key words turn the highlighter itself (12.5:1), as the kit draws them */
html[data-theme="dark"] .mo-wh strong .mo-w.is-on { color: var(--accent); box-shadow: none; }
@media (prefers-reduced-motion: reduce) { html[data-theme="dark"] .mo-wh strong .mo-w { color: var(--accent); box-shadow: none; } }

/* om's pinned chapters: the step in view gets the highlighter rule again */
html[data-theme="dark"] [data-moment="pinned-chapters"].is-live .mo-pc__step.is-on { border-left-color: var(--accent); }

/* the newsletter field: paper edge at 55 % (6.0:1 on the ground), paper haze on focus */
@media (prefers-reduced-motion: no-preference) {
  html[data-theme="dark"] .kv-news .field input:not([type="checkbox"]):focus { box-shadow: 0 0 0 3px color-mix(in oklab, var(--ink) 22%, transparent); }
}

/* the mega menu's sheet: the kit's panel vignette (::before, the card colour at 34 %) paints over the
   sheet, which on paper was invisible; with the dark card it greyed the figure, so the sheet sits above it */
html[data-theme="dark"] .kv-menu-sheet { position: relative; z-index: 1; }

/* inside a paper sheet the kit's own tokens are the sheet's: a kit rule that colours text with --ink (om's
   pinned chapters set every step paragraph in --ink, so a sheet's explanation came out paper on paper)
   gets the sheet's ink there. The sheet's own focus ring stays the page's (it sits on the dark ground). */
html[data-theme="dark"] .kv-sheet { --ink: var(--kv-ink); --muted: var(--kv-muted);
  --line: color-mix(in oklab, #0e1217 11%, transparent); --line-strong: color-mix(in oklab, #0e1217 20%, transparent); }


/* ---------------------------------------------------------------- what v2b-dark changed in v2b.css and site.css
   (there they were edits in place; here they are overrides, since the light rules stay for the light theme) */
/* the lit ground is the dark surface step (panels under the sheets, the scale frame, the about page's desk) */
:root[data-theme="dark"] { --ground-bg: #181d24; --ground-surface: #222831; --ground-ink: #f3f4f1; --ground-muted: #a3a9b0; --ground-accent: #f2d13a; }
html[data-theme="dark"] ::selection { background: var(--p-accent); color: var(--p-accent-ink); }
/* the drawn sheets are the palette's paper #f3f4f1 instead of white; every figure colour stays as it is */
html[data-theme="dark"] .kv-sheet { --kv-sheet: #f3f4f1; }
html[data-theme="dark"] .ly-collage .ly-piece { background: var(--kv-sheet, #f3f4f1); box-shadow: none; border-color: transparent; }
html[data-theme="dark"] .kv-bar-track { background: color-mix(in oklab, var(--kv-ink) 8%, var(--kv-sheet, #f3f4f1)); }
html[data-theme="dark"] .kv-card-sheet, html[data-theme="dark"] .kv-pc-sheet { box-shadow: none; border-color: transparent; }
html[data-theme="dark"] .kv-example { background: color-mix(in oklab, var(--kv-mark, var(--accent)) 45%, var(--kv-sheet, #f3f4f1)); }
