/* Dark theme for the public site.
 *
 * Pure CSS, driven by the device setting, so there is no toggle to find, no JavaScript, and no
 * white flash before a script runs. Only the tokens are redefined; every rule on every page is
 * untouched, which is why light mode is provably unchanged.
 *
 * `html:root` rather than `:root` on purpose: it raises specificity just enough that this file
 * wins no matter where a page happens to put its own :root block relative to this link tag.
 *
 * TWO THINGS DO NOT INVERT, and getting this wrong is what makes a dark mode look broken:
 *   --on-accent   white TEXT on a coloured fill. Same value in both themes, which is the whole
 *                 reason it is separate from --surface, whose value is identical today.
 *   *-fill        colours drawn BEHIND white text. They stay dark while their text-coloured
 *                 twins go light, or white stops reading on them.
 */
@media (prefers-color-scheme: dark) {
  html:root {
    /* grounds and surfaces */
    --off-white: #101219;
    --white: #14161d;
    --surface: #14161d;
    --surface-2: #1b1e27;
    --surface-3: #181b23;
    --surface-4: #1b1e27;
    --panel-dark: #1f222c;

    /* text */
    --text: #e8eaf2;
    --black: #f2f3f7;
    --muted: #a3a9bd;
    --muted-2: #9096ab;
    --ink-700: #c7ccdb;
    --ink-600: #b6bccb;
    --ink-500: #aab0c2;
    --ink-450: #9aa0b8;

    /* lines */
    --border: #2a2e3a;
    --line-2: #2c3040;
    --line-3: #333847;
    --line-4: #3b4150;
    --brand-line: #35304a;

    /* brand: text goes light, the fill stays dark enough for white on it */
    --brand: #a77fe0;
    --brand-light: #c3a4f0;
    --brand-dark: #8f6bc8;
    --brand-ink: #c0b5d8;
    --brand-tint: #241d33;
    --brand-fill: #8257c4;
    /* The lighter half of a brand gradient that carries white text. Left at its light value it
       averaged out to 4.34, just under AA. */
    --brand-fill-lite: #7a52b8;
    --ink-fill: #2b2f3b;

    --shadow: 0 4px 24px rgba(0,0,0,.5);

    /* The footer and the dark panels are dark in BOTH themes, so this one does not invert. */
    --ink-fill: #0b0d13;

    /* ── The other pages ──────────────────────────────────────────────────────────────
       They were each built with their own vocabulary: --line where index says --border,
       --ink where it says --text, --card and --bg where it says --surface. Rather than
       rename tokens across twelve files and risk twelve regressions, every name any page
       uses gets a dark value here. */
    /* The page ground. index calls it --off-white, every other page calls it --bg, and missing
       this one left six pages rendering a white body under light text. */
    --bg: #0e1016;
    --bg-2: #161922;
    --bg-3: #1c202a;
    --card: #14161d;
    --ink: #e8eaf2;
    --ink-2: #b6bccb;
    --body: #c7ccdb;
    --dim: #9096ab;
    --muted2: #9096ab;
    --line: #2a2e3a;
    --brand-lite: #c3a4f0;

    /* Accents lighten so they separate from a dark ground. */
    --gold: #fbbf24;
    --green: #34d399;
    --amber: #fcd34d;
    --blue: #60a5fa;
    --gold-2: #fcd34d;
    --muted2-2: #9096ab;
    /* Gold behind white text stays dark, like the other *-fill tokens. */
    --gold-fill: #8a5d0c;

    /* Tints were mixed for white. At 8 to 9 percent they vanish on a dark ground, so they
       carry roughly double the alpha here to stay visible as the same gesture. */
    --brand-soft: rgba(167,127,224,.14);
    --brand-mid: rgba(167,127,224,.20);
    --brand-dim: rgba(167,127,224,.16);
    --brand-border: rgba(167,127,224,.30);
    --gold-soft: rgba(251,191,36,.14);
    --gold-bg: rgba(251,191,36,.14);
    --gold-border: rgba(251,191,36,.30);
    --green-soft: rgba(52,211,153,.14);
    --green-border: rgba(52,211,153,.30);
    --amber-soft: rgba(252,211,77,.14);
    --blue-soft: rgba(96,165,250,.14);

    --shadow-sm: 0 2px 12px rgba(0,0,0,.45);
    --shadow-md: 0 6px 28px rgba(0,0,0,.5);
    --shadow-lg: 0 16px 52px rgba(0,0,0,.55);
  }

  /* Those always-dark panels take their text from tokens that DO invert, so on a dark page the
     footer ended up dark grey on near-black. They are pinned to the light values they had. */
  html:root .site-footer { color: #9ca3af; }
  html:root .footer-tagline { color: #9ca3af; }
  html:root .footer-col ul li a { color: #adb5bd; }
  html:root .footer-legal { color: #8f95a6; }
  html:root .footer-social a { color: #9ca3af; }

  /* The jump bar is a translucent white strip, written as a literal rather than a token. */
  html:root .jump-bar {
    background: rgba(18,20,27,.88);
    border-bottom-color: rgba(255,255,255,.08);
  }
  html:root .jump-link:hover { background: rgba(255,255,255,.06); }

  /* The fake browser chrome in the portal preview. */
  html:root .ppf-bar { background: #1b1e27; }

  /* The hero is a photo behind a near-opaque CREAM scrim, sized for dark copy on a light wash.
     Flip the scrim, or the headline turns light and sits on a light photo: the one place on this
     page where a token swap alone is not enough, because the readability comes from the overlay
     rather than from any colour a token controls. */
  html:root .hero::after {
    background:
      linear-gradient(rgba(16,18,25,.88), rgba(16,18,25,.94)),
      radial-gradient(1000px 520px at 50% -10%, rgba(167,127,224,.22), rgba(167,127,224,0) 70%);
  }
  /* The ghost CTA had a white fill to survive the photo. On the dark scrim it needs the opposite. */
  html:root .hero .btn-secondary-brand {
    background: rgba(255,255,255,.10);
    border-color: rgba(255,255,255,.22);
    color: var(--text);
  }
  html:root .hero .btn-secondary-brand:hover {
    background: rgba(255,255,255,.17);
    border-color: var(--brand);
  }

  /* ── css/nav.css ──────────────────────────────────────────────────────────────────────
     It is shared by every page and has no tokens of its own, so all 28 of its light values
     are literals that have to be restated here. This is the whole shared chrome: header,
     dropdown, the mobile drawer, and the related-pages pills.
     Only pages that link this file are affected, so the rest of the site is untouched. */
  html:root .wb-header { background: #14161d; border-bottom-color: #2a2e3a; }
  html:root .wb-dropdown { background: #171a23; border-color: #2a2e3a; }
  html:root .wb-dd-divider { background: #2a2e3a; }
  html:root .wb-nav-link, html:root .wb-nav-link:visited { color: #d7dae6; }
  html:root .wb-dd-item, html:root .wb-dd-item:visited { color: #d7dae6; }
  html:root .wb-get-started-btn { background: #1f2430; color: #e8eaf2; border-color: #39405020; }
  html:root .wb-get-started-btn:hover { background: #e8eaf2; border-color: #e8eaf2; color: #0e1016; }

  /* The mobile drawer. This was the worst of it: a white sheet with pale grey links, so on a
     dark phone the menu opened as an unreadable slab. */
  /* The hamburger bars are #374151, a dark slate that all but disappears against a dark header.
     They carry the same weight as the nav links now. */
  html:root .wb-hamburger span { background: #d7dae6; }
  html:root .wb-hamburger:hover { background: rgba(255,255,255,.08); }
  html:root .wb-hamburger:hover span { background: #ffffff; }

  html:root .wb-mobile-menu { background: #14161d; border-top-color: #2a2e3a; }
  html:root .wb-mob-backdrop { background: rgba(0,0,0,.55); }
  html:root .wb-mob-link, html:root .wb-mob-link:visited { color: #d7dae6; border-bottom-color: #242835; }
  html:root .wb-mob-link:hover, html:root .wb-mob-link.wb-active { color: #c3a4f0; }
  html:root .wb-mob-link i { color: #8d93a8; }
  html:root .wb-mob-link:hover i { color: #c3a4f0; }
  html:root .wb-mob-sub { color: #a3a9bd; }
  html:root .wb-mob-accordion { color: #d7dae6; }
  html:root .wb-mob-accordion i { color: #8d93a8; }
  html:root .wb-mob-accordion.wb-open { color: #c3a4f0; border-bottom-color: #242835; }
  html:root .wb-mob-accordion.wb-open i { color: #c3a4f0; }
  html:root .wb-mob-divider { background: #2a2e3a; }
  html:root .wb-mob-cta { color: #c3a4f0; }
  html:root .wb-mob-cta:hover { background: #8257c4; color: #ffffff; }

  /* Fake browser chrome. Both use an rgba() fill, which a hex-based tokenizer never saw, so the
     url pill stayed a pale slab on one page and went dark-on-dark on the other. */
  html:root .browser-url { background: rgba(255,255,255,.07); color: #a3a9bd; }

  html:root .portal-embed { background: #14161d; border-color: #2a2e3a; }
  html:root .portal-embed .pe-bar { background: #1b1e27; border-bottom-color: #2a2e3a; }
  html:root .portal-embed .pe-url { color: #9aa0b8; }
  html:root .related-pill { background: #171a23; border-color: #2a2e3a; color: #e8eaf2; }
  html:root .related-pill:hover, html:root .related-pill > i:first-child { color: #c3a4f0; }

  /* css/nav.css has no tokens of its own, so its colours are literals and have to be named here.
     These only apply on pages that link this file, so the rest of the site is untouched. */
  html:root .wb-logo-word { color: #e8eaf2; }
  /* The class is .wb-portal-btn, not .btn-nav-client. Measured rather than guessed: the element
     reported rgb(120,81,169) even after the first override, which is how the real name turned up. */
  html:root .btn-nav-client, html:root .wb-portal-btn { color: #c3a4f0; border-color: #8257c4; }
  html:root .btn-nav-client:hover, html:root .wb-portal-btn:hover { background: #8257c4; color: #ffffff; }
  html:root .wb-nav-link.wb-active { color: #c3a4f0; background: rgba(167,127,224,.12); }
  html:root .wb-dd-item:hover { background: rgba(167,127,224,.12); color: #c3a4f0; }
  html:root .wb-dd-item:hover i { color: #c3a4f0; }
  html:root .wb-dd { background: #171a23; border-color: #2a2e3a; }

  /* The shared nav and footer live in css/nav.css, which has no tokens of its own. */
  html:root .wb-header { background: #14161d; border-bottom-color: #2a2e3a; }
  html:root img[src*="webeaze-transparent"] { filter: brightness(1.9); }
}

/* Only alive while the device setting actually changes, so nothing on the page carries a
   transition cost for the other 99.99% of the time. */
@media (prefers-reduced-motion: no-preference) {
  html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
    transition: background-color .3s ease, color .3s ease, border-color .3s ease,
                fill .3s ease, stroke .3s ease, box-shadow .3s ease !important;
  }
}

/* ── Billy's assistant (css/ask.css) and the home showcase's browser bar ──────────────────────
   ask.css is loaded on every page, light and dark, and is written in literals, so its dark
   values live here, where only the pages that have a dark theme pick them up. html:root outranks
   ask.css, which is added to the page after this file. One ink colour is both dark text and the
   dark pill behind the hello bubble, so it is not inverted as a token: each part is set here. */
@media (prefers-color-scheme: dark) {
  html:root .ask-row-btn { background: #1d2029; color: #f2f3f7; }
  html:root .ask-row-btn:hover { background: #252936; }
  html:root .ask-row-txt span, html:root .ask-row-chev { color: #a3a9bd; }
  html:root .ask-compose textarea { color: #e8eaf2; }
  html:root .ask-compose textarea::placeholder { color: #7d8398; }
  html:root .ask-chip, html:root .ask-slot { background: #11131a; border-color: #2c3040; color: #e8eaf2; }

  html:root .ask-panel { background: #14161d; border-color: #2c3040; color: #e8eaf2; box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .8); }
  html:root .ask-head, html:root .ask-foot { border-color: #2a2e3a; }
  html:root .ask-who b, html:root .ask-slot b { color: #f2f3f7; }
  html:root .ask-who span, html:root .ask-slot span, html:root .ask-booked span, html:root .ask-alt a { color: #a3a9bd; }
  html:root .ask-x { background: rgba(255, 255, 255, .07); color: #e8eaf2; }
  html:root .ask-x:hover { background: rgba(255, 255, 255, .13); }
  html:root .ask-msg.bot, html:root .ask-typing { background: #1f222c; color: #e8eaf2; }
  html:root .ask-msg a { color: #c9b0f2; }
  html:root .ask-slot.picked { background: #251e35; }
  html:root .ask-foot { background: rgba(20, 22, 29, .94); }
  html:root .ask-compose { background: #11131a; border-color: #2c3040; }

  html:root .hx-show-bar { background: rgba(27, 30, 39, .94); border-bottom-color: rgba(255, 255, 255, .07); }

  /* The work tiles were pastel washes mixed for a white page; on a dark one they glare. The same
     hues, deepened, keep each client's colour without the light-mode look. */
  html:root .t-violet .hx-tile { background: linear-gradient(160deg, #2b2142, #3d2c60); }
  html:root .t-sky .hx-tile { background: linear-gradient(160deg, #15253a, #1c3653); }
  html:root .t-grass .hx-tile { background: linear-gradient(160deg, #152a1d, #1f4129); }
  html:root .t-sand .hx-tile { background: linear-gradient(160deg, #2c2217, #45331e); }
  html:root .t-violet .hx-blob, html:root .t-sky .hx-blob, html:root .t-grass .hx-blob, html:root .t-sand .hx-blob { opacity: .35; }
  html:root .hx-case-cta .hx-tile { background: linear-gradient(150deg, #4a2d77, #5b3b8e 60%, #6b4b9f); }
  /* Marks meant for a white page: the quote's yellow highlight turned olive, the purple underline vanished. */
  html:root .hx-quote mark { background: linear-gradient(transparent 58%, rgba(167, 127, 224, .38) 58%); }
  html:root .hx-mark { background-image: linear-gradient(rgba(196, 167, 242, .75), rgba(196, 167, 242, .75)); }
  html:root .hx-url { background: #11131a; border-color: #2c3040; color: #c7ccdb; }
}

/* ── The phone menu (css/menu.css) on a dark page ──────────────────────────────────────────────
   Its pill is near-black, which vanishes on a dark header, so here the pill is light and the card
   it grows into is dark. menu.css holds its colours with !important (for pages that force every
   element's colour), so these do too, with html:root to outrank it. */
@media (prefers-color-scheme: dark) {
  html:root .wb-hamburger.wbm-pill { background: #f2f3f7; }
  html:root .wb-hamburger.wbm-pill:hover { background: #ffffff; }
  /* The old icon's lines were spans painted light; the pill's label is a span too, so it keeps no fill. */
  html:root .wb-hamburger.wbm-pill span, html:root .wb-hamburger.wbm-pill:hover span { background: none; }
  html:root .wb-hamburger.wbm-pill, html:root .wb-hamburger.wbm-pill * { color: #14121c !important; }
  html:root .wbm-scrim { background: rgba(0, 0, 0, .45); }
  html:root .wbm-card { background: #191c25; border-color: #2c3040; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8); }
  html:root .wbm-card.is-pill { background: #f2f3f7; }
  html:root #wbm .wbm-link, html:root #wbm .wbm-link:hover { color: #f2f3f7 !important; }
  html:root #wbm .wbm-x { background: rgba(255, 255, 255, .08); color: #f2f3f7 !important; }
  html:root .wbm-chev { border-color: #a3a9bd; }
  html:root .wbm-sub { background: #222533; }
  html:root #wbm .wbm-sub a { color: #c7ccdb !important; }
  html:root #wbm .wbm-sub a:hover, html:root #wbm .wbm-sub a[aria-current="page"], html:root #wbm .wbm-badge a { color: #c9b0f2 !important; }
  html:root .wbm-badge { background: #1f222c; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05); }
  html:root .wbm-foot { background: #191c25; box-shadow: 0 -18px 18px -14px #191c25; }
  html:root #wbm .wbm-badge, html:root #wbm .wbm-badge .wbm-how { color: #a3a9bd !important; }
}

/* ── The Oct 2026 desktop header and the one-line banner, dark ──────────────────────────────── */
@media (prefers-color-scheme: dark) and (min-width: 992px) {
  html:root .wb-logo-word::after { color: #a3a9bd; }
  /* A text link now, so the old filled hover (purple block) must not come back. */
  html:root .wb-portal-btn, html:root .wb-portal-btn:hover { background: none; border-color: #3a3e4b; color: #f2f3f7; }
  html:root .wb-portal-btn:hover { border-color: #f2f3f7; background: rgba(255, 255, 255, .04); }
  html:root .wb-portal-btn i, html:root .wb-portal-btn svg { color: #c9b0f2; }
}
@media (prefers-color-scheme: dark) {
  /* The plum bar sat almost on the dark header's colour; a step lighter and a hairline set it apart. */
  html:root .wbb-brand, html:root .wbb-anniversary { background: #2a2140; }
  html:root .wbb { box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .06); }
}
