/* ============================================================
   ChromaFlow One — feuille de style
   Design : dark, glassmorphism, accents CMJ
   ============================================================ */

:root {
  --bg: #06070c;
  --ink: #eef1f7;
  --muted: #99a2b4;
  --line: rgba(255, 255, 255, 0.08);
  --card: rgba(13, 16, 24, 0.55);

  --cyan: #00c2e8;
  --mag: #ec2c9c;
  --yel: #ffd91c;
  --wht: #f2f3f5;
  --blk: #191b21;

  --grad: linear-gradient(92deg, #22d3ee 0%, #e879f9 50%, #fde047 100%);

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(232, 121, 249, 0.35); }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #07080d; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(#22d3ee, #e879f9);
  border-radius: 6px;
  border: 2px solid #07080d;
}

/* ------------------------------------------------------------
   Décor d'arrière-plan : halos de couleur + grille
   ------------------------------------------------------------ */
.blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(130px);
  z-index: -2;
  pointer-events: none;
}
.blob.b1 { width: 46vw; height: 46vw; left: -12vw; top: -14vw; background: rgba(0, 194, 232, 0.13); }
.blob.b2 { width: 42vw; height: 42vw; right: -14vw; top: 22vh; background: rgba(236, 44, 156, 0.11); }
.blob.b3 { width: 38vw; height: 38vw; left: 8vw; bottom: -16vw; background: rgba(255, 217, 28, 0.07); }

.grid-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 35%, black 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 35%, black 30%, transparent 100%);
}

/* ------------------------------------------------------------
   Canvas 3D + calque d'étiquettes
   ------------------------------------------------------------ */
#scene3d {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

#labelLayer {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}
#labelLines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.lbl {
  position: absolute;
  transform: translate(-50%, -50%);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #e8ecf4;
  background: rgba(10, 12, 18, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 0.45em 0.8em;
  border-radius: 8px;
  backdrop-filter: blur(8px);
  white-space: nowrap;
  opacity: 0;
  will-change: opacity, left, top;
}
.lbl-dot {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
  transform: translate(-50%, -50%);
  opacity: 0;
}

/* ------------------------------------------------------------
   Barre de progression + navigation
   ------------------------------------------------------------ */
#progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: var(--grad);
  transform-origin: 0 50%;
  transform: scaleX(0);
  z-index: 60;
}

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem clamp(1.2rem, 4vw, 3.5rem);
  transition: background 0.4s, border-color 0.4s, padding 0.4s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(6, 7, 12, 0.72);
  backdrop-filter: blur(16px) saturate(1.4);
  border-bottom-color: var(--line);
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
}
.logo svg { display: block; }
.logo b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.nav-links {
  display: flex;
  gap: 1.9rem;
  list-style: none;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  transition: color 0.25s;
}
.nav-links a:hover { color: var(--ink); }

/* ------------------------------------------------------------
   Boutons
   ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.85em 1.7em;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: transform 0.25s, box-shadow 0.25s, background 0.25s;
}
.btn-primary {
  background: var(--grad);
  color: #0a0c12;
  box-shadow: 0 8px 30px rgba(232, 121, 249, 0.25);
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 44px rgba(232, 121, 249, 0.4);
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.1);
}
.btn-sm { padding: 0.55em 1.2em; font-size: 0.85rem; }

/* ------------------------------------------------------------
   Sections — mise en page générale
   ------------------------------------------------------------ */
main { position: relative; z-index: 3; }

.section {
  min-height: 115vh;
  display: flex;
  align-items: center;
  padding: 14vh clamp(1.2rem, 5vw, 5rem);
}
.section-inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3rem;
  align-items: center;
}
.side-left .content { grid-column: 1; }
.side-right .content { grid-column: 2; }
.side-center { text-align: left; }
.side-center .content { grid-column: 1 / -1; max-width: 880px; margin: 0 auto; width: 100%; }

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: transparent;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  margin-bottom: 1.1rem;
}
.kicker::before {
  content: "";
  width: 26px;
  height: 2px;
  background: var(--grad);
  border-radius: 2px;
}

h2 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin-bottom: 1.2rem;
}
.muted { color: var(--muted); }
.content > p { color: var(--muted); font-size: 1.04rem; max-width: 56ch; }
.content p + p { margin-top: 1rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: clamp(1.6rem, 3vw, 2.6rem);
  backdrop-filter: blur(18px) saturate(1.35);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
}

/* Animations d'apparition */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.1s; }
.reveal.d2 { transition-delay: 0.2s; }
.reveal.d3 { transition-delay: 0.3s; }

/* ------------------------------------------------------------
   HERO
   ------------------------------------------------------------ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 16vh clamp(1.2rem, 5vw, 5rem) 8vh;
  position: relative;
}
.hero-inner { max-width: 1280px; margin: 0 auto; width: 100%; }
.hero-content { max-width: 640px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.5em 1.1em;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  margin-bottom: 1.8rem;
}
.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 12px #4ade80;
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.03em;
  margin-bottom: 1.6rem;
}
h1 .grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  font-size: clamp(1.02rem, 1.4vw, 1.18rem);
  color: var(--muted);
  max-width: 54ch;
  margin-bottom: 2.2rem;
}

.cta-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 3.6rem; }

.stats {
  display: flex;
  gap: clamp(1.6rem, 4vw, 3.4rem);
  list-style: none;
  flex-wrap: wrap;
}
.stats b {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  font-weight: 700;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.15;
}
.stats span {
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.scroll-hint {
  position: absolute;
  bottom: 2.4rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  white-space: nowrap;
}
.scroll-hint::after {
  content: "";
  width: 1px;
  height: 44px;
  background: linear-gradient(var(--muted), transparent);
  animation: drip 2s infinite;
}
@keyframes drip {
  0% { transform: scaleY(0); transform-origin: top; }
  55% { transform: scaleY(1); transform-origin: top; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ------------------------------------------------------------
   CONCEPT — diagramme CMJ
   ------------------------------------------------------------ */
.venn-box {
  background: #f3f4f7;
  border-radius: 20px;
  padding: 1.6rem;
  margin: 1.8rem 0 1.4rem;
}
.venn { position: relative; height: 215px; }
.vc {
  position: absolute;
  width: 138px;
  height: 138px;
  border-radius: 50%;
  mix-blend-mode: multiply;
}
.vc.c { background: #00b6e3; left: calc(50% - 110px); top: 6px; }
.vc.m { background: #ec268f; left: calc(50% - 28px); top: 6px; }
.vc.y { background: #ffe000; left: calc(50% - 69px); top: 72px; }

.chips { display: flex; gap: 0.9rem; flex-wrap: wrap; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  font-size: 0.82rem;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.45em 1em;
  border-radius: 999px;
}
.chip i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

/* ------------------------------------------------------------
   ANATOMIE — liste des pièces
   ------------------------------------------------------------ */
.parts { list-style: none; margin-top: 1.6rem; }
.parts li {
  display: flex;
  gap: 1.1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.parts li:last-child { border-bottom: none; }
.parts .num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  flex: 0 0 2em;
}
.parts b { font-family: var(--font-display); font-weight: 600; font-size: 0.98rem; }
.parts p { font-size: 0.86rem; color: var(--muted); margin-top: 0.15rem; }

/* ------------------------------------------------------------
   COUPE — étapes
   ------------------------------------------------------------ */
.steps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  margin-top: 1.7rem;
}
.step {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.1rem 1.2rem;
}
.step .snum {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.step b {
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
  margin: 0.3rem 0 0.25rem;
}
.step p { font-size: 0.84rem; color: var(--muted); }

.note {
  margin-top: 1.5rem;
  font-size: 0.87rem;
  color: var(--muted);
  border-left: 3px solid;
  border-image: var(--grad) 1;
  padding-left: 1rem;
}

/* ------------------------------------------------------------
   LABORATOIRE de mélange
   ------------------------------------------------------------ */
.lab-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 2.2rem;
  align-items: center;
  margin-top: 1.6rem;
}

.mix-row {
  display: grid;
  grid-template-columns: 18px 78px 1fr 52px;
  align-items: center;
  gap: 0.8rem;
  padding: 0.45rem 0;
}
.mix-row .dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.mix-row label { font-size: 0.86rem; font-weight: 500; }
.mix-row output {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  text-align: right;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid #0b0d13;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35), 0 4px 12px rgba(0, 0, 0, 0.5);
}
input[type="range"]::-moz-range-thumb {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid #0b0d13;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.lab-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
}
.swatch {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: #ff8a3d;
  border: 5px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 70px -8px currentColor;
  transition: background 0.3s;
  margin-bottom: 0.6rem;
}
.hexval {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.rgbval { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); }
.lab-note { font-size: 0.8rem; color: var(--muted); margin-top: 0.7rem; max-width: 24ch; }

.recipe {
  margin-top: 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.presets { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1.3rem; }
.preset {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.42em 1em;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.preset:hover { background: rgba(255, 255, 255, 0.11); transform: translateY(-2px); }
.preset i { width: 13px; height: 13px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.2); }

/* ------------------------------------------------------------
   ÉLECTRONIQUE
   ------------------------------------------------------------ */
.elec-list { list-style: none; margin-top: 1.4rem; }
.elec-list li {
  position: relative;
  padding: 0.55rem 0 0.55rem 1.7rem;
  font-size: 0.93rem;
  color: var(--muted);
}
.elec-list li::before {
  content: "▸";
  position: absolute;
  left: 0.2rem;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.elec-list b { color: var(--ink); font-weight: 600; }

.code {
  background: #0a0c12;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.4rem 1.6rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.75;
  overflow-x: auto;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.4);
}
.code .cm { color: #5b657a; }
.code .kw { color: #22d3ee; font-weight: 700; }
.code .pr { color: #e879f9; }

.pipeline {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-top: 1.6rem;
}
.pipe-chip {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.5em 0.95em;
  border-radius: 10px;
  color: var(--muted);
}
.pipe-arrow { color: var(--muted); font-size: 0.8rem; }
.pipe-chip.hl {
  background: var(--grad);
  color: #0a0c12;
  font-weight: 700;
  border: none;
}

/* ------------------------------------------------------------
   SPECS
   ------------------------------------------------------------ */
.spec-table { width: 100%; border-collapse: collapse; margin-top: 1.4rem; }
.spec-table td {
  padding: 0.85rem 0.5rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.93rem;
}
.spec-table tr:last-child td { border-bottom: none; }
.spec-table td:first-child { color: var(--muted); width: 42%; }
.spec-table td:last-child { font-weight: 500; }
.spec-table b { font-family: var(--font-mono); font-weight: 600; font-size: 0.88rem; }

/* ------------------------------------------------------------
   FOOTER
   ------------------------------------------------------------ */
footer {
  position: relative;
  z-index: 3;
  border-top: 1px solid var(--line);
  background: linear-gradient(rgba(6, 7, 12, 0.4), rgba(6, 7, 12, 0.92));
  backdrop-filter: blur(10px);
  padding: 6rem clamp(1.2rem, 5vw, 5rem) 2.5rem;
  text-align: center;
}
.footer-cta h2 { margin-bottom: 1.6rem; }
.footer-bottom {
  margin-top: 5rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 980px) {
  .nav-links { display: none; }
  #scene3d { opacity: 0.55; }
  .section { min-height: auto; padding: 12vh 1.2rem; }
  .section-inner { grid-template-columns: 1fr; }
  .side-left .content, .side-right .content { grid-column: 1; }
  .card { background: rgba(10, 12, 19, 0.78); }
  .lab-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .hero { padding-top: 22vh; }
  .scroll-hint { display: none; }
  #labelLayer { display: none; }
}
