/* =============================================================================
   Bloc vidéo « Majors Suite + Majors Brain » — hero de la page d'accueil
   Affiche animée (halos, grille, bordure lumineuse, bouton play qui pulse).
   Le lecteur YouTube (youtube-nocookie.com) n'est chargé qu'au clic :
   aucune requête vers YouTube avant l'action du visiteur (RGPD).
   Préfixe mbv- (le préfixe mb- est déjà pris par la campagne Majors Brain).
   Chargé par js/brain-video.js (defer).
   ============================================================================= */

@property --mbv-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

.mbv-video {
  --mbv-angle: 0deg;
  --mbv-ink: #0B0F1F;
  --mbv-violet: #7A4DFF;
  --mbv-grad-deep: linear-gradient(135deg, #6E3FE0 0%, #9C3DBA 100%);
  --mbv-radius: 20px;
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0;
  border-radius: var(--mbv-radius);
  overflow: hidden;
  isolation: isolate;
  color: #fff;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(122, 77, 255, 0.22) 0%, transparent 55%),
    radial-gradient(90% 80% at 0% 100%, rgba(156, 61, 186, 0.18) 0%, transparent 60%),
    linear-gradient(160deg, #141A36 0%, var(--mbv-ink) 55%, #0A0D1B 100%);
  box-shadow:
    0 30px 60px -24px rgba(56, 27, 137, 0.45),
    0 10px 28px -10px rgba(13, 16, 35, 0.30);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transform: translateZ(0);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1), box-shadow 0.35s ease;
}

.mbv-video,
.mbv-video * {
  box-sizing: border-box;
}

.mbv-video:hover {
  transform: translateY(-3px) scale(1.012);
  box-shadow:
    0 36px 70px -24px rgba(122, 77, 255, 0.55),
    0 12px 30px -10px rgba(13, 16, 35, 0.35);
}

.mbv-video:focus-visible {
  outline: 3px solid var(--mbv-violet);
  outline-offset: 4px;
}

/* Bordure lumineuse : un reflet qui tourne le long du cadre */
.mbv-video::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  border-radius: inherit;
  padding: 1.5px;
  background:
    conic-gradient(from var(--mbv-angle),
      rgba(255, 255, 255, 0.10) 0deg,
      rgba(255, 255, 255, 0.10) 230deg,
      rgba(199, 117, 181, 0.95) 290deg,
      rgba(165, 133, 255, 1) 320deg,
      rgba(255, 255, 255, 0.10) 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
  animation: mbv-spin 7s linear infinite;
}

/* Halos qui respirent */
.mbv-halo {
  position: absolute;
  z-index: 0;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(42px);
  pointer-events: none;
  will-change: transform;
}

.mbv-halo-a {
  top: -35%;
  right: -20%;
  background: radial-gradient(circle, rgba(122, 77, 255, 0.60) 0%, rgba(122, 77, 255, 0) 70%);
  animation: mbv-drift-a 14s ease-in-out infinite alternate;
}

.mbv-halo-b {
  bottom: -40%;
  left: -20%;
  width: 60%;
  background: radial-gradient(circle, rgba(199, 117, 181, 0.45) 0%, rgba(199, 117, 181, 0) 70%);
  animation: mbv-drift-b 18s ease-in-out infinite alternate;
}

/* Grille fine, fondue sur les bords */
.mbv-grid {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 36px 36px;
  background-position: center;
  -webkit-mask-image: radial-gradient(ellipse 80% 75% at 50% 50%, #000 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 80% 75% at 50% 50%, #000 30%, transparent 100%);
  pointer-events: none;
}

/* Rangée du haut : logo Brain blanc + durée */
.mbv-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: clamp(14px, 4%, 22px) clamp(16px, 4.5%, 24px);
  pointer-events: none;
}

/* Les deux logos côte à côte : Suite puis Brain, séparés d'un filet */
.mbv-logos {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2.2%, 18px);
  min-width: 0;
}

.mbv-logo {
  display: block;
  height: clamp(22px, 2.4vw, 44px);
  width: auto;
  flex: 0 1 auto;
  min-width: 0;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35));
}

.mbv-logos-sep {
  flex: 0 0 1px;
  width: 1px;
  height: clamp(16px, 2vw, 36px);
  background: rgba(255, 255, 255, 0.28);
}

.mbv-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(13, 16, 35, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.86);
  white-space: nowrap;
}

.mbv-chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #C775B5;
  box-shadow: 0 0 0 0 rgba(199, 117, 181, 0.6);
  animation: mbv-dot 2.4s ease-out infinite;
}

/* Bouton play : au centre, pulse */
.mbv-play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: clamp(56px, 17%, 84px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--mbv-grad-deep);
  color: #fff;
  box-shadow:
    0 14px 40px -6px rgba(122, 77, 255, 0.75),
    0 0 0 0 rgba(122, 77, 255, 0.55);
  transform: translate(-50%, -50%);
  animation: mbv-pulse 2.2s cubic-bezier(0.32, 0.72, 0, 1) infinite;
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1), filter 0.3s ease;
  pointer-events: none;
}

.mbv-play svg {
  width: 38%;
  height: 38%;
  margin-left: 6%;
  fill: currentColor;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

.mbv-video:hover .mbv-play {
  transform: translate(-50%, -50%) scale(1.08);
  filter: brightness(1.08);
}

/* Titre + ligne d'invitation, en bas sur un voile */
.mbv-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: clamp(40px, 16%, 70px) clamp(16px, 4.5%, 24px) clamp(14px, 4.5%, 22px);
  background: linear-gradient(180deg, rgba(11, 15, 31, 0) 0%, rgba(11, 15, 31, 0.72) 45%, rgba(11, 15, 31, 0.92) 100%);
  pointer-events: none;
}

.mbv-title {
  margin: 0 0 6px;
  font-family: 'Manrope', 'Public Sans', 'Inter', sans-serif;
  font-weight: 800;
  font-size: clamp(1rem, 0.72rem + 1.1vw, 1.45rem);
  line-height: 1.18;
  letter-spacing: -0.015em;
  color: #fff;
  text-wrap: balance;
}

/* L'italique garde le dégradé violet du hero sur fond sombre (lisible),
   pas le grad-deep de la charte, trop sombre sur l'encre de l'affiche. */
.mbv-title em {
  font-style: italic;
  font-weight: 800;
  background: linear-gradient(135deg, #a585ff 0%, #d96bb8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.mbv-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 500;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.74);
}

.mbv-foot svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  fill: currentColor;
}

/* Lecteur chargé au clic : il remplace l'affiche */
.mbv-video.is-playing {
  cursor: default;
  animation: none;
  transform: none;
}

.mbv-video.is-playing::before,
.mbv-video.is-playing .mbv-halo,
.mbv-video.is-playing .mbv-grid,
.mbv-video.is-playing .mbv-top,
.mbv-video.is-playing .mbv-play,
.mbv-video.is-playing .mbv-caption {
  display: none;
}

.mbv-video iframe {
  position: absolute;
  inset: 0;
  z-index: 5;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

/* Place dans le hero : en bas à droite, à cheval sur la vague de fin de
   section (moitié dans le hero, moitié sur la section suivante). Le globe
   reste libre au-dessus. Hors du .container pour se caler sur le bas de #home. */
#home.hero-section {
  position: relative;
  /* overflow: hidden du template rognait la moitié basse de la carte.
     clip sur l'axe horizontal (le globe déborde à droite), libre en vertical. */
  overflow: visible !important;
  overflow-x: clip !important;
  overflow-y: visible !important;
}

:root {
  --mbv-container: 960px;
  --mbv-w: calc(var(--mbv-container) * 0.63);
  /* partie de la carte visible dans le hero (son haut), le reste passe sous la vague */
  --mbv-peek: 120px;
  --mbv-dip: calc(var(--mbv-w) * 9 / 16 - var(--mbv-peek));
}

#home .hero-media {
  position: relative;
  z-index: 4;
}

@media (min-width: 992px) {
  /* Réserve en bas du hero la partie visible de la carte + 72 px d'air. */
  #home {
    padding-bottom: calc(var(--mbv-peek) + 72px);
  }
  #home .hero-media {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    /* centrée ; seul son haut (--mbv-peek) reste dans le hero */
    bottom: calc(-1 * var(--mbv-dip));
    width: var(--mbv-w);
  }
  /* La section suivante s'écarte du débordement de la carte (+ 48 px d'air). */
  #tabs-2.tabs-section {
    padding-top: calc(var(--mbv-dip) + 48px) !important;
  }
}

@media (min-width: 1200px) {
  :root {
    --mbv-container: 1140px;
  }
}

@media (min-width: 1400px) {
  :root {
    --mbv-container: 1320px;
  }
}

/* Tablette et mobile : la carte suit le texte, en flux, et déborde sur la
   section suivante pour chevaucher la vague. */
@media (max-width: 991.98px) {
  /* Le hero du template a une hauteur mini (108 vh) : en colonne flex, la
     carte est poussée en bas (margin-top auto) quel que soit l'écran. */
  #home {
    display: flex;
    flex-direction: column;
    /* hauteur au contenu : sinon 108 vh laissent un vide entre texte et carte sur tablette */
    min-height: 0;
  }
  #home .hero-media {
    --mbv-dip: 84px;
    width: min(640px, calc(100% - 32px));
    margin: auto auto calc(-1 * var(--mbv-dip));
    padding-top: 56px;
  }
}

@media (max-width: 767px) {
  #home .hero-media {
    --mbv-dip: 60px;
    padding-top: 44px;
  }
  .mbv-video {
    --mbv-radius: 16px;
  }
}

/* Petite carte (mobile) : bouton play remonté pour ne pas chevaucher le
   titre, ligne d'invitation raccourcie. */
@media (max-width: 479px) {
  .mbv-play {
    top: 41%;
  }
  .mbv-title {
    font-size: 0.95rem;
    margin-bottom: 4px;
  }
  .mbv-foot {
    font-size: 0.75rem;
  }
  .mbv-foot-more {
    display: none;
  }
  .mbv-caption {
    padding-top: 30px;
  }
}

@keyframes mbv-spin {
  to { --mbv-angle: 360deg; }
}

@keyframes mbv-pulse {
  0%   { box-shadow: 0 14px 40px -6px rgba(122, 77, 255, 0.75), 0 0 0 0 rgba(122, 77, 255, 0.55); }
  70%  { box-shadow: 0 14px 40px -6px rgba(122, 77, 255, 0.75), 0 0 0 18px rgba(122, 77, 255, 0); }
  100% { box-shadow: 0 14px 40px -6px rgba(122, 77, 255, 0.75), 0 0 0 0 rgba(122, 77, 255, 0); }
}

@keyframes mbv-dot {
  0%   { box-shadow: 0 0 0 0 rgba(199, 117, 181, 0.6); }
  100% { box-shadow: 0 0 0 7px rgba(199, 117, 181, 0); }
}

@keyframes mbv-drift-a {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-14%, 18%) scale(1.15); }
}

@keyframes mbv-drift-b {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(16%, -14%) scale(1.1); }
}

@media (prefers-reduced-motion: reduce) {
  .mbv-video,
  .mbv-video::before,
  .mbv-video *,
  .mbv-video *::before {
    animation: none !important;
    transition: none !important;
  }
  .mbv-video:hover {
    transform: none;
  }
}
