/* L’ouverture compose trois plans autour de la porte des Érables. */
.td-hero {
  --td-hero-ease: cubic-bezier(.2, .75, .24, 1);
  color: var(--td-white);
  background: var(--td-night);
}

.td-home .td-head:not(.td-head--solid) { border-bottom-color: #ffffff24; }

.td-hero-scene {
  --td-hero-x: 0;
  --td-hero-y: 0;
  --td-hero-scroll: 0;
  position: relative;
  isolation: isolate;
  height: clamp(25rem, min(43cqi, calc(var(--td-cover-height) - 12.5rem)), 38rem);
  overflow: clip;
}

.td-hero-art {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.td-hero-intro {
  position: relative;
  z-index: 2;
  max-width: 90rem;
  margin-inline: auto;
  padding: clamp(1.25rem, 2.6cqi, 2.4rem) max(1rem, 4cqi) 0;
  text-align: center;
}

.td-hero .td-hero-name {
  color: var(--td-white);
  font-size: clamp(.85rem, 1.45cqi, 1.12rem);
  font-weight: 650;
  line-height: 1.3;
}

.td-hero .td-hero-intro h1 {
  margin-block-start: clamp(.55rem, 1.25cqi, 1rem);
  font-size: clamp(2.1rem, 7.45cqi, 7.25rem);
  font-weight: 400;
  letter-spacing: -.044em;
  line-height: .99;
}

.td-hero-intro h1 span { display: block; text-wrap: balance; }
.td-hero-intro h1 span + span { color: var(--td-accent); }

.td-hero-shot {
  --td-hero-direction: 0;
  position: absolute;
  bottom: var(--td-shot-bottom);
  left: var(--td-shot-start);
  width: var(--td-shot-width);
  height: var(--td-shot-height);
  transform-origin: center bottom;
  transform: rotate(var(--td-shot-angle));
}

.td-hero-aperture {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 50% 50% .18rem .18rem / 37% 37% .18rem .18rem;
  background: var(--td-deep);
}

.td-hero-aperture img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--td-shot-focus);
}

.td-hero:not([data-td-service="live"]) .td-hero-shot--culte,
.td-hero[data-td-service="live"] .td-hero-shot--accueil {
  --td-shot-start: 10%;
  --td-shot-width: 25%;
  --td-shot-height: 57%;
  --td-shot-bottom: 5.5%;
  --td-shot-angle: -7deg;
  --td-shot-focus: 40% 55%;
  --td-hero-direction: -1;
}

.td-hero-shot--cafe {
  --td-shot-start: 66%;
  --td-shot-width: 24%;
  --td-shot-height: 48%;
  --td-shot-bottom: 8%;
  --td-shot-angle: 6deg;
  --td-shot-focus: 58% 55%;
  --td-hero-direction: 1;
}

.td-hero:not([data-td-service="live"]) .td-hero-shot--accueil,
.td-hero[data-td-service="live"] .td-hero-shot--culte {
  --td-shot-start: 25%;
  --td-shot-width: 50%;
  --td-shot-height: 80%;
  --td-shot-bottom: 0%;
  --td-shot-angle: 0deg;
  --td-shot-focus: 50% 49%;
  z-index: 1;
}

.td-hero:not([data-td-service="live"]) .td-hero-shot--accueil .td-hero-aperture::after,
.td-hero[data-td-service="live"] .td-hero-shot--culte .td-hero-aperture::after {
  position: absolute;
  inset: 0;
  /* Voile de contraste derrière le titre, limité au sommet de l’arche. */
  background: linear-gradient(180deg, #11262fed 0%, #11262fd9 21%, #11262f00 53%);
  content: "";
}

.td-hero-rail {
  border-bottom: 1px solid #d7cebf;
  background: var(--td-sand);
  color: var(--td-ink);
}

.td-hero-rail-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem 2rem;
  padding-block: clamp(.85rem, 1.9cqi, 1.65rem);
}

.td-hero-info {
  display: grid;
  gap: .15rem;
  min-width: 0;
  font-size: clamp(.82rem, 1.15cqi, .97rem);
  line-height: 1.35;
}

.td-hero-info address { color: var(--td-muted); }
.td-hero-status { display: grid; justify-items: start; gap: .14rem; }

.td-hero-state {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-weight: 650;
}

.td-hero-when {
  font: 400 clamp(1.15rem, 2.25cqi, 2rem)/1.13 var(--td-display);
  letter-spacing: -.021em;
}

.td-hero-when[role="timer"] { font-family: var(--td-text); font-weight: 650; font-variant-numeric: tabular-nums; }
.td-hero[data-td-service="live"] .td-hero-state { color: #823829; }

.td-on-air {
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  background: #a04433;
}

.td-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 clamp(.75rem, 1.6cqi, 1.5rem);
  flex: 0 0 auto;
}

.td-viewport :is(.td-hero-visit, .td-hero-live) {
  padding-inline: clamp(.7rem, 1.65cqi, 1.4rem);
  background: var(--td-night);
  color: var(--td-white);
}

.td-viewport :is(.td-hero-visit, .td-hero-live):hover { background: var(--td-deep); }

/* Pendant le culte, rejoindre le direct devient l'action principale et la visite passe en contour. */
.td-viewport .td-hero[data-td-service="live"] .td-hero-visit:not(:hover) {
  border-color: #96aaa7;
  background: transparent;
  color: var(--td-ink);
}
.td-hero-rail :focus-visible { outline-color: #225f58; }

@container erables (max-width: 660px) {
  .td-hero-scene { height: clamp(19rem, 89cqi, 26rem); }
  .td-hero-intro { padding: 1.3rem .62rem 0; }
  .td-hero .td-hero-intro h1 { font-size: clamp(1.8rem, 9cqi, 3rem); }
  .td-hero-intro h1 span { text-wrap: pretty; }

  .td-hero:not([data-td-service="live"]) .td-hero-shot--accueil,
  .td-hero[data-td-service="live"] .td-hero-shot--culte {
    --td-shot-start: 15%;
    --td-shot-width: 70%;
    --td-shot-height: 71%;
    --td-shot-focus: 52% 50%;
  }

  .td-hero:not([data-td-service="live"]) .td-hero-shot--culte,
  .td-hero[data-td-service="live"] .td-hero-shot--accueil {
    --td-shot-start: -8%;
    --td-shot-width: 34%;
    --td-shot-height: 46%;
    --td-shot-bottom: 7%;
  }

  .td-hero-shot--cafe {
    --td-shot-start: 74%;
    --td-shot-width: 34%;
    --td-shot-height: 39%;
    --td-shot-bottom: 8%;
    --td-shot-focus: 66% 50%;
  }

  .td-hero-rail-inner { align-items: start; flex-direction: column; }
  .td-hero-actions { max-width: 100%; }
  .td-viewport .td-hero-actions :is(.td-cta, .td-text-link) { font-size: .82rem; }
  .td-viewport .td-hero-actions .td-hero-live { padding-inline: .55rem; }
}

@container erables (max-width: 365px) {
  .td-hero-actions { gap: .4rem; }
  .td-viewport .td-hero-visit { padding-inline: .55rem; }
  .td-hero-actions .td-hero-live svg { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .td-hero { --td-hero-play-state: paused; }
  .td-hero[data-td-hero-running] { --td-hero-play-state: running; }

  .td-hero-art .td-hero-shot {
    transform: translate3d(
      calc(var(--td-hero-x) * (12px + var(--td-hero-direction) * 6px) + var(--td-hero-scroll) * var(--td-hero-direction) * 11cqi),
      calc(var(--td-hero-y) * 13px + var(--td-hero-scroll) * 15px),
      0
    ) rotate(calc(var(--td-shot-angle) * (1 + var(--td-hero-scroll) * .7)))
      scale(calc(1 + var(--td-hero-scroll) * (1 - abs(var(--td-hero-direction))) * .23));
    opacity: calc(1 - var(--td-hero-scroll) * abs(var(--td-hero-direction)) * .63);
  }

  .td-hero-intro { transform: translateY(calc(var(--td-hero-scroll) * -5cqi)); }

  .td-hero[data-td-hero-enter]:not([data-td-service="live"]) .td-hero-shot--accueil .td-hero-aperture,
  .td-hero[data-td-hero-enter][data-td-service="live"] .td-hero-shot--culte .td-hero-aperture {
    animation: td-hero-open 1400ms var(--td-hero-ease) both var(--td-hero-play-state);
  }

  .td-hero[data-td-hero-enter] .td-hero-shot--cafe .td-hero-aperture,
  .td-hero[data-td-hero-enter]:not([data-td-service="live"]) .td-hero-shot--culte .td-hero-aperture,
  .td-hero[data-td-hero-enter][data-td-service="live"] .td-hero-shot--accueil .td-hero-aperture {
    animation: td-hero-wings 1140ms var(--td-hero-ease) var(--td-wing-delay, 160ms) both var(--td-hero-play-state);
  }

  .td-hero-shot--cafe { --td-wing-delay: 265ms; }
  .td-hero[data-td-hero-enter] .td-hero-aperture img { animation: td-hero-settle 3500ms ease-out 1400ms both var(--td-hero-play-state); }
  .td-hero[data-td-hero-enter] .td-hero-intro h1 span { animation: td-hero-line 780ms var(--td-hero-ease) backwards var(--td-hero-play-state); }
  .td-hero[data-td-hero-enter] .td-hero-intro h1 span + span { animation-delay: 230ms; }
  .td-hero[data-td-hero-enter] .td-hero-rail-inner { animation: td-hero-line 760ms var(--td-hero-ease) 410ms backwards var(--td-hero-play-state); }
  .td-hero[data-td-hero-enter] .td-hero-visit svg { animation: td-hero-arrow 660ms ease-out 1350ms 2 var(--td-hero-play-state); }
}

@keyframes td-hero-open {
  0% { clip-path: inset(9% 45% 0 round 46% 46% 0 0); }
  100% { clip-path: inset(0); }
}

@keyframes td-hero-wings {
  from { opacity: 0; transform: translate(calc(var(--td-hero-direction) * -40%), 11%) scale(.86); }
}

@keyframes td-hero-line { from { transform: translateY(.19em); } }
@keyframes td-hero-settle { from { transform: scale(1.055); } }
@keyframes td-hero-arrow { 45% { transform: translateY(4px); } }
