/* Public-site theme contract. First visit is light; only an explicit saved
 * choice enables dark. Loaded after page CSS to share one palette everywhere. */
:root:not([data-theme="dark"]),
:root:not([data-theme="dark"]) body {
  color-scheme: light;
  --bg: #faf9fc;
  --surface: #ffffff;
  --surface2: #f0edf5;
  --surface-2: var(--surface2);
  --border: #ded9e7;
  --border-strong: #b0a7bf;
  --accent: #6943bd;
  --accent-deep: #57359f;
  --accent-strong: #57359f;
  --accent-soft: rgba(105, 67, 189, 0.09);
  --accent2: #a52c70;
  --text: #252132;
  --muted: #655d74;
  --rating: #916000;
  --on-accent: #fbfaff;
  --nav-bg: rgba(250, 249, 252, 0.96);
  --copy: #51495f;
  --hover-bg: rgba(105, 67, 189, 0.07);
  --positive: #207044;
  --error: #b4233d;
  --discovery-copy: #5d546e;
  --discovery-label: #51495f;
  --discovery-prose: #443d51;
  --discovery-hover: #57359f;
  --discovery-feature: #f0eaf8;
  --discovery-cta-text: var(--on-accent);
}
:root[data-theme="dark"],
:root[data-theme="dark"] body {
  color-scheme: dark;
  --bg: #0e0e12;
  --surface: #16161e;
  --surface2: #1e1e29;
  --surface-2: var(--surface2);
  --border: #2a2a38;
  --border-strong: #3a3a4e;
  --accent: #a78bfa;
  --accent-deep: #7c6cf0;
  --accent-strong: #b8a2fb;
  --accent-soft: rgba(167, 139, 250, 0.12);
  --accent2: #f472b6;
  --text: #ececf4;
  --muted: #9a9ab8;
  --rating: #fbbf24;
  --on-accent: #171222;
  --nav-bg: rgba(14, 14, 18, 0.94);
  --copy: #b6b6cb;
  --hover-bg: rgba(167, 139, 250, 0.08);
  --positive: #4ade80;
  --error: #fca5a5;
  --discovery-copy: #b6b6cb;
  --discovery-label: #c2c2d4;
  --discovery-prose: #c8c8d9;
  --discovery-hover: #b8a2fb;
  --discovery-feature: #1c1929;
  --discovery-cta-text: var(--on-accent);
}
:root body { background: var(--bg); color: var(--text); }
:root body nav { background: var(--nav-bg); }
:root body .nav-links a:hover,
:root body .mobile-menu a:hover,
:root body .mobile-menu a.active { background: var(--hover-bg); }
:root body .hero-synopsis,
:root body .synopsis-text,
:root body .review-text { color: var(--copy); }
:root body .btn-primary,
:root body .where-to-watch-action,
:root body .primary,
:root body .auth-submit,
:root body .auth-tabs button.active,
:root body .hero-poster-badge,
:root body .discovery-skip { color: var(--on-accent); }
:root body .btn-secondary { background: var(--surface2); }
:root body .status-badge { color: var(--positive); }
:root body .auth-error { color: var(--error); }
:root body .auth-form input,
:root body .settings-input,
:root body input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) { background: var(--surface2); }
:root body .dropdown-menu { background: var(--surface); }
:root:not([data-theme="dark"]) body .card-rating,
:root:not([data-theme="dark"]) body .actor-count { color: #f8d378; }
:root:not([data-theme="dark"]) body .hero-poster-art,
:root:not([data-theme="dark"]) body .cast-avatar,
:root:not([data-theme="dark"]) body .ep-thumb,
:root:not([data-theme="dark"]) body .related-poster { color: #d4cae4; }

/* Explicit day/night actions remain visible next to the mobile menu. */
:root body .theme-switch {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface2);
}
:root body .theme-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 32px;
  padding: 6px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: 600 12px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  white-space: nowrap;
  cursor: pointer;
}
:root body .theme-option svg { display: block; flex: none; pointer-events: none; }
:root body .theme-option[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
:root body .theme-option:hover { color: var(--text); }
:root body .theme-option[aria-pressed="true"]:hover { color: var(--on-accent); }
:root body .theme-option:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
:root body .navbar .theme-switch { margin-left: auto; margin-right: 0.75rem; }
@media (max-width: 1100px) {
  :root body .nav-right .search-bar,
  :root body.discovery-page .nav-right .search-bar { width: 145px; }
}
@media (max-width: 900px) {
  :root body .nav-right .search-bar,
  :root body.discovery-page .nav-right .search-bar { display: none; }
}
@media (max-width: 767px) {
  :root body .theme-option { min-height: 36px; }
  :root body .nav-right { gap: 0.5rem; }
}
