/* Light / dark theme for www.dykos.com (owner 2026-10-19).
   The theme follows the visitor's system setting until they press the switch in the top bar; the switch
   sets data-theme="light|dark" on <html> (remembered in localStorage "dykos-theme", applied by an inline
   script in <head> before anything paints). Every colour below is defined light first, then redefined twice
   for dark: once for the system setting, once for the switch, so the switch wins in both directions.

   --b-*  the home page (static/homepage-b.js and software-b.js read them through B_TOK)
   --ink, --fg, ...  the server-rendered pages (templates/legal_base.html defines the light values)
   --night  bands that stay navy in both themes (top strip, phone section, portfolio, footer, page heroes)
   .b-light  "stays light" islands: boxes holding brand logos and photo labels keep light colours in both themes */

:root {
  --b-bg: #FFFFFF; --b-bg2: #F4F7FB; --b-bg3: #EAF0F7; --b-card: #FFFFFF;
  --b-line: #DCE3ED; --b-lineHard: #B8C3D2;
  --b-ink: #0E1A33; --b-fg: #1B2A47; --b-dim: #566379; --b-dimmer: #8B95A8;
  --b-blue: #1F62D8; --b-blueDark: #0E3FA0; --b-blueSoft: #E6EFFC;
  --b-hero-1: rgba(255, 255, 255, 0.88); --b-hero-2: rgba(244, 247, 251, 0.5); --b-hero-3: rgba(244, 247, 251, 0.12);
  --night: #0E1A33;
  --toggle-ink: #1B2A47; --toggle-line: #DCE3ED; --toggle-hover: #1F62D8;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --b-bg: #0B1426; --b-bg2: #0F1A30; --b-bg3: #15223B; --b-card: #13203A;
    --b-line: #24324D; --b-lineHard: #3A4A6B;
    --b-ink: #EEF2F8; --b-fg: #D3DBE8; --b-dim: #9AA8BF; --b-dimmer: #74829B;
    --b-blue: #3B7DF0; --b-blueDark: #8DB4FF; --b-blueSoft: #17284A;
    --b-hero-1: rgba(11, 20, 38, 0.9); --b-hero-2: rgba(11, 20, 38, 0.66); --b-hero-3: rgba(11, 20, 38, 0.3);
    --ink: #EEF2F8; --fg: #D3DBE8; --dim: #9AA8BF; --dimmer: #74829B;
    --line: #24324D; --lineHard: #3A4A6B;
    --bg: #0B1426; --bg2: #0F1A30; --bg3: #15223B;
    --blue: #3B7DF0; --blueDark: #8DB4FF; --blueSoft: #17284A;
    --toggle-ink: #D3DBE8; --toggle-line: #24324D; --toggle-hover: #8DB4FF;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --b-bg: #0B1426; --b-bg2: #0F1A30; --b-bg3: #15223B; --b-card: #13203A;
  --b-line: #24324D; --b-lineHard: #3A4A6B;
  --b-ink: #EEF2F8; --b-fg: #D3DBE8; --b-dim: #9AA8BF; --b-dimmer: #74829B;
  --b-blue: #3B7DF0; --b-blueDark: #8DB4FF; --b-blueSoft: #17284A;
  --b-hero-1: rgba(11, 20, 38, 0.9); --b-hero-2: rgba(11, 20, 38, 0.66); --b-hero-3: rgba(11, 20, 38, 0.3);
  --ink: #EEF2F8; --fg: #D3DBE8; --dim: #9AA8BF; --dimmer: #74829B;
  --line: #24324D; --lineHard: #3A4A6B;
  --bg: #0B1426; --bg2: #0F1A30; --bg3: #15223B;
  --blue: #3B7DF0; --blueDark: #8DB4FF; --blueSoft: #17284A;
  --toggle-ink: #D3DBE8; --toggle-line: #24324D; --toggle-hover: #8DB4FF;
  color-scheme: dark;
}

/* boxes with brand logos / photo labels: light in both themes */
.b-light {
  --b-bg: #FFFFFF; --b-bg2: #F4F7FB; --b-bg3: #EAF0F7; --b-card: #FFFFFF;
  --b-line: #DCE3ED; --b-lineHard: #B8C3D2;
  --b-ink: #0E1A33; --b-fg: #1B2A47; --b-dim: #566379; --b-dimmer: #8B95A8;
  --b-blue: #1F62D8; --b-blueDark: #0E3FA0; --b-blueSoft: #E6EFFC;
  color-scheme: light;
}

/* the switch in the top bar: shows a moon in light mode (go dark) and a sun in dark mode (go light) */
.theme-toggle {
  appearance: none; background: transparent; border: 1.5px solid var(--toggle-line); color: var(--toggle-ink);
  width: 40px; height: 40px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0; flex: none;
}
.theme-toggle:hover { border-color: var(--toggle-hover); color: var(--toggle-hover); }
.theme-toggle:focus-visible { outline: 2px solid var(--toggle-hover); outline-offset: 2px; }
.theme-toggle svg { width: 18px; height: 18px; display: block; }
.theme-toggle .t-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .t-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .t-moon { display: none; }
}
:root[data-theme="dark"] .theme-toggle .t-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .t-moon { display: none; }
@media (max-width: 768px) { .theme-toggle { width: 38px; height: 38px; } }
