/* ============================================================
   FLUXIA — site cinématique · base, nav, hero, motion
   Charte : gris perle, noir graphite, un seul accent rouge
   (#c4161c sur clair, #e0343a sur noir). Barlow Semi Condensed (titres) + Barlow (texte).
   Les sections sont dans sections.css.
   ============================================================ */

:root {
  /* Clair : gris perle + encre noire + un seul accent rouge */
  --bg:        #efeff0;
  --bg-2:      #e4e4e6;
  --bg-3:      #d8d8db;
  --ink:       #111113;

  --fg:        #131316;
  --fg-soft:   #45454c;
  --muted:     #6c6c75;

  --accent:    #c4161c;
  --on-accent: #ffffff;
  --line:      rgba(19, 19, 22, 0.14);
  --line-2:    rgba(19, 19, 22, 0.28);

  --maxw: 1240px;
  --pad:  clamp(22px, 5vw, 80px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --serif: "Barlow Semi Condensed", "Barlow", system-ui, sans-serif;   /* titres */
  --sans:  "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif; /* texte */
  --mono:  "Barlow Semi Condensed", "Barlow", system-ui, sans-serif;   /* étiquettes */
}
/* Sections sombres : noir graphite */
.dark {
  --bg:        #0c0c0d;
  --bg-2:      #141416;
  --bg-3:      #1d1d20;
  --ink:       #070708;

  --fg:        #f2f2f3;
  --fg-soft:   #bdbdc4;
  --muted:     #8a8a93;

  --accent:    #e0343a;
  --on-accent: #ffffff;
  --line:      rgba(242, 242, 243, 0.14);
  --line-2:    rgba(242, 242, 243, 0.28);
  color: var(--fg);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--sans); font-weight: 400; font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 600; line-height: 1.02; letter-spacing: -0.01em; }
em { font-style: normal; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--on-accent); }

/* ---- Shared bits ---- */
.eyebrow {
  font-family: var(--mono); font-size: 13px; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent);
  margin: 0 0 22px; display: flex; align-items: center; gap: 14px;
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--accent); flex: 0 0 auto; }
.lede { font-size: clamp(16px, 1.4vw, 19px); color: var(--fg-soft); max-width: 48ch; margin-top: 26px; line-height: 1.7; }

.btn {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 16px 28px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer;
  transition: background .35s var(--ease), color .35s var(--ease), border-color .35s var(--ease), transform .35s var(--ease);
}
.btn--lime { background: var(--accent); color: var(--on-accent); }
.btn--lime:hover { background: var(--fg); color: var(--bg); transform: translateY(-2px); }
.btn--ghost { color: var(--fg); border-color: var(--line-2); }
.btn--ghost:hover { background: var(--fg); color: var(--bg); transform: translateY(-2px); }
.btn:active { transform: scale(0.98); transition-duration: .12s; }
.btn__arrow { transition: transform .35s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(4px); }

/* ---- Scroll progress ---- */
.scroll-progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; background: var(--accent); z-index: 200; }

/* ---- Nav ---- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 150;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 22px var(--pad);
  transition: background .5s var(--ease), padding .5s var(--ease), border-color .5s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(10, 10, 11, 0.86); backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  padding-top: 14px; padding-bottom: 14px; border-bottom-color: var(--line);
}
.wordmark { font-family: var(--serif); font-weight: 700; font-size: 26px; letter-spacing: -0.01em; color: var(--fg); }
.wordmark em { color: var(--accent); }
.nav__links { display: flex; gap: 34px; }
.nav__links a {
  font-size: 13.5px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--fg-soft); position: relative; padding: 4px 0; transition: color .3s;
}
.nav__links a::after { content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 0; background: var(--accent); transition: width .4s var(--ease); }
.nav__links a:hover { color: var(--fg); }
.nav__links a:hover::after { width: 100%; }
.nav__cta {
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--on-accent); background: var(--accent); padding: 11px 20px; border-radius: 999px;
  transition: background .35s var(--ease), transform .35s var(--ease); white-space: nowrap;
}
.nav__cta:hover { background: var(--fg); color: var(--bg); transform: translateY(-1px); }

/* Hero : noir profond, même rouge */
.noir, .nav.nav--noir {
  --bg:        #050505;
  --accent:    #e0343a;
  --on-accent: #ffffff;
}
.nav.nav--noir.is-scrolled { background: rgba(5, 5, 5, 0.8); }
.wordmark { display: inline-flex; align-items: center; }
.wordmark__mark { height: 26px; width: auto; opacity: .95; margin-right: 10px; }

/* ============================================================
   HERO — fly-through procédural (canvas piloté par le scroll)
   ============================================================ */
.scrub { position: relative; height: 100vh; height: 100svh; min-height: 640px; background: var(--bg); }
.scrub__stage { position: relative; height: 100%; overflow: hidden; }
.scrub__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scrub__scrim { display: none; }
.scrub__beat {
  position: absolute; left: var(--pad); right: var(--pad); bottom: clamp(64px, 12vh, 130px); z-index: 10;
  max-width: min(46vw, 620px); opacity: 0; will-change: opacity, transform; pointer-events: none;
}
.scrub__eyebrow { font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); margin-bottom: 18px; }
.scrub__title, .scrub__beat-title {
  font-size: clamp(34px, 4.6vw, 70px); line-height: 1.02; color: var(--fg);
  text-shadow: 0 2px 50px rgba(0,0,0,0.5);
}
.scrub__title em, .scrub__beat-title em { color: var(--accent); }
.scrub__beat--center { left: 0; right: 0; top: 0; bottom: 0; max-width: none; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; text-align: center; padding: 55vh var(--pad) 0; }
.scrub__beat--center .scrub__actions { justify-content: center; }
.scrub__beat--center .scrub__tagline, .scrub__beat--center .scrub__beat-copy { margin-left: auto; margin-right: auto; }
.scrub__welcome { font-size: clamp(42px, 6.8vw, 112px); line-height: 1; font-weight: 700; letter-spacing: -0.015em; letter-spacing: -0.03em; color: var(--fg); text-shadow: 0 4px 60px rgba(0,0,0,0.7); }
.scrub__welcome em { color: var(--accent); }
.scrub__tagline, .scrub__beat-copy {
  font-size: clamp(15px, 1.25vw, 18px); color: var(--fg-soft);
  margin-top: 24px; max-width: 46ch; line-height: 1.65; text-shadow: 0 1px 20px rgba(0,0,0,0.6);
}
.scrub__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.scrub__cue {
  position: absolute; right: var(--pad); bottom: clamp(48px, 10vh, 96px); z-index: 10;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--fg-soft);
}
.scrub__cue-line { width: 1px; height: 54px; background: linear-gradient(var(--fg-soft), transparent); animation: cuePulse 2.4s var(--ease) infinite; }
@keyframes cuePulse { 0%,100% { opacity: .35; transform: scaleY(.7); transform-origin: top; } 50% { opacity: 1; transform: scaleY(1); } }

/* Hero : apparition lettre par lettre (créées par script.js) */
.w { display: inline-block; white-space: nowrap; }
.ch { display: inline-block; opacity: 0; transform: translateX(-0.55em); filter: blur(3px); animation: chIn .6s var(--ease) both; animation-delay: var(--cd, 0s); }
@keyframes chIn { from { opacity: 0; transform: translateX(-0.55em); filter: blur(3px); } to { opacity: 1; transform: none; filter: blur(0); } }
.scrub__actions.is-delayed { opacity: 0; animation: fadeUp .9s var(--ease) forwards; animation-delay: var(--cd, 0s); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Pas de JS : on garde un hero lisible */
.no-js .scrub { height: auto; }
.no-js .scrub__stage { position: relative; height: auto; padding: 160px 0 80px; }
.no-js .scrub__beat { position: relative; opacity: 1; bottom: auto; margin-bottom: 40px; }

/* ============================================================
   MOTION
   ============================================================ */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: var(--d, 0s); }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

.ml-line { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.ml-line__inner { display: block; transform: translateY(112%); transition: transform 1s var(--ease); transition-delay: var(--ml-delay, 0s); will-change: transform; }
.is-shown .ml-line__inner { transform: none; }

body.intro .nav { opacity: 0; transform: translateY(-12px); }
body.intro.is-loaded .nav { opacity: 1; transform: none; transition: opacity .8s var(--ease), transform .8s var(--ease), background .5s var(--ease), padding .5s var(--ease), border-color .5s var(--ease); }

/* ============================================================
   RESPONSIVE (base + hero)
   ============================================================ */
@media (max-width: 980px) { .nav__links { display: none; } }
/* 820px = breakpoint JS « isSmall » : le hero devient un plan animé en boucle, sans scroll-scrub */
@media (max-width: 820px) {
  .scrub { height: 100vh; height: 100svh; }
  .scrub__beat[data-beat="1"], .scrub__beat[data-beat="2"], .scrub__beat[data-beat="3"] { display: none; }
  .scrub__cue { display: none; }
  .scrub__welcome { font-size: clamp(38px, 11vw, 64px); }
  .scrub__beat--center { padding-top: 47vh; }
  .scrub__tagline { font-size: 15px; margin-top: 18px; }
  .scrub__actions { margin-top: 22px; gap: 10px; }
  .scrub__actions .btn { padding: 14px 20px; font-size: 11px; }
}
@media (max-width: 560px) { .nav__cta { padding: 10px 16px; } .btn { padding: 15px 22px; } }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .ml-line { overflow: visible; }
  .ml-line__inner { transform: none !important; transition: none !important; }
  body.intro .nav { opacity: 1 !important; transform: none !important; }
}
