/* Theme Toggle & Dark / Light Contrast System for SUA */

/* ─────────────────────────────────────────────────────────────
   1. Theme Toggle Button
   ───────────────────────────────────────────────────────────── */
.theme-toggle.motion-toggle {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  flex-shrink: 0 !important;
  min-height: 32px !important;
  padding: 5px 12px !important;
  border: 1px solid #d5d5dc !important;
  border-radius: 999px !important;
  color: #1e1e1e !important;
  background: #ffffff !important;
  font-family: inherit !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  line-height: 1 !important;
  cursor: pointer !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08) !important;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease !important;
}
.theme-toggle.motion-toggle:hover {
  background: #f4f4f7 !important;
  border-color: #b5b5be !important;
  color: #000000 !important;
}
.theme-toggle.motion-toggle:active {
  transform: scale(0.97) !important;
}
.theme-toggle-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: inherit !important;
  line-height: 0 !important;
}
.theme-toggle-icon svg {
  display: block !important;
  width: 13px !important;
  height: 13px !important;
}
.theme-toggle-label {
  font-size: 11px !important;
  letter-spacing: -0.01em !important;
}

/* ─────────────────────────────────────────────────────────────
   2. LIGHT MODE: Dark, Crisp, High-Contrast Text
   Applied ONLY when theme-dark is NOT active
   ───────────────────────────────────────────────────────────── */
html:not(.theme-dark) body.midnight:not(.page-AI):not(.page-admin) {
  color: #222222 !important;
}
html:not(.theme-dark) .site-brand {
  color: #111111 !important;
}
html:not(.theme-dark) .brand-caption {
  color: #555555 !important;
}
html:not(.theme-dark) .site-nav > a {
  color: #444444 !important;
}
html:not(.theme-dark) .site-nav > a:hover,
html:not(.theme-dark) .site-nav > a[aria-current="page"] {
  color: #000000 !important;
}
html:not(.theme-dark) .nav-more > summary {
  color: #444444 !important;
}
html:not(.theme-dark) .nav-dropdown a {
  color: #222222 !important;
}
html:not(.theme-dark) .nav-dropdown a:hover {
  color: #000000 !important;
  background: #f0f0f4 !important;
}
html:not(.theme-dark) .sua-newsbar {
  background: #f8f8fa !important;
  border-bottom: 1px solid #e5e5ea !important;
}
html:not(.theme-dark) .sua-news-title {
  color: #222222 !important;
}
html:not(.theme-dark) .sua-news-badge {
  background: #fbe6f0 !important;
  color: #924068 !important;
}
html:not(.theme-dark) .mini-hero h1,
html:not(.theme-dark) .mini-section > h2,
html:not(.theme-dark) .project-case h2,
html:not(.theme-dark) .project-case h3,
html:not(.theme-dark) .mini-project-body h3 a,
html:not(.theme-dark) .page-intro h1,
html:not(.theme-dark) .cherin-page-intro h1 {
  color: #111111 !important;
}
html:not(.theme-dark) .mini-lead,
html:not(.theme-dark) .mini-about,
html:not(.theme-dark) .mini-project-body p,
html:not(.theme-dark) .mini-resume-detail,
html:not(.theme-dark) .project-body p,
html:not(.theme-dark) .page-description {
  color: #383838 !important;
}
html:not(.theme-dark) .mini-eyebrow,
html:not(.theme-dark) .mini-hero .sua-eyebrow {
  color: #333333 !important;
  border-color: #dcdce2 !important;
  background: #f7f7fa !important;
}
html:not(.theme-dark) .mini-resume-name strong {
  color: #111111 !important;
}
html:not(.theme-dark) .mini-resume-name small,
html:not(.theme-dark) .mini-resume-meta,
html:not(.theme-dark) .mini-project-kind,
html:not(.theme-dark) .project-meta,
html:not(.theme-dark) .mini-section-note {
  color: #555555 !important;
}
html:not(.theme-dark) .mini-project-actions a {
  color: #222222 !important;
  background: #f5f5f7 !important;
  border-color: #dcdce2 !important;
}
html:not(.theme-dark) .mini-project-actions a:hover {
  color: #000000 !important;
  background: #ebebee !important;
}
html:not(.theme-dark) .mini-all-projects {
  color: #222222 !important;
  background: #f5f5f7 !important;
  border-color: #dcdce2 !important;
}
html:not(.theme-dark) .mini-all-projects:hover {
  color: #000000 !important;
  background: #ebebee !important;
}
html:not(.theme-dark) .mini-contact > a {
  color: #222222 !important;
  background: #f9f9fb !important;
  border-color: #e2e2e8 !important;
}
html:not(.theme-dark) .mini-contact > a:hover {
  color: #000000 !important;
  background: #f0f0f4 !important;
}
html:not(.theme-dark) .mini-footer {
  border-top-color: #e5e5ea !important;
}
html:not(.theme-dark) .mini-footer-top a {
  color: #333333 !important;
}
html:not(.theme-dark) .mini-footer-top a:hover {
  color: #000000 !important;
}
html:not(.theme-dark) .mini-footer-bottom {
  color: #555555 !important;
}
html:not(.theme-dark) .mini-footer-bottom a {
  color: #444444 !important;
}
html:not(.theme-dark) .mini-footer-bottom a:hover {
  color: #000000 !important;
}

/* ─────────────────────────────────────────────────────────────
   3. DARK MODE: Bright, Luminous, High-Contrast Text
   Comprehensive visibility guarantee for ALL elements
   ───────────────────────────────────────────────────────────── */
html.theme-dark,
html.theme-dark body,
html.theme-dark body.midnight,
body.theme-dark,
body.theme-dark.midnight {
  color-scheme: dark !important;
  --night: #0a080d !important;
  --paper: #f7edf4 !important;
  --ink: #f7edf4 !important;
  --ink-soft: #ded5de !important;
  --ink-faint: #baa7b9 !important;
  --bg: #0a080d !important;
  --line: #291f2b !important;
  --surface: #140f17 !important;
  --surface-strong: #1e1522 !important;
  --accent: #f0bed9 !important;
  --accent-deep: #f5c4dc !important;
  background: radial-gradient(ellipse 700px 360px at 50% 0, #36172750, transparent 75%), #0a080d !important;
  color: #f7edf4 !important;
}

html.theme-dark body.minimal-portfolio::before {
  background-image: radial-gradient(#ffffff22 1px, transparent 1px) !important;
}

/* Header & Navigation in Dark Mode */
html.theme-dark .site-header {
  background: #0f0c13f2 !important;
  border-bottom-color: #271d28 !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55) !important;
}
html.theme-dark .site-brand {
  color: #ffffff !important;
}
html.theme-dark .brand-caption {
  color: #baa7b9 !important;
}
html.theme-dark .sua-wordmark img,
html.theme-dark .luna-wordmark img {
  filter: invert(1) brightness(1.3) !important;
}
html.theme-dark .site-nav {
  color: #cfbece !important;
}
html.theme-dark .site-nav > a {
  color: #cfbece !important;
}
html.theme-dark .site-nav > a:hover,
html.theme-dark .site-nav > a[aria-current="page"] {
  color: #ffffff !important;
  background: #221625 !important;
}
html.theme-dark .site-nav > a[aria-current="page"]::after {
  background: #f0bed9 !important;
}
html.theme-dark .nav-more > summary {
  color: #cfbece !important;
}
html.theme-dark .nav-more > summary:hover,
html.theme-dark .nav-more > summary.is-current {
  color: #ffffff !important;
  background: #221625 !important;
}
html.theme-dark .nav-dropdown {
  background: #17111a !important;
  border-color: #3c2a3d !important;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.75) !important;
}
html.theme-dark .nav-dropdown a {
  color: #e2d7e1 !important;
}
html.theme-dark .nav-dropdown a:hover {
  background: #281c2b !important;
  color: #ffffff !important;
}
html.theme-dark .nav-dropdown .back-to-orbit {
  color: #f0bed9 !important;
  border-color: #3c2a3d !important;
}
html.theme-dark .menu-toggle {
  color: #ffffff !important;
}
html.theme-dark .menu-toggle i {
  background: #ffffff !important;
}

/* Button in Dark Mode */
html.theme-dark .theme-toggle.motion-toggle {
  background: #1c1420 !important;
  border-color: #463045 !important;
  color: #fce8f4 !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45) !important;
}
html.theme-dark .theme-toggle.motion-toggle:hover {
  background: #2a1d2e !important;
  border-color: #603a5f !important;
  color: #ffffff !important;
}

/* Newsbar in Dark Mode */
html.theme-dark .sua-newsbar {
  background: #150f18 !important;
  border-bottom-color: #291e2b !important;
}
html.theme-dark .sua-news-title {
  color: #ede1ec !important;
}
html.theme-dark .sua-news-badge {
  background: #3e2137 !important;
  color: #f5c4dc !important;
}
html.theme-dark .sua-news-arrow {
  color: #cfbece !important;
}
html.theme-dark .sua-news-today {
  color: #baa7b9 !important;
  border-color: #3c293b !important;
}
html.theme-dark .sua-news-today:hover {
  background: #271a29 !important;
  color: #ffffff !important;
}

/* ─────────────────────────────────────────────────────────────
   CRITICAL: Universal Headings in Dark Mode (#ffffff)
   Guarantees no dark or invisible headings across any page
   ───────────────────────────────────────────────────────────── */
html.theme-dark h1,
html.theme-dark h2,
html.theme-dark h3,
html.theme-dark h4,
html.theme-dark h5,
html.theme-dark h6,
html.theme-dark .mini-hero h1,
html.theme-dark .mini-section > h2,
html.theme-dark .page-intro h1,
html.theme-dark .cherin-page-intro h1,
html.theme-dark .cherin-category-heading h2,
html.theme-dark .project-case h2,
html.theme-dark .project-case h3,
html.theme-dark .case-copy h2,
html.theme-dark .case-copy h3,
html.theme-dark .board-item-head h2,
html.theme-dark .board-item-head h2 a,
html.theme-dark .board-item > a h2,
html.theme-dark .board-article-title,
html.theme-dark .partner-copy h2,
html.theme-dark .partner-invite h2,
html.theme-dark .person-entry h2,
html.theme-dark .letter-paper h2,
html.theme-dark #letter-gate-title,
html.theme-dark .art-orbit .art-name,
html.theme-dark .experience-row h3,
html.theme-dark .mini-resume-name strong,
html.theme-dark .mini-project-body h3 a {
  color: #ffffff !important;
}

html.theme-dark .mini-pink,
html.theme-dark em {
  color: #f0bed9 !important;
}

/* ─────────────────────────────────────────────────────────────
   CRITICAL: Universal Body Text in Dark Mode (#f0e6ef / #ded5de)
   Guarantees no dark paragraphs, lists, or descriptions
   ───────────────────────────────────────────────────────────── */
html.theme-dark p,
html.theme-dark li,
html.theme-dark dd,
html.theme-dark dt,
html.theme-dark blockquote,
html.theme-dark .mini-lead,
html.theme-dark .mini-about,
html.theme-dark .mini-project-body p,
html.theme-dark .mini-resume-detail,
html.theme-dark .project-body p,
html.theme-dark .page-description,
html.theme-dark .board-article-body,
html.theme-dark .board-article-body *,
html.theme-dark .board-summary,
html.theme-dark .blog-summary,
html.theme-dark .case-copy p,
html.theme-dark .partner-copy p,
html.theme-dark .partner-invite p,
html.theme-dark .person-entry p,
html.theme-dark .letter-paper p,
html.theme-dark .people-quote p,
html.theme-dark .cherin-community-copy,
html.theme-dark .board-comment-text,
html.theme-dark .board-comment p,
html.theme-dark .comment-body,
html.theme-dark .experience-row p,
html.theme-dark .case-details p,
html.theme-dark .case-details li {
  color: #ded5de !important;
}

/* ─────────────────────────────────────────────────────────────
   CRITICAL: Universal Metadata, Small & Subtext (#baa7b9)
   ───────────────────────────────────────────────────────────── */
html.theme-dark small,
html.theme-dark time,
html.theme-dark .kicker,
html.theme-dark .page-meta,
html.theme-dark .board-meta,
html.theme-dark .board-author,
html.theme-dark .board-date,
html.theme-dark .board-views,
html.theme-dark .board-counts,
html.theme-dark .partner-handle,
html.theme-dark .person-index,
html.theme-dark .mini-resume-name small,
html.theme-dark .mini-resume-meta,
html.theme-dark .mini-project-kind,
html.theme-dark .project-meta,
html.theme-dark .mini-section-note,
html.theme-dark #people-count,
html.theme-dark .experience-row small,
html.theme-dark .experience-row > span,
html.theme-dark .case-details > summary,
html.theme-dark .case-details > summary span,
html.theme-dark .letter-paper time,
html.theme-dark .letter-paper small,
html.theme-dark .mini-footer-bottom {
  color: #baa7b9 !important;
}

html.theme-dark .mini-eyebrow,
html.theme-dark .mini-hero .sua-eyebrow {
  background: #211524 !important;
  border-color: #422940 !important;
  color: #f0bed9 !important;
}
html.theme-dark .mini-eyebrow > span {
  color: #bfaec0 !important;
}
html.theme-dark .mini-avatar {
  border-color: #2e1d2d !important;
  box-shadow: 0 0 0 6px #1b111d, 0 10px 30px rgba(0, 0, 0, 0.65) !important;
}
html.theme-dark .mini-section > h2::before {
  background: #f0bed9 !important;
}
html.theme-dark .mini-inline-link {
  color: #f0bed9 !important;
  border-bottom-color: #55344e !important;
}
html.theme-dark .mini-inline-link:hover {
  color: #ffffff !important;
  border-bottom-color: #f0bed9 !important;
}

/* ─────────────────────────────────────────────────────────────
   Containers & Card Surfaces in Dark Mode
   ───────────────────────────────────────────────────────────── */
html.theme-dark .mini-project,
html.theme-dark .project-case,
html.theme-dark .blog-card,
html.theme-dark .board-item,
html.theme-dark .board-item a,
html.theme-dark .board-article,
html.theme-dark .board-comment,
html.theme-dark .board-panel,
html.theme-dark .board-empty,
html.theme-dark .board-form,
html.theme-dark .partner-row,
html.theme-dark .partner-invite,
html.theme-dark .partner-user-card,
html.theme-dark .person-entry,
html.theme-dark .people-quote,
html.theme-dark .letter-paper,
html.theme-dark .letter-gate,
html.theme-dark .blog-files li > a,
html.theme-dark .blog-files-edit li,
html.theme-dark .adm > .card {
  background: #140f17 !important;
  border-color: #2f202f !important;
  color: #ded5de !important;
}
html.theme-dark .mini-project:hover,
html.theme-dark .project-case:hover,
html.theme-dark .blog-card:hover,
html.theme-dark .partner-row:hover,
html.theme-dark .person-entry:hover {
  border-color: #603a5f !important;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.75) !important;
}

/* Form inputs & controls in Dark Mode */
html.theme-dark .board-field > span,
html.theme-dark label {
  color: #ded5de !important;
}
html.theme-dark input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
html.theme-dark textarea,
html.theme-dark select,
html.theme-dark .people-search input,
html.theme-dark .board-field :is(input, textarea, select),
html.theme-dark .code-input {
  background: #19111c !important;
  border-color: #3d293d !important;
  color: #ffffff !important;
}
html.theme-dark input::placeholder,
html.theme-dark textarea::placeholder {
  color: #8f7f8d !important;
}

/* Tags & Buttons in Dark Mode */
html.theme-dark .mini-skill-tags > span,
html.theme-dark .reference-skill,
html.theme-dark .board-btn,
html.theme-dark .blog-tab,
html.theme-dark .letter-reset,
html.theme-dark .letter-back,
html.theme-dark .project-toolbar button {
  background: #1b121e !important;
  color: #baa7b9 !important;
  border-color: #372437 !important;
}
html.theme-dark .board-btn:hover,
html.theme-dark .blog-tab:hover,
html.theme-dark .blog-tab[aria-current="page"],
html.theme-dark .board-pager a[aria-current="page"],
html.theme-dark .project-toolbar button.is-active,
html.theme-dark .project-toolbar button:hover {
  background: #2d1c30 !important;
  color: #ffffff !important;
  border-color: #603a5f !important;
}
html.theme-dark .board-badge,
html.theme-dark .blog-cat {
  background: #2d1c30 !important;
  color: #f0bed9 !important;
}
html.theme-dark .mini-project-actions a,
html.theme-dark .project-actions a,
html.theme-dark .partner-portfolio-link {
  background: #221625 !important;
  color: #e8dbe6 !important;
  border-color: #40283f !important;
}
html.theme-dark .mini-project-actions a:hover,
html.theme-dark .project-actions a:hover,
html.theme-dark .partner-portfolio-link:hover {
  background: #361f38 !important;
  color: #ffffff !important;
  border-color: #603a5f !important;
}
html.theme-dark .mini-all-projects {
  background: #1b121e !important;
  color: #f0bed9 !important;
  border-color: #40283f !important;
}
html.theme-dark .mini-all-projects:hover {
  background: #2e1c31 !important;
  color: #ffffff !important;
  border-color: #603a5f !important;
}
html.theme-dark .round-arrow,
html.theme-dark .primary-link {
  background: #251829 !important;
  border-color: #4b304f !important;
  color: #fcebf5 !important;
}
html.theme-dark .round-arrow:hover,
html.theme-dark .primary-link:hover {
  background: #3b2241 !important;
  border-color: #724777 !important;
  color: #ffffff !important;
}
html.theme-dark .code-submit,
html.theme-dark .board-btn-primary {
  background: #f0bed9 !important;
  color: #140812 !important;
  border-color: #f0bed9 !important;
  font-weight: 600 !important;
}
html.theme-dark .code-submit:hover,
html.theme-dark .board-btn-primary:hover {
  background: #f5c4dc !important;
  color: #000000 !important;
}

/* Links in Dark Mode */
html.theme-dark a:not(.site-brand):not(.site-nav > a):not(.primary-link):not(.round-arrow):not(.mini-all-projects):not(.mini-contact > a):not(.board-btn):not(.blog-tab):not(.portfolio-shortcut):not(.back-to-orbit):not(.artist-link-btn) {
  color: #f0bed9 !important;
}
html.theme-dark a:not(.site-brand):not(.site-nav > a):not(.primary-link):not(.round-arrow):not(.mini-all-projects):not(.mini-contact > a):not(.board-btn):not(.blog-tab):not(.portfolio-shortcut):not(.back-to-orbit):not(.artist-link-btn):hover {
  color: #ffffff !important;
}
html.theme-dark .board-item > a:hover h2 {
  color: #ffffff !important;
  text-decoration: underline !important;
}
html.theme-dark .board-article-body a {
  color: #f0bed9 !important;
}

/* Contact & Footer in Dark Mode */
html.theme-dark .mini-contact > a {
  background: #140f17 !important;
  border-color: #2f202f !important;
  color: #ded5de !important;
}
html.theme-dark .mini-contact > a:hover {
  background: #221625 !important;
  color: #ffffff !important;
  border-color: #553454 !important;
}
html.theme-dark .mini-footer {
  border-top-color: #291e2b !important;
  color: #baa7b9 !important;
}
html.theme-dark .mini-footer-top a {
  color: #baa7b9 !important;
}
html.theme-dark .mini-footer-top a:hover {
  color: #ffffff !important;
}
html.theme-dark .mini-footer-bottom a {
  color: #baa7b9 !important;
}
html.theme-dark .mini-footer-bottom a:hover {
  color: #ffffff !important;
}
