/* Shared PMW light palette. Dark mode remains the site's unchanged default. */
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f7fb;
  --bg-primary: #f5f7fb;
  --bg-secondary: #ffffff;
  --bg-tertiary: #edf1f6;
  --bg-card: #ffffff;
  --bg-hover: #e8edf3;
  --bg-glass: rgba(255, 255, 255, 0.88);
  --card: #ffffff;
  --surface: #ffffff;
  --surface-soft: #eef2f7;
  --text: #171a20;
  --text-primary: #171a20;
  --text-secondary: #566170;
  --text-muted: #747f8d;
  --muted: #687382;
  --border: rgba(20, 29, 43, 0.14);
  --border-hover: rgba(20, 29, 43, 0.28);
  --line: rgba(20, 29, 43, 0.14);
  --accent: #171a20;
  --accent-dim: rgba(20, 29, 43, 0.08);
  --gold: #8a6200;
  --gold-bright: #a97700;
  --glow-white: 0 10px 35px rgba(36, 49, 68, 0.10);
  --glow-strong: 0 16px 50px rgba(36, 49, 68, 0.15);
}

html[data-theme="light"] body,
html[data-theme="light"] .pmw-home-page,
html[data-theme="light"] .pmw-auth-page,
html[data-theme="light"] .pmw-account-dashboard-page,
html[data-theme="light"] .tools-page,
html[data-theme="light"] .converter-page {
  color: var(--text-primary);
  background-color: var(--bg-primary);
}

html[data-theme="light"] body::before,
html[data-theme="light"] body::after {
  opacity: 0.18;
}

html[data-theme="light"] :where(
  .main-nav,
  .navbar,
  .nav-bar,
  .pmw-home-nav,
  .pmw-auth-nav,
  .tools-nav,
  .converter-nav,
  .wallpaper-nav,
  .pmw-dashboard-sidebar,
  .account-menu-panel
) {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.92);
  border-color: var(--border);
  box-shadow: 0 12px 36px rgba(33, 44, 60, 0.10);
}

html[data-theme="light"] :where(
  .main-nav a,
  .navbar a,
  .nav-bar a,
  .pmw-home-nav a,
  .pmw-auth-nav a,
  .tools-nav a,
  .converter-nav a,
  .wallpaper-nav a,
  .account-menu-panel a
) {
  color: var(--text-secondary);
}

html[data-theme="light"] :where(
  .main-nav a:hover,
  .main-nav a.active,
  .navbar a:hover,
  .navbar a.active,
  .nav-bar a:hover,
  .nav-bar a.active,
  .pmw-home-nav a:hover,
  .pmw-home-nav a.active,
  .tools-nav a:hover,
  .tools-nav a.active,
  .converter-nav a:hover,
  .converter-nav a.active,
  .wallpaper-nav a:hover,
  .wallpaper-nav a.active
) {
  color: var(--text-primary);
  background: var(--bg-hover);
}

html[data-theme="light"] :where(
  .pmw-home-card,
  .platform-card,
  .tool-card,
  .tools-card,
  .feature-card,
  .pmw-auth-card,
  .pmw-auth-form-card,
  .pmw-auth-feature,
  .pmw-dashboard-panel,
  .pmw-account-card,
  .pmw-stat-card,
  .pmw-member-card,
  .pmw-overview-card,
  .pmw-help-card,
  .pmw-premium-dashboard-card,
  .wallpaper-card,
  .asset-card,
  .detail-card,
  .tool-panel,
  .tool-card-panel,
  .upload-panel,
  .settings-panel,
  .result-panel,
  .legal-card,
  .policy-card,
  .modal-content,
  .wallpaper-modal,
  .wallpaper-panel
) {
  color: var(--text-primary);
  background-color: var(--bg-card);
  border-color: var(--border);
  box-shadow: 0 12px 34px rgba(36, 49, 68, 0.08);
}

html[data-theme="light"] :where(
  input,
  select,
  textarea,
  .search-input,
  .search-bar,
  .filter-select,
  .tool-input
) {
  color: var(--text-primary);
  background-color: #ffffff;
  border-color: var(--border);
}

html[data-theme="light"] :where(input, textarea)::placeholder {
  color: #8a94a1;
}

html[data-theme="light"] :where(
  .chip,
  .filter-chip,
  .tag,
  .badge,
  .tool-tab,
  .preset-button,
  .format-button,
  .icon-button,
  .pmw-outline-button
) {
  color: var(--text-secondary);
  background-color: #ffffff;
  border-color: var(--border);
}

html[data-theme="light"] :where(
  .chip:hover,
  .chip.active,
  .filter-chip:hover,
  .filter-chip.active,
  .tool-tab:hover,
  .tool-tab.active,
  .preset-button:hover,
  .preset-button.active,
  .format-button:hover,
  .format-button.active
) {
  color: var(--text-primary);
  background-color: var(--bg-hover);
  border-color: var(--border-hover);
}

html[data-theme="light"] :where(
  .hero-title,
  .section-title,
  h1,
  h2,
  h3,
  strong
) {
  color: var(--text-primary);
}

html[data-theme="light"] :where(p, .subtitle, .description, .meta, small) {
  color: var(--text-secondary);
}

/* The homepage hero deliberately remains a cinematic dark canvas in both
   themes. Keep its foreground palette bright while the surrounding shell,
   navigation, sections, and controls follow the selected light theme. */
html[data-theme="light"] .pmw-home-hero-copy h1,
html[data-theme="light"] .pmw-home-hero-copy h1::first-line {
  color: #ffffff;
}

html[data-theme="light"] .pmw-home-hero-copy .pmw-home-lead {
  color: #c4cad4;
}

html[data-theme="light"] .pmw-home-hero-copy .pmw-home-kicker,
html[data-theme="light"] .pmw-home-hero-copy .pmw-home-proof {
  color: #e2e6ec;
}

html[data-theme="light"] :where(
  .pmw-tools-dashboard,
  .pmw-wallpaper-float,
  .pmw-studio-float,
  .pmw-floating-mini,
  .pmw-eye-mark
) {
  color: #f5f7fb;
}

html[data-theme="light"] :where(
  .pmw-tools-dashboard,
  .pmw-wallpaper-float,
  .pmw-studio-float,
  .pmw-floating-mini
) :where(h2, h3, strong, p, small, span) {
  color: inherit;
}

html[data-theme="light"] :where(.pmw-dashboard-sidebar, .pmw-dashboard-main, .pmw-dashboard-aside) {
  --text-primary: #171a20;
  --text-secondary: #5d6876;
}

html[data-theme="light"] .pmw-profile-avatar {
  color: #ffffff;
  background: radial-gradient(circle at 50% 28%, #7d8794, #222831 58%, #101318);
  box-shadow: 0 12px 32px rgba(26, 34, 45, 0.22);
}

html[data-theme="light"] :where(.pmw-dashboard-link, .pmw-theme-control) {
  color: var(--text-primary);
  background: rgba(20, 29, 43, 0.035);
  border-color: var(--border);
}

html[data-theme="light"] .pmw-dashboard-link:hover,
html[data-theme="light"] .pmw-dashboard-link.is-active {
  color: #171a20;
  background: rgba(199, 148, 24, 0.14);
}

html[data-theme="light"] :where(.drop-zone, .upload-area, .tool-dropzone) {
  color: var(--text-primary);
  background: #f8fafc;
  border-color: rgba(20, 29, 43, 0.2);
}

html[data-theme="light"] :where(.wallpaper-card, .asset-card) {
  overflow: hidden;
}

html[data-theme="light"] :where(.wallpaper-card img, .asset-card img, .wallpaper-preview img) {
  background-color: #e7ebf0;
}

html[data-theme="light"] :where(.modal-backdrop, .wallpaper-modal-backdrop) {
  background: rgba(35, 42, 52, 0.52);
}

html[data-theme="light"] dialog::backdrop {
  background: rgba(35, 42, 52, 0.52);
}

html[data-theme="light"] :where(.cookie-consent, .cookie-bar, #cookieConsent) {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.96);
  border-color: var(--border);
  box-shadow: 0 -8px 28px rgba(36, 49, 68, 0.1);
}

html[data-theme="light"] :where(.platform-footer, footer) {
  color: var(--text-secondary);
  background-color: #eef2f7;
  border-color: var(--border);
}

html[data-theme="light"] :where(.platform-footer a, footer a) {
  color: var(--text-secondary);
}

html[data-theme="light"] :where(.platform-footer a:hover, footer a:hover) {
  color: var(--text-primary);
}

html[data-theme="light"] :where(.pmw-primary-button, .primary-button, .download-button) {
  color: #ffffff;
  background: #171a20;
  border-color: #171a20;
}

html[data-theme="light"] :where(.pmw-primary-button, .primary-button, .download-button):hover {
  color: #ffffff;
  background: #303640;
  border-color: #303640;
}

@media (prefers-reduced-motion: reduce) {
  html[data-theme="light"] *,
  html[data-theme="light"] *::before,
  html[data-theme="light"] *::after {
    transition-duration: 0.01ms !important;
  }
}
