/* ==========================================================================
   The Loft Tres — design tokens (RYTHME)
   ========================================================================== */

:root {
  /* Rythme — décidé une fois, tenu partout */
  --ratio: 1.55;
  --duree: 500ms;

  --corps: 16px;
  --sous-titre: calc(var(--corps) * var(--ratio));
  --titre: calc(var(--sous-titre) * var(--ratio));
  --grand-titre: calc(var(--titre) * var(--ratio));

  /* Palette */
  --blanc: #FFFFFF;
  --texte: #171717;
  --texte-secondaire: #9B9488;
  --bleu-immersif: #173552;
  --accent: #F4D03F;

  /* Polices */
  --font-serif: 'Cormorant Garamond', 'Georgia', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Layout */
  --content-max: 1280px;
  --marge: 24px;
  --radius-photo: 6px;
}

@media (min-width: 768px) {
  :root { --marge: 40px; }
}
@media (min-width: 1440px) {
  :root { --marge: 64px; }
}

/* ==========================================================================
   Reset minimal
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--corps);
  line-height: 1.6;
  color: var(--texte);
  background: var(--blanc);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap;
}

.wrap {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--marge);
}

em, .italic { font-style: italic; }

/* ==========================================================================
   Typographie — tout découle de --corps via --ratio
   ========================================================================== */

.txt-corps        { font-size: var(--corps); }
.txt-sous-titre    { font-size: var(--sous-titre); }
.txt-titre         { font-size: var(--titre); }
.txt-grand-titre   { font-size: var(--grand-titre); }

h2.section-title {
  font-family: var(--font-serif);
  font-size: var(--titre);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0.01em;
}

/* ==========================================================================
   Loader (façon Soneva)
   ========================================================================== */

#loader {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: var(--blanc);
  transition: opacity var(--duree) ease, visibility var(--duree) ease;
}
#loader .mark {
  width: 40px; height: 40px;
  color: var(--bleu-immersif);
  animation: spin 1.4s linear infinite;
}
#loader.is-leaving .mark {
  animation: none;
  transform: translateY(24px);
  opacity: 0;
  transition: transform var(--duree) ease, opacity var(--duree) ease;
}
#loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
body.is-loading { overflow: hidden; }

/* ==========================================================================
   Navbar
   ========================================================================== */

.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  padding: 20px var(--marge);
  display: flex; align-items: center; justify-content: space-between;
  background: transparent;
  color: var(--blanc);
  transition: background var(--duree) ease, color var(--duree) ease, padding var(--duree) ease;
}
.navbar.is-scrolled {
  background: var(--blanc);
  color: var(--texte);
  padding-top: 14px;
  padding-bottom: 14px;
  box-shadow: 0 1px 0 rgba(23,23,23,0.06);
}
.navbar-brand {
  display: flex; align-items: center; gap: 10px;
}
.navbar-brand svg { width: 26px; height: 26px; color: currentColor; }
.navbar-brand-text {
  display: flex; flex-direction: column; line-height: 1.1;
}
.navbar-name {
  font-family: var(--font-serif);
  font-size: var(--sous-titre);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.navbar-domaine {
  font-family: var(--font-sans);
  font-size: calc(var(--corps) * 0.6);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--texte-secondaire);
  margin-top: 4px;
}
.navbar-right { display: flex; align-items: center; gap: 20px; }
.lang-select {
  font-size: calc(var(--corps) * 0.8);
  letter-spacing: 0.08em;
  color: currentColor;
  opacity: 0.45;
  cursor: default;
}
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: calc(var(--corps) * 0.8);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 13px 22px;
  border: 1px solid currentColor;
  transition: background var(--duree) ease, color var(--duree) ease, border-color var(--duree) ease;
}
.btn-fill {
  background: var(--blanc);
  color: var(--texte);
  border-color: var(--blanc);
}
.btn-fill:hover { background: var(--accent); border-color: var(--accent); color: var(--texte); }
.navbar.is-scrolled .btn-fill {
  background: var(--texte);
  color: var(--blanc);
  border-color: var(--texte);
}
.navbar.is-scrolled .btn-fill:hover { background: var(--accent); border-color: var(--accent); color: var(--texte); }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: flex-end;
  overflow: hidden;
}
.hero-media {
  position: absolute; inset: 0;
  background-image: url('../assets/photo/hero.png');
  background-size: cover;
  background-position: center 65%;
}
.hero-media::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 140px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0));
}
.hero-media::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.55), rgba(0,0,0,0) 55%);
}
.hero-content {
  position: relative; z-index: 2;
  color: var(--blanc);
  padding: 0 var(--marge) 90px;
  max-width: 780px;
}
.rating-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: calc(var(--corps) * 0.8);
  letter-spacing: 0.02em;
  padding: 7px 14px;
  border: 1px solid rgba(255,255,255,0.55);
  border-radius: 999px;
  margin-bottom: 20px;
}
.rating-badge .star { color: var(--accent); }
.hero-title {
  font-family: var(--font-serif);
  font-size: var(--grand-titre);
  line-height: 1.12;
  font-weight: 400;
  margin-bottom: 20px;
}
.hero-sub {
  font-family: var(--font-sans);
  font-size: var(--corps);
  color: rgba(255,255,255,0.86);
  max-width: 560px;
  margin-bottom: 32px;
}
.hero-content .btn { color: var(--texte); }

/* ==========================================================================
   Immersion (piscine / plage)
   ========================================================================== */

.immersion {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.immersion-media {
  position: absolute; inset: -8% -8%;
  background-size: cover;
  background-position: center;
  will-change: transform;
}
.immersion-piscine .immersion-media {
  background-image: url('../assets/photo/eau-piscine-turquoise-02.jpg');
  background-size: 120%;
  background-position: center;
}
.immersion-piscine::after {
  content: '';
  position: absolute; inset: 0;
  /* dégradé léger, plus sombre en bas → plus clair en haut, remplace le voile uni.
     Contraste mesuré sur le texte blanc à travers la hauteur de la section :
     minimum ~5.18:1 (haut), ~5.5:1 (centre, zone du texte), ~5.6:1 (bas) — tous > 4.5:1. */
  background: linear-gradient(to top, rgba(23, 53, 82, 0.35) 0%, rgba(23, 53, 82, 0.02) 100%);
}
.immersion-plage .immersion-media {
  background-image: url('../assets/photo/plage-pererenan.jpg');
}
.immersion-plage::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(23, 23, 23, 0.25);
}
.immersion-text {
  position: relative; z-index: 2;
  color: var(--blanc);
  font-family: var(--font-serif);
  font-size: var(--titre);
  line-height: 1.35;
  text-align: center;
  max-width: 880px;
  padding: 0 var(--marge);
}

/* ==========================================================================
   Reveal (titres de section — lettre par lettre, inchangé)
   ========================================================================== */

.reveal-char {
  opacity: 0.22;
  transition: opacity calc(var(--duree) * 0.6) ease;
}
.reveal-char.is-visible { opacity: 1; }

/* ==========================================================================
   Reveal (sections plein écran — ligne par ligne, au scroll)
   ========================================================================== */

.reveal-continuous {
  /* le paragraphe reste neutre : chaque mot de chaque ligne porte sa
     propre progression (voir .reveal-line-word), déterminée en JS par la
     position réelle de sa ligne dans la fenêtre. */
}
.reveal-line-word {
  display: inline-block;
  opacity: 0.35;
  font-weight: 400;
  transform: scale(0.97);
  transition: opacity calc(var(--duree) * 0.2) linear,
              font-weight calc(var(--duree) * 0.2) linear,
              transform calc(var(--duree) * 0.2) linear;
}

/* ==========================================================================
   Discover your loft
   ========================================================================== */

.loft-section { padding: 120px 0; }
.loft-intro {
  max-width: 720px;
  margin: 0 auto 64px;
  text-align: center;
}
.loft-intro h2 { margin-bottom: 24px; }
.loft-intro p {
  font-size: var(--corps);
  color: var(--texte-secondaire);
  line-height: 1.7;
}
.loft-lead {
  margin-bottom: 96px;
}
.loft-lead img {
  width: 100%;
  height: clamp(280px, 46vw, 560px);
  object-fit: cover;
  border-radius: var(--radius-photo);
}

.room-block {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  padding: 56px 0;
  border-top: 1px solid rgba(23,23,23,0.08);
}
.room-block:last-child { border-bottom: 1px solid rgba(23,23,23,0.08); }
.room-info h3 {
  font-family: var(--font-serif);
  font-size: var(--titre);
  font-weight: 400;
  margin-bottom: 14px;
}
.room-info p {
  color: var(--texte-secondaire);
  font-size: calc(var(--corps) * 0.94);
  line-height: 1.7;
}
.room-gallery {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 8px;
}
.room-gallery .room-large { grid-row: 1 / -1; height: 100%; min-height: 320px; }
.room-gallery .room-large img,
.room-gallery .room-small img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-photo); }
.room-gallery-small { display: grid; gap: 8px; }
.room-gallery-small.count-2 { grid-template-rows: 1fr 1fr; }
.room-gallery-small.count-3 { grid-template-rows: 1fr 1fr 1fr; }

@media (min-width: 768px) {
  .room-block { grid-template-columns: 280px 1fr; align-items: start; gap: 48px; }
  .room-info { position: sticky; top: 120px; }
}
@media (min-width: 1024px) {
  .room-block { grid-template-columns: 320px 1fr; gap: 64px; }
}

/* ==========================================================================
   Guest Reviews — carrousel
   ========================================================================== */

.reviews-section { padding: 120px 0; background: #FAF9F7; }
.reviews-section h2 { text-align: center; margin-bottom: 64px; }

.carousel { position: relative; }
.carousel-track-wrap { overflow: hidden; }
.carousel-track {
  display: flex;
  gap: 24px;
  transition: transform var(--duree) ease;
}
.review-card {
  flex: 0 0 100%;
  border: 1px solid var(--accent);
  padding: 28px;
  background: var(--blanc);
}
@media (min-width: 768px) {
  .review-card { flex: 0 0 calc((100% - 48px) / 3); }
}
.review-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.review-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--bleu-immersif); color: var(--blanc);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-size: calc(var(--corps) * 1.05);
  flex-shrink: 0;
}
.review-name { font-weight: 600; font-size: calc(var(--corps) * 0.95); }
.review-meta { font-size: calc(var(--corps) * 0.78); color: var(--texte-secondaire); }
.review-stars { color: var(--accent); margin-bottom: 10px; font-size: calc(var(--corps) * 0.9); letter-spacing: 2px; }
.review-text { font-size: calc(var(--corps) * 0.92); line-height: 1.65; }

.carousel-nav {
  display: flex; justify-content: center; gap: 16px; margin-top: 40px;
}
.carousel-btn {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--texte); background: transparent;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--duree) ease, color var(--duree) ease;
}
.carousel-btn:hover { background: var(--texte); color: var(--blanc); }
.carousel-btn:disabled { opacity: 0.3; cursor: default; }
.carousel-btn:disabled:hover { background: transparent; color: var(--texte); }

/* ==========================================================================
   Book direct
   ========================================================================== */

.book-section {
  position: relative;
  padding: 140px 0;
  color: var(--blanc);
  overflow: hidden;
}
.book-media {
  position: absolute; inset: 0;
  background-image: url('../assets/photo/salon-05.jpg');
  background-size: cover; background-position: center;
}
.book-media::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(23, 23, 23, 0.72);
}
.book-content { position: relative; z-index: 2; text-align: center; max-width: 760px; margin: 0 auto; }
.book-content h2 { font-size: var(--grand-titre); margin-bottom: 24px; }
.book-content .book-sub {
  font-size: var(--corps);
  color: rgba(255,255,255,0.85);
  max-width: 560px; margin: 0 auto 40px;
}
.book-content .btn { margin-bottom: 64px; }
.book-content .btn-fill { color: var(--texte); }

.conditions-list {
  list-style: none; padding: 0; margin: 0 0 64px;
  display: grid; gap: 14px;
  text-align: left;
  max-width: 620px; margin-left: auto; margin-right: auto;
  border-top: 1px solid rgba(255,255,255,0.2);
  padding-top: 32px;
}
.conditions-list li {
  font-size: calc(var(--corps) * 0.92);
  color: rgba(255,255,255,0.85);
  display: flex; gap: 12px;
}
.conditions-list li::before { content: '—'; color: var(--accent); flex-shrink: 0; }

.faq { text-align: left; max-width: 620px; margin: 0 auto; }
.faq-item { border-top: 1px solid rgba(255,255,255,0.2); padding: 22px 0; }
.faq-item:last-child { border-bottom: 1px solid rgba(255,255,255,0.2); }
.faq-q { font-family: var(--font-serif); font-size: var(--sous-titre); margin-bottom: 10px; }
.faq-a { font-size: calc(var(--corps) * 0.92); color: rgba(255,255,255,0.8); line-height: 1.6; }

/* ==========================================================================
   Footer
   ========================================================================== */

footer {
  background: var(--texte); color: rgba(255,255,255,0.75);
  padding: 72px 0 32px;
}
.footer-grid {
  display: grid; gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.14);
  margin-bottom: 28px;
}
@media (min-width: 768px) {
  .footer-grid { grid-template-columns: 1.2fr 1fr 1fr; }
}
.footer-name {
  font-family: var(--font-serif);
  color: var(--blanc);
  font-size: var(--sous-titre);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.footer-col p { font-size: calc(var(--corps) * 0.9); line-height: 1.7; }
.footer-col h4 {
  color: var(--blanc);
  font-size: calc(var(--corps) * 0.78);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.footer-col a { font-size: calc(var(--corps) * 0.9); }
.footer-col a:hover { color: var(--accent); }
.social-row { display: flex; gap: 14px; margin-top: 18px; }
.social-icon {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center;
  opacity: 0.35;
}
.social-icon svg { width: 16px; height: 16px; }
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: 8px 16px;
  justify-content: space-between;
  font-size: calc(var(--corps) * 0.72);
  color: rgba(255,255,255,0.5);
}
.footer-bottom .legal-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-bottom a:hover { color: var(--accent); }

/* ==========================================================================
   Pastille de contact flottante
   ========================================================================== */

.contact-pill {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 900;
  display: flex;
  align-items: center;
  background: var(--texte);
  border-radius: 999px;
  padding: 4px;
  box-shadow: 0 8px 24px rgba(23,23,23,0.22);
  overflow: hidden;
  transition: bottom var(--duree) ease;
}
.contact-pill-label {
  display: inline-block;
  color: var(--blanc);
  font-size: calc(var(--corps) * 0.85);
  letter-spacing: 0.02em;
  white-space: nowrap;
  max-width: 0;
  opacity: 0;
  padding-left: 0;
  transition: max-width var(--duree) ease, opacity calc(var(--duree) * 0.7) ease, padding-left var(--duree) ease;
}
.contact-pill:hover .contact-pill-label,
.contact-pill:focus-visible .contact-pill-label {
  max-width: 160px;
  opacity: 1;
  padding-left: 18px;
}
.contact-pill-photo {
  width: 75px; height: 75px; border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--accent);
  flex-shrink: 0;
}
.contact-pill-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

@media (max-width: 767px) {
  .contact-pill { right: 16px; bottom: 16px; }
  .contact-pill-photo { width: 64px; height: 64px; }
}

/* ==========================================================================
   Lightbox galerie
   ========================================================================== */

.room-gallery img { cursor: pointer; }

@media (hover: hover) {
  .room-gallery img {
    transition: filter calc(var(--duree) * 0.4) ease;
  }
  .room-gallery img:hover {
    filter: brightness(0.9);
  }
}

.lightbox {
  position: fixed; inset: 0; z-index: 3000;
  background: rgba(10, 10, 10, 0.92);
  display: flex; align-items: center; justify-content: center;
}
.lightbox[hidden] { display: none; }
body.lightbox-open { overflow: hidden; }

.lightbox-stage { max-width: 92vw; max-height: 88vh; }
.lightbox-img {
  display: block;
  max-width: 92vw; max-height: 88vh;
  width: auto; height: auto;
  object-fit: contain;
  margin: 0 auto;
}

.lightbox-close, .lightbox-prev, .lightbox-next {
  position: fixed;
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.35);
  color: var(--blanc);
  display: flex; align-items: center; justify-content: center;
  font-size: calc(var(--corps) * 1.1);
  transition: background var(--duree) ease;
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover { background: rgba(255,255,255,0.22); }
.lightbox-close { top: 24px; right: 24px; }
.lightbox-prev { left: 24px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 24px; top: 50%; transform: translateY(-50%); }

@media (max-width: 767px) {
  .lightbox-prev { left: 12px; }
  .lightbox-next { right: 12px; }
  .lightbox-close { top: 12px; right: 12px; }
}

/* ==========================================================================
   Pages légales
   ========================================================================== */

.legal-page { padding: 160px 0 100px; max-width: 760px; margin: 0 auto; }
.legal-page h1 {
  font-family: var(--font-serif);
  font-size: var(--grand-titre);
  margin-bottom: 40px;
}
.legal-page h2 {
  font-family: var(--font-serif);
  font-size: var(--titre);
  font-weight: 400;
  margin: 48px 0 16px;
}
.legal-page p, .legal-page li { font-size: var(--corps); line-height: 1.75; color: var(--texte); }
.legal-page ul { padding-left: 20px; }
.legal-page a { text-decoration: underline; }
.back-link { display: inline-block; margin-bottom: 40px; font-size: calc(var(--corps) * 0.9); text-decoration: underline; }

/* ==========================================================================
   Responsive — 375 / 768 / 1024 / 1440
   ========================================================================== */

@media (max-width: 767px) {
  .navbar-domaine { display: none; }
  .hero-title { font-size: calc(var(--titre) * 1.1); }
  .immersion-text { font-size: var(--sous-titre); }
  .loft-section { padding: 72px 0; }
  .room-gallery { grid-template-columns: 1fr; }
  .room-gallery .room-large { min-height: 220px; }
  .room-gallery-small.count-2 { grid-template-columns: 1fr 1fr; grid-template-rows: none; }
  .room-gallery-small.count-3 { grid-template-columns: 1fr 1fr 1fr; grid-template-rows: none; }
  .book-content h2 { font-size: var(--titre); }
  .conditions-list, .faq { text-align: left; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .review-card { flex: 0 0 calc((100% - 48px) / 3); }
}
