/* ==========================================================================
   QrTagy OS — présentation produit « vitrine dynamique » (v2)
   À charger APRÈS main.css (v2). Utilise ses tokens : couleurs, --space-*, --radius,
   --transition-*, --shadow-*, --header-h, --z-*.

   Contenu :
     1. Appareils (téléphone, fenêtre navigateur) + halo lumineux
     2. Hero produit (.ph)
     3. Parcours produit (.tour) : écran fixe + étapes qui défilent
   Gabarit réutilisable pour les autres produits : seuls le texte et les images changent.

   Aucun cadre n'est dessiné en CSS : seules les images sont affichées.
   Palette inchangée. Colonnes fixées par point de rupture (--cols), comme dans main.css.
   Points de rupture : 40rem · 52rem · 62rem
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Tokens propres à la vitrine
   -------------------------------------------------------------------------- */
@property --a {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

:root {
  --glow-blue: rgba(19, 108, 252, 0.75);
  --glow-lime: rgba(195, 248, 74, 0.28);
  --shadow-device: rgba(8, 16, 32, 0.35);
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* --------------------------------------------------------------------------
   1. Appareils
   Les appareils n'ont AUCUN cadre CSS : seules vos images sont affichées (leur cadre éventuel
   fait partie de l'image). Seule une ombre portée suit la forme de l'image.
   -------------------------------------------------------------------------- */
.device-phone,
.device-browser { position: relative; }
.device-browser__bar { display: none; }
.device-phone__screen { position: relative; aspect-ratio: 420 / 860; }
.device-browser__screen { position: relative; aspect-ratio: 1200 / 750; }

.device-phone__screen img,
.device-browser__screen img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
  -webkit-filter: drop-shadow(0 24px 34px var(--shadow-device));
  filter: drop-shadow(0 24px 34px var(--shadow-device));
}

/* Halo lumineux lime / bleu derrière l'appareil (flou, sans bord visible) */
.slot-phone { position: relative; isolation: isolate; }
.slot-phone::before {
  content: '';
  position: absolute;
  inset: 8% -10%;
  z-index: -1;
  border-radius: 50%;
  background: conic-gradient(from var(--a), rgba(19, 108, 252, 0.55), rgba(195, 248, 74, 0.6), rgba(19, 108, 252, 0.55));
  -webkit-filter: blur(34px);
  filter: blur(34px);
  opacity: 0.7;
  animation: spin 8s linear infinite;
}
@keyframes spin { to { --a: 360deg; } }

/* Pastilles flottantes */
.chip {
  position: absolute;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: 0.45rem 0.85rem 0.45rem 0.5rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.96);
  color: var(--color-dark);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 14px 30px -10px rgba(8, 16, 32, 0.45);
  animation: float 6s ease-in-out infinite;
}
.chip .icon-tile { width: 1.6rem; height: 1.6rem; margin: 0; border-radius: var(--radius-pill); }
.chip .icon { width: 0.95rem; height: 0.95rem; }
.chip:nth-of-type(2) { animation-delay: -2s; }
.chip:nth-of-type(3) { animation-delay: -4s; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}

/* --------------------------------------------------------------------------
   2. Hero produit
   -------------------------------------------------------------------------- */
.ph {
  position: relative;
  overflow: hidden;
  padding-block: clamp(2rem, 1rem + 4.5vw, 4.5rem) clamp(2rem, 1.5rem + 3vw, 3.5rem);
  background: var(--color-dark);
  color: var(--color-white);
}
/* Nappes de lumière */
.ph::before,
.ph::after {
  content: '';
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  pointer-events: none;
  -webkit-filter: blur(70px);
  filter: blur(70px);
  animation: drift 16s ease-in-out infinite alternate;
}
.ph::before { top: -20%; right: -10%; width: 46rem; height: 46rem; background: radial-gradient(circle, var(--glow-blue), transparent 65%); }
.ph::after  { bottom: -25%; left: -12%; width: 34rem; height: 34rem; background: radial-gradient(circle, var(--glow-lime), transparent 65%); animation-duration: 20s; animation-direction: alternate-reverse; }
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-4%, 6%, 0) scale(1.12); }
}
.ph > .container { position: relative; z-index: 1; }
.ph .breadcrumb { padding-top: 0; }
.ph .breadcrumb a { color: var(--color-on-dark-muted); }
.ph .breadcrumb a:hover { color: var(--color-lime); }
.ph .breadcrumb li + li::before { color: #7f93b3; }

.ph__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-xl); align-items: center; }
.ph__text { min-width: 0; }
.ph h1 { color: var(--color-white); }
.ph h1 em { font-style: normal; color: var(--color-lime); }
.ph .lead { max-width: 34rem; color: var(--color-on-dark-muted); }
.ph .eyebrow { background: rgba(255, 255, 255, 0.08); border-color: var(--color-border-on-dark); color: var(--color-lime); }
.ph .btn--secondary { color: var(--color-white); border-color: rgba(255, 255, 255, 0.55); }
.ph .btn--secondary:hover { background: var(--color-white); color: var(--color-dark); }
.ph .icon-tile { color: var(--color-dark); }

.ph__stage { position: relative; min-width: 0; width: 100%; max-width: 36rem; margin-inline: auto; padding: 0 0 3.5rem 3rem; }
.ph__phone { position: absolute; bottom: 0; left: 0; z-index: 3; width: 31%; }
.ph__stage .chip--a { top: -0.9rem; right: 0.5rem; }
.ph__stage .chip--b { bottom: 5.5rem; right: -0.25rem; }
.ph__stage .chip--c { bottom: 0.25rem; left: 36%; display: none; }

/* Bandeau des 4 arguments : 1 → 2 → 4 colonnes fixes */
.ph__values {
  --cols: 1;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: var(--space-sm);
  margin: var(--space-xl) 0 0;
  padding: 0;
  list-style: none;
}
.ph__values > * { min-width: 0; }
.ph__values li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: var(--space-sm);
  align-items: start;
  padding: var(--space-sm) var(--space-md) var(--space-sm) var(--space-sm);
  border: 1px solid var(--color-border-on-dark);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: var(--transition-ui);
}
@media (hover: hover) {
  .ph__values li:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.3); transform: translateY(-2px); }
}
.ph__values .icon-tile { grid-row: span 3; margin: 0; }
.ph__values strong { display: block; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-lime); }
.ph__values b { display: block; margin: 0.1rem 0; font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem); font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; color: var(--color-white); }
.ph__values span { font-size: 0.875rem; line-height: 1.4; color: var(--color-on-dark-muted); }

@media (min-width: 40rem) {
  .ph__values { --cols: 2; }
  .ph__stage .chip--c { display: inline-flex; }
}
@media (min-width: 62rem) {
  .ph__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: var(--space-xl); }
  .ph__values { --cols: 4; }
}

/* --------------------------------------------------------------------------
   3. Parcours produit : écran fixe + étapes
   -------------------------------------------------------------------------- */
.tour { position: relative; overflow-x: clip; background: var(--color-light); }
.tour__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.tour__grid > * { min-width: 0; }

.tour__step { padding-block: var(--space-md); }
.tour__num {
  display: block;
  margin-bottom: var(--space-3xs);
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--color-blue);
}
.tour__tag {
  display: inline-block;
  margin-bottom: var(--space-xs);
  padding: 0.2rem 0.7rem;
  border-radius: var(--radius-pill);
  background: var(--color-lime);
  color: var(--color-dark);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tour__step h3 { font-size: clamp(1.3rem, 1.1rem + 1vw, 1.75rem); letter-spacing: -0.01em; }
.tour__step .lead { max-width: 30rem; }
.tour__fig {
  margin: var(--space-md) 0 0;
  padding: clamp(1rem, 4vw, 1.75rem);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.tour__fig .device-phone { width: min(70%, 15rem); margin-inline: auto; }

/* Écran fixe : affiché seulement si JS actif et écran large */
.tour__stage-col { display: none; }

@media (min-width: 62rem) {
  .tour__grid {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    column-gap: clamp(2rem, 6vw, 5rem);
    align-items: start;
  }
  .tour__step { display: flex; align-items: center; min-height: 72vh; padding-block: 0; }
  .tour__fig { display: none; }

  .tour__stage-col { display: block; grid-column: 2; grid-row: 1; align-self: stretch; }
  .tour__steps { grid-column: 1; grid-row: 1; }
  .tour__stage {
    position: -webkit-sticky;
    position: sticky;
    top: calc(var(--header-h) + 4.75rem);
    height: min(35rem, calc(100vh - var(--header-h) - 7.5rem));
    min-height: 26rem;
    margin-block: var(--space-lg);
  }
  .js-tour .tour__step { opacity: 0.35; transition: opacity 0.4s ease; }
  .js-tour .tour__step.is-active { opacity: 1; }
}

.tour__glow { position: absolute; inset: -12% -8%; z-index: 0; pointer-events: none; }
.tour__glow::before,
.tour__glow::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  -webkit-filter: blur(60px);
  filter: blur(60px);
  animation: drift 14s ease-in-out infinite alternate;
}
.tour__glow::before { top: 0; left: 5%; width: 60%; height: 60%; background: radial-gradient(circle, rgba(19, 108, 252, 0.4), transparent 65%); }
.tour__glow::after  { right: 0; bottom: 0; width: 55%; height: 55%; background: radial-gradient(circle, rgba(195, 248, 74, 0.7), transparent 65%); animation-direction: alternate-reverse; }

.tour__browser {
  position: absolute;
  z-index: 1;
  top: 7%;
  left: 0;
  width: 90%;
  transition: transform 0.7s var(--ease-out), opacity 0.6s ease, filter 0.6s ease;
}
.tour__phone {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 0;
  width: 33%;
  transition: transform 0.7s var(--ease-out), opacity 0.6s ease;
}

/* Fondu entre les captures d'un même appareil */
.tour__stage [data-s] { opacity: 0; transition: opacity 0.55s ease; }
.tour__stage[data-step='1'] [data-s~='1'],
.tour__stage[data-step='2'] [data-s~='2'],
.tour__stage[data-step='3'] [data-s~='3'],
.tour__stage[data-step='4'] [data-s~='4'] { opacity: 1; }

/* Étapes 1 et 4 : le téléphone passe devant. Étapes 2 et 3 : la console passe devant. */
.tour__stage[data-step='1'] .tour__browser,
.tour__stage[data-step='4'] .tour__browser { opacity: 0.4; transform: translateY(-3%) scale(0.95); -webkit-filter: saturate(0.7); filter: saturate(0.7); }
.tour__stage[data-step='1'] .tour__phone,
.tour__stage[data-step='4'] .tour__phone { transform: translateY(-2%) scale(1.06); }
.tour__stage[data-step='2'] .tour__phone,
.tour__stage[data-step='3'] .tour__phone { opacity: 0.9; transform: translateY(5%) scale(0.92); }

/* Indicateur de progression */
.tour__progress { position: absolute; z-index: 3; bottom: -1.5rem; left: 0; display: flex; gap: 0.4rem; margin: 0; padding: 0; list-style: none; }
.tour__progress li { width: 1.25rem; height: 0.3rem; border-radius: var(--radius-pill); background: var(--color-border-strong); transition: width 0.4s ease, background-color 0.4s ease; }
.tour__stage[data-step='1'] .tour__progress li:nth-child(1),
.tour__stage[data-step='2'] .tour__progress li:nth-child(2),
.tour__stage[data-step='3'] .tour__progress li:nth-child(3),
.tour__stage[data-step='4'] .tour__progress li:nth-child(4) { width: 2.5rem; background: var(--color-blue); }

/* --------------------------------------------------------------------------
   4. Mouvement réduit : tout reste lisible, rien ne bouge
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .ph::before,
  .ph::after,
  .tour__glow::before,
  .tour__glow::after,
  .slot-phone::before,
  .chip { animation: none; }
  .ph__values li:hover { transform: none; }
}
