/* Dark theme (Apple-style) + theme toggle — loaded LAST on every page.
   Light stays the default. The toggle sets <html data-theme="dark"> and remembers it;
   with no stored choice the page follows the visitor's system setting (set inline in <head>).
   Everything here is scoped to html[data-theme="dark"] so light is untouched. */

/* ---------- toggle button (theme-agnostic) ---------- */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; min-width: 44px; padding: 0; margin: 0;
  border: 1px solid var(--rule-light); border-radius: 99px;
  background: transparent; color: var(--on-light); cursor: pointer;
  transition: background-color .2s var(--ease-out), color .2s var(--ease-out), border-color .2s var(--ease-out);
}
.theme-toggle svg { width: 18px; height: 18px; display: block; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle:hover { background: var(--light); }
.theme-toggle:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
/* in the hero the toggle sits among 32px pills, so match their height */
.rb-acts .theme-toggle { width: 32px; height: 32px; min-width: 32px; margin-left: 2px; }
.rb-acts .theme-toggle svg { width: 15px; height: 15px; }

/* ---------- dark tokens ---------- */
html[data-theme="dark"] {
  color-scheme: dark;
  /* industry.css tokens (note: --dark = the white sections, --light = the grey sections) */
  --dark: #000000;
  --dark-lift: #1d1d1f;
  --on-dark: #f5f5f7;
  --on-dark-soft: #a1a1a6;
  --light: #1d1d1f;
  --light-well: #000000;
  --on-light: #f5f5f7;
  --on-light-soft: #a1a1a6;
  --on-light-soft-strong: #d2d2d7;
  --on-dark-soft-strong: #d2d2d7;
  --rule-dark: rgba(255, 255, 255, .14);
  --rule-light: rgba(255, 255, 255, .14);
  --red: #0071e3;          /* filled buttons keep Apple blue + white text */
  --red-press: #0077ed;
  --red-text-light: #2997ff; /* link text on black (Apple dark link blue) */
  --red-text-dark: #2997ff;
  --bezel: #0a0a0a;
  --bezel-edge: #3a3a3c;
  /* home-v2.css local tokens */
  --white: #000000;
  --grey: #1d1d1f;
  --field-edge: #424245;
  --error: #ff6961;
}

/* ---------- hero (ribbon) ---------- */
html[data-theme="dark"] .rb {
  color-scheme: dark;
  --rb-bg: #000000; --rb-ink: #f5f5f7; --rb-mid: #a1a1a6; --rb-line: rgba(255, 255, 255, .14);
}
html[data-theme="dark"] .rb-glow { background: linear-gradient(rgba(0, 0, 0, .9), rgba(0, 0, 0, 0)); }
html[data-theme="dark"] .rb-acts a { border-color: rgba(255, 255, 255, .35); }
html[data-theme="dark"] .rb-acts a:hover { background: var(--rb-ink); color: var(--rb-bg); }

/* ---------- bits that were hardcoded light ---------- */
html[data-theme="dark"] .skip:focus { color: #000; }
html[data-theme="dark"] .work-item img,
html[data-theme="dark"] .work-item video { outline-color: rgba(255, 255, 255, .1); }
html[data-theme="dark"] .reel-row img { background: #1d1d1f; outline-color: rgba(255, 255, 255, .08); }
html[data-theme="dark"] .reel-type { color: #f5f5f7; -webkit-text-stroke-color: #f5f5f7; }
html[data-theme="dark"] .field select {
  background-image:
    linear-gradient(45deg, transparent 50%, #a1a1a6 50%),
    linear-gradient(135deg, #a1a1a6 50%, transparent 50%);
}
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* the example chat / workflow widgets keep their own light surfaces but need dark text */
html[data-theme="dark"] .pd-motion { --paper: #1d1d1f; --line: rgba(255, 255, 255, .14); }