/*
 * Night mode. Turned on by <html data-theme="dark"> (toggle in the header, remembered per visitor).
 * Mostly a token swap; the rest covers the few places that use a fixed light colour.
 */
html[data-theme="dark"] {
	color-scheme: dark;
	--cx-brand: #8E68C6;
	--cx-brand-d: #A988D9;
	--cx-tint: #251C33;
	--cx-form-bg: #1B1524;
	--cx-form-line: #3A2E4A;
	--cx-text: #ECE7F3;
	--cx-muted: #A79EB5;
	--cx-bg: #110D17;
	--cx-soft: #1C1626;
	--cx-line: #2E263A;
	--cx-ink: #1A1424;
	--cx-ink-2: #241B31;
	--cx-ok-bg: #12301F;
	--cx-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
}
html[data-theme="dark"] .hero { border-bottom: 1px solid var(--cx-line); }

/* Logo: white version */
.logo .lg-d { display: none; }
html[data-theme="dark"] .logo .lg-l { display: none; }
html[data-theme="dark"] .logo .lg-d { display: block; }

/* Fixed light surfaces → dark */
html[data-theme="dark"] .opt-row button,
html[data-theme="dark"] .sbar .add,
html[data-theme="dark"] .qty,
html[data-theme="dark"] .dm,
html[data-theme="dark"] .osum,
html[data-theme="dark"] .field input,
html[data-theme="dark"] .field select,
html[data-theme="dark"] .field textarea,
html[data-theme="dark"] .cx .skip-link:focus { background-color: var(--cx-soft); color: var(--cx-text); }
html[data-theme="dark"] .sbar { background: rgba(17, 13, 23, .97); }
html[data-theme="dark"] .field.err input,
html[data-theme="dark"] .field.err select { background-color: #2A141A; }
html[data-theme="dark"] .form-err { background: #2A141A; color: #FF9AA8; }
html[data-theme="dark"] .notice { background: #2A2112; color: #F2C77A; }
html[data-theme="dark"] .tag-ob { background: #3A2A0E; color: #F5C46B; }
html[data-theme="dark"] .tag-demo { background: #222833; color: #B7C0CE; }
html[data-theme="dark"] .qoffer { background: var(--cx-tint); color: #D8C6F2; }
html[data-theme="dark"] .pledge { background: #1C1912; border-color: #3A342A; color: #DED6C6; }
html[data-theme="dark"] .ph { color: #5D5470; }
html[data-theme="dark"] select option { background: #1C1626; color: #ECE7F3; }
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #776E86; }
html[data-theme="dark"] #infoBody .info-link { color: var(--cx-text); }

/* Product photos: soften pure white backgrounds a little */
html[data-theme="dark"] .pcard img,
html[data-theme="dark"] .gallery img { filter: brightness(.94); }

/* Toggle button */
.theme-btn .sun { display: none; }
html[data-theme="dark"] .theme-btn .sun { display: block; }
html[data-theme="dark"] .theme-btn .moon { display: none; }
html[data-theme="dark"] .tag-new { color: #CDB8EC; }

/* Living background in night mode: a little stronger so it reads on the dark base. */
html[data-theme="dark"] .cx-fx { color: #B48FE6; }
html[data-theme="dark"] .cx-fx .g:nth-child(-n+2) { opacity: .2; }
html[data-theme="dark"] .cx-fx .s { opacity: .17; }
