/* ============================================================
   ENMIIS — Couche d'annonce.

   La page d'accueil reste visible et intacte : cette feuille ne fait
   qu'ajouter le voile qui s'ouvre au clic. Elle est chargée APRÈS
   css/styles.css et ne redéfinit aucune de ses règles.
   ============================================================ */

.gate {
  --gate-noir:   #0B0A09;
  --gate-creme:  #F4EFE6;
  --gate-doux:   #CFC7BA;
  --gate-or:     #C8A86B;
  --gate-or-clair: #E3CE9E;
  --gate-lux: cubic-bezier(0.22, 0.61, 0.36, 1);

  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  grid-template-rows: 1fr auto;
  padding:
    calc(clamp(1.5rem, 5vw, 3.5rem) + env(safe-area-inset-top))
    calc(clamp(1.25rem, 5vw, 3rem) + env(safe-area-inset-right))
    calc(clamp(1.25rem, 4vw, 2.5rem) + env(safe-area-inset-bottom))
    calc(clamp(1.25rem, 5vw, 3rem) + env(safe-area-inset-left));

  /* L'accueil reste perceptible derrière : le verre teinté plutôt que
     le rideau opaque. backdrop-filter floute ce qui est dessous ; là où
     il n'est pas géré, le fond reste simplement plus dense. */
  background:
    radial-gradient(115% 85% at 50% 40%,
      rgba(11, 10, 9, 0.80) 0%,
      rgba(11, 10, 9, 0.94) 100%);
  -webkit-backdrop-filter: blur(16px) saturate(0.9);
  backdrop-filter: blur(16px) saturate(0.9);

  color: var(--gate-creme);
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  font-weight: 300;

  visibility: hidden;
  opacity: 0;
  transition: opacity 0.9s var(--gate-lux), visibility 0s linear 0.9s;
}

@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .gate {
    background: radial-gradient(115% 85% at 50% 40%,
      rgba(11, 10, 9, 0.62) 0%,
      rgba(11, 10, 9, 0.86) 100%);
  }
}

.gate.is-open {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.9s var(--gate-lux), visibility 0s;
}

/* Le vignettage ferme les angles, comme sur l'accueil. */
.gate::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(72% 62% at 50% 48%,
    rgba(0, 0, 0, 0) 42%,
    rgba(0, 0, 0, 0.45) 100%);
}

/* ---------- Fermeture ---------- */

.gate__close {
  position: absolute;
  top: calc(clamp(0.9rem, 3vw, 1.75rem) + env(safe-area-inset-top));
  right: calc(clamp(0.9rem, 3vw, 1.75rem) + env(safe-area-inset-right));
  z-index: 2;
  /* 44 px : la cible tactile minimale confortable. */
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(244, 239, 230, 0.22);
  border-radius: 999px;
  background: none;
  color: var(--gate-creme);
  cursor: pointer;
  transition: border-color 0.4s, color 0.4s;
}

.gate__close:hover,
.gate__close:focus-visible { border-color: var(--gate-or); color: var(--gate-or-clair); }

.gate__close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
}

/* ---------- Composition ---------- */

.gate__panel {
  position: relative;
  z-index: 1;
  align-self: center;
  justify-self: center;
  width: 100%;
  max-width: 46rem;
  text-align: center;
  filter: drop-shadow(0 0 60px rgba(11, 10, 9, 0.6));
}

.gate__mark {
  /* Le logo est noir sur transparent : ramené au blanc pour ce fond. */
  filter: brightness(0) invert(1);
  width: min(clamp(9rem, 32vw, 14rem), 34vh);
  height: auto;
  margin: 0 auto min(clamp(1.75rem, 4.5vw, 3rem), 5vh);
  opacity: 0.94;
}

.gate__eyebrow {
  margin: 0 0 min(clamp(1rem, 3vw, 1.6rem), 3vh);
  font-size: clamp(0.58rem, 0.5rem + 0.35vw, 0.7rem);
  font-weight: 400;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  text-transform: uppercase;
  color: var(--gate-or);
}

.gate__title {
  margin: 0 0 min(clamp(1.5rem, 4vw, 2.5rem), 4.5vh);
  font-family: "Cormorant Garamond", "Times New Roman", Georgia, serif;
  font-weight: 300;
  font-size: min(clamp(2.6rem, 1.3rem + 7.6vw, 6.25rem), 15vh);
  line-height: 0.98;
  color: var(--gate-creme);
  text-wrap: balance;
  text-shadow: 0 2px 40px rgba(0, 0, 0, 0.55);
}

.gate__title-br { display: block; height: 0; }

@media (min-width: 30rem) {
  .gate__title-br { display: inline; height: auto; }
}

.gate__date {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.8rem, 3vw, 1.5rem);
  margin: 0 0 min(clamp(2rem, 4.5vw, 3rem), 5vh);
}

.gate__rule {
  flex: 1 1 auto;
  max-width: 5.5rem;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(200, 168, 107, 0.55));
}

.gate__rule:last-child {
  background: linear-gradient(to left, transparent, rgba(200, 168, 107, 0.55));
}

.gate__date-text {
  flex: 0 0 auto;
  font-size: clamp(0.75rem, 0.66rem + 0.5vw, 0.95rem);
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  text-transform: uppercase;
  white-space: nowrap;
}

.gate__date-text time { color: var(--gate-or-clair); font-weight: 400; }

.gate__tagline {
  margin: min(clamp(1.75rem, 4.5vw, 2.75rem), 4.5vh) 0 0;
  font-family: "Cormorant Garamond", "Times New Roman", Georgia, serif;
  font-style: italic;
  font-size: clamp(0.95rem, 0.88rem + 0.7vw, 1.3rem);
  line-height: 1.5;
  color: var(--gate-doux);
  text-wrap: balance;
}

/* ---------- Compte à rebours ---------- */

.gate__count {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.35rem, 2vw, 1.25rem);
  max-width: 30rem;
  margin-inline: auto;
  padding-top: min(clamp(1.35rem, 3.5vw, 2rem), 3.5vh);
  border-top: 1px solid rgba(244, 239, 230, 0.14);
}

.gate__unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

/* Chiffres tabulaires : le bloc ne tressaute pas à chaque seconde. */
.gate__n {
  font-family: "Cormorant Garamond", "Times New Roman", Georgia, serif;
  font-size: min(clamp(1.5rem, 1rem + 2.8vw, 2.7rem), 7vh);
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

.gate__l {
  font-size: clamp(0.48rem, 0.43rem + 0.26vw, 0.6rem);
  font-weight: 400;
  letter-spacing: 0.24em;
  text-indent: 0.24em;
  text-transform: uppercase;
  color: rgba(207, 199, 186, 0.75);
  white-space: nowrap;
}

.gate__count.is-open {
  display: block;
  font-family: "Cormorant Garamond", "Times New Roman", Georgia, serif;
  font-size: clamp(1.1rem, 1rem + 1vw, 1.5rem);
  color: var(--gate-or-clair);
  border-top-color: rgba(200, 168, 107, 0.3);
}

/* ---------- Pied ---------- */

.gate__foot {
  position: relative;
  z-index: 1;
  align-self: end;
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: clamp(0.54rem, 0.5rem + 0.25vw, 0.64rem);
  font-weight: 400;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  text-transform: uppercase;
  color: rgba(207, 199, 186, 0.5);
}

.gate__foot span:nth-child(2) { color: var(--gate-or); }

/* ---------- Entrée en scène ---------- */

.gate__mark,
.gate__eyebrow,
.gate__title,
.gate__date,
.gate__count,
.gate__tagline,
.gate__foot {
  opacity: 0;
  transform: translateY(1.25rem);
}

.gate.is-open .gate__mark,
.gate.is-open .gate__eyebrow,
.gate.is-open .gate__title,
.gate.is-open .gate__date,
.gate.is-open .gate__count,
.gate.is-open .gate__tagline,
.gate.is-open .gate__foot {
  animation: gate-monter 1.15s var(--gate-lux) forwards;
}

.gate.is-open .gate__mark    { animation-delay: 0.20s; }
.gate.is-open .gate__eyebrow { animation-delay: 0.34s; }
.gate.is-open .gate__title   { animation-delay: 0.46s; }
.gate.is-open .gate__date    { animation-delay: 0.62s; }
.gate.is-open .gate__count   { animation-delay: 0.76s; }
.gate.is-open .gate__tagline { animation-delay: 0.88s; }
.gate.is-open .gate__foot    { animation-delay: 1.02s; }

@keyframes gate-monter { to { opacity: 1; transform: none; } }

/* ---------- Écrans bas ---------- */

@media (max-height: 27rem) {
  .gate__count { display: none; }
  .gate__count.is-open { display: block; }
  .gate__tagline { margin-top: 1rem; }
}

@media (max-width: 22.5rem) {
  .gate__count { gap: 0.25rem; }
  .gate__l { letter-spacing: 0.14em; text-indent: 0.14em; }
}

/* ---------- Mouvement réduit ---------- */

@media (prefers-reduced-motion: reduce) {
  .gate,
  .gate.is-open .gate__mark,
  .gate.is-open .gate__eyebrow,
  .gate.is-open .gate__title,
  .gate.is-open .gate__date,
  .gate.is-open .gate__count,
  .gate.is-open .gate__tagline,
  .gate.is-open .gate__foot {
    transition-duration: 0.01ms;
    animation: none !important;
  }
  .gate__mark, .gate__eyebrow, .gate__title,
  .gate__date, .gate__count, .gate__tagline, .gate__foot {
    opacity: 1;
    transform: none;
  }
}
