/* Styles spécifiques à l'accueil animé scroll-driven.
   Chargé uniquement par /pages/index.astro (ou son layout dédié).
   Le reste du site conserve la palette cream/navy du global.css. */

@font-face {
  font-family: "Playfair Display";
  src: url("/fonts/playfair-display-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

.page-accueil {
  /* Trajectoire du fond de page pilotée par la boucle rAF du HeroCanvas
     via --hero-progress (0 = début séquence, 1 = fin). */
  --hero-progress: 0;

  --bg-start: #0A0A0B;
  --bg-mid: #1C1A18;
  --bg-end: #F5EFE6;
  --ink-dark: #E8E6E3;
  --ink-mid: #C7BFB4;
  --ink-light: #1A1613;
  --accent-dark: #C8A96E;
  --accent-mid: #B8935A;
  /* Or foncé pour les fonds clairs. Le brief proposait #8A6A2F, qui ne donne
     que 4,39:1 sur #F5EFE6 — sous le seuil AA, et très loin du AAA exigé par
     ailleurs pour une clientèle de 55-70 ans. #62491D est la teinte la plus
     claire qui atteigne AAA à la fois en texte (7,38:1) et en fond de bouton
     avec texte crème dessus (8,08:1). Vérifiable par `npm run check:contrast`. */
  --accent-light: #62491D;

  /* Interpolation entre les 3 fonds via une fonction linéaire par morceaux
     projetée à partir de --hero-progress. La couleur de TEXTE, elle, ne
     s'interpole pas — chaque section définit sa paire fond/texte figée
     et déclenche sa transition à son propre seuil. */
  background: var(--bg-start);
  color: var(--ink-dark);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  transition: background 400ms ease-out, color 400ms ease-out;
}

/* ---- État sombre : Héro + Section 1 ---- */
.page-accueil .theme-dark {
  background: var(--bg-start);
  color: var(--ink-dark);
}
/* ---- État mid : Section 2 (bascule) ---- */
.page-accueil .theme-mid {
  background: var(--bg-mid);
  color: var(--ink-dark);
}
/* ---- État clair : Section 3 + désambiguïsation ---- */
.page-accueil .theme-light {
  background: var(--bg-end);
  color: var(--ink-light);
}
.page-accueil .theme-dark,
.page-accueil .theme-mid,
.page-accueil .theme-light {
  transition: background 500ms ease-out, color 500ms ease-out;
}

/* ---- Typographie sur l'accueil ---- */
.page-accueil h1,
.page-accueil h2,
.page-accueil .display {
  font-family: "Playfair Display", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.1;
  color: var(--ink-dark);
}
.page-accueil h1 {
  font-size: clamp(2.5rem, 1.6rem + 3.5vw, 4.25rem);
  color: var(--ink-dark);
  text-shadow: 0 2px 24px rgba(10, 10, 11, 0.55);
}
.page-accueil h2 { font-size: clamp(2rem, 1.4rem + 2vw, 3rem); }
/* Sur les sections claires, on rétablit la couleur foncée + retire l'ombre */
.page-accueil .theme-light h2 { color: var(--ink-light); text-shadow: none; }
.page-accueil .theme-light p, .page-accueil .theme-light li { color: var(--ink-light); }
.page-accueil .disambig-block h2 { color: var(--ink-light); text-shadow: none; }

.page-accueil p,
.page-accueil li {
  font-size: 1.125rem; /* 18px min */
  line-height: 1.7;
  max-width: 62ch;
}

.page-accueil .lede {
  font-family: "Playfair Display", serif;
  font-weight: 400;
  font-size: clamp(1.25rem, 0.9rem + 1vw, 1.625rem);
  line-height: 1.5;
  font-style: italic;
  color: var(--ink-dark);
  text-shadow: 0 2px 16px rgba(10, 10, 11, 0.55);
}

/* ---- Layout Hero (canvas en fond, texte overlay) ---- */
.page-accueil .hero-wrapper {
  position: relative;
  width: 100%;
  height: 160vh; /* épinglé */
  background: var(--bg-start);
}
@media (max-width: 767px) {
  .page-accueil .hero-wrapper { height: 110vh; }
}
.page-accueil .hero-canvas {
  z-index: 1;
}
/* Scrim dégradé sombre par-dessus le canvas pour garantir la lisibilité
   du texte quelle que soit la frame affichée (poster clair, mid, dark).
   Voile plus dense sur toute la largeur, s'estompe légèrement à droite
   pour laisser deviner le canvas sans concurrencer le texte. */
.page-accueil .hero-canvas::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background:
    linear-gradient(
      to right,
      rgba(10, 10, 11, 0.92) 0%,
      rgba(10, 10, 11, 0.85) 40%,
      rgba(10, 10, 11, 0.65) 70%,
      rgba(10, 10, 11, 0.55) 100%
    );
}
@media (max-width: 900px) {
  .page-accueil .hero-canvas::after {
    background: linear-gradient(
      to bottom,
      rgba(10, 10, 11, 0.60) 0%,
      rgba(10, 10, 11, 0.85) 60%,
      rgba(10, 10, 11, 0.90) 100%
    );
  }
}

.page-accueil .hero-overlay {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 100vh;
  margin-top: -100vh; /* remonte le texte par-dessus le canvas */
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px clamp(1.5rem, 6vw, 6rem) 40px;
  pointer-events: none;
  max-width: 900px;
}
.page-accueil .hero-overlay > * { pointer-events: auto; }
.page-accueil .hero-overlay h1 { max-width: 720px; }
.page-accueil .hero-overlay .lede { max-width: 640px; }

.page-accueil .hero-eyebrow {
  font-family: "Inter", sans-serif;
  font-size: 0.875rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent-dark);
  font-weight: 600;
  margin-bottom: 1.5rem;
}
.page-accueil .hero-cta {
  margin-top: 2.5rem;
  display: inline-flex;
  gap: 1.5rem;
  align-items: baseline;
  flex-wrap: wrap;
}
.page-accueil .hero-cta a.btn-gold {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 0.9rem 1.75rem;
  background: var(--accent-dark);
  color: #1A1613;
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: none;
  border: 1px solid var(--accent-dark);
  transition: background 200ms ease-out, color 200ms ease-out;
}
.page-accueil .hero-cta a.btn-gold:hover {
  background: transparent;
  color: var(--accent-dark);
}
.page-accueil .hero-cta a.tel {
  color: var(--ink-dark);
  text-decoration: none;
  font-weight: 400;
  font-size: 1.15rem;
  border-bottom: 1px solid transparent;
}
.page-accueil .hero-cta a.tel:hover { border-bottom-color: var(--accent-dark); }
.page-accueil .hero-cta a.tel strong {
  font-weight: 600;
  color: var(--accent-dark);
}

/* ---- Sections narratives ---- */
.page-accueil .story {
  padding: clamp(6rem, 12vh, 12rem) clamp(1.5rem, 6vw, 6rem);
  max-width: 1080px;
  margin-inline: auto;
}
.page-accueil .story .eyebrow {
  font-family: "Inter", sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 1.25rem;
}
.page-accueil .story .eyebrow.dark { color: var(--accent-dark); }
.page-accueil .story .eyebrow.mid { color: var(--accent-mid); }
.page-accueil .story .eyebrow.light { color: var(--accent-light); }

.page-accueil .story h2 { margin-bottom: 1.5rem; }
.page-accueil .story p + p { margin-top: 1.25em; }

/* ---- Liens contextuels dans les sections narratives ---- */
.page-accueil .story a,
.page-accueil .steps-list a {
  color: var(--accent-dark);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: rgba(200, 169, 110, 0.45);
  transition: text-decoration-color 160ms ease-out;
}
.page-accueil .story a:hover,
.page-accueil .steps-list a:hover {
  text-decoration-color: var(--accent-dark);
  text-decoration-thickness: 2px;
}
/* Sur fond clair, l'or clair ne tient pas le contraste : on bascule sur l'or foncé */
.page-accueil .theme-light a,
.page-accueil .disambig-block a {
  color: var(--accent-light);
  text-decoration-color: rgba(98, 73, 29, 0.45);
}
.page-accueil .theme-light a:hover,
.page-accueil .disambig-block a:hover {
  text-decoration-color: var(--accent-light);
}

/* ---- Liste d'orientation par situation ---- */
.page-accueil .orient-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  max-width: 760px;
}
.page-accueil .orient-list li {
  padding: 0.9rem 0;
  border-top: 1px solid rgba(200, 169, 110, 0.22);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink-mid);
  max-width: none;
}
.page-accueil .orient-list li:last-child {
  border-bottom: 1px solid rgba(200, 169, 110, 0.22);
}
.page-accueil .orient-list a {
  font-weight: 600;
  color: var(--ink-dark);
  text-decoration-color: rgba(200, 169, 110, 0.5);
}
.page-accueil .orient-list a:hover {
  color: var(--accent-dark);
}
.page-accueil .orient-more {
  margin-top: 1.75rem;
  font-size: 1rem;
  color: var(--ink-mid);
}
.page-accueil .calendar-more {
  margin-top: 1.75rem;
  font-size: 1rem;
}

/* Étapes numérotées section 2 */
.page-accueil .steps-list {
  list-style: none;
  padding: 0;
  margin: 2.5rem 0 0;
  counter-reset: step;
}
.page-accueil .steps-list li {
  counter-increment: step;
  padding: 1.25rem 0 1.25rem 4rem;
  position: relative;
  border-top: 1px solid rgba(200, 169, 110, 0.28);
  font-size: 1.125rem;
  line-height: 1.6;
  max-width: 720px;
}
.page-accueil .steps-list li:last-child { border-bottom: 1px solid rgba(200, 169, 110, 0.28); }
.page-accueil .steps-list li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 1.15rem;
  font-family: "Playfair Display", serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent-mid);
  line-height: 1;
}

/* Calendrier section 3 */
.page-accueil .calendar {
  margin-top: 2.5rem;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.page-accueil .calendar .item {
  padding: 1.75rem;
  border: 1px solid rgba(138, 106, 47, 0.3);
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(4px);
}
.page-accueil .calendar .item .date {
  font-family: "Playfair Display", serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-light);
  margin-bottom: 0.75rem;
}
.page-accueil .calendar .item p {
  font-size: 1rem;
  color: var(--ink-light);
  margin: 0;
}

.page-accueil .cta-final {
  margin-top: 3.5rem;
  text-align: center;
}
.page-accueil .cta-final a {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  padding: 1rem 2rem;
  background: var(--accent-light);
  color: #FCFAF5;
  font-weight: 600;
  font-size: 1.1rem;
  text-decoration: none;
  border: 1px solid var(--accent-light);
  transition: background 200ms ease-out, color 200ms ease-out;
}
.page-accueil .cta-final a:hover {
  background: transparent;
  color: var(--accent-light);
}

/* ---- Bloc désambiguïsation en pied ---- */
.page-accueil .disambig-block {
  padding: clamp(4rem, 8vh, 6rem) clamp(1.5rem, 6vw, 6rem);
  background: #FCFAF5;
  color: var(--ink-light);
  border-top: 1px solid rgba(138, 106, 47, 0.2);
}
.page-accueil .disambig-block .inner {
  max-width: 720px;
  margin-inline: auto;
}
.page-accueil .disambig-block h2 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}
.page-accueil .disambig-block details {
  border-top: 1px solid rgba(138, 106, 47, 0.28);
  padding: 0.5rem 0;
}
.page-accueil .disambig-block details:last-of-type {
  border-bottom: 1px solid rgba(138, 106, 47, 0.28);
}
.page-accueil .disambig-block summary {
  cursor: pointer;
  padding: 0.75rem 0;
  font-family: "Playfair Display", serif;
  font-weight: 700;
  font-size: 1.15rem;
  min-height: 48px;
  display: flex;
  align-items: center;
  list-style: none;
}
.page-accueil .disambig-block summary::-webkit-details-marker { display: none; }
.page-accueil .disambig-block summary::before {
  content: "+";
  color: var(--accent-light);
  font-family: "Inter", sans-serif;
  margin-right: 0.85rem;
  font-size: 1.25rem;
  width: 1.25rem;
  text-align: center;
  font-weight: 400;
}
.page-accueil .disambig-block details[open] summary::before { content: "−"; }
.page-accueil .disambig-block details p {
  padding: 0.25rem 0 0.75rem 2.1rem;
  color: var(--ink-light);
}

/* ---- Fondus d'apparition (IntersectionObserver ajoute .visible) ---- */
.page-accueil .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 500ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 500ms cubic-bezier(0.16, 1, 0.3, 1);
}
.page-accueil .reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Overrides header/footer/skip pour thème sombre en haut d'accueil ---- */
body.page-accueil .header {
  background: rgba(10, 10, 11, 0.85) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(232, 230, 227, 0.08) !important;
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}
body.page-accueil .header .brand-name { color: var(--ink-dark) !important; }
body.page-accueil .header .brand-baseline { color: var(--ink-mid) !important; }
body.page-accueil .header .nav a { color: var(--ink-dark) !important; }
body.page-accueil .header .nav a:hover { color: var(--accent-dark) !important; }
body.page-accueil .header .header-phone {
  background: var(--accent-dark) !important;
  color: #1A1613 !important;
}
body.page-accueil .header .header-phone:hover { background: var(--accent-light) !important; color: #FCFAF5 !important; }

body.page-accueil .footer {
  background: #FCFAF5 !important;
  color: var(--ink-light) !important;
  margin-top: 0 !important;
  border-top: 1px solid rgba(138, 106, 47, 0.2);
}

body.page-accueil .skip-link { background: var(--accent-dark) !important; color: #1A1613 !important; }

/* ---- Dégradation ---- */
@media (prefers-reduced-motion: reduce) {
  .page-accueil { background: var(--bg-end); color: var(--ink-light); }
  .page-accueil .hero-wrapper { height: auto; background: var(--bg-end); }
  .page-accueil .hero-canvas { position: relative; height: auto; }
  .page-accueil .hero-overlay {
    position: relative; margin-top: 0; height: auto;
    padding: 6rem clamp(1.5rem, 6vw, 6rem);
    color: var(--ink-light);
  }
  .page-accueil .hero-eyebrow { color: var(--accent-light); }
  .page-accueil .hero-cta a.tel { color: var(--ink-light); }
  .page-accueil .hero-cta a.tel strong { color: var(--accent-light); }
  .page-accueil .reveal { opacity: 1; transform: none; transition: none; }
  .page-accueil .theme-dark, .page-accueil .theme-mid {
    background: var(--bg-end); color: var(--ink-light);
  }
  .page-accueil .theme-dark .eyebrow,
  .page-accueil .theme-mid .eyebrow { color: var(--accent-light); }
}
