/* =========================================================
   Anaëlle & Rémi · 22 mai 2027
   Palette douce, typo Anaelle3, blobs aquarelle
   ========================================================= */

@font-face {
  font-family: 'Anaelle3';
  src: url('/assets/fonts/Anaelle3-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  /* ── Palette ── */
  --cream:       #FDFAF5;
  --cream-mid:   #F5EAE0;
  --cream-deep:  #EDD5C0;
  --pink:        #F0AFA0;
  --peach:       #F0C4AC;
  --mustard:     #ECC97A;
  --sand:        #E8D4A8;
  --sage:        #A8BFA0;
  --sage-deep:   #8AA382;
  --accent:      #C8705A;
  --accent-dark: #A55840;
  --ink:         #2A2622;
  --ink-soft:    #5A5248;
  --ink-mute:    rgba(42, 38, 34, 0.4);

  /* ── Effets ── */
  --shadow-soft: 0 2px 20px rgba(42, 38, 34, 0.07);
  --shadow-card: 0 4px 28px rgba(42, 38, 34, 0.10);
  --radius-card: 20px;
  --radius-pill: 100px;

  /* ── Gabarits ── */
  --max-content: 1100px;

  /* ── Typographie ── */
  --font-display: 'Anaelle3', cursive;
  --font-hand:    'Anaelle3', cursive;
  --font-serif:   'Anaelle3', cursive;
}

/* =========================================================
   RESET & BASE
   ========================================================= */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  font-family: 'Anaelle3', cursive;
  font-weight: 400;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
  position: relative;
  min-height: 100vh;
}

::selection { background: var(--mustard); color: var(--ink); }

img { max-width: 100%; display: block; }
button { font: inherit; }
a { color: inherit; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* =========================================================
   BLOBS DÉCORATIFS
   ========================================================= */
.page-blobs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.blob { position: absolute; display: block; transition: transform .05s linear; will-change: transform; }
.blob-tl { width: 125px; top: 68px; left: 90px; transform-origin: top left; }
.blob-tr { width: 125px; top: -62px; right: 0; transform-origin: top right; }
.blob-bl { width: 125px; bottom: -62px; left: 0; transform-origin: bottom left; }
.blob-br { width: 125px; bottom: -62px; right: 40px; transform-origin: bottom right; }
.blob-float {
  width: max(10vw, 80px);
  position: absolute;
  transform: translate(-50%, -50%);
  animation: float-diag 9s ease-in-out infinite;
  opacity: 0.45;
  pointer-events: none;
}
@keyframes float-diag {
  0%   { transform: translate(-50%, -50%); }
  25%  { transform: translate(calc(-50% + 28px), calc(-50% + 22px)); }
  50%  { transform: translate(calc(-50% + 18px), calc(-50% + 38px)); }
  75%  { transform: translate(calc(-50% - 12px), calc(-50% + 20px)); }
  100% { transform: translate(-50%, -50%); }
}

.nav, section, header, footer { position: relative; z-index: 1; }

/* =========================================================
   INTRO — COEUR D'OUVERTURE
   ========================================================= */
.intro { display: none; }
html.is-intro { overflow: hidden; }
html.is-intro body { overflow: hidden; }
html.is-intro .intro { display: flex; }

.intro {
  position: fixed;
  inset: 0;
  z-index: 500;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(240, 196, 172, 0.35) 0%, transparent 62%),
    var(--cream);
  opacity: 1;
  transition: opacity .9s ease;
}
.intro.is-leaving { opacity: 0; pointer-events: none; }

.intro-blob { position: absolute; width: 150px; opacity: 0.7; pointer-events: none; }
.intro-blob-tl { top: -40px; left: -30px; }
.intro-blob-br { bottom: -46px; right: -20px; }

.intro-inner { position: relative; z-index: 1; }
.intro-label {
  display: inline-block;
  background: url('/assets/images/bouton-fond.png') center / 100% 100% no-repeat;
  padding: 6px 26px;
  font-family: var(--font-hand);
  font-size: 18px;
  color: var(--ink);
  animation: intro-rise .9s ease .1s backwards;
}
.intro-names {
  font-family: var(--font-display);
  font-size: clamp(38px, 9vw, 68px);
  line-height: 1.1;
  color: var(--ink);
  margin-top: 10px;
  animation: intro-rise .9s ease .25s backwards;
}
.intro-heart {
  display: block;
  margin: 26px auto 0;
  width: min(190px, 44vw);
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: transform .3s ease;
  animation: intro-rise .9s ease .4s backwards;
}
.intro-heart img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 8px 18px rgba(42, 38, 34, 0.18));
  /* Le battement vit sur l'image : le JS peut le relancer sans rejouer intro-rise. */
  animation: heart-beat 1.7s ease-in-out 1.4s infinite;
}
.intro-heart:hover, .intro-heart:focus-visible { transform: scale(1.06); }
.intro-heart:focus-visible { outline: 2px dashed var(--accent); outline-offset: 12px; border-radius: 12px; }
.intro-heart.is-popped { animation: heart-pop .55s ease-out forwards; }
.intro-heart.is-popped img { animation: none; }

/* Vit hors du voile : pilote le battement pendant l'intro, la musique ensuite. */
.sound-toggle {
  position: fixed;
  bottom: 22px; right: 22px;
  z-index: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  background: var(--cream-mid);
  color: var(--ink-soft);
  border: 1.5px solid rgba(42, 38, 34, 0.12);
  border-radius: 50%;
  cursor: pointer;
  transition: color .25s, background .25s, transform .2s;
  animation: intro-rise .9s ease .7s backwards;
}
.sound-toggle:hover { color: var(--accent); transform: scale(1.08); }
.sound-toggle:focus-visible { outline: 2px dashed var(--accent); outline-offset: 4px; }
.sound-toggle[aria-pressed="true"] { color: var(--accent); background: var(--cream-deep); }
.sound-toggle .icon-on { display: none; }
.sound-toggle[aria-pressed="true"] .icon-on  { display: block; }
.sound-toggle[aria-pressed="true"] .icon-off { display: none; }

.intro-hint {
  margin-top: 22px;
  font-family: var(--font-hand);
  font-size: 20px;
  color: var(--ink-soft);
  animation: intro-rise .9s ease .55s backwards, hint-pulse 2.4s ease-in-out 1.6s infinite;
}

/* Pluie de coeurs */
.intro-burst { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.intro-burst img {
  position: absolute;
  width: var(--s);
  height: auto;
  margin: calc(var(--s) / -2);
  opacity: 0;
  animation: heart-fly var(--d) cubic-bezier(.16, .68, .3, 1) var(--delay) forwards;
}

@keyframes intro-rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* Poum-poum : pics à 8% et 24% du cycle — voir BEAT_TIMES dans main.js */
@keyframes heart-beat {
  0%   { transform: scale(1); }
  8%   { transform: scale(1.12); }
  16%  { transform: scale(1); }
  24%  { transform: scale(1.07); }
  32%  { transform: scale(1); }
  100% { transform: scale(1); }
}
@keyframes heart-pop {
  0%   { transform: scale(1); opacity: 1; }
  35%  { transform: scale(1.35); opacity: 1; }
  100% { transform: scale(0.2); opacity: 0; }
}
@keyframes hint-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.45; }
}
@keyframes heart-fly {
  0%   { transform: translate(0, 0) scale(.25) rotate(0deg); opacity: 0; }
  10%  { opacity: 1; }
  70%  { opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) scale(var(--sc)) rotate(var(--r)); opacity: 0; }
}

/* =========================================================
   NAV
   ========================================================= */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  padding: 16px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(253, 250, 245, 0.88);
  border-bottom: 1px solid rgba(42, 38, 34, 0.08);
}
.logo {
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-mark { width: 30px; height: auto; display: block; transition: transform .4s ease; }
.logo:hover .logo-mark { transform: rotate(20deg) scale(1.15); }

.nav-links { display: flex; gap: 32px; list-style: none; align-items: center; }
.nav-links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 400;
  padding: 4px 0;
  transition: color .25s;
}
.nav-links a:hover { color: var(--accent); }
/* Sélecteur à deux classes : doit primer sur `.nav-links a`, plus spécifique qu'une classe seule. */
.nav-links .nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: var(--cream);
  padding: 10px 32px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 18px;
  text-decoration: none;
  transition: background .25s, transform .2s;
}
/* `color` est indispensable ici : sans lui, `.nav-links a:hover` repeint le texte en accent sur fond accent. */
.nav-links .nav-cta:hover,
.nav-links .nav-cta:focus-visible {
  background: var(--accent);
  color: var(--cream);
  transform: translateY(-1px);
}

.nav-toggle { display: none; background: transparent; border: 0; cursor: pointer; padding: 8px; color: var(--ink); }
.nav-toggle svg { display: block; }

/* =========================================================
   ÉTIQUETTES & TITRES DE SECTION
   ========================================================= */
.section-label {
  display: inline-block;
  background: url('/assets/images/bouton-fond.png') center / 100% 100% no-repeat;
  padding: 6px 24px;
  font-family: var(--font-hand);
  font-size: 18px;
  color: var(--ink);
  margin-bottom: 14px;
}
.underline { position: relative; display: inline-block; }
.underline::after {
  content: '';
  position: absolute;
  bottom: -4px; left: -2px; right: -2px;
  height: 10px;
  background: var(--mustard);
  z-index: -1;
  transform: skewX(-4deg);
  opacity: 0.7;
}
.underline--pink::after  { background: var(--pink); }
.underline--sage::after  { background: var(--sage); }

.section-header { text-align: center; margin-bottom: 56px; padding: 0 20px; }
.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(40px, 7vw, 76px);
  line-height: 1;
  color: var(--ink);
}
.section-header p {
  margin-top: 14px;
  font-size: 18px;
  color: var(--ink-soft);
  font-style: italic;
}

/* =========================================================
   BOUTONS
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--ink);
  color: var(--cream);
  padding: 14px 30px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 18px;
  border: 0;
  cursor: pointer;
  transition: background .25s, transform .2s;
}
.btn:hover { background: var(--accent); transform: translateY(-2px); }
.btn--ghost { background: transparent; color: var(--ink); border: 2px solid var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--cream); transform: translateY(-2px); }

/* =========================================================
   HERO
   ========================================================= */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 130px 40px 80px;
  text-align: center;
  gap: 0;
}
.hero-illustration {
  width: min(560px, 92%);
  height: auto;
  margin: 36px auto 0;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}
.hero-countdown {
  margin-top: 30px;
  font-family: var(--font-hand);
  font-size: 22px;
  color: var(--ink-soft);
  background: var(--cream-mid);
  padding: 10px 26px;
  border-radius: var(--radius-pill);
}
.hero-countdown strong { color: var(--accent); font-size: 1.3em; }
.hero-actions {
  margin-top: 28px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

/* =========================================================
   PROGRAMME — TIMELINE
   ========================================================= */
.programme {
  padding: 80px 40px 100px;
  max-width: var(--max-content);
  margin: 0 auto;
}
.timeline {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
}
.timeline::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: 100px;
  width: 2px;
  background: repeating-linear-gradient(to bottom, rgba(42,38,34,.18) 0 8px, transparent 8px 16px);
}
.timeline-item {
  position: relative;
  display: flex;
  gap: 24px;
  padding: 0 0 44px 0;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-icon {
  flex-shrink: 0;
  width: 200px; height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  position: relative;
  z-index: 1;
}
.timeline-icon img {
  width: 100%; height: 100%;
  object-fit: contain;
}
.timeline-content { padding-top: 6px; }
.timeline-time {
  font-family: var(--font-hand);
  font-size: 20px;
  color: var(--accent);
  display: block;
  margin-bottom: 2px;
}
.timeline-title {
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--ink);
}
.timeline-desc {
  font-size: 16px;
  color: var(--ink-soft);
  margin-top: 4px;
}
.timeline-day-label {
  font-family: var(--font-hand);
  font-size: 22px;
  color: var(--ink-soft);
  margin: 36px 0 20px 0;
  padding-left: 80px;
}
.timeline-day-label:first-child { margin-top: 0; }

/* =========================================================
   INFOS PRATIQUES
   ========================================================= */
.infos {
  padding: 80px 40px 100px;
  max-width: var(--max-content);
  margin: 0 auto;
}
.infos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-bottom: 60px;
}
.info-card {
  background: var(--cream-mid);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  padding: 32px;
}
.info-card h3 {
  font-family: var(--font-display);
  font-size: 28px;
  margin-bottom: 14px;
  color: var(--ink);
}
.info-card p, .info-card ul {
  font-size: 16px;
  color: var(--ink-soft);
  line-height: 1.8;
}
.info-card ul { list-style: none; }
.info-card a { color: var(--accent-dark); text-decoration: none; border-bottom: 1px solid currentColor; }
.info-card a:hover { color: var(--accent); }
.info-card strong { color: var(--ink); }
.info-deadline {
  display: inline-block;
  margin-top: 14px;
  background: var(--mustard);
  color: var(--ink);
  font-family: var(--font-hand);
  font-size: 16px;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
}

/* =========================================================
   FORMULAIRE RSVP
   ========================================================= */
.rsvp-card {
  background: var(--cream);
  border-radius: var(--radius-card);
  border: 1.5px dashed rgba(42, 38, 34, 0.2);
  padding: 44px;
  box-shadow: var(--shadow-soft);
  max-width: 760px;
  margin: 0 auto;
}
.rsvp-card h3 {
  font-family: var(--font-display);
  font-size: 32px;
  margin-bottom: 6px;
  text-align: center;
}
.rsvp-intro {
  text-align: center;
  color: var(--ink-soft);
  font-style: italic;
  margin-bottom: 30px;
}
.field { display: block; margin-bottom: 18px; }
.field label {
  display: block;
  font-family: var(--font-hand);
  font-size: 19px;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid rgba(42, 38, 34, 0.25);
  border-radius: 12px;
  background: var(--cream);
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--ink);
  transition: box-shadow .2s, border-color .2s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200, 112, 90, 0.15);
}
.field textarea { min-height: 110px; resize: vertical; }
.field-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.radio-group { display: flex; gap: 18px; flex-wrap: wrap; }
.radio-group label {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-serif); font-size: 16px; color: var(--ink);
  cursor: pointer; margin-bottom: 0;
}
.radio-group input { width: auto; }
fieldset { border: 0; margin-bottom: 18px; padding: 0; }
fieldset legend {
  font-family: var(--font-hand);
  font-size: 19px;
  color: var(--ink-soft);
  margin-bottom: 8px;
  padding: 0;
}
.form-actions {
  margin-top: 26px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}
.form-status { font-family: var(--font-hand); font-size: 19px; color: var(--ink-soft); }
.form-status[data-state="ok"]    { color: var(--sage-deep); }
.form-status[data-state="error"] { color: var(--accent); }

/* =========================================================
   PETIT MOT
   ========================================================= */
.petit-mot {
  padding: 80px 40px 100px;
  max-width: 860px;
  margin: 0 auto;
}
.petit-mot-text {
  font-size: 19px;
  line-height: 2;
  color: var(--ink-soft);
  text-align: center;
}
.petit-mot-text p { margin-bottom: 22px; }
.petit-mot-famille {
  display: block;
  width: min(210px, 50%);
  height: auto;
  margin: 56px auto 0;
}
.temoins {
  margin-top: 60px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
.temoins-card {
  background: var(--cream-mid);
  border-radius: var(--radius-card);
  padding: 28px 32px;
  text-align: center;
}
.temoins-card h4 {
  font-family: var(--font-hand);
  font-size: 18px;
  color: var(--ink-soft);
  background: var(--mustard);
  display: inline-block;
  padding: 4px 16px;
  border-radius: var(--radius-pill);
  margin-bottom: 16px;
}
.temoins-card ul { list-style: none; }
.temoins-card li { margin-bottom: 10px; font-size: 17px; }
.temoins-card strong { font-family: var(--font-display); font-size: 19px; display: block; }
.temoins-card span { color: var(--ink-soft); font-size: 14px; }
.temoins-card a { color: var(--accent-dark); text-decoration: none; }
.temoins-card a:hover { color: var(--accent); }

/* =========================================================
   FOOTER
   ========================================================= */
.footer {
  background: var(--cream-mid);
  padding: 36px 40px;
  text-align: center;
  font-size: 16px;
  color: var(--ink-soft);
  border-top: 1px dashed rgba(42, 38, 34, 0.2);
}
.footer-heart { display: inline-block; width: 18px; height: auto; vertical-align: middle; margin: 0 2px; }
.footer p:first-child { font-family: var(--font-display); font-size: 22px; color: var(--ink); margin-bottom: 6px; }

/* =========================================================
   ANIMATIONS
   ========================================================= */
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  .intro-label, .intro-names, .intro-heart, .intro-heart img, .intro-hint, .sound-toggle { animation: none; }
  .intro-heart.is-popped { animation: none; opacity: 0; }
}

@media (max-width: 900px) {
  .blob-tl { left: 0; }
  .intro-blob { width: 110px; }
  .intro-hint { font-size: 18px; }
  .nav { padding: 12px 20px; overflow: visible; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--cream);
    border-bottom: 1px dashed rgba(42, 38, 34, 0.15);
    max-height: 0;
    overflow: hidden;
    padding: 0;
    transition: max-height .35s ease, padding .3s ease;
    z-index: 200;
    box-shadow: 0 8px 24px rgba(42, 38, 34, 0.08);
  }
  .nav-links.is-open { max-height: 500px; padding: 12px 0 20px; }
  .nav-links li { width: 100%; text-align: center; }
  .nav-links a { display: block; padding: 14px 20px; font-size: 22px; }
  .nav-links .nav-cta { margin: 12px auto 4px; padding: 10px 28px; }
  .nav-toggle { display: inline-flex; }

  .hero { padding: 110px 20px 60px; }
  .hero-illustration { width: 100%; margin: 18px auto 0; border-radius: 14px; }
  .programme, .infos, .petit-mot { padding: 60px 20px 80px; }
  .infos-grid { grid-template-columns: 1fr; }
  .rsvp-card { padding: 28px 22px; }
  .field-row { grid-template-columns: 1fr; }
  .timeline::before { left: 70px; }
  .timeline-icon { width: 140px; height: 140px; font-size: 20px; }
  .timeline-title { font-size: 22px; }
  .timeline-day-label { padding-left: 60px; }
  .temoins { grid-template-columns: 1fr; }
  .footer { padding: 24px 20px; }
}
