/* ==========================================================================
   Thème clair / sombre du site public.
   Les pages à CSS intégré (Works, Contact, projets, blog, erreurs) utilisent
   ces variables ; le thème Roundex (accueil, About) est ajusté plus bas.
   Sombre par défaut ; <html data-theme="light"> active le thème clair.
   ========================================================================== */

:root {
    --bg: #0a0a0a;
    --bg-rgb: 10, 10, 10;
    --fg: #ffffff;
    --fg-rgb: 255, 255, 255;
    --surface: #111111;
    --surface-rgb: 17, 17, 17;
    --surface-2: #131313;
    --muted: #777777;
    color-scheme: dark;
}

html[data-theme="light"] {
    --bg: #f4f2ee;
    --bg-rgb: 244, 242, 238;
    --fg: #111111;
    --fg-rgb: 17, 17, 17;
    --surface: #ffffff;
    --surface-rgb: 255, 255, 255;
    --surface-2: #faf9f6;
    --muted: #8a8a8a;
    color-scheme: light;
}

/* Transition douce uniquement au moment du basculement. */
html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after {
    transition: background-color .4s ease, color .4s ease, border-color .4s ease, fill .4s ease, stroke .4s ease !important;
}

/* ─── Bouton soleil / lune ─────────────────────────────────── */
.theme-toggle {
    position: fixed;
    top: 47px;
    right: 104px;
    z-index: 200;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(var(--fg-rgb), .22);
    background: rgba(var(--bg-rgb), .35);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    color: var(--fg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color .3s ease, transform .4s cubic-bezier(.215,.61,.355,1), background .3s ease;
}
.theme-toggle:hover { border-color: var(--fg); transform: rotate(-20deg); }
.theme-toggle:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
.theme-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .theme-icon-moon { display: none; fill: currentColor; stroke: none; }
html[data-theme="light"] .theme-toggle .theme-icon-sun { display: none; }
html[data-theme="light"] .theme-toggle .theme-icon-moon { display: block; }

@media (max-width: 995px) {
    .theme-toggle { top: 37px; right: 92px; }
}
@media (max-width: 600px) {
    .theme-toggle { top: 27px; right: 80px; width: 36px; height: 36px; }
}

/* ==========================================================================
   Thème Roundex (accueil, About) en mode clair
   ========================================================================== */
html[data-theme="light"] body,
html[data-theme="light"] body.body-dark { background: var(--bg); }

html[data-theme="light"] #preloader,
html[data-theme="light"] .preloader-bg,
html[data-theme="light"] .upper-page,
html[data-theme="light"] nav.navigation-menu.show,
html[data-theme="light"] .round-menu.direction,
html[data-theme="light"] .to-top-arrow { background: var(--bg); }

html[data-theme="light"] .loader { border-color: rgba(var(--fg-rgb), .15); }
html[data-theme="light"] .loader span { border-top-color: rgba(var(--fg-rgb), .75); }

/* Section blanche de la page About : légèrement teintée pour se détacher. */
html[data-theme="light"] .bg-light,
html[data-theme="light"] .upper-page-color { background: var(--surface); }

html[data-theme="light"] .round-menu { color: var(--fg); }
html[data-theme="light"] .round-menu .dot-1,
html[data-theme="light"] .round-menu .dot-2,
html[data-theme="light"] .round-menu .dot-3 { background: var(--fg); }

html[data-theme="light"] nav.navigation-menu a,
html[data-theme="light"] nav.navigation-menu a:hover,
html[data-theme="light"] nav.navigation-menu a:link,
html[data-theme="light"] nav.navigation-menu a:visited,
html[data-theme="light"] nav.navigation-menu a:active { color: var(--fg); }

html[data-theme="light"] .vertical-effect { border-right-color: rgba(var(--fg-rgb), .08); }
html[data-theme="light"] .vertical-effect-2 { border-bottom-color: rgba(var(--fg-rgb), .08); }

/* Titres posés à cheval sur la vidéo et le fond : le mode "différence"
   les garde lisibles sur le fond clair comme sur l'image. La diapositive
   reçoit le fond clair pour que le mélange "voie" ce fond. */
html[data-theme="light"] .swiper-slide,
html[data-theme="light"] .swiper-slide-inner { background: var(--bg); }
html[data-theme="light"] .swiper-slide-inner-txt,
html[data-theme="light"] .swiper-slide-inner-txt-all {
    mix-blend-mode: difference;
}

/* Bandes autour de la vidéo d'accueil */
html[data-theme="light"] .circle-wrapper.swiper-slide-inner-bg { background: #000; }

/* Commandes du diaporama */
html[data-theme="light"] .swiper-slide-controls { background: var(--fg); color: var(--bg); }
html[data-theme="light"] .swiper-slide-controls-play-pause { color: var(--fg); }
html[data-theme="light"] .circle { stroke: var(--fg); }
html[data-theme="light"] .hero-sound-toggle {
    color: var(--fg);
    border-color: rgba(var(--fg-rgb), .35);
    background: rgba(var(--bg-rgb), .55);
}
html[data-theme="light"] .hero-sound-toggle:hover,
html[data-theme="light"] .hero-sound-toggle.is-on { background: var(--fg); border-color: var(--fg); color: var(--bg); }

/* Page About */
html[data-theme="light"] .intro,
html[data-theme="light"] .subtitle:not(.subtitle-light) { color: var(--fg); }
html[data-theme="light"] .section-txt p { color: #555; }
html[data-theme="light"] .about-gallery-item { background: var(--surface); }

/* Visionneuse photo */
html[data-theme="light"] .lightbox { background: rgba(var(--bg-rgb), .96); }
html[data-theme="light"] .lightbox button { color: var(--fg); border-color: rgba(var(--fg-rgb), .25); background: rgba(var(--fg-rgb), .05); }
html[data-theme="light"] .lightbox button:hover { background: rgba(var(--fg-rgb), .12); border-color: var(--fg); }
html[data-theme="light"] .lightbox-counter { color: rgba(var(--fg-rgb), .55); }
html[data-theme="light"] .lightbox-img { box-shadow: 0 30px 80px rgba(0,0,0,.18); }

/* ==========================================================================
   Éléments posés sur une photo ou une vidéo : identiques dans les deux
   thèmes (voile sombre, bouton lecture et légendes en blanc), et cadres
   vidéo toujours noirs.
   ========================================================================== */
html[data-theme="light"] .featured-frame,
html[data-theme="light"] .video-frame,
html[data-theme="light"] .video-ratio { background: #000; }

html[data-theme="light"] .featured-poster::before,
html[data-theme="light"] .video-poster::before {
    background: linear-gradient(180deg, rgba(10,10,10,.15), rgba(10,10,10,.55));
}
html[data-theme="light"] .featured-poster:hover::before,
html[data-theme="light"] .video-poster:hover::before {
    background: linear-gradient(180deg, rgba(10,10,10,.05), rgba(10,10,10,.45));
}

html[data-theme="light"] .play-btn {
    background: rgba(255,255,255,.1);
    border-color: rgba(255,255,255,.5);
}
html[data-theme="light"] .featured-poster:hover .play-btn,
html[data-theme="light"] .video-poster:hover .play-btn { background: rgba(255,255,255,.18); }
html[data-theme="light"] .play-btn::after { border-color: transparent transparent transparent #fff; }

html[data-theme="light"] .bts-cap { color: rgba(255,255,255,.85); }

html[data-theme="light"] .post-thumb .tag {
    background: rgba(10,10,10,.55);
    border-color: rgba(255,255,255,.25);
    color: #fff;
}

/* Liens légaux sous le menu de navigation (toutes les pages) */
.nav-legal {
    display: flex; justify-content: center; align-items: center; gap: 8px;
    margin-top: 18px;
    font-family: 'Montserrat', sans-serif; font-size: 9px; font-weight: 700;
    letter-spacing: 2px; text-transform: uppercase;
}
.nav-legal a,
nav.navigation-menu .nav-legal a,
nav.navigation-menu .nav-legal a:link,
nav.navigation-menu .nav-legal a:visited {
    font-size: 9px !important; letter-spacing: 2px; line-height: 1;
    color: rgba(var(--fg-rgb), .45) !important;
    text-decoration: none;
}
.nav-legal a:hover { color: var(--fg) !important; }
.nav-legal span { color: rgba(var(--fg-rgb), .25); }
