/* ============================================
   MVNU ART — BASE
   Resets, typography, small site-wide utilities.
   ============================================ */

html {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

body {
  position: relative;
  font-family: var(--font-sans);
  background: var(--bg-wash), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  transition: var(--transition-theme), background 0.5s ease;
}

/* Grain filmique — presente dans les deux themes, plus marquee en dark */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2000;
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  transition: opacity 0.5s ease;
}

a {
  color: inherit;
}

::selection {
  background: var(--glow-accent);
  color: var(--text);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Scroll-to-top button (global chrome, lives in index.php) --- */
#scrollToTopBtn {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  width: 44px;
  height: 44px;
  font-size: 1.1rem;
  background-color: var(--accent);
  color: var(--text-on-accent);
  border: none;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

#scrollToTopBtn:hover {
  background-color: var(--accent-strong);
  transform: translateY(-2px);
}

/* --- Correctif dark mode pour les visuels "texte fonce sur fond transparent" ---
   (titres dessines a la main, penses pour un fond clair). invert+hue-rotate
   les rend lisibles en dark sans re-exporter les fichiers. */
.mvnu-dark-invert {
  transition: filter 0.35s ease;
}

:root[data-theme="dark"] .mvnu-dark-invert {
  filter: invert(1) hue-rotate(180deg);
}
