/* The brand's artwork colours stay independent of the page theme. */
:root {
  color-scheme: light;
  --theme-bg: #F3E2BD;
  --theme-text: #750027;
  --theme-muted: #750027;
  --theme-border: rgba(117, 0, 39, .25);
  --theme-surface: rgba(243, 226, 189, .7);
  --theme-shadow: 0 20px 50px rgba(0, 0, 0, .12);
}
html[data-theme="dark"] {
  color-scheme: dark;
  --theme-bg: #10191a;
  --theme-text: #F3E2BD;
  --theme-muted: #c8bea9;
  --theme-border: rgba(243, 226, 189, .23);
  --theme-surface: rgba(25, 43, 43, .8);
  --theme-shadow: 0 20px 50px rgba(0, 0, 0, .3);
  --bubble-shadow: 0 16px 38px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(243, 226, 189, .06);
}
.site-header .theme-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 11px;
  border: 1px solid var(--theme-border);
  border-radius: 100px;
  background: rgba(255, 255, 255, .28);
  color: var(--theme-text);
  font-size: 13px;
  line-height: 1.2;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.theme-toggle[hidden] { display: none !important; }
.theme-toggle-icons { display: flex; align-items: center; gap: 3px; }
.theme-toggle svg { display: block; width: 20px; height: 20px; }
.theme-toggle .theme-sun { display: none; }
.theme-toggle:hover { border-color: currentColor; transform: translateY(-1px); }
.theme-toggle:focus-visible { outline: 3px solid #F57912; outline-offset: 4px; }
html[data-theme="dark"] .theme-toggle .theme-sun { display: block; }
html[data-theme="dark"] .theme-toggle .theme-moon { display: none; }
html[data-theme="dark"] .site-header .theme-toggle {
  background: rgba(243, 226, 189, .09);
  border-color: rgba(243, 226, 189, .35);
  box-shadow: inset 0 1px 0 rgba(243, 226, 189, .1);
}
html[data-theme="dark"] body {
  background: radial-gradient(ellipse at 85% 0, rgba(8, 97, 92, .22), transparent 55%), var(--theme-bg);
  color: var(--theme-text);
}
html[data-theme="dark"] .site-header { color: var(--theme-text); }
html[data-theme="dark"] .site-header nav .portfolio-link { border-color: var(--theme-border); }
html[data-theme="dark"] .site-header nav a[aria-current="page"] {
  background: #750027;
  color: #F3E2BD;
  border-color: rgba(243, 226, 189, .28);
}
html[data-theme="dark"] .site-header nav a:hover,
html[data-theme="dark"] .site-header nav a:focus-visible {
  background: #263b3b;
  color: #F3E2BD;
  border-color: rgba(243, 226, 189, .45);
  box-shadow: 0 4px 0 #050d0e;
}
html[data-theme="dark"] .button {
  background: #F3E2BD;
  border-color: #F3E2BD;
  color: #750027;
}
html[data-theme="dark"] .button:hover { background: #ffb574; border-color: #ffb574; color: #10191a; }
html[data-theme="dark"] .text-link:hover { color: #ffb574; }
html[data-theme="dark"] h2 span,
html[data-theme="dark"] .hero h1 span,
html[data-theme="dark"] .home-intro h1 span { color: #96cdc5; }
html[data-theme="dark"] .text-bubble,
html[data-theme="dark"] .home-intro-bubble,
html[data-theme="dark"] .home-bottom {
  background: linear-gradient(135deg, rgba(243, 226, 189, .08), rgba(243, 226, 189, .015)), var(--theme-surface);
  color: var(--theme-text);
  border-color: var(--theme-border);
  box-shadow: var(--theme-shadow), inset 0 1px 0 rgba(243, 226, 189, .07);
}
html[data-theme="dark"] .home-video-backdrop { background: var(--theme-bg); }
html[data-theme="dark"] .home-video-backdrop::after {
  background: linear-gradient(180deg, rgba(8, 17, 18, .9), rgba(8, 17, 18, .7) 45%, rgba(8, 17, 18, .52) 72%, rgba(8, 17, 18, .9));
}
html[data-theme="dark"] .category-carousel {
  background: radial-gradient(ellipse at 12% 45%, rgba(8, 97, 92, .22), transparent 50%),
    radial-gradient(ellipse at 83% 65%, rgba(245, 121, 18, .12), transparent 47%), rgba(16, 25, 26, .4);
  border-color: var(--theme-border);
  box-shadow: inset 0 1px 0 rgba(243, 226, 189, .08), var(--theme-shadow);
}
html[data-theme="dark"] .carousel-controls button,
html[data-theme="dark"] .video-toggle {
  background: rgba(243, 226, 189, .09);
  color: #F3E2BD;
  border-color: var(--theme-border);
  box-shadow: inset 0 1px 0 rgba(243, 226, 189, .08);
}
html[data-theme="dark"] .carousel-controls button:hover:not(:disabled),
html[data-theme="dark"] .video-toggle:hover { background: #F3E2BD; color: #10191a; }
html[data-theme="dark"] .category-track { scrollbar-color: #c8bea9 transparent; }
html[data-theme="dark"] .category-card:focus-visible { outline-color: #F3E2BD; }
html[data-theme="dark"] footer,
html[data-theme="dark"] .home-video-page footer {
  background: rgba(8, 16, 17, .94);
  color: #F3E2BD;
  border-color: var(--theme-border);
}
html[data-theme="dark"] footer a:hover { color: #ffb574; }
html[data-theme="dark"] .replay-intro { color: #F3E2BD; border-color: var(--theme-border); }
html[data-theme="dark"] .skip { background: #F3E2BD; color: #10191a; }
html[data-theme="dark"] .logo-intro,
html[data-theme="dark"] .logo-intro::backdrop { background: #10191a; color: #F3E2BD; }
html[data-theme="dark"] .intro-skip {
  background: #263b3b;
  border-color: rgba(243, 226, 189, .4);
  color: #F3E2BD;
}
html[data-theme="dark"] .intro-skip:hover { background: #F3E2BD; color: #10191a; }
@media (max-width: 700px) {
  .site-header .theme-toggle { padding: 8px 10px; gap: 6px; }
  .site-header .theme-toggle > span:last-child { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .theme-toggle, .theme-toggle:hover { transition: none; transform: none; }
}
