/* ======================================================================
   TYPOGRAPHY
   ====================================================================== */
@font-face{
  font-family: "Darleston";
  src: url("typo/Darleston.otf") format("opentype");
  font-display: swap;
}

@font-face{
  font-family: "BemoreSerif";
  src: url("typo/Bemore Serif.otf") format("opentype");
  font-display: swap;
}

/* ======================================================================
   VARIABLES
   ====================================================================== */
:root{
  --menu-h: 60px;
}

/* ======================================================================
   BASE
   ====================================================================== */
html,
body{
  margin: 0;
  min-height: 100%;
}

html{
  background: #000;
}

body{
  min-height: 100svh;
  background: transparent;
  overflow-x: hidden;
}

/* Background fixed (évite le flicker) */
body::before{
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: #000 url("img/fond.png") center/cover no-repeat;
  transform: translateZ(0);
  will-change: transform;
}

/* ======================================================================
   HERO / LAYOUT
   ====================================================================== */
.hero{
  position: relative;
  width: 100%;
  min-height: 100svh;
  overflow: hidden;
  padding-top: var(--menu-h); /* push contenu sous la barre */
}

/* ======================================================================
   TOP MENU
   ====================================================================== */
.topbar{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--menu-h);
  z-index: 10000;

  background-color: rgba(126, 24, 40, 0.9);
  opacity: 0.9;

  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  border-bottom: 1px solid rgba(255,255,255,0.10);
}

.topbar .inner{
  height: 100%;
  width: min(1100px, 92vw);
  margin: 0 auto;

  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand{
  font-family: "BemoreSerif", serif;
  letter-spacing: 0.14em;
  font-size: 20px;
  color: #fff;
  white-space: nowrap;
}

.menu-toggle{
  display: none;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: #fff;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;

  font-family: "BemoreSerif", serif;
  letter-spacing: 0.10em;
  font-size: 20px;
}
.menu-toggle:focus-visible{
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

.nav{
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav a{
  font-family: "BemoreSerif", serif;
  font-size: 20px;
  letter-spacing: 0.12em;
  text-transform: uppercase;

  color: rgba(255,255,255,0.92);
  text-decoration: none;

  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid transparent;

  transition: background 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}
.nav a:hover{
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.10);
  transform: translateY(-1px);
}
.nav a.is-active{
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.18);
}

/* Mobile menu */
@media (max-width: 720px){
  :root{ --menu-h: 64px; }

  .menu-toggle{
    display: inline-flex;
    align-items: center;
    gap: 10px;
  }

  .nav{
    position: absolute;
    left: 0;
    right: 0;
    top: var(--menu-h);

    background: rgba(0,0,0,0.92);
    border-bottom: 1px solid rgba(255,255,255,0.10);

    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;

    transform-origin: top;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }

  .topbar.open .nav{ max-height: 320px; }

  .nav a{
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.05);
  }
}

/* ======================================================================
   LOGO + TEXT
   ====================================================================== */
.logo-wrapper{
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, calc(-50% - 4vh));
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 3;
  pointer-events: auto;
}

.logo-center{
  width: clamp(380px, 30vw, 520px);
  aspect-ratio: 1 / 1;
  background: url("img/logo.png") center/contain no-repeat;
  filter: drop-shadow(0 0 20px rgba(255,255,255,0.25));

  opacity: 0;
  animation: fadeIn 2s ease forwards;
  animation-delay: 0.5s;
}

.logo-text{
  margin-top: 4.5rem;
  text-align: center;
}

.text-main{
  font-family: "BemoreSerif", serif;
  font-size: clamp(38px, 5vw, 56px);
  color: #fff;
  line-height: 1.1;
}

.text-sub{
  margin-top: 0.7rem;
  font-family: "BemoreSerif", serif;
  font-size: clamp(28px, 5vw, 38px);
  font-style: italic;
  color: #fff;
  letter-spacing: 0.08em;
}

/* ======================================================================
   CONTENT (lecture sur fond, sans boîtes)
   ====================================================================== */
.content{
  width: min(980px, 92vw);
  margin: 0 auto;
  padding: 38px 0 140px;
}

/* Sécurité anti "cadre blanc" (si un ancien CSS ajoute une bordure) */
.content,
.panels,
.panel,
.section{
  border: 0 !important;
  outline: 0 !important;
}

.header{
  text-align: center;
  padding: 24px 0 10px;
}

.big-title{
  font-family: "BemoreSerif", serif;
  font-size: clamp(88px, 7.2vw, 104px);
  color: #fff;
  line-height: 1.0;
  margin: 110px 0 10px 0;
  text-shadow: 0 10px 25px rgba(0,0,0,0.55);
}

.sub-title{
  margin: 0 0 10px 0;
  font-family: "BemoreSerif", serif;
  font-size: clamp(16px, 3vw, 24px);
  color: #ffd9d9;
  letter-spacing: 0.08em;
  text-shadow: 0 10px 25px rgba(0,0,0,0.55);
}

.lead{
  margin: 0 auto;
  padding-top: 20px;
  max-width: 70ch;

  font-family: "BemoreSerif", serif;
  font-size: clamp(14px, 2vw, 16px);
  letter-spacing: 0.04em;
  line-height: 1.65;
  color: rgba(255,255,255,0.88);

  text-shadow: 0 10px 25px rgba(0,0,0,0.65);
}

.section{
  padding: 38px 0;
  scroll-margin-top: calc(var(--menu-h) + 18px);
}

.section h2{
  text-align: center;
  font-family: "BemoreSerif", serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: clamp(38px, 3.6vw, 56px);
  color: #fff;
  text-shadow: 0 10px 25px rgba(0,0,0,0.55);
}

.section p,
.section li{
  font-family: "BemoreSerif", serif;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.90);
  line-height: 1.7;
  font-size: clamp(24px, 2vw, 26px);
  text-shadow: 0 10px 25px rgba(0,0,0,0.70);
}

.section ul{
  margin: 10px 0 0;
  padding-left: 18px;
  list-style: none;
}

/* ======================================================================
   NAV PAR PANNEAUX (clic menu)
   ====================================================================== */
.panels{
  margin-top: 10px;
  position: relative;
  overflow: visible;
  transition: height 0.8s ease;
}

/* On évite display:none (ça casse les transitions). On empile les panneaux. */
.panel{
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;

  opacity: 0;
  transform: translateY(10px);
  visibility: hidden;
  pointer-events: none;

  transition: opacity 0.8s ease, transform 0.8s ease;
}

/* Panneau prêt à entrer (visible mais encore invisible) */
.panel.is-prep{
  visibility: visible;
}

/* Panneau actif (dans le flux, donne la hauteur au conteneur) */
.panel.is-active{
  position: relative;
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
}

/* Panneau sortant (reste empilé au-dessus le temps du fade-out) */
.panel.is-leaving{
  position: absolute;
  opacity: 0;
  transform: translateY(-8px);
  visibility: visible;
  pointer-events: none;
}

/* ======================================================================
   REVEAL (scroll / ouverture panneau)
   ====================================================================== */
.reveal{
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.is-visible{
  opacity: 1;
  transform: translateY(0);
}

/* ======================================================================
   TIMELINE PROGRAMME
   ====================================================================== */
.timeline{
  position: relative;
  margin-top: 18px;
  padding: 12px 0;
}

.timeline:before{
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-50%);
  background: rgba(255, 215, 215, 0.75);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.25);
}

.t-item{
  position: relative;
  display: grid;
  grid-template-columns: 1fr 54px 1fr;
  align-items: start;
  gap: 18px;
  padding: 18px 0;
}

.t-side{ min-height: 10px; }

.t-badge{
  position: sticky;
  top: calc(var(--menu-h) + 18px);
  width: 54px;
  height: 54px;
  border-radius: 999px;
  display: grid;
  place-items: center;

  background: rgba(126, 24, 40, 0.95);
  border: 2px solid rgba(255,255,255,0.35);
  box-shadow: 0 10px 25px rgba(0,0,0,0.45);

  color: #fff;
  font-family: "BemoreSerif", serif;
  letter-spacing: 0.06em;
  font-size: 38px;
}

.t-card{ max-width: 44ch; }

.t-meta{
  font-family: "BemoreSerif", serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 30px;
  color: rgba(235,60,87,0.95);
  margin-bottom: 6px;
  text-shadow: 0 10px 25px rgba(0,0,0,0.75);
}

.t-title{
  font-family: "BemoreSerif", serif;
  letter-spacing: 0.08em;
  font-size: clamp(30px, 2.4vw, 36px);
  color: #fff;
  margin: 0 0 8px;
  text-shadow: 0 10px 25px rgba(0,0,0,0.75);
}

.t-details{
  margin: 0;
  padding-left: 18px;
}
.t-details li{ 
	margin: 6px -18px 0; 
}

.t-link{
  display: inline-block;
  margin-top: 10px;

  font-family: "BemoreSerif", serif;
  letter-spacing: 0.10em;
  color: #ffd9d9;
  text-decoration: none;

  border-bottom: 1px solid rgba(255, 217, 217, 0.55);
}
.t-link:hover{ border-bottom-color: rgba(255, 217, 217, 0.95); }

/* Alternance gauche/droite */
.t-item:nth-child(odd) .t-card{ justify-self: end; text-align: right; }
.t-item:nth-child(odd) .t-details{ padding-left: 0; padding-right: 18px; list-style-position: inside; }
.t-item:nth-child(even) .t-card{ justify-self: start; text-align: left; }

/* Sur mobile: tout à droite de la ligne (plus lisible) */
@media (max-width: 860px){
  .timeline:before{ left: 26px; }

  .t-item{
    grid-template-columns: 54px 1fr;
    gap: 14px;
  }

  /* Sur mobile on n'affiche que la carte qui contient du contenu */
  .t-side{ display: none; }
  .t-side.has-card{
    display: block;
    grid-column: 2;
    grid-row: 1;
  }

  .t-badge{
    position: relative;
    top: 0;
    grid-column: 1;
    grid-row: 1;
  }

  .t-card{ max-width: none; }
  .t-item:nth-child(odd) .t-card{ justify-self: start; text-align: left; }
  .t-item:nth-child(odd) .t-details{ padding-right: 0; padding-left: 18px; list-style-position: outside; }
}

/* ======================================================================
   CARTE CONNEXION
   ====================================================================== */
.center-wrap{
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, calc(-50% - 4vh));
  z-index: 4;
  width: min(92vw, 520px);
}

.card{
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 5px;
  padding: 22px 18px;

  text-align: center;
}

.card h1{
  margin: 0 0 10px 0;
  font-family: "BemoreSerif", serif;
  font-size: clamp(18px, 2.2vw, 24px);
  letter-spacing: 0.10em;
  color: #fff;
  font-weight: 600;
}

.hint{
  margin: 0 0 16px 0;
  font-family: "BemoreSerif", serif;
  font-size: clamp(16px, 1.7vw, 17px);
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.75);
}

.field{
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;

  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.18);

  background: rgba(0,0,0,0.35);
  color: #fff;
  font-size: 16px;

  outline: none;
}
option {
	background: rgba(0,0,0,0.85);
}
.field:focus{
  border-color: rgba(196,0,0,0.8);
  box-shadow: 0 0 0 3px rgba(196,0,0,0.18);
}

input[type="date"]::-webkit-calendar-picker-indicator{
  filter: invert(1);
  opacity: 1;
  cursor: pointer;
}

.btn{
  margin-top: 14px;
  display: inline-block;
  width: 100%;
  padding: 0.85em 1.2em;

  font-family: "BemoreSerif", serif;
  font-size: clamp(14px, 1.4vw, 18px);
  letter-spacing: 0.12em;
  text-transform: uppercase;

  color: #fff;
  text-decoration: none;

  border: 2px solid #58101B;
  background: #58101B;
  border-radius: 5px;

  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}
.btn:hover{ background: #851122; transform: translateY(-1px); }
.btn:focus-visible{ outline: 2px solid #ffffff; outline-offset: 4px; }

.error{
  margin-top: 12px;
  font-family: "BemoreSerif", serif;
  font-size: 14px;
  letter-spacing: 0.06em;
  color: #ffb3b3;
}

/* ======================================================================
   FORM RSVP
   ====================================================================== */
.rsvp-form{
  margin-top: 16px;
  text-align: left;
}

.rsvp-form .section-title{
  margin: 18px 0 8px;
  font-family: "BemoreSerif", serif;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  font-size: 30px;
  color: rgba(255,255,255,0.78);
}

.form-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 760px){
  .form-grid{ grid-template-columns: 1fr 1fr; }
  .span-2{ grid-column: span 2; }
}

.field-label{
  display: block;
  margin: 2px 0 6px;
  font-size: 17px;
  color: rgba(255,255,255,0.86);
}

.help{
  margin: 6px 0 0;
  font-size: 13px;
  color: rgba(255,255,255,0.65);
}

.choice-row{
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 10px 12px;

  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.28);
}

.choice{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: rgba(255,255,255,0.90);
}

.choice input{ accent-color: #c40000; }

.success{
  margin-top: 12px;
  padding: 10px 12px;

  border-radius: 12px;
  border: 1px solid rgba(0,255,120,0.25);
  background: rgba(0,255,120,0.20);

  color: rgba(255,255,255,0.95);
  font-size: 24px;
}

/* ======================================================================
   BUTTONS / LINKS
   ====================================================================== */
.cta-button{
  margin-top: 1.4rem;
  display: inline-block;
  padding: 0.75em 2.2em;

  font-family: "BemoreSerif", serif;
  font-size: clamp(14px, 1.4vw, 18px);
  letter-spacing: 0.22em;
  text-transform: uppercase;

  color: #fff;
  text-decoration: none;

  border: 2px solid #58101B;
  background: #58101B;
  border-radius: 5px;

  transition: background 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.cta-button:hover{
  background: #7e1828;
  color: #fff;
  transform: translateY(-2px);
}

.cta-button:focus-visible{
  outline: 2px solid #ffffff;
  outline-offset: 4px;
}

/* ======================================================================
   DECOR (spiders / fog)
   ====================================================================== */
.spider{
  position: fixed;
  left: var(--x);
  top: var(--y);

  width: clamp(120px, 12vw, 230px);
  aspect-ratio: 230 / 800;

  transform: translateX(-50%);
  background: url("img/spider.png") center/contain no-repeat;

  animation: bob var(--dur) ease-in-out infinite;
  animation-delay: var(--delay);

  pointer-events: none; /* décor : ne gêne pas les clics */
  z-index: 1;
}
.spider2{
  position: fixed;
  left: var(--x);
  top: var(--y);

  width: clamp(120px, 12vw, 230px);
  aspect-ratio: 230 / 800;

  transform: translateX(-50%);
  background: url("img/spider2.png") center/contain no-repeat;

  animation: bob var(--dur) ease-in-out infinite;
  animation-delay: var(--delay);

  pointer-events: none; /* décor : ne gêne pas les clics */
  z-index: 1;
}

/* La brume est un calque fixe en bas de l'écran */
.fog{
  position: fixed;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 1000px;
  pointer-events: none;
  z-index: 9999;

  background:
    linear-gradient(to top, rgba(0,0,0,0.35), rgba(0,0,0,0)),
    url("img/fog.png"),
    url("img/fog.png");

  background-repeat: no-repeat, repeat-x, repeat-x;
  background-size: 100% 100%, 900px 520px, 1200px 260px;
  background-position: 0 0, 0 100%, 300px 100%;

  filter: blur(2px);
  opacity: 0.75;

  animation: fogMove 35s linear infinite;
}

/* ======================================================================
   COUNTDOWN FOOTER
   ====================================================================== */
.countdown-bar{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;

  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  padding: 14px 16px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
  text-align: center;
}

#countdown{
  font-family: "BemoreSerif", serif;
  font-size: clamp(16px, 2.6vw, 28px);
  letter-spacing: 0.10em;
  color: #fff;
  white-space: nowrap;
}

#countdown .sep{
  opacity: 0.5;
  padding: 0 10px;
}

/* ======================================================================
   UTILITIES
   ====================================================================== */
.responsive-img{
  max-width: 100%;
  height: auto;
  display: block;
}

.visually-hidden{
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

.gred{
  color: #dd3650e6;
  font-size: 29px;
}

/* ======================================================================
   ANIMATIONS BRUME
   ====================================================================== */
@keyframes fadeIn{
  from{ opacity: 0; transform: scale(0.95); }
  to{ opacity: 1; transform: scale(1); }
}

@keyframes bob{
  0%   { transform: translateX(-50%) translateY(0); }
  50%  { transform: translateX(-50%) translateY(var(--drop)); }
  100% { transform: translateX(-50%) translateY(0); }
}

@keyframes fogMove{
  0%   { background-position: 0 0, 0 100%, 300px 100%; transform: translateY(0); }
  50%  { background-position: 0 0, -900px 100%, 900px 100%; transform: translateY(-6px); }
  100% { background-position: 0 0, -1800px 100%, 1500px 100%; transform: translateY(0); }
}

/* Motion reduction */
@media (prefers-reduced-motion: reduce){
  .spider{ animation: none; }
  .reveal{ opacity: 1; transform: none; transition: none; }
  .fog{ animation: none; }
}
