/* ====================================================================
   FUBIZ — css/flux.css   (page flux.html, 100% autonome)
   DA Fubiz : noir #000 + dégradé. Voix : Fraunces (serif) + Space Mono.
   Aucune autre page ne charge ce fichier ; il n'importe rien.
   ==================================================================== */

:root {
  --fx-black: #000;
  --fx-ink: #0a0a0b;
  --fx-ivory: #f2f0eb;
  --fx-ivory-72: rgba(242, 240, 235, 0.72);
  --fx-ivory-50: rgba(242, 240, 235, 0.5);
  --fx-ivory-30: rgba(242, 240, 235, 0.3);
  --fx-line: rgba(242, 240, 235, 0.14);
  --fx-grad: linear-gradient(120deg, #e0315b 0%, #c13584 52%, #833ab4 100%);
  --fx-accent: #e0315b;
  --fx-violet: #833ab4;
  --fx-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --fx-mono: 'Space Mono', ui-monospace, monospace;
  --fx-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --fx-pad: clamp(1.25rem, 5vw, 5rem);
}

* { box-sizing: border-box; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body.flux-page {
  margin: 0;
  background: var(--fx-black);
  color: var(--fx-ivory);
  font-family: var(--fx-serif);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.flux-page img { display: block; max-width: 100%; }
::selection { background: #c1358488; color: #fff; }
.flux-defs { position: absolute; width: 0; height: 0; }
.flux-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (hover: hover) and (pointer: fine) {
  body.flux-page.has-cursor, body.flux-page.has-cursor a, body.flux-page.has-cursor button { cursor: none; }
}

.flux-kicker {
  font-family: var(--fx-mono);
  font-size: 0.7rem; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--fx-ivory-50); margin: 0;
}
.flux-grad {
  background: var(--fx-grad);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

/* ============================ CURSEUR VISEUR ======================= */
.flux-cursor { display: none; }
@media (hover: hover) and (pointer: fine) {
  .flux-cursor { display: block; position: fixed; top: 0; left: 0; z-index: 9999; pointer-events: none; }
  .flux-cursor-dot {
    position: fixed; top: 0; left: 0; width: 6px; height: 6px; margin: -3px 0 0 -3px;
    border-radius: 50%; background: var(--fx-ivory); will-change: transform;
  }
  .flux-cursor-frame {
    position: fixed; top: 0; left: 0; width: 38px; height: 38px; margin: -19px 0 0 -19px;
    will-change: transform; transition: width 0.3s var(--fx-ease), height 0.3s var(--fx-ease), margin 0.3s var(--fx-ease);
    display: flex; align-items: center; justify-content: center;
  }
  body.flux-page.cursor-view .flux-cursor-frame { width: 92px; height: 92px; margin: -46px 0 0 -46px; }
  body.flux-page.cursor-view .flux-cursor-dot { opacity: 0; }
  .fc-br { position: absolute; width: 10px; height: 10px; border: 2px solid var(--fx-ivory); opacity: 0.55; transition: opacity 0.3s var(--fx-ease); }
  .fc-tl { top: 0; left: 0; border-right: 0; border-bottom: 0; }
  .fc-tr { top: 0; right: 0; border-left: 0; border-bottom: 0; }
  .fc-bl { bottom: 0; left: 0; border-right: 0; border-top: 0; }
  .fc-br2 { bottom: 0; right: 0; border-left: 0; border-top: 0; }
  body.flux-page.cursor-view .fc-br { opacity: 1; }
  .flux-cursor-label {
    font-family: var(--fx-mono); font-size: 0.56rem; letter-spacing: 0.24em; color: var(--fx-ivory);
    opacity: 0; transition: opacity 0.3s var(--fx-ease);
  }
  body.flux-page.cursor-view .flux-cursor-label { opacity: 1; }
}

/* ================================ NAV ============================== */
.flux-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  display: flex; align-items: center; gap: 1rem;
  padding: clamp(1rem, 2.4vh, 1.6rem) var(--fx-pad);
  mix-blend-mode: difference;
}
.flux-brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--fx-ivory); }
.flux-brand-mark { width: 30px; height: 30px; }
.flux-brand-word { font-family: var(--fx-mono); font-size: 0.82rem; letter-spacing: 0.3em; }
.flux-nav-links { margin-left: auto; display: flex; gap: clamp(0.9rem, 2.4vw, 2.2rem); }
.flux-nav-links a {
  font-family: var(--fx-mono); font-size: 0.66rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--fx-ivory); text-decoration: none; opacity: 0.82; transition: opacity 0.3s var(--fx-ease);
}
.flux-nav-links a:hover { opacity: 1; }
.flux-nav-links a[aria-current="page"] {
  background: var(--fx-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; opacity: 1;
}
@media (max-width: 640px) { .flux-nav-links a { font-size: 0.56rem; letter-spacing: 0.14em; } .flux-nav-links { gap: 0.7rem; } }

/* ============================ SECTION ============================== */
.flux-section { position: relative; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; overflow: hidden; }
.flux-head { position: relative; z-index: 5; padding: clamp(5.5rem, 13vh, 8.5rem) var(--fx-pad) clamp(1rem, 2vh, 1.75rem); text-align: center; }
.flux-head .flux-kicker { margin-bottom: 0.7rem; }

/* #2 titre gooey */
.flux-title { margin: 0; line-height: 0.86; }
.flux-title-goo {
  display: inline-block;
  font-family: var(--fx-serif);
  font-weight: 600;
  font-size: clamp(3rem, 12vw, 10rem);
  letter-spacing: -0.02em;
  text-transform: uppercase;
  background: var(--fx-grad);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: url(#flux-gooey);
}
.flux-title-goo .goo-l { display: inline-block; will-change: transform; }
.flux-title-goo .goo-sp { display: inline-block; width: 0.28em; }
.flux-sub {
  margin: 1rem 0 0; font-family: var(--fx-mono);
  font-size: clamp(0.72rem, 1.5vw, 0.95rem); letter-spacing: 0.3em; text-transform: uppercase; color: var(--fx-ivory-72);
}
.flux-counter { margin: 0.6rem 0 0; font-family: var(--fx-mono); font-size: clamp(0.72rem, 1.3vw, 0.9rem); letter-spacing: 0.14em; color: var(--fx-accent); }

/* #4 pastilles de curation */
.flux-toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin-top: clamp(1.25rem, 3vh, 2rem); }
.flux-pill {
  font-family: var(--fx-mono); font-size: 0.62rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--fx-ivory-50); background: transparent; border: 1px solid var(--fx-line); border-radius: 999px;
  padding: 0.5rem 0.95rem; cursor: pointer; transition: color 0.3s var(--fx-ease), border-color 0.3s var(--fx-ease);
}
.flux-pill:hover { color: var(--fx-ivory); }
.flux-pill.is-active { color: var(--fx-ivory); border-color: transparent; background: var(--fx-grad); }
.flux-pill:focus-visible { outline: 2px solid #c13584; outline-offset: 3px; }

/* ============================ LIGNES (FLUX) ======================== */
.flux-rows {
  position: relative; flex: 1; min-height: 0;
  display: flex; flex-direction: column; justify-content: center;
  gap: clamp(0.6rem, 1.8vh, 1.4rem); padding-bottom: clamp(2.5rem, 6vh, 4rem);
}
.flux-row { overflow: visible; will-change: transform; }
.flux-track {
  display: flex; align-items: center; gap: clamp(0.7rem, 1.4vw, 1.4rem);
  width: max-content; will-change: transform;
  animation: flux-marq var(--dur, 60s) linear infinite;
  animation-direction: var(--dir, normal);
}
@keyframes flux-marq { from { transform: translateX(0); } to { transform: translateX(-50%); } }
/* pause au survol d'une ligne (pour viser/cliquer) et hors viewport */
.flux-row:hover .flux-track { animation-play-state: paused; }
.flux-rows.is-paused .flux-track { animation-play-state: paused; }
/* #4 : pendant un filtre actif, les lignes ralentissent */
.flux-rows.is-filtering .flux-track { animation-duration: calc(var(--dur, 60s) * 2.4); }
.flux-tile { flex: 0 0 auto; display: block; text-decoration: none; will-change: transform; }
.flux-tile-inner {
  position: relative; display: block; width: clamp(180px, 21vw, 320px); aspect-ratio: 3 / 2;
  overflow: hidden; border: 1px solid var(--fx-line); background: #0c0c0d;
  transform-origin: center; transition: transform 0.5s var(--fx-ease);
}
.flux-tile-inner img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(1) brightness(0.72) contrast(1.04);
  transition: filter 0.5s var(--fx-ease); -webkit-user-drag: none;
}
.flux-tile-cat {
  position: absolute; top: 0.5rem; left: 0.5rem; z-index: 2;
  font-family: var(--fx-mono); font-size: 0.5rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--fx-ivory); background: rgba(0,0,0,0.45); padding: 0.2rem 0.45rem; border-radius: 2px;
  opacity: 0; transition: opacity 0.4s var(--fx-ease);
}
.flux-tile-title {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  font-family: var(--fx-mono); font-size: 0.62rem; letter-spacing: 0.08em; line-height: 1.3;
  padding: 0.6rem 0.7rem; color: var(--fx-ivory);
  background: linear-gradient(to top, rgba(0,0,0,0.85), rgba(0,0,0,0));
  opacity: 0; transform: translateY(10px); transition: opacity 0.4s var(--fx-ease), transform 0.4s var(--fx-ease);
  pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.flux-tile:hover { position: relative; z-index: 8; }
.flux-tile:hover .flux-tile-inner, .flux-tile:focus-visible .flux-tile-inner { transform: scale(1.14); }
.flux-tile:hover .flux-tile-inner img, .flux-tile:focus-visible .flux-tile-inner img { filter: none; }
.flux-tile:hover .flux-tile-title, .flux-tile:focus-visible .flux-tile-title,
.flux-tile:hover .flux-tile-cat, .flux-tile:focus-visible .flux-tile-cat { opacity: 1; transform: none; }
.flux-tile:focus-visible .flux-tile-inner { outline: 2px solid #c13584; outline-offset: 3px; }
/* #4 hors-catégorie : estompé + désaturé */
.flux-tile.is-dimmed .flux-tile-inner { opacity: 0.12; }
.flux-tile.is-dimmed .flux-tile-inner img { filter: grayscale(1) brightness(0.5); }
/* image capturée (#5) : liseré dégradé bref */
.flux-tile.is-captured .flux-tile-inner { box-shadow: 0 0 0 2px #c13584; }

/* canvas WebGL (#1) : derrière les lignes, qui deviennent des "fenêtres" */
#flux-curtains { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.flux-rows.webgl { position: relative; z-index: 2; }
.flux-rows.webgl .flux-tile-inner { background: transparent; }
.flux-rows.webgl .flux-tile-inner img { opacity: 0; }
/* repli CSS (#1) : flou + zoom de proximité quand WebGL absent */
.flux-tile.fx-near .flux-tile-inner img { filter: none; }

/* ============================ CAPTURE (#5) ========================= */
.flux-capture {
  position: fixed; right: var(--fx-pad); bottom: clamp(1.25rem, 3vh, 2rem); z-index: 40;
  width: 52px; height: 52px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--fx-grad); color: var(--fx-ivory);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 30px rgba(193, 53, 132, 0.5);
  transition: transform 0.3s var(--fx-ease);
}
.flux-capture:hover { transform: scale(1.08); }
.flux-capture:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.flux-flash { position: fixed; inset: 0; z-index: 9998; background: #fff; opacity: 0; pointer-events: none; }
.flux-flash.is-flashing { animation: flux-flash 0.42s var(--fx-ease); }
@keyframes flux-flash { 0% { opacity: 0; } 12% { opacity: 0.92; } 100% { opacity: 0; } }

.flux-selection {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: clamp(0.75rem, 2vh, 1.25rem); z-index: 45;
  max-width: min(92vw, 760px); background: rgba(10,10,11,0.82); backdrop-filter: blur(8px);
  border: 1px solid var(--fx-line); border-radius: 10px; padding: 0.7rem 0.9rem;
}
.flux-selection-head { margin: 0 0 0.5rem; font-family: var(--fx-mono); font-size: 0.58rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--fx-ivory-50); }
.flux-selection-count { color: var(--fx-accent); }
.flux-selection-strip { display: flex; gap: 0.4rem; overflow-x: auto; }
.flux-thumb { flex: 0 0 auto; width: 64px; height: 44px; border-radius: 3px; overflow: hidden; border: 1px solid var(--fx-line); cursor: pointer; position: relative; }
.flux-thumb img { width: 100%; height: 100%; object-fit: cover; }
.flux-thumb::after { content: '×'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.55); color: #fff; font-family: var(--fx-mono); opacity: 0; transition: opacity 0.25s var(--fx-ease); }
.flux-thumb:hover::after { opacity: 1; }

/* ============================ SON (#3) ============================= */
.flux-sound {
  position: fixed; left: var(--fx-pad); bottom: clamp(1.25rem, 3vh, 2rem); z-index: 40;
  display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.95rem;
  border: 1px solid var(--fx-line); border-radius: 999px; background: rgba(0,0,0,0.4);
  color: var(--fx-ivory-72); font-family: var(--fx-mono); font-size: 0.6rem; letter-spacing: 0.26em; text-transform: uppercase;
  cursor: pointer; transition: color 0.3s var(--fx-ease), border-color 0.3s var(--fx-ease);
}
.flux-sound:hover { color: var(--fx-ivory); border-color: var(--fx-accent); }
.flux-sound-ico { width: 9px; height: 9px; border-radius: 50%; background: var(--fx-ivory-30); transition: background 0.3s var(--fx-ease); }
.flux-sound.is-on { color: var(--fx-ivory); border-color: transparent; }
.flux-sound.is-on .flux-sound-ico { background: var(--fx-grad); box-shadow: 0 0 10px rgba(193,53,132,0.8); }
.flux-sound:focus-visible { outline: 2px solid #c13584; outline-offset: 3px; }

/* ============================ FOOTER =============================== */
.flux-footer {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 1.25rem;
  padding: clamp(3rem, 7vh, 4.5rem) var(--fx-pad) clamp(4rem, 9vh, 6rem); border-top: 1px solid var(--fx-line);
}
.flux-footer-brand { font-family: var(--fx-serif); font-size: clamp(1.5rem, 3.4vw, 2.4rem); letter-spacing: 0.12em; margin: 0; }
.flux-footer-nav { display: flex; flex-wrap: wrap; gap: clamp(0.9rem, 2.4vw, 2rem); }
.flux-footer-nav a { font-family: var(--fx-mono); font-size: 0.66rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--fx-ivory-50); text-decoration: none; transition: color 0.3s var(--fx-ease); }
.flux-footer-nav a:hover, .flux-footer-nav a[aria-current="page"] { color: var(--fx-ivory); }
.flux-footer-copy { font-family: var(--fx-mono); font-size: 0.66rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--fx-ivory-30); margin: 0; }

/* ====================================================================
   PREFERS-REDUCED-MOTION
   ==================================================================== */
@media (prefers-reduced-motion: reduce) {
  .flux-tile-inner { transition: none; }
  .flux-tile:hover .flux-tile-inner, .flux-tile:focus-visible .flux-tile-inner { transform: none; }
  .flux-title-goo .goo-l { animation: none !important; }
  .flux-flash.is-flashing { animation: none; }
  .flux-capture:hover { transform: none; }
}

/* ============================ RESPONSIVE =========================== */
@media (max-width: 760px) {
  .flux-rows { overflow-x: hidden; }
  .flux-tile-inner { width: clamp(140px, 44vw, 240px); }
  .flux-selection { max-width: 94vw; }
}
