/* Dark mode (Lucas, 17 Nov 2026: "Add dark mode"). Light is the site's face and the default; dark is the visitor's
   choice from the toggle in the bar (next.js), kept in localStorage as bb-theme and set on <html data-theme="dark"> by
   the head's own script before anything paints. This sheet loads after every other one on every landing-next page and
   only ever applies under that attribute, so the light site is exactly what it was.

   How it works: the colour tokens swap (ink and paper trade places, the panels step up from the ground), and three
   kinds of place keep the light site's tokens inside them:
   - the orange fills, which always carry ink (the orange stays a fill with ink on it, never text);
   - the black panels (the ink band, the ink plan, the quote cards on ink), which stay black: a step under the ground with a
     hairline round them, so they still read as the loud panel;
   - the product screens, which switch to the app's own dark theme (beautify.css, html.dark) from next.js.
   The paintings stay as they are. Contrast measured in the browser on the ground, the panels (--mist, --mist-on) and the
   warm band: text 13:1 and up, body text under a headline 10:1 and up, grey meta 5.5:1 and up. */

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0E0E0E;      /* design-ok: Lucas, 17 Nov 2026: "Add dark mode" (the ground, not pure black) */
  --paper2: #1F1C17;     /* design-ok: Lucas, 17 Nov 2026: "Add dark mode" (the warm band at night) */
  --ink: #F4F4F4;        /* design-ok: Lucas, 17 Nov 2026: "Add dark mode" (type, the logo, outlines: the paper's colour) */
  --ink2: #C9C9C9;       /* design-ok: Lucas, 17 Nov 2026: "Add dark mode" (body text under a headline) */
  --grey: #9E9E9E;       /* design-ok: Lucas, 17 Nov 2026: "Add dark mode" (meta: 5.1:1 on the lightest panel) */
  --mist: #1A1A1A;       /* design-ok: Lucas, 17 Nov 2026: "Add dark mode" (the panels, a step up from the ground) */
  --mist-hover: #202020; /* design-ok: Lucas, 17 Nov 2026: "Add dark mode" */
  --mist-on: #282828;    /* design-ok: Lucas, 17 Nov 2026: "Add dark mode" (a panel pointed at) */
  --hairline: color-mix(in srgb, var(--ink) 13%, transparent);   /* a hairline a step over the ground */
  --hair: var(--hairline);
  --win-edge: color-mix(in srgb, var(--ink) 20%, transparent);   /* the product window's edge on the night's panel */
  --sel: color-mix(in srgb, var(--ink) 9%, transparent);
  --sel-hover: color-mix(in srgb, var(--ink) 5%, transparent);
  /* the CSS ruler's solids (before three.js, and without it): dark grey from the same one light, lit top lightest */
  --s-top: #5C5C5C;      /* design-ok: Lucas, 17 Nov 2026: "Add dark mode" */
  --s-front: #444444;    /* design-ok: Lucas, 17 Nov 2026: "Add dark mode" */
  --s-side: #2E2E2E;     /* design-ok: Lucas, 17 Nov 2026: "Add dark mode" */
  /* the three.js solids' faces (ruler3d.js, stack3d.js read it; light has none and keeps white) */
  --solid: #343434;      /* design-ok: Lucas, 17 Nov 2026: "Add dark mode" */
  --sun-ink: #111111;    /* design-ok: Lucas, 17 Nov 2026: "Add dark mode" (what sits on the orange stays ink) */
  /* the black panels' ground: a step under the page's, framed by a hairline */
  --ink-ground: #080808; /* design-ok: Lucas, 17 Nov 2026: "Add dark mode" */
  /* the app's own surfaces at night (beautify.css), for the frames round the product screens */
  --app-card: #1A1A19;   /* design-ok: Lucas, 17 Nov 2026: "Add dark mode" (the app's card at night) */
  --app-ground: #0E0E0D; /* design-ok: Lucas, 17 Nov 2026: "Add dark mode" (the app's ground at night) */
  --app-dots: #2E2E2B;   /* design-ok: Lucas, 17 Nov 2026: "Add dark mode" (the window's dots at night) */
}

/* no transitions while the colours change, so every part switches in the same frame (next.js adds it for a frame) */
:root.bb-switching *, :root.bb-switching *::before, :root.bb-switching *::after { transition: none !important; }   /* design-ok: one frame only, over every transition on the page, so nothing fades between the themes */

/* ---------- the light site's tokens, kept inside the orange fills, the black panels and the logo tiles ---------- */
:root[data-theme="dark"] :is(.nx-loud, .start-box, .cmp-pick-bb, .pg-two.lab > div:first-child, .pn-cost.us, .pn-mx tbody tr.us > *,
  .cmp .us, .g-vs .us, .int-soon, .pill-sun, .br-sun, .cm-yes.cm-ours, .fs-top, .pnl-body .cmp thead th.us, .nx-room:not(.pr-main *),
  .pn-brand:not(.dark) .pn-brand-g, .vc-mark:not(.vc-mark-ink) .vc-mark-i,
  .band-ink, .v2-plan-ink, .sig-ink, .dd-quote, .tier-ink, .go-box, .pn-brand.dark .pn-brand-g, .vc-code, .vc-mark-ink .vc-mark-i,
  .film-box, .acd-play, .acd-vid video, .ha-film, .ha-over, .ha-ink, .ha-sunt, .nx-film3) {
  --paper: #FFFFFF; --paper2: #EAE3D6; --ink: #111111; --ink2: #383838; --grey: #68645D;   /* design-ok: the light site's own tokens (landing-new.css) */
  --mist: #F4F4F4; --mist-hover: #EFEFEF; --mist-on: #E7E7E7;   /* design-ok: the light site's own tokens (next.css) */
  --hairline: color-mix(in srgb, var(--ink) 10%, transparent); --hair: var(--hairline);
  --sel: color-mix(in srgb, var(--ink) 6%, transparent); --sel-hover: color-mix(in srgb, var(--ink) 3%, transparent);
  color-scheme: light;
}
/* the black panels (and the films' and the videos' grounds): the light site's tokens, their ink the deep ground and their
   paper the night's paper; the panels get a hairline round them, so the black band still reads on the black page */
:root[data-theme="dark"] :is(.band-ink, .uses .use-ink, .v2-plan-ink, .sig-ink, .dd-quote, .tier-ink, .go-box, .pn-brand.dark .pn-brand-g, .vc-code, .vc-mark-ink .vc-mark-i,
  .film-box, .acd-play, .acd-vid video, .ha-film, .ha-over, .ha-ink, .ha-sunt, .nx-film3) {
  --ink: var(--ink-ground); --paper: #F4F4F4;   /* design-ok: Lucas, 17 Nov 2026: "Add dark mode" */
  color-scheme: dark;
}
:root[data-theme="dark"] :is(.band-ink, .uses .use-ink, .v2-plan-ink, .sig-ink, .dd-quote, .tier-ink, .go-box, .pn-brand.dark .pn-brand-g, .vc-code, .vc-mark-ink .vc-mark-i) {
  box-shadow: inset 0 0 0 1px #2A2A2A;   /* design-ok: Lucas, 17 Nov 2026: "Add dark mode" (the black band keeps its edge on the black page) */
}

/* the orange buttons keep ink on them; the ink buttons turn orange on hover, with ink on it */
:root[data-theme="dark"] .btn-sun, :root[data-theme="dark"] .btn-ink:hover { color: #111111; }   /* design-ok: ink on the orange, as in light */

/* ---------- the product screens: the app's own dark theme (next.js switches the frames); their plates follow ---------- */
:root[data-theme="dark"] :is(.crop iframe, .self-shot, .sig-shot, .window) { background: var(--app-card); }
:root[data-theme="dark"] :is(.stage, .stage iframe, .window.window-app, .app-screen, .app-screen iframe) { background: var(--app-ground); }
:root[data-theme="dark"] .window-app .wb-dots i { background: var(--app-dots); }
:root[data-theme="dark"] :is(.moment, .dx-card) { border-color: rgba(255, 255, 255, .12); background: var(--app-card); }   /* design-ok: the card's edge at night */
:root[data-theme="dark"] :is(.window, .moment, .dx-card) { box-shadow: 0 0 0 1px var(--win-edge), 0 1px 2px rgba(0, 0, 0, .4), 0 8px 20px -8px rgba(0, 0, 0, .7); }   /* design-ok: Jens, 17 Nov 2026: "behöver vara tydligare kant/skugga runt produkten" (Lucas, 19 Nov: fix it); the window's edge and shadow at night */
:root[data-theme="dark"] .x3-c { box-shadow: 0 0 0 calc(1px / var(--k, 1)) var(--win-edge), 0 calc(1px / var(--k, 1)) calc(2px / var(--k, 1)) rgba(0, 0, 0, .4), 0 calc(8px / var(--k, 1)) calc(20px / var(--k, 1)) calc(-8px / var(--k, 1)) rgba(0, 0, 0, .7); }   /* design-ok: the same, at the scale of the plane it sits in */
/* a crop cut at its card's border keeps no plate: the panel shows round the card */
:root[data-theme="dark"] .nx-dx :is(.dx-stage, .dx-shot) > .dx-card[data-clear], :root[data-theme="dark"] .v2-panel > .moment[data-clear],
:root[data-theme="dark"] .sig-shot[data-clear], :root[data-theme="dark"] [data-clear] :is(.crop, .ha-crop) iframe { background: transparent; }
:root[data-theme="dark"] .cursor svg { stroke: #111111; }   /* design-ok: the pointer's edge, dark round the light pointer */

/* ---------- logos: every logo is one ink on the site, so at night it's the paper's ink, as on the black band ---------- */
:root[data-theme="dark"] :is(.lg-track, .int-l, .cs-co, .cs-logos, .pg-logos, .trust-logos, .sp-proof .q-logo) img,
:root[data-theme="dark"] .int-l svg, :root[data-theme="dark"] .nx-q-logo { filter: brightness(0) invert(.95); }   /* design-ok: Lucas, 17 Nov 2026: "Add dark mode" (the logos in the paper's ink) */

/* ---------- the toggle: a small round icon button, the bar's pill size ---------- */
.nx-thm { display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 999px; background: none; color: var(--ink); cursor: pointer; transition: background-color var(--dur-fast) var(--ease-standard), scale var(--dur-spring) var(--ease-spring); }   /* design-ok: Lucas, 17 Nov 2026: "Add dark mode" (the bar's pill, round) */
.nx-thm svg { grid-area: 1 / 1; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }   /* design-ok: the icon's size */
.nx-thm .nx-sun, :root[data-theme="dark"] .nx-thm .nx-moon { display: none; }
:root[data-theme="dark"] .nx-thm .nx-sun { display: block; }
@media (hover: hover) and (pointer: fine) { .nx-thm:hover { background: var(--mist); } }
.nx-thm:active { scale: .94; transition-duration: var(--dur-instant); }
.nx-thm:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.nx-thm:focus:not(:focus-visible) { outline: none; }
.nav-end .nx-thm { margin-right: -8px; }   /* design-ok: the icon's own air, so it sits as close to Log in as the words do */
.nav-links .nx-thm { display: none; }   /* the phone menu's own, under its button */
@media (max-width: 1100px) {
  .nav-end .nx-thm { display: none; }
}
/* on a phone the toggle can't sit beside the logo (next.css): the open menu has its own */
@media (max-width: 560px) {
  .nav.open .nav-links .nx-thm { display: inline-grid; align-self: flex-start; margin: var(--s-1) 0 0 -8px; }   /* design-ok: the icon's own air, on the menu's edge */
}

/* ---------- drawn parts: ink becomes the paper's colour ---------- */
/* the three.js ruler's number on an orange block keeps ink; the flat AI stack (before three.js) has dark grey slabs */
:root[data-theme="dark"] .r3d-n.hot { color: var(--sun-ink); }
:root[data-theme="dark"] .fs-slab:not(.fs-top) { background: var(--solid); color: var(--ink); }
/* the kit's drawings, put inline by landing-new.js: their ink and paper from the tokens, the orange as it is */
:root[data-theme="dark"] svg [stroke="#111111" i], :root[data-theme="dark"] svg [stroke="#111" i] { stroke: var(--ink); }   /* design-ok: the drawings' own ink, matched to swap it */
:root[data-theme="dark"] svg [fill="#111111" i], :root[data-theme="dark"] svg [fill="#111" i] { fill: var(--ink); }   /* design-ok: the drawings' own ink, matched to swap it */
:root[data-theme="dark"] svg [fill="#F4EFE6" i] { fill: var(--paper); }   /* design-ok: the drawings' own paper, matched to swap it */

/* the outside card's light pill on the black: its chip and hover the light site's mist, so the arrow shows */
:root[data-theme="dark"] .uses .use-ink { --go-chip: #E9E9E9; --go-hover: #E9E9E9; }   /* design-ok: Lucas, 17 Nov 2026: "Add dark mode" */

