/* ═══════════════════════════════════════════════════════════════════════════
   DARK THEME — <html data-theme="dark"> (set in SiteLayout's head from the system
   setting and followed live; no on-page control).

   Only the white and grey grounds change. Everything already dark — the navy
   bands, the textured hero and banner tiles, the photo proof cards, the closing
   banner, the footer — stays exactly as it is. Product UI shown on the page stays
   light (it is a picture of the app), except the home page's campaign replay,
   which has its own dark product skin below. White sections take #0B0F17 and grey
   sections #0F1420, both a step darker than navy so the navy bands still read as
   bands. Cards sit raised on #111725 / #161D2E.

   Order: shared tokens first, then light islands, then the rules that hard-code
   a light colour. Selectors carry :root[data-theme="dark"] so they beat the
   pages' own inline <style> blocks.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Tokens ── */
:root[data-theme="dark"]{
  color-scheme:dark;
  --ink:#F4F6FA; --ink-2:rgba(244,246,250,.78); --ink-3:rgba(244,246,250,.62); --ink-4:rgba(244,246,250,.45);
  --paper:#111725;     /* raised surface: cards, menus, panels */
  --grey:#0F1420;      /* the grey field */
  --grey-2:#161D2E;    /* wells and second-level surfaces */
  --mist:rgba(76,139,245,.12); --mist-2:rgba(76,139,245,.22);
  --rule:rgba(255,255,255,.10); --rule-cool:rgba(255,255,255,.10); --rule-dark:rgba(255,255,255,.14);
}
:root[data-theme="dark"] body{background:#0B0F17}
:where(:root[data-theme="dark"]) a{color:var(--blue-lift)}
:where(:root[data-theme="dark"]) a:hover{color:#7FAAF7}
:root[data-theme="dark"] :is(.label b,.label-blue,.btn-link){color:var(--blue-lift)}

/* ── Light islands: product UI, light-scrimmed texture and the landing-page templates (.lp-root, their own light
   design) stay light, with the light token set restored. ── */
:root[data-theme="dark"] :is(.ui,.nat-scrim-light,.pl-ui,.lp-root){
  color-scheme:light;
  --ink:#20242C; --ink-2:#464E5C; --ink-3:#5E6675; --ink-4:#98A0AC;
  --paper:#FFFFFF; --grey:#F7F7F7; --grey-2:#ECEDEF; --mist:#EDF3FE; --mist-2:#D6E5FC;
  --rule:#E6E9EE; --rule-cool:#E4E8EF; --rule-dark:rgba(255,255,255,.14);
  color:var(--ink);
}

/* ── Nav: dark gloss glass — the light glass's blur and saturation, a faint top highlight, a hairline and a soft shadow. ── */
:root[data-theme="dark"] .nav{
  background:linear-gradient(180deg,rgba(20,26,40,.80) 0%,rgba(11,15,23,.74) 55%,rgba(11,15,23,.70) 100%);
  -webkit-backdrop-filter:blur(24px) saturate(180%);backdrop-filter:blur(24px) saturate(180%);border-bottom-color:rgba(255,255,255,.07);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.07),0 1px 0 rgba(255,255,255,.07),0 12px 30px -18px rgba(0,0,0,.75)}
:root[data-theme="dark"] .nav .nav-logo img:not(.nav-logo-dk){display:none}
:root[data-theme="dark"] .nav .nav-logo-dk{display:block}
:root[data-theme="dark"] .nav-menu > div{background:#111725;box-shadow:0 0 0 1px rgba(255,255,255,.09),0 20px 44px -16px rgba(0,0,0,.75)}
:root[data-theme="dark"] .nav-menu a:hover{background:rgba(255,255,255,.05)}
:root[data-theme="dark"] .mega-p a.np-c{background:rgba(255,255,255,.035)}
:root[data-theme="dark"] .mega-p a.np-c:hover{background:rgba(255,255,255,.07)}
:root[data-theme="dark"] .mega-p a.np-feat{box-shadow:inset 0 0 0 1px rgba(255,255,255,.08)}
:root[data-theme="dark"] .nav-feat-img{background:#161D2E}
@media (max-width:820px){
  :root[data-theme="dark"] .nav.open .nav-links{background:#0E131E;border-bottom-color:rgba(255,255,255,.08);box-shadow:0 18px 30px -20px rgba(0,0,0,.8)}
  :root[data-theme="dark"] .nav.open .nav-menu > div{background:none;box-shadow:none}
  :root[data-theme="dark"] .nav.open .mega-p a.np-c{background:none}
}

/* ── Shared components on white and grey grounds ── */
:root[data-theme="dark"] .unit{box-shadow:0 0 0 1px rgba(255,255,255,.08),0 8px 22px -12px rgba(0,0,0,.6)}
:root[data-theme="dark"] .grain::after{mix-blend-mode:overlay;opacity:.08}
:root[data-theme="dark"] .marks:not(.nat-scrim-light .marks) img{filter:grayscale(1) brightness(0) invert(1);opacity:.6}
:root[data-theme="dark"] .hz{--tray:#161D2E}
:root[data-theme="dark"] :is(.hm-grey,.field-grey) .hz{--tray:#141A29}
:root[data-theme="dark"] .hz-tray{box-shadow:inset 0 0 0 1px rgba(255,255,255,.08)}
:root[data-theme="dark"] .hz-c{background:#111725;box-shadow:0 0 0 1px rgba(255,255,255,.10)}
:root[data-theme="dark"] a.hz-c:hover{box-shadow:0 0 0 1px rgba(255,255,255,.24),0 10px 24px -14px rgba(0,0,0,.7)}
:root[data-theme="dark"] .hz .hz-c.on{box-shadow:0 0 0 1.5px var(--ink),0 16px 30px -18px rgba(0,0,0,.7)}
:root[data-theme="dark"] .hz-c.on::after{color:#0B0F17}
:root[data-theme="dark"] .seq-s:hover{background:rgba(255,255,255,.04)}

/* Title frames on white and grey grounds: light-on-dark hairlines and diamonds. Frames already on dark tiles keep theirs. */
:root[data-theme="dark"] .xf:not(.hero-copy,.lst-frame,.hp-team){--xf-line:rgba(255,255,255,.11);--xf-faint:rgba(255,255,255,.04);--xf-cross:rgba(255,255,255,.38)}

/* Outline buttons on the redesigned grounds turn white, the same as their dark-ground rule. */
:root[data-theme="dark"] :is(.nav,.hero-home,.sec,.cta) a.btn{color:#fff;border-color:rgba(255,255,255,.88)}
:root[data-theme="dark"] :is(.nav,.hero-home,.sec,.cta) a.btn:hover{background:rgba(255,255,255,.08);border-color:#fff;color:#fff;box-shadow:0 0 28px -6px var(--sheen-1),inset 0 0 0 1px rgba(255,255,255,.18)}
:root[data-theme="dark"] :is(.nav,.hero-home,.sec,.cta) a.btn:focus-visible{outline-color:#fff}

/* ═════════════════════════ Home page ═════════════════════════ */
/* Hero: the tile is already dark; the ground around it and the logo strip change. */
:root[data-theme="dark"] .hero-home{background:#0B0F17}
:root[data-theme="dark"] .hero-track .marks-black img,:root[data-theme="dark"] .marks-black img{filter:grayscale(1) brightness(0) invert(1);opacity:.82}

/* Campaign demo (#work, grey ground): the textured stage stays; the replayed app inside it takes a dark product skin.
   The app reads its own --bg/--fg/--line/... set, so most of it follows these values; the rest hard-codes white. */
:root[data-theme="dark"] .lc-tab:hover{background:rgba(255,255,255,.04)}
:root[data-theme="dark"] .lc-tab.on{background:#111725;box-shadow:0 0 0 1px rgba(255,255,255,.12),0 18px 36px -24px rgba(0,0,0,.7)}
:root[data-theme="dark"] .lc-tab:focus-visible{outline-color:var(--blue-lift)}
:root[data-theme="dark"] .lc-screen{border-color:rgba(255,255,255,.08);box-shadow:0 1px 2px rgba(0,0,0,.2),0 24px 48px -30px rgba(0,0,0,.7)}
:root[data-theme="dark"] .lca-app{
  --bg:#0F1420;--bg-2:#1A2234;--bg-3:#1E2638;
  --fg:#F4F6FA;--fg-2:rgba(244,246,250,.78);--fg-3:rgba(244,246,250,.58);--fg-4:rgba(244,246,250,.38);
  --line:rgba(255,255,255,.09);--accent:var(--blue-lift);--tint:rgba(76,139,245,.16);
  --ok:#2FB463;--ok-tint:rgba(47,180,99,.15);--ok-text:#6ADB97;--ring:rgba(255,255,255,.16);
  --chrome:#111725;--chrome-line:rgba(255,255,255,.08);--plan:rgba(244,246,250,.42);
  --shadow-small:0 0 calc(1*var(--u)) rgba(0,0,0,.5),0 calc(1*var(--u)) calc(2*var(--u)) rgba(0,0,0,.4)}
/* Icon rail and header bar: one chrome surface. The mark is drawn in currentColor (black as an <img>), so it inverts. */
:root[data-theme="dark"] .lca-app .m-rail{--bg-2:#111725;--border:rgba(255,255,255,.08);--fg-2:rgba(244,246,250,.6);--accent:#1960DC}
:root[data-theme="dark"] .lca-app .m-rail .m-logo img{filter:invert(1)}
/* Stages panel and its cards; the spinner and check keep their colours. */
:root[data-theme="dark"] .lca-app .m-st{background:#141A28}
:root[data-theme="dark"] .lca-app .m-stg{background:#161D2E;box-shadow:inset 0 0 0 calc(1*var(--u)) rgba(255,255,255,.09),0 calc(1*var(--u)) calc(2*var(--u)) rgba(0,0,0,.25),0 calc(8*var(--u)) calc(20*var(--u)) calc(-14*var(--u)) rgba(0,0,0,.6)}
:root[data-theme="dark"] .lca-app .m-stg.on{box-shadow:inset 0 0 0 calc(1*var(--u)) rgba(76,139,245,.5),0 calc(1*var(--u)) calc(2*var(--u)) rgba(0,0,0,.3),0 calc(12*var(--u)) calc(26*var(--u)) calc(-14*var(--u)) rgba(0,0,0,.7)}
:root[data-theme="dark"] .lca-app .m-stg::after{background:linear-gradient(100deg,transparent 35%,rgba(47,180,99,.16) 50%,transparent 65%);background-size:300% 100%;background-position:100% 0}
/* The open session: blue-tinted dark. */
:root[data-theme="dark"] .lca-app .m-ses.now{background:rgba(76,139,245,.14);box-shadow:inset 0 0 0 1px rgba(76,139,245,.3)}
:root[data-theme="dark"] .lca-app .m-ses.now > svg{color:var(--blue-lift)}
/* Thread: user bubbles a raised surface; result cards #161D2E; chips and composer outlined in white tints. */
:root[data-theme="dark"] .lca-app .m-user{box-shadow:inset 0 0 0 calc(1*var(--u)) rgba(255,255,255,.08)}
:root[data-theme="dark"] .lca-app .m-rc{background:#161D2E;box-shadow:0 0 0 calc(1*var(--u)) rgba(255,255,255,.09),0 calc(1*var(--u)) calc(2*var(--u)) rgba(0,0,0,.3)}
:root[data-theme="dark"] .lca-app .m-chart .dot{stroke:#161D2E}
:root[data-theme="dark"] .lca-app .m-btn{border-color:rgba(255,255,255,.32);color:rgba(244,246,250,.86)}
:root[data-theme="dark"] .lca-app .m-chip.press{background:rgba(76,139,245,.16);border-color:var(--blue-lift);color:var(--blue-lift)}
:root[data-theme="dark"] .lca-app .m-chip.m-go{border-color:var(--blue-lift);color:var(--blue-lift)}
:root[data-theme="dark"] .lca-app .m-comp{background:#141A28;box-shadow:0 0 0 calc(1*var(--u)) rgba(255,255,255,.14),var(--shadow-small)}
:root[data-theme="dark"] .lca-app .m-pill.ping::after{box-shadow:0 0 0 0 rgba(47,180,99,.4)}
:root[data-theme="dark"] .lca-app .m-pill.m-blue.ping::after{box-shadow:0 0 0 0 rgba(76,139,245,.4)}

/* Harness (#harness, white ground): the panel and its control card take dark surfaces. site.js recolours the drawing. */
:root[data-theme="dark"] #harness .hx-panel{background:#0F1420 radial-gradient(rgba(255,255,255,.075) 1px,transparent 1.3px) 0 0/16px 16px;box-shadow:inset 0 0 0 1px rgba(255,255,255,.09)}
:root[data-theme="dark"] #harness .hx-card{background:#111725;border-color:rgba(255,255,255,.11);box-shadow:0 1px 2px rgba(0,0,0,.25),0 22px 44px -26px rgba(0,0,0,.8)}
:root[data-theme="dark"] #harness .hx-tag{background:#161D2E;box-shadow:inset 0 0 0 1px rgba(255,255,255,.10)}
:root[data-theme="dark"] #harness :is(.hx-k b,.hx-ku){color:var(--blue-lift)}
:root[data-theme="dark"] #harness .hx-prog{background:rgba(255,255,255,.10)}
:root[data-theme="dark"] #harness .hx-bar{background:var(--blue-lift)}
:root[data-theme="dark"] #harness .hx-tab{border-color:rgba(255,255,255,.14)}
:root[data-theme="dark"] #harness .hx-tab:hover{border-color:rgba(255,255,255,.4);color:#fff}
:root[data-theme="dark"] #harness .hx-tab[aria-selected="true"]{border-color:rgba(255,255,255,.78);color:#fff}
:root[data-theme="dark"] #harness .hx-tab:focus-visible{outline-color:var(--blue-lift)}
:root[data-theme="dark"] #harness .hx-still i{filter:brightness(1.6)}

/* Segment cards (#segments, grey ground): raised dark cards; the hover glow keeps the hero's hue. */
:root[data-theme="dark"] .seg-c{background:#111725;box-shadow:0 0 0 1px rgba(255,255,255,.09)}
:root[data-theme="dark"] .seg-c:hover{box-shadow:0 0 0 1px rgba(255,255,255,.2),0 16px 36px -20px rgba(0,0,0,.7),0 18px 44px -26px var(--sheen-1)}
:root[data-theme="dark"] .seg-c::before{mix-blend-mode:screen}
:root[data-theme="dark"] .seg-c .seg-arw{box-shadow:inset 0 0 0 1px rgba(255,255,255,.16)}
:root[data-theme="dark"] .seg-c:hover .seg-arw{color:#fff}
:root[data-theme="dark"] .seg-c:focus-visible{outline-color:var(--blue-lift)}

/* Proof rail (#resources, white ground): the photo cards stay; the progress bar lifts. */
:root[data-theme="dark"] #resources .res-track{background:rgba(255,255,255,.12)}
:root[data-theme="dark"] #resources .res-track i{background:var(--blue-lift)}

/* ═════════════════════════ Other pages ═════════════════════════
   Readable dark for the cards and fields these pages hard-code in white or grey: raised cards take #111725, inner
   wells #161D2E, and hard-coded white/grey sections fall back to the page and grey grounds. */
:root[data-theme="dark"] :is(.mh-p,.mh-m,.jr-tags a,.jr-feat span,.ms-p,.ms-link span,.ms-m,.pt-s,.pl-c,.sk-g,.sk-t,.sk-hub,.sg-ic,.dp-ask,.tc,.cl-card,.ops-c){background-color:#111725}
:root[data-theme="dark"] :is(.mh-tray,.ms-h,.unit-m.crop){background-color:#161D2E}
/* Sections that set a light ground in a style attribute (only !important reaches those). */
:root[data-theme="dark"] .sec:is([style*="#F5F5F5" i],[style*="#F7F7F7" i]){background-color:#0F1420!important}
:root[data-theme="dark"] .sec:is([style*="#ffffff" i],[style*="#fff;" i]){background-color:#0B0F17!important}
:root[data-theme="dark"] .tp-pg[aria-current="page"]{color:#0B0F17}
:root[data-theme="dark"] .cl-gov{background:rgba(76,139,245,.14);color:var(--blue-lift)}
