/* ==========================================================================
   Les Encens de Cassou — Hero vidéo plein cadre (thème sombre / cinéma)
   ========================================================================== */

.hero {
  --hero-bg: #0d0806;
  --hero-text: #f6ecdf;
  --hero-muted: rgba(246, 236, 223, .76);
  --hero-gold: #e9b44c;
  --bar-h: clamp(10px, 2.4vh, 22px);

  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  height: calc(100svh - var(--topbar-h) - var(--header-h));
  min-height: 580px;
  max-height: 940px;
  background: var(--hero-bg);
  color: var(--hero-text);
}

/* ---- Vidéo plein cadre ---- */
.hero__media {
  position: absolute;
  inset: 0;
  z-index: -4;
  overflow: hidden;
}
/* Sans JS : simple « cover ». Avec JS (.is-framed), taille et position calculées
   pour garder la braise en vue et masquer le haut de la vidéo. */
.hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 58% 45%;
  filter: brightness(.82) contrast(1.06) saturate(1.08) sepia(.12);
  opacity: 0;
  animation:
    hero-video-in 1.8s .25s var(--ease-out) forwards,
    hero-zoom 9s .25s var(--ease-out) both;
}
.hero__video.is-framed {
  inset: auto;
  max-width: none;
}

/* ---- Voiles : lisibilité du texte, halo chaud, vignette ---- */
.hero__shade {
  position: absolute;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(ellipse 45% 55% at 60% 40%, rgba(233, 140, 54, .16), transparent 70%),
    linear-gradient(90deg, rgba(13, 8, 6, .9) 0%, rgba(13, 8, 6, .72) 30%, rgba(13, 8, 6, .2) 58%, rgba(13, 8, 6, .1) 75%, rgba(13, 8, 6, .45) 100%),
    linear-gradient(180deg, rgba(13, 8, 6, .5) 0%, transparent 20%, transparent 62%, rgba(13, 8, 6, .92) 100%);
}
.hero__shade::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 60% 45%, transparent 50%, rgba(0, 0, 0, .55) 100%);
}

/* ---- Grain pellicule ---- */
.hero__grain {
  position: absolute;
  inset: -100%;
  z-index: -2;
  pointer-events: none;
  opacity: .1;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: hero-grain 1.2s steps(6) infinite;
}

/* ---- Bandes cinéma (s'ouvrent au chargement) ---- */
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  z-index: 6;
  height: var(--bar-h);
  background: #000;
  pointer-events: none;
  animation: hero-curtain 1.5s var(--ease-in-out) both;
}
.hero::before { top: 0; }
.hero::after { bottom: 0; }

/* ---- Contenu ---- */
.hero__inner {
  position: relative;
  padding-block: calc(var(--bar-h) + 40px);
}
.hero__content { max-width: 660px; }

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 22px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--hero-gold);
}
.hero__ember {
  flex: none;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #ff9f45;
  box-shadow: 0 0 10px 2px rgba(255, 159, 69, .8);
  animation: hero-ember 2.4s ease-in-out infinite;
}

.hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(44px, 5.2vw, 88px);
  font-weight: 500;
  line-height: .98;
  letter-spacing: -.01em;
  color: var(--hero-text);
  text-shadow: 0 2px 30px rgba(0, 0, 0, .35);
}
.hero__title .line { display: block; overflow: hidden; padding-bottom: .08em; }
.hero__title .line > span { display: block; }
.hero__title em {
  font-style: italic;
  font-weight: 500;
  background: linear-gradient(100deg, #f3c877 10%, #e9923c 55%, #f0b865 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__text {
  max-width: 46ch;
  margin: 26px 0 0;
  font-size: clamp(16px, 1.25vw, 18px);
  line-height: 1.7;
  color: var(--hero-muted);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 38px;
}
.hero__actions .btn { height: 54px; padding: 0 30px; }
.hero__actions .btn svg { width: 17px; height: 17px; transition: transform .35s var(--ease-out); }
.hero__actions .btn:hover svg { transform: translateX(4px); }

.hero__highlights {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 26px;
  margin-top: 44px;
  padding-top: 26px;
  border-top: 1px solid rgba(246, 236, 223, .14);
  font-size: 13px;
  letter-spacing: .04em;
  color: var(--hero-muted);
}
.hero__highlights li { display: inline-flex; align-items: center; gap: 9px; }
.hero__highlights svg { width: 17px; height: 17px; color: var(--hero-gold); }

/* ---- Légende + lecture/pause (bas droite) ---- */
.hero__controls {
  position: absolute;
  right: max(var(--gutter), calc((100% - var(--container)) / 2 + var(--gutter)));
  bottom: calc(var(--bar-h) + 30px);
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 18px;
}
.hero__caption {
  margin: 0;
  text-align: right;
  font-family: var(--font-display);
  font-size: 21px;
  font-style: italic;
  font-weight: 500;
  line-height: 1.2;
  color: var(--hero-text);
  text-shadow: 0 2px 16px rgba(0, 0, 0, .6);
}
.hero__caption small {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 6px;
  font-family: var(--font-body);
  font-size: 10.5px;
  font-style: normal;
  font-weight: 500;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--hero-gold);
}
.hero__caption .hero__ember { width: 6px; height: 6px; }

.hero__toggle {
  display: grid;
  place-items: center;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(13, 8, 6, .4);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(246, 236, 223, .25);
  color: var(--hero-text);
  transition: background .3s, border-color .3s, transform .3s var(--ease-out);
}
.hero__toggle:hover { background: rgba(233, 180, 76, .25); border-color: rgba(233, 180, 76, .7); transform: scale(1.06); }
.hero__toggle svg { width: 16px; height: 16px; }
.hero__toggle .icon-play { display: none; }
.hero.is-paused .hero__toggle .icon-play { display: block; }
.hero.is-paused .hero__toggle .icon-pause { display: none; }

/* ---- Progression de la vidéo (au-dessus de la bande basse) ---- */
.hero__progress {
  position: absolute;
  left: 0; right: 0;
  bottom: var(--bar-h);
  z-index: 5;
  height: 2px;
  background: rgba(246, 236, 223, .08);
}
.hero__progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--c-amber), var(--hero-gold));
  box-shadow: 0 0 10px rgba(233, 180, 76, .8);
  transform: scaleX(0);
  transform-origin: left;
}

/* ---- Indicateur de défilement ---- */
.hero__scroll {
  position: absolute;
  left: 50%; bottom: calc(var(--bar-h) + 18px);
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transform: translateX(-50%);
  font-size: 10.5px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--hero-muted);
  transition: color .3s;
}
.hero__scroll:hover { color: var(--hero-gold); }
.hero__scroll-line {
  position: relative;
  width: 1px; height: 42px;
  overflow: hidden;
  background: rgba(246, 236, 223, .2);
}
.hero__scroll-line::after {
  content: "";
  position: absolute;
  left: 0; top: -40%;
  width: 100%; height: 40%;
  background: var(--hero-gold);
  animation: hero-scroll 2.2s var(--ease-in-out) infinite;
}

/* ---- Apparition du contenu (après l'ouverture des bandes) ---- */
.hero-reveal {
  opacity: 0;
  transform: translateY(24px);
  animation: hero-reveal 1.1s var(--ease-out) forwards;
  animation-delay: calc(.7s + var(--d, 0) * 120ms);
}
.hero__title .line > span {
  transform: translateY(110%);
  animation: hero-line 1.2s var(--ease-out) forwards;
  animation-delay: calc(.8s + var(--d, 0) * 130ms);
}
.d-1 { --d: 1; } .d-2 { --d: 2; } .d-3 { --d: 3; } .d-4 { --d: 4; } .d-5 { --d: 5; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (min-width: 900px) {
  .hero__title .line > span { white-space: nowrap; }
}

@media (max-width: 1180px) {
  .hero__caption { display: none; }
}

/* Mobile / tablette portrait : texte en bas, vidéo au-dessus */
@media (max-width: 899px) {
  .hero { align-items: flex-end; }
  .hero__inner { padding-block: 48px calc(var(--bar-h) + 30px); }
  .hero__shade {
    background:
      radial-gradient(ellipse 80% 40% at 60% 22%, rgba(233, 140, 54, .18), transparent 70%),
      linear-gradient(180deg, rgba(13, 8, 6, .45) 0%, transparent 22%, rgba(13, 8, 6, .5) 52%, rgba(13, 8, 6, .95) 86%);
  }
  .hero__eyebrow { margin-bottom: 16px; font-size: 11px; letter-spacing: .18em; }
  .hero__title { font-size: clamp(40px, 11vw, 64px); }
  .hero__text { margin-top: 18px; }
  .hero__actions { margin-top: 28px; }
  .hero__highlights,
  .hero__scroll { display: none; }
  .hero__controls { top: calc(var(--bar-h) + 16px); bottom: auto; right: var(--gutter); }
  .hero__toggle { width: 42px; height: 42px; }
}

@media (max-width: 480px) {
  .hero__actions { flex-direction: column; }
  .hero__actions .btn { width: 100%; }
}

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */
@keyframes hero-curtain {
  from { height: 50%; }
  to   { height: var(--bar-h); }
}
@keyframes hero-video-in {
  to { opacity: 1; }
}
/* Léger travelling avant à l'ouverture (zoom centré sur la braise, voir hero.js) */
@keyframes hero-zoom {
  from { transform: scale(1.08); }
  to   { transform: scale(1); }
}
@keyframes hero-reveal {
  to { opacity: 1; transform: none; }
}
@keyframes hero-line {
  to { transform: none; }
}
@keyframes hero-ember {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px 1px rgba(255, 159, 69, .7); }
  50%      { opacity: .6; box-shadow: 0 0 16px 4px rgba(255, 159, 69, .95); }
}
@keyframes hero-scroll {
  0%   { top: -40%; }
  100% { top: 100%; }
}
@keyframes hero-grain {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-6%, 4%); }
  40%  { transform: translate(5%, -7%); }
  60%  { transform: translate(-3%, 8%); }
  80%  { transform: translate(7%, 2%); }
  100% { transform: translate(-4%, -5%); }
}
