/* Dark Mode - PrintEclipse */

html[data-theme="dark"] {
  --bg:          #1A1A18;
  --surface:     #252525;
  --ink:         #F5F2EC;
  --accent:      #4a9e7a;
  --accent-warm: #E07B39;
  --muted:       #8C8C85;
  --wire:        #3a3a3a;
  color-scheme: dark;
}

html[data-theme="dark"] body {
  background: var(--bg);
  color: var(--ink);
}

html[data-theme="dark"] .header--scrolled {
  background-color: rgba(26, 26, 24, 0.9);
}

html[data-theme="dark"] .mobile-menu {
  background: var(--bg);
}

html[data-theme="dark"] .loading-screen {
  background: var(--bg);
}

html[data-theme="dark"] .section-number {
  color: var(--surface);
}

html[data-theme="dark"] .grid-bg {
  opacity: 0.08;
}

html[data-theme="dark"] .mission-visual {
  background: #1e1e1e;
  box-shadow: inset 0 0 80px rgba(0,0,0,0.2), 0 4px 24px rgba(0,0,0,0.15);
}

html[data-theme="dark"] .card {
  background: var(--bg);
}

html[data-theme="dark"] .card--dark {
  background: var(--surface);
}

html[data-theme="dark"] .project-card {
  background: #2a2a26;
  border-color: #3a3a36;
}

html[data-theme="dark"] .stat-item {
  background: var(--bg);
}

html[data-theme="dark"] .material-card {
  background: var(--bg);
}

html[data-theme="dark"] .process-step__icon {
  border-color: var(--wire);
}

html[data-theme="dark"] .filter-btn:hover,
html[data-theme="dark"] .filter-btn.is-active {
  background: var(--surface);
}

html[data-theme="dark"] .workshop-item {
  background: var(--bg);
}

html[data-theme="dark"] .submit-zone {
  background: var(--bg);
}

html[data-theme="dark"] .submit-zone.is-printing {
  background: var(--surface);
}

html[data-theme="dark"] .submit-zone.is-success {
  border-color: var(--accent);
}

html[data-theme="dark"] .error-page__code {
  color: var(--surface);
}

html[data-theme="dark"] .timeline__progress::before {
  background: var(--wire);
}

html[data-theme="dark"] .timeline__item::before {
  background: var(--bg);
}

html[data-theme="dark"] .timeline__item.is-active::before {
  background: var(--accent-warm);
}

/* ── Smooth theme transition fallback ── */
.theme-transitioning,
.theme-transitioning body,
.theme-transitioning .header,
.theme-transitioning .card,
.theme-transitioning .section,
.theme-transitioning .mobile-menu,
.theme-transitioning .loading-screen,
.theme-transitioning .project-card__img,
.theme-transitioning .stat-item,
.theme-transitioning .material-card,
.theme-transitioning .process-step__icon,
.theme-transitioning .filter-btn,
.theme-transitioning .workshop-item,
.theme-transitioning .submit-zone,
.theme-transitioning .mission-visual,
.theme-transitioning .footer,
.theme-transitioning .field__input,
.theme-transitioning .faq-item {
  transition: background-color 0.5s var(--ease-organic),
              color 0.5s var(--ease-organic),
              border-color 0.5s var(--ease-organic),
              box-shadow 0.5s var(--ease-organic) !important;
}

/* ── View Transitions API custom animation ── */
@supports (view-transition-name: none) {
  ::view-transition-old(root) {
    animation: fade-out 0.4s var(--ease-organic) forwards;
  }

  ::view-transition-new(root) {
    animation: fade-in 0.4s var(--ease-organic) forwards;
  }
}

@keyframes fade-out {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.995); }
}

@keyframes fade-in {
  from { opacity: 0; transform: scale(1.005); }
  to   { opacity: 1; transform: scale(1); }
}

html[data-theme="dark"] #map {
  filter: brightness(0.85) contrast(1.1);
}
