/* Shared night palette. Brand buttons and sections that are already dark keep their own colors. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --night-bg: #101b1d;
  --night-alt: #152426;
  --night-surface: #1b2c2e;
  --night-text: #ecf4f0;
  --night-muted: #bdcdc7;
  --night-border: #3c5552;
  --off-white: var(--night-alt);
  --off: var(--night-alt);
  --paper: var(--night-alt);
  --line: var(--night-border);
  --border: var(--night-border);
  --gray: var(--night-muted);
  --text: var(--night-text);
  --color-bg: var(--night-bg);
  --color-text: var(--night-text);
  --color-light-bg: var(--night-surface);
  --color-muted: var(--night-muted);
  --bg: var(--night-bg);
  --surface: var(--night-surface);
  --text-muted: var(--night-muted);
}

html[data-theme="dark"] body { background: var(--night-bg); color: var(--night-text); }
html[data-theme="dark"] :is(input, textarea, select) { color-scheme: dark; }
html[data-theme="dark"] :is(.section-alt, .section.alt, .pull-quote, .why-not, .outcomes, .faq-section, .related-articles) { background: var(--night-alt); }
html[data-theme="dark"] :is(.sh-title, .step-marker-title, .pull-quote-text, .free-lessons-headline, .ai-partner-headline, .contrast-headline, .ai-chat-header, .ai-chat-greeting h3, .lesson-title, .deep-card h3, .founder-name, .founder-bio strong, .founder-more, .ch-title, .mech-step h3, .testi-name, .review-source, .free-lessons-next a, .compare-col.good h3, .card h3, .section h2, .section h3, .product h3, .chip, .card-meta) { color: var(--night-text); }
html[data-theme="dark"] :is(.sh-sub, .founder-bio, .founder-subtitle, .ch-sub, .ch-lessons li, .mech-step p, .testi-role, .faq-body, .deep-card p, .free-lessons-sub, .ai-partner-desc, .ai-benefits-list li, .ai-chat-greeting p, .lesson-desc, .section p.lead, .card p, .note, .lede) { color: var(--night-muted); }
html[data-theme="dark"] :is(.card, .ch, .founder, .testi, .deep-card, .lesson-card, .pill, .outcomes-list li, .faq details, .chip, .product, .mech-step) { background: var(--night-surface); border-color: var(--night-border); }
html[data-theme="dark"] :is(.card, .ch, .founder, .testi, .deep-card, .lesson-card, .pill, .outcomes-list li, .faq details, .chip, .product, .mech-step):hover { border-color: #8fc16a; }
html[data-theme="dark"] :is(.section:not(.section-dark) a:not(.button):not(.btn), .article-body a, .product a, .breadcrumb a, .free-lessons-next a) { color: #a9dbb8; }
html[data-theme="dark"] :is(.section:not(.section-dark) a:not(.button):not(.btn), .article-body a, .product a, .breadcrumb a):hover { color: #d3f2c3; }
html[data-theme="dark"] :is(.section-dark, .hero, .offer, .final-cta, .art-cta, .cta-section, .contact-card, .author-box) a { color: inherit; }

/* Home page: comparison, course cards, testimonials and chat preview. */
html[data-theme="dark"] :is(.pull-quote, .outcomes, .free-lessons-section, .lead-magnet-section) { border-color: var(--night-border); }
html[data-theme="dark"] .free-lessons-section { background: linear-gradient(135deg, #152426, #1c302b); }
html[data-theme="dark"] :is(.mechanism, .contrast-section, .ai-partner-section) { background: var(--night-bg); }
html[data-theme="dark"] .mech-note { background: var(--night-surface); color: var(--night-text); }
html[data-theme="dark"] :is(.before-col, .compare-col.bad, .contrast-col.contrast-bad) { background: #302327; border-color: #a96a70; }
html[data-theme="dark"] :is(.after-col, .compare-col.good) { background: #1b302a; border-color: #8fc16a; }
html[data-theme="dark"] :is(.before-col .transform-list li, .compare-col.bad .compare-list li, .contrast-bad .contrast-list li) { color: #e7cdd0; }
html[data-theme="dark"] :is(.after-col .transform-list li, .compare-col.good .compare-list li, .outcomes-list li, .contrast-good .contrast-list li) { color: var(--night-text); }
html[data-theme="dark"] :is(.arrow-mid, .faq-btn, .deep-meta) { color: var(--night-text); }
html[data-theme="dark"] .pill:hover { background: #244033; }
html[data-theme="dark"] .ch-lessons li { border-color: var(--night-border); }
html[data-theme="dark"] .testi-text { color: var(--night-text); }
html[data-theme="dark"] .testi-name { color: var(--night-text); }
html[data-theme="dark"] .founder-image-wrapper { background: var(--night-surface); }
html[data-theme="dark"] .lesson-meta { color: #b6dea7; }
html[data-theme="dark"] .ai-chat-preview { background: var(--night-surface); border-color: var(--night-border); }
html[data-theme="dark"] .ai-chat-welcome { background: #203335; }
html[data-theme="dark"] .ai-chat-thread { background: var(--night-surface); border-color: var(--night-border); }
html[data-theme="dark"] .ai-chat-answer-text { background: #2b4147; color: var(--night-text); }
html[data-theme="dark"] .ai-chat-example-label { color: var(--night-muted); }
html[data-theme="dark"] .ai-benefits-list li { border-color: var(--night-border); }
html[data-theme="dark"] .ai-benefit-icon { color: #a9dbb8; }
html[data-theme="dark"] .lead-input { color: var(--night-text); }

/* Course and about pages. */
html[data-theme="dark"] :is(h2, h3, .price, .faq summary, .course-price-reveal summary) { color: var(--night-text); }
html[data-theme="dark"] .hero :is(h1, h2, h3) { color: #fff; }
html[data-theme="dark"] :is(.button, .cta, .btn-cta, .cta-btn) { color: #0a3332; }
html[data-theme="dark"] :is(.button.secondary, .course-price-reveal-body) { background: var(--night-surface); color: var(--night-text); border-color: var(--night-border); }
html[data-theme="dark"] .course-price-reveal summary { border-color: #8fc16a; }
html[data-theme="dark"] .course-price-regular { color: var(--night-muted); }
html[data-theme="dark"] .course-price-regular del { text-decoration-color: #8fc16a; }
html[data-theme="dark"] :is(.page-tag, .info-box, table.criteria th) { background: var(--night-surface); color: var(--night-text); }
html[data-theme="dark"] :is(table.criteria caption, table.criteria td.status-ok) { color: var(--night-text); }
html[data-theme="dark"] :is(.product a, main > .section a:not(.button), main > .section .card a) { color: #a9dbb8; }
html[data-theme="dark"] .product a:hover { color: #d3f2c3; }
html[data-theme="dark"] .accessibility-page h1 { color: var(--night-text); }
html[data-theme="dark"] .accessibility-page main a { color: #a9dbb8; }
html[data-theme="dark"] .accessibility-page main a:hover { color: #d3f2c3; }

/* Blog index and static articles. */
html[data-theme="dark"] :is(.breadcrumb, .breadcrumbs) { color: var(--night-muted); }
html[data-theme="dark"] .breadcrumb { background: var(--night-bg); }
html[data-theme="dark"] .breadcrumb a { color: #a9dbb8; }
html[data-theme="dark"] :is(.search-input, .search-box input) { background: var(--night-surface); color: var(--night-text); border-color: var(--night-border); }
html[data-theme="dark"] :is(.search-input, .search-box input)::placeholder { color: var(--night-muted); }
html[data-theme="dark"] :is(.no-results, .why-item, .why) { background: var(--night-alt); color: var(--night-text); }
html[data-theme="dark"] :is(.answer-box, .step-card, .stat-pill, .tip-box, .warn-box, .warning-box, .highlight-box, .energy-card, .rule-card, .related-card, .faq-item) { background: var(--night-surface); color: var(--night-text); border-color: var(--night-border); }
html[data-theme="dark"] :is(.answer-box p, .article-body p, .article-body li, .article-body h3, .faq-a, .rule-desc) { color: var(--night-text); }
html[data-theme="dark"] :is(.article-body h2, .article-body h3, .article-body strong, .faq-q, .answer-box strong, .related-articles h3, .related-articles a, .stat-pill .sn, .compare-table .col-cat) { color: var(--night-text); }
html[data-theme="dark"] :is(.faq-section, .related-articles, .related-section) { background: var(--night-alt); }
html[data-theme="dark"] :is(.compare-table tbody tr:nth-child(even), .article-body th) { background: var(--night-alt); }
html[data-theme="dark"] .article-body blockquote { background: #28353a; color: var(--night-text); }
html[data-theme="dark"] .article-body h2 { border-color: var(--night-border); }
html[data-theme="dark"] :is(.stat-pill .sl, .faq-a, .article-meta) { color: var(--night-muted); }
html[data-theme="dark"] .compare-col.bad .compare-col-title { color: #f0a0a3; }
html[data-theme="dark"] .compare-col.good .compare-col-title { color: #a9dbb8; }
html[data-theme="dark"] :is(.energy-card.drains, .energy-card.charges) { background: var(--night-surface); }
html[data-theme="dark"] .energy-card.drains h4 { color: #f0a0a3; }
html[data-theme="dark"] .energy-card.charges h4 { color: #a9dbb8; }
html[data-theme="dark"] .related-card:hover { color: #d3f2c3; }
html[data-theme="dark"] .site-footer a { color: #a9dbb8; }

/* Kotevli articles rendered by the Netlify function. */
html[data-theme="dark"] header.site-header { background: var(--night-surface); border-color: var(--night-border); }
html[data-theme="dark"] header.site-header :is(a, .brand-logo) { color: var(--night-text); }
html[data-theme="dark"] .article-tag { background: #2b4147; color: #c8e6c8; }
html[data-theme="dark"] .article-header :is(h1, h2),
html[data-theme="dark"] .article-body :is(h2, h3, h4, h5, h6) { color: var(--night-text); }
html[data-theme="dark"] .article-body th { background: var(--night-alt); }
html[data-theme="dark"] .article-body td { color: var(--night-text); }
html[data-theme="dark"] .author-info h3 { color: #fff; }

/* Focus must remain visible against both palettes. */
html[data-theme="dark"] :focus-visible { outline-color: #b7e888 !important; }
