/* =============================================================
   scroll.css : styles de la version « scrollytelling » de l'accueil
   (index.html). Se charge APRÈS style.css et ne fait que
   compléter / surcharger. style.css n'est pas modifié.

   Principe : par défaut (sans JS, ou avec « réduire les animations »),
   tout s'affiche normalement, empilé. Les effets ne s'activent que si
   scroll.js ajoute ses classes (sc-anim, sc-h, sc-marquee...).
   ============================================================= */

/* ---------- Réglages visuels faciles à changer ---------- */
:root {
  --sc-chemin: var(--terracotta);   /* couleur du chemin et du point */
  --sc-chemin-epaisseur: 2px;       /* épaisseur du chemin */
  --sc-rayon-grand: 28px;           /* arrondi des grandes photos et cartes */
}

/* Le site n'a jamais de défilement horizontal (le bandeau d'avis dépasse) */
html, body { overflow-x: clip; }

/* Lenis (défilement fluide) gère lui-même la douceur : on coupe celle du CSS */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Chaque section passe au-dessus du chemin (le chemin se glisse « dessous ») */
.sc-page section > .container,
.sc-page section > .sc-track-zone,
.sc-page section > .sc-reviews { position: relative; z-index: 2; }

/* Éléments qui apparaissent au scroll : cachés seulement si les
   animations sont actives (classe ajoutée dans le <head>). */
.sc-anim [data-reveal],
.sc-anim [data-geo],
.sc-anim [data-geo-pin] { opacity: 0; }

/* ---------- Barre de progression ---------- */
.sc-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--terracotta);
  transform: scaleX(0);
  transform-origin: 0 50%;
  z-index: 70;
  pointer-events: none;
}

/* ---------- Menu : fixe, se cache en descendant ---------- */
.sc-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  transition: transform .35s ease;
}
.sc-nav.is-hidden { transform: translateY(-100%); }
@media (prefers-reduced-motion: reduce) { .sc-nav { transition: none; } }

/* ---------- Le chemin ---------- */
.sc-path {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 0;            /* hauteur donnée par scroll.js */
  z-index: 1;
  pointer-events: none;
  overflow: visible;
}
.sc-path-line {
  fill: none;
  stroke: var(--sc-chemin);
  stroke-width: var(--sc-chemin-epaisseur);
  stroke-linecap: round;
  opacity: .55;
}
.sc-path-dot {
  position: absolute;
  top: 0; left: 0;
  width: 12px; height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--sc-chemin);
  box-shadow: 0 0 0 5px rgba(92, 26, 43, .15), 0 0 18px 4px rgba(140, 67, 86, .55);
  z-index: 1;
  pointer-events: none;
  opacity: 0;
}
.sc-waypoint { display: block; height: 0; }

/* =============================================================
   SCÈNE 1 : ARRIVÉE
   ============================================================= */
.sc-hero {
  position: relative;
  z-index: 3;                 /* passe au-dessus du chemin */
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  display: flex;
  align-items: flex-end;
  background: var(--sable);
  color: var(--blanc);
  overflow: hidden;
}
/* Cadre de la photo : arrondi, il dézoome au scroll (transform: scale) */
.sc-hero-frame {
  position: absolute;
  inset: 0;
  border-radius: var(--sc-rayon-grand);
  overflow: hidden;
  background: var(--marine);
  will-change: transform;
}
.sc-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: transform;
}
/* Voile sombre pour la lisibilité du texte blanc */
.sc-hero-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,10,10,.15) 0%, rgba(10,10,10,.25) 45%, rgba(10,10,10,.68) 100%);
}
/* Sans JS : on garde la photo plein cadre, sans arrondi */
html:not(.sc-anim) .sc-hero-frame { border-radius: 0; }

.sc-hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding-bottom: clamp(48px, 10vh, 110px);
}
.sc-hero h1 {
  color: var(--blanc);
  font-size: clamp(3rem, 11vw, 8.5rem);
  line-height: .95;
  letter-spacing: -.02em;
  margin-bottom: .25em;
}
.sc-hero p {
  max-width: 600px;
  color: #eef0f0;
  font-size: 1.05rem;
  margin: 0 0 28px;
}
.sc-hero .hero-eyebrow { display: block; color: #f1d6dc; }

/* Petite flèche « scrollez » */
.sc-scroll-hint {
  position: absolute;
  right: clamp(20px, 4vw, 48px);
  bottom: clamp(48px, 10vh, 110px);
  z-index: 2;
  width: 26px; height: 42px;
  border: 2px solid rgba(255,255,255,.7);
  border-radius: 14px;
}
.sc-scroll-hint span {
  position: absolute;
  left: 50%; top: 8px;
  width: 4px; height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--blanc);
  animation: sc-hint 1.6s ease-in-out infinite;
}
@keyframes sc-hint {
  0% { transform: translateY(0); opacity: 1; }
  80% { transform: translateY(14px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}
@media (max-width: 767px) { .sc-scroll-hint { display: none; } }

/* =============================================================
   SCÈNE 2 : AMBIANCE
   ============================================================= */
.sc-ambiance { padding: 120px 0 140px; overflow: hidden; }
.sc-ambiance-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
  align-items: center;
}
.sc-amb-photo { margin: 0; border-radius: var(--sc-rayon-grand); overflow: hidden; box-shadow: var(--ombre); }
.sc-amb-photo img { width: 100%; height: 100%; object-fit: cover; }
.sc-amb-a { grid-column: 1 / span 4; grid-row: 1 / span 2; aspect-ratio: 3 / 4; }
.sc-amb-b { grid-column: 9 / span 4; grid-row: 1 / span 2; aspect-ratio: 3 / 4; margin-top: 160px; }
.sc-amb-c { grid-column: 5 / span 3; grid-row: 2; aspect-ratio: 4 / 5; margin-top: 40px; }
.sc-accroche {
  grid-column: 5 / span 4;
  grid-row: 1;
  align-self: end;
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: clamp(1.6rem, 2.6vw, 2.3rem);
  line-height: 1.2;
  color: var(--marine);
  margin: 0;
  text-align: center;
}
/* Chaque mot (découpé par scroll.js) part en semi-transparent */
.sc-word { display: inline-block; }

@media (max-width: 767px) {
  .sc-ambiance { padding: 80px 0; }
  .sc-ambiance-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .sc-accroche { grid-column: 1 / -1; grid-row: 1; margin-bottom: 24px; }
  .sc-amb-a { grid-column: 1; grid-row: 2; }
  .sc-amb-b { grid-column: 2; grid-row: 2; margin-top: 60px; }
  .sc-amb-c { grid-column: 1 / -1; grid-row: 3; aspect-ratio: 16 / 10; margin-top: 0; }
}

/* =============================================================
   SCÈNE 3 : NOS LOGEMENTS
   Par défaut : cartes empilées (mobile, sans JS, mouvement réduit).
   Classe .sc-h (ajoutée par scroll.js sur grand écran) : une rangée
   horizontale qui défile pendant que la section est épinglée.
   ============================================================= */
.sc-logements {
  position: relative;
  z-index: 3;             /* passe au-dessus du chemin pendant l'épinglage */
  background: var(--sable);
  padding: 100px 0 60px;
}
.sc-logements-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
}
.sc-logements-head .section-head { margin-bottom: 30px; }
.sc-counter {
  display: none;          /* utile seulement en mode horizontal */
  font-family: 'Fraunces', serif;
  font-size: 1.1rem;
  color: var(--marine);
  margin-bottom: 34px;
  white-space: nowrap;
}
.sc-counter-num { font-size: 2rem; color: var(--terracotta); }
.sc-counter-bar {
  display: block;
  width: 120px; height: 2px;
  margin-top: 8px;
  background: var(--sable-fonce);
  overflow: hidden;
}
.sc-counter-bar span {
  display: block;
  height: 100%;
  background: var(--terracotta);
  transform: scaleX(.3333);
  transform-origin: 0 50%;
}

.sc-track {
  display: grid;
  gap: 28px;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}
.hs-card {
  display: grid;
  grid-template-columns: 1fr;
  background: var(--blanc);
  border-radius: var(--sc-rayon-grand);
  overflow: hidden;
  box-shadow: var(--ombre);
}
.hs-media { aspect-ratio: 4 / 3; background: var(--sable-fonce); }
.hs-media img { width: 100%; height: 100%; object-fit: cover; }
.hs-body { position: relative; padding: 28px 26px 26px; }
.hs-num {
  display: block;
  font-family: 'Fraunces', serif;
  font-size: .95rem;
  color: var(--terracotta);
  letter-spacing: .1em;
  margin-bottom: 10px;
}
.hs-body .category-title { flex-wrap: wrap; margin-bottom: 14px; }
.hs-body h3 { font-size: clamp(1.3rem, 2.2vw, 1.8rem); margin: 0; }
.hs-body .category-cta { margin-bottom: 18px; }
/* Mini-galerie : 5 vignettes sur une ligne (main.js la remplit) */
.hs-card .photo-bento { grid-template-columns: repeat(5, 1fr); grid-auto-rows: 62px; gap: 8px; }
.hs-card .photo-bento .photo-thumb:first-child { grid-column: auto; grid-row: auto; }
.hs-card .photo-thumb { border-radius: 10px; }
.hs-card .photo-thumb.more::after { font-size: .72rem; }

/* --- Mode horizontal (grand écran, animations actives) --- */
.sc-h .sc-logements { height: 100vh; height: 100svh; padding: 90px 0 0; overflow: hidden; }
.sc-h .sc-counter { display: block; }
.sc-h .sc-track {
  display: flex;
  gap: 36px;
  max-width: none;
  width: max-content;
  /* aligne la 1re carte sur la marge du contenu */
  padding: 0 max(20px, calc((100vw - 1140px) / 2 + 20px));
  will-change: transform;
}
.sc-h .hs-card {
  width: min(1040px, 80vw);
  height: min(600px, calc(100svh - 270px));
  grid-template-columns: 1.05fr 1fr;
}
.sc-h .hs-media { aspect-ratio: auto; height: 100%; overflow: hidden; }
.sc-h .hs-media img { will-change: transform; }
.sc-h .hs-body { padding: clamp(22px, 3.5vh, 40px) 36px; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.sc-h .hs-body .category-note { font-size: .9rem; }
.sc-h .hs-num { font-size: 3.2rem; line-height: 1; color: var(--sable-fonce); margin-bottom: 6px; }

/* Grand écran sans animation (ou sans JS) : photo à gauche, texte à droite */
@media (min-width: 1024px) {
  html:not(.sc-h) .hs-card { grid-template-columns: 1fr 1fr; }
  html:not(.sc-h) .hs-media { aspect-ratio: auto; min-height: 420px; position: relative; }
  /* la photo remplit la colonne sans en décider la hauteur (pas de saut au chargement) */
  html:not(.sc-h) .hs-media img { position: absolute; inset: 0; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .sc-track { grid-template-columns: 1fr 1fr; }
  .sc-track .hs-card:last-child { grid-column: 1 / -1; }
}

/* =============================================================
   SCÈNE 4 : AVIS
   ============================================================= */
.sc-avis { position: relative; padding: 110px 0 90px; }
.sc-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  margin: -10px 0 40px;
  padding: 10px 22px 10px 18px;
  background: var(--blanc);
  border-radius: 999px;
  box-shadow: var(--ombre);
  font-weight: 600;
  color: var(--marine);
}
.sc-count {
  font-family: 'Fraunces', serif;
  font-size: 2rem;
  line-height: 1;
  color: var(--terracotta);
  min-width: 1.3em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.sc-reviews { max-width: 1140px; margin: 0 auto; padding: 0 20px; }

/* --- Bandeau défilant (classe ajoutée par scroll.js) --- */
.sc-marquee.sc-reviews { max-width: none; padding: 0; overflow: hidden; }
.sc-marquee .reviews-grid {
  display: flex;
  width: max-content;
  gap: 0;
  will-change: transform;
  padding: 10px 0 30px;
}
.sc-marquee .review-card {
  width: 330px;
  flex: 0 0 auto;
  margin-right: 20px;    /* marge (et pas gap) pour une boucle parfaite */
}
.sc-marquee .reviews-grid:hover { cursor: default; }

/* =============================================================
   SCÈNE 5 : OÙ NOUS TROUVER
   ============================================================= */
.sc-locate { position: relative; }
.sc-geo {
  position: relative;
  height: 210px;
  margin: 0 0 44px;
}
.sc-geo-coast {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.sc-geo-coast path {
  fill: none;
  stroke: var(--marine);
  stroke-width: 1.5;
  stroke-dasharray: 6 8;
  opacity: .35;
  vector-effect: non-scaling-stroke;
}
.sc-geo-mark {
  position: absolute;
  top: 46%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--blanc);
  border-radius: 999px;
  box-shadow: var(--ombre);
  font-size: .9rem;
  font-weight: 600;
  color: var(--marine);
  white-space: nowrap;
}
.sc-geo-west { left: 4%; }
.sc-geo-east { right: 6%; top: 52%; }
.sc-geo-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--terracotta); }
.sc-geo-pin {
  position: absolute;
  left: 50%;
  top: 8%;
  width: 34px;
  margin-left: -17px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.sc-geo-pin svg path { fill: var(--terracotta); }
.sc-geo-pin svg circle { fill: var(--sable); }
.sc-geo-label {
  margin-top: 8px;
  font-family: 'Fraunces', serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--marine);
  white-space: nowrap;
}
/* Onde qui pulse sous le pin */
.sc-geo-ring {
  position: absolute;
  top: 34px;
  left: 50%;
  width: 40px; height: 14px;
  margin-left: -20px;
  border-radius: 50%;
  border: 2px solid var(--terracotta);
  animation: sc-ring 2.2s ease-out infinite;
}
@keyframes sc-ring {
  0% { transform: scale(.4); opacity: .8; }
  100% { transform: scale(2.4); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .sc-geo-ring, .sc-scroll-hint span { animation: none; }
}
@media (max-width: 767px) {
  .sc-geo { height: 230px; }
  .sc-geo-west { left: 0; top: auto; bottom: 34px; font-size: .8rem; }
  .sc-geo-east { right: 0; top: auto; bottom: 0; font-size: .8rem; }
  .sc-geo-pin { top: 0; }
}

/* =============================================================
   SCÈNE 6 : CONTACT (coucher de soleil)
   ============================================================= */
.sc-contact {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  padding: 120px 0;
  overflow: hidden;
  background: var(--sable);
}
/* Le dégradé « coucher de soleil » : son opacité monte au scroll */
.sc-sunset {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #fafaf7 0%, #f3e0d2 35%, #e8b49d 70%, #b8645f 90%, #5c1a2b 100%);
}
/* Sans animation : le dégradé est déjà là */
.sc-anim .sc-sunset { opacity: 0; }
.sc-sun {
  position: absolute;
  left: 50%;
  bottom: -120px;
  width: 520px; height: 520px;
  margin-left: -260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 214, 170, .9) 0%, rgba(240, 160, 120, .45) 40%, rgba(240, 160, 120, 0) 70%);
  pointer-events: none;
}
.sc-contact .container { text-align: center; }
.sc-contact .section-head { margin: 0 auto 36px; }
.sc-contact h2 { font-size: clamp(2rem, 4.5vw, 3.4rem); }
.sc-contact .section-head p { color: #3d3330; }
.sc-contact-actions { justify-content: center; }
.sc-contact-actions .btn-outline { background: rgba(255,255,255,.55); }


/* =============================================================
   REPÈRES POUR LES VISITEURS PEU HABITUÉS AU SCROLL
   ============================================================= */

/* --- Logements : indicateur 1/3 + petit texte d'aide --- */
.sc-counter-box { display: none; margin-bottom: 30px; max-width: 250px; text-align: right; }
.sc-h .sc-counter-box { display: block; }
.sc-counter-box .sc-counter { margin-bottom: 8px; display: inline-block; text-align: left; }
.sc-counter-hint { margin: 0; font-size: .8rem; line-height: 1.4; color: #6b6b6b; }

/* --- Logements : grosses flèches précédent / suivant --- */
.sc-track-zone { position: relative; }
.sc-arrow {
  display: none;                  /* seulement en mode horizontal (grand écran) */
  position: absolute;
  top: 50%;
  z-index: 4;
  width: 60px; height: 60px;
  margin-top: -30px;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: var(--sable);
  color: #5C1A2B;
  font-size: 1.7rem;
  line-height: 1;
  box-shadow: 0 6px 20px rgba(10, 10, 10, .18);
  cursor: pointer;
  transition: opacity .3s ease, visibility .3s, background-color .2s ease, color .2s ease;
}
.sc-h .sc-arrow { display: flex; }
.sc-arrow-prev { left: 24px; }
.sc-arrow-next { right: 24px; }
/* Au survol : fond bordeaux, flèche ivoire */
.sc-arrow:hover { background: #5C1A2B; color: #FAFAF7; }
.sc-arrow:focus-visible,
.sc-down:focus-visible { outline: 3px solid #5C1A2B; outline-offset: 4px; }
.sc-arrow.is-off { opacity: 0; visibility: hidden; pointer-events: none; }

/* --- Hero : « Faites défiler pour découvrir la résidence ↓ » --- */
.sc-hero-hint {
  margin: 22px 0 0;
  font-size: .85rem;
  color: rgba(255, 255, 255, .85);
  transition: opacity .5s ease;
}
.sc-hero-hint.is-hidden { opacity: 0; }

/* --- Flèche « Descendre » fixe, à droite et centrée --- */
.sc-down {
  position: fixed;
  right: 22px;
  top: 50%;
  z-index: 55;
  margin-top: -40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 10px 9px;
  border: none;
  border-radius: 999px;
  background: var(--sable);   /* opaque : le texte derrière ne se voit pas à travers */
  box-shadow: 0 6px 20px rgba(10, 10, 10, .14);
  color: #5C1A2B;
  cursor: pointer;
  transition: opacity .5s ease, visibility .5s;
}
.sc-down[hidden] { display: none; }
.sc-down-arrow {
  font-size: 1.6rem;
  line-height: 1;
  animation: sc-rebond 2.4s ease-in-out infinite;   /* rebond lent */
}
.sc-down-text { font-size: .68rem; font-weight: 600; letter-spacing: .02em; }
.sc-down.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
@keyframes sc-rebond {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}
@media (prefers-reduced-motion: reduce) {
  .sc-down-arrow { animation: none; }
}
/* Mobile : en bas au centre, plus petite */
@media (max-width: 767px) {
  .sc-down {
    top: auto;
    right: auto;
    left: 50%;
    bottom: 12px;
    margin: 0 0 0 -34px;
    width: 68px;
    padding: 6px 6px 6px;
    gap: 3px;
  }
  .sc-down-arrow { font-size: 1.2rem; }
  .sc-down-text { font-size: .6rem; }
}
