/* ============================================================
   UbDesigner — Marketing v5 · Pivot "Vizcom" (hero clair éditorial
   + module interactif croquis → rendu → 3D → imprimable).
   Chargée APRÈS v4. Contenu inchangé : uniquement direction visuelle,
   mise en scène et interactions du hero.
   ============================================================ */

:root {
  --v5-cream: #F1EFEC;      /* fond hero (crème chaud, comme Vizcom) */
  --v5-cream-2: #E9E7E2;
  --v5-ink: #14161C;        /* noir éditorial */
  --v5-blue: #2B6BFF;
  --v5-select: #F0663A;     /* orange sélection (poignées) */
  --v5-line: rgba(20,22,28,.10);
  --ease-premium: cubic-bezier(.22,.61,.36,1);
  --ease-out-expo: cubic-bezier(.16,1,.3,1);
}

/* ============================================================
   Nav : pilule sombre flottante (home)
   ============================================================ */
.site-header {
  background: transparent !important; border-bottom: 0 !important; box-shadow: none !important;
  backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
  top: 14px !important;
}
.site-header .container.nav-row {
  max-width: 1120px; background: #16181F; border-radius: 999px;
  padding: 0 12px 0 22px; height: 58px; box-shadow: 0 10px 40px rgba(20,22,28,.22);
  border: 1px solid rgba(255,255,255,.06);
  transition: box-shadow .4s var(--ease-premium), background .4s var(--ease-premium);
}
body.v4-scrolled .site-header .container.nav-row { background: #0F1116; box-shadow: 0 12px 44px rgba(20,22,28,.34); }
.site-header .brand .b-text, .site-header .brand .b-suffix { color: #fff !important; }
.site-header .brand .b-suffix { border-left-color: rgba(255,255,255,.2) !important; }
.site-header .nav-links a { color: rgba(255,255,255,.82) !important; }
.site-header .nav-links a:hover, .site-header .nav-links a.is-active { color: #fff !important; }
.site-header .nav-links a::after { background: var(--v5-blue) !important; }
.site-header .lang-switch button { color: rgba(255,255,255,.7); }
.site-header .lang-switch button.is-active { color: #fff; background: rgba(255,255,255,.12); }
.site-header .btn-ghost { color: #fff !important; border-color: rgba(255,255,255,.22) !important; }
.site-header .btn-ghost:hover { background: rgba(255,255,255,.1) !important; }
.site-header .btn-primary { background: var(--v5-blue) !important; border-color: transparent !important; color: #fff !important; }
@media (max-width: 820px) {
  .site-header .container.nav-row { height: 54px; padding: 0 10px 0 16px; }
}

/* ============================================================
   HERO v5 — clair, éditorial, asymétrique
   ============================================================ */
.hero.hero-v5 {
  background: var(--v5-cream);
  color: var(--v5-ink);
  min-height: 92vh; padding: 150px 0 70px; position: relative; overflow: hidden; isolation: isolate;
}
/* grille technique très discrète + vignette */
.hero-v5::before {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: linear-gradient(var(--v5-line) 1px, transparent 1px), linear-gradient(90deg, var(--v5-line) 1px, transparent 1px);
  background-size: 46px 46px; -webkit-mask-image: radial-gradient(120% 100% at 50% 40%, #000, transparent 78%); mask-image: radial-gradient(120% 100% at 50% 40%, #000, transparent 78%);
  opacity: .5;
}
/* typo géante manuscrite en fond (tagline existante) */
.hero-bigtype {
  position: absolute; z-index: 0; left: 50%; top: 40%; transform: translate(-50%,-50%);
  font-family: var(--font-hand); font-weight: 700; white-space: nowrap;
  font-size: clamp(120px, 20vw, 300px); line-height: .8; color: var(--v5-ink);
  opacity: .05; pointer-events: none; letter-spacing: -.02em;
}
.hero-v5 .container.hero-grid { position: relative; z-index: 2; align-items: center; }

/* colonne texte */
.hero-v5 .eyebrow { color: var(--v5-ink); }
.hero-v5 .eyebrow .eb-bar { background: var(--v5-blue); }
.hero-v5 h1 { color: var(--v5-ink); font-size: clamp(40px, 5vw, 74px); line-height: .98; letter-spacing: -.035em; }
.hero-v5 h1 em { color: var(--v5-blue); font-style: normal; position: relative; }
.hero-v5 h1 em::after { content: ''; position: absolute; left: 0; right: 0; bottom: 4px; height: 10px; background: var(--v5-blue); opacity: .16; border-radius: 3px; transform: skewX(-12deg); }
.hero-v5 .lede { color: #4B5162; }
.hero-v5 .hero-trust { color: #5C6275; }
.hero-v5 .hero-trust .stars { color: var(--v5-select); }
.hero-v5 .hero-avatars img { border-color: var(--v5-cream); }
.hero-v5 .hero-meta { border-top-color: var(--v5-line); }
.hero-v5 .hero-meta-item .num { -webkit-text-fill-color: initial; background: none; color: var(--v5-ink); font-family: var(--font-display); font-weight: 700; }
.hero-v5 .hero-meta-item .lbl { color: #6E7488; }
.hero-v5 .btn-primary { background: var(--v5-blue); color: #fff; box-shadow: 0 8px 24px rgba(43,107,255,.26); }
.hero-v5 .btn-ghost { color: var(--v5-ink) !important; border-color: var(--v5-line) !important; background: #fff; }
.hero-v5 .btn-ghost:hover { border-color: var(--v5-ink) !important; }

/* ============================================================
   Module interactif "croquis → réel"
   ============================================================ */
.hero-lab { position: relative; }
.lab-stage {
  position: relative; aspect-ratio: 1 / 1; width: 100%; max-width: 430px; margin: 0 auto;
  display: grid; place-items: center;
}
.lab-frame {
  position: relative; width: 70%; height: 64%; display: grid; place-items: center;
  background: rgba(255,255,255,.5); border-radius: 10px;
}
/* grille de construction sous l'objet */
.lab-frame::before {
  content: ''; position: absolute; inset: 6%; z-index: 0;
  background-image: linear-gradient(rgba(20,22,28,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(20,22,28,.08) 1px, transparent 1px);
  background-size: 26px 26px; opacity: 0; transition: opacity .6s var(--ease-premium);
}
.lab-stage[data-state="select"] .lab-frame::before, .lab-stage[data-state="sketch"] .lab-frame::before { opacity: .7; }

.lab-sketch, .lab-render {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
}
.lab-sketch { mix-blend-mode: multiply; transition: opacity .7s var(--ease-premium); z-index: 1; }
.lab-render {
  z-index: 2; border-radius: 12px; object-fit: cover; box-shadow: 0 30px 70px rgba(20,22,28,.28);
  clip-path: inset(0 100% 0 0); opacity: 0; transition: clip-path 1.1s var(--ease-out-expo), opacity .5s var(--ease-premium);
}
.lab-stage[data-state="render"] .lab-render, .lab-stage[data-state="print"] .lab-render { opacity: 1; clip-path: inset(0 0 0 0); }
.lab-stage[data-state="render"] .lab-sketch, .lab-stage[data-state="print"] .lab-sketch { opacity: 0; }

/* wireframe overlay (phase intermédiaire) */
.lab-wire { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .5s var(--ease-premium); }
.lab-stage[data-state="wire"] .lab-wire { opacity: 1; }
.lab-stage[data-state="wire"] .lab-sketch { opacity: .25; }

/* couches d'impression (phase print) */
.lab-print { position: absolute; inset: 0; z-index: 4; pointer-events: none; opacity: 0;
  background: repeating-linear-gradient(0deg, rgba(52,211,153,.0) 0 6px, rgba(52,211,153,.16) 6px 7px);
  transition: opacity .5s var(--ease-premium); border-radius: 12px;
}
.lab-stage[data-state="print"] .lab-print { opacity: 1; }

/* boîte de sélection + poignées */
.lab-select { position: absolute; inset: -3%; z-index: 5; border: 1.5px solid var(--v5-select); border-radius: 3px;
  opacity: 0; transform: scale(.96); transition: opacity .4s var(--ease-premium), transform .4s var(--ease-premium); pointer-events: none; }
.lab-stage[data-state="select"] .lab-select, .lab-stage[data-state="wire"] .lab-select, .lab-stage[data-state="render"] .lab-select { opacity: 1; transform: none; }
.lab-select i { position: absolute; width: 9px; height: 9px; background: #fff; border: 1.5px solid var(--v5-select); border-radius: 2px; }
.lab-select i:nth-child(1){ top: -5px; left: -5px; } .lab-select i:nth-child(2){ top: -5px; right: -5px; }
.lab-select i:nth-child(3){ bottom: -5px; left: -5px; } .lab-select i:nth-child(4){ bottom: -5px; right: -5px; }
.lab-select i:nth-child(5){ top: -5px; left: calc(50% - 4px); } .lab-select i:nth-child(6){ bottom: -5px; left: calc(50% - 4px); }
.lab-select i:nth-child(7){ top: calc(50% - 4px); left: -5px; } .lab-select i:nth-child(8){ top: calc(50% - 4px); right: -5px; }

/* barre de prompt */
.lab-prompt {
  position: absolute; z-index: 6; bottom: 15%; left: 50%; transform: translateX(-50%) translateY(10px);
  display: flex; align-items: center; gap: 10px; min-width: 62%;
  background: #16181F; color: #fff; border-radius: 12px; padding: 10px 10px 10px 16px;
  box-shadow: 0 16px 40px rgba(20,22,28,.34); opacity: 0; transition: opacity .45s var(--ease-premium), transform .45s var(--ease-premium);
  font-family: var(--font-mono); font-size: 14px;
}
.lab-stage[data-state="select"] .lab-prompt, .lab-stage[data-state="wire"] .lab-prompt, .lab-stage[data-state="render"] .lab-prompt, .lab-stage[data-state="print"] .lab-prompt { opacity: 1; transform: translateX(-50%) translateY(0); }
.lab-prompt .lab-ic { color: var(--v5-blue); font-style: normal; }
.lab-prompt .lab-text { flex: 1; white-space: nowrap; }
.lab-prompt .lab-caret { display: inline-block; width: 1.5px; height: 15px; background: var(--v5-blue); margin-left: 1px; animation: labcaret 1s steps(2) infinite; vertical-align: middle; }
@keyframes labcaret { 50% { opacity: 0; } }
.lab-go { width: 38px; height: 34px; border: 0; border-radius: 9px; background: var(--v5-blue); color: #fff; font-size: 16px; cursor: pointer; display: grid; place-items: center; transition: background .3s, transform .3s var(--ease-premium); }
.lab-go:hover { background: var(--v5-blue); transform: scale(1.06); }
.lab-stage[data-state="render"] .lab-go, .lab-stage[data-state="print"] .lab-go { background: #16A34A; }

/* étiquette d'état (mono) */
.lab-state { position: absolute; z-index: 6; top: 4%; left: 4%; font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #6E7488; display: flex; align-items: center; gap: 7px; }
.lab-state b { width: 7px; height: 7px; border-radius: 50%; background: var(--v5-blue); font-style: normal; box-shadow: 0 0 8px var(--v5-blue); }
.lab-stage[data-state="render"] .lab-state b, .lab-stage[data-state="print"] .lab-state b { background: #16A34A; box-shadow: 0 0 8px #16A34A; }

/* curseur fantôme */
.lab-cursor { position: absolute; z-index: 7; width: 20px; height: 20px; pointer-events: none; opacity: 0; transition: opacity .3s, left .8s var(--ease-premium), top .8s var(--ease-premium);
  background: no-repeat center/contain url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2316181F' stroke='white' stroke-width='1.2'%3E%3Cpath d='M4 2l6 16 2.5-6.5L19 9z'/%3E%3C/svg%3E"); }
.lab-stage.cursor-on .lab-cursor { opacity: 1; }

/* croquis flottants (côtés) */
.hero-floaters { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.hero-floaters img { position: absolute; width: clamp(120px, 12vw, 200px); mix-blend-mode: multiply; opacity: .9; animation: v5float 8s var(--ease-premium) infinite; }
.hero-floaters img:nth-child(1){ left: 1%; top: 34%; animation-delay: 0s; }
.hero-floaters img:nth-child(2){ right: 1.5%; top: 20%; animation-delay: 1.2s; }
@keyframes v5float { 0%,100%{ transform: translateY(0) rotate(-1deg);} 50%{ transform: translateY(-14px) rotate(1deg);} }
@media (max-width: 1200px){ .hero-floaters { display: none; } }

/* badges techniques discrets (repositionnés pour fond clair) */
.hero-v5 .hero-badges b { background: rgba(255,255,255,.85); border-color: var(--v5-line); color: var(--v5-ink); box-shadow: 0 4px 16px rgba(20,22,28,.08); }
.hero-v5 .hero-badges b i { background: var(--v5-blue); box-shadow: 0 0 8px rgba(43,107,255,.6); }

@media (max-width: 900px) {
  .hero-v5 { padding-top: 120px; }
  .hero-lab { margin-top: 30px; }
  .hero-bigtype { font-size: clamp(90px, 30vw, 160px); opacity: .045; }
}

/* ============================================================
   reduced-motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .hero-floaters img, .lab-caret, .lab-cursor { animation: none !important; }
  .lab-render { transition: opacity .3s; clip-path: none; }
}
