/* Hero */
.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: max(560px, 100svh);
  padding: 120px var(--gutter) 44px;
  overflow: clip;
  isolation: isolate;
  color: var(--white);
  view-timeline-name: --hero;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
}

.hero::before { background: url("../images/ua-pou-wideview.webp") center 30% / cover no-repeat; }

.hero::after {
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0) 55%, rgba(15, 30, 20, 0.6) 100%);
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .hero::before {
      animation: hero-parallax linear both;
      animation-timeline: --hero;
      animation-range: exit 0% exit 100%;
    }
  }
}

@keyframes hero-parallax {
  to { transform: translateY(30%); }
}

.hero-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  width: 100%;
}

.hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3rem, 7vw, 4.6rem);
  line-height: 1;
  letter-spacing: -0.015em;
}

.hero-title em { color: var(--cream); }

.hero-title-line {
  display: block;
  overflow: clip;
  padding: 0 0.1em 0.1em 0;
  margin-bottom: -0.1em;
}

.hero-title-line > * { display: block; }

@media (prefers-reduced-motion: no-preference) {
  .hero-title-line > * { animation: hero-title-rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both; }
  .hero-title-line + .hero-title-line > * { animation-delay: 0.35s; }
  .hero .eyebrow { animation: hero-fade-rise 0.6s ease-out both; }
  .hero-aside { animation: hero-fade-rise 0.6s ease-out 0.7s both; }
}

@keyframes hero-title-rise {
  from { transform: translateY(115%); }
}

@keyframes hero-fade-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.hero-aside {
  max-width: 17rem;
  margin-bottom: 4px;
  font-size: 0.95rem;
  line-height: 1.55;
  text-wrap: pretty;
}

.hero-aside p { margin: 0 0 16px; }

/* Welcome */
.welcome-band {
  position: relative;
  isolation: isolate;
  background: radial-gradient(ellipse 60% 70% at 85% 40%, rgba(163, 203, 160, 0.07), transparent 70%);
}

.welcome-band::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.06;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.welcome {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 64px;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 88px var(--gutter) 104px;
}

.welcome-greeting {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(3.2rem, 7vw, 4.75rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--green-mint);
}

.welcome-title {
  margin: 16px 0 24px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.6rem, 3vw, 2rem);
  line-height: 1.2;
  text-wrap: balance;
}

.welcome-text p:not(.welcome-greeting) {
  max-width: 62ch;
  margin: 0 0 20px;
  font-size: 1rem;
  line-height: 1.7;
  opacity: 0.88;
  text-wrap: pretty;
}

.welcome-text .button { margin-top: 4px; }

/* Environ la hauteur du texte à côté : 430px de large, cadre compris. */
.polaroid {
  justify-self: center;
  width: 100%;
  max-width: 430px;
  margin: 0;
  padding: 14px 14px 56px;
  background: var(--cream);
  transform: rotate(2.5deg);
  box-shadow: 0 30px 60px rgba(var(--shadow-tint), 0.55), 0 4px 10px rgba(var(--shadow-tint), 0.3);
}

.polaroid img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  .welcome-text > * {
    animation: slide-from-left 0.7s cubic-bezier(0.22, 1, 0.36, 1) calc(var(--reveal-step) * 0.1s) both paused;
  }

  .welcome .polaroid { animation: polaroid-from-right 0.9s cubic-bezier(0.34, 1.4, 0.64, 1) 0.3s both paused; }

  .lodging-text > * {
    animation: slide-from-right 0.7s cubic-bezier(0.22, 1, 0.36, 1) calc(var(--reveal-step) * 0.1s) both paused;
  }

  /* backwards et non both : le survol des polaroids doit pouvoir reprendre la main sur transform */
  .lodging-polaroid {
    animation: polaroid-from-left 0.9s cubic-bezier(0.34, 1.4, 0.64, 1) calc(0.3s + var(--reveal-step) * 0.15s) backwards paused;
  }

  :is(.welcome-text, .lodging-text) > :nth-child(1),
  .lodging-polaroid:nth-child(1) { --reveal-step: 0; }
  :is(.welcome-text, .lodging-text) > :nth-child(2),
  .lodging-polaroid:nth-child(2) { --reveal-step: 1; }
  :is(.welcome-text, .lodging-text) > :nth-child(3),
  .lodging-polaroid:nth-child(3) { --reveal-step: 2; }
  :is(.welcome-text, .lodging-text) > :nth-child(4) { --reveal-step: 3; }
  :is(.welcome-text, .lodging-text) > :nth-child(5) { --reveal-step: 4; }

  .welcome.is-visible .welcome-text > *,
  .welcome.is-visible .polaroid,
  .lodging-inner.is-visible .lodging-text > *,
  .lodging-inner.is-visible .lodging-polaroid { animation-play-state: running; }
}

@keyframes slide-from-left { from { opacity: 0; transform: translateX(-32px); } }
@keyframes slide-from-right { from { opacity: 0; transform: translateX(32px); } }
@keyframes polaroid-from-right { from { opacity: 0; transform: translateX(48px) rotate(8deg); } }
@keyframes polaroid-from-left { from { opacity: 0; transform: translateX(-48px) rotate(-8deg); } }

/* Lodging */
.lodging {
  background: var(--cream);
  color: var(--green-dark);
}

.lodging-inner {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  grid-template-areas: "photos text";
  align-items: center;
  gap: 48px 72px;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 96px var(--gutter) 120px;
}

.lodging-text { grid-area: text; }

.lodging-eyebrow { color: var(--green-leaf); }

.lodging-title {
  margin: 0 0 24px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 4.2vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.lodging-text p:not(.eyebrow) {
  max-width: 62ch;
  margin: 0 0 28px;
  font-size: 1rem;
  line-height: 1.7;
  text-wrap: pretty;
}

.lodging-facts {
  margin: 0 0 32px;
  border-top: 1px solid rgba(var(--shadow-tint), 0.15);
}

.lodging-facts div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(var(--shadow-tint), 0.15);
}

.lodging-facts dt { font-size: 0.95rem; }

.lodging-facts dd {
  margin: 0;
  font-family: var(--font-hand);
  font-size: 1.15rem;
  text-align: right;
  color: var(--green-leaf);
}

.lodging-photos {
  grid-area: photos;
  display: grid;
  grid-template-columns: 3fr 2fr;
  grid-template-rows: auto auto;
  gap: 20px;
}

.lodging-polaroid {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 12px 12px 0;
  background: var(--white);
  box-shadow: 0 18px 40px rgba(var(--shadow-tint), 0.18), 0 2px 6px rgba(var(--shadow-tint), 0.08);
  transition: transform 0.4s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.lodging-polaroid:nth-child(1) { grid-row: span 2; transform: rotate(-2deg); }
.lodging-polaroid:nth-child(2) { transform: rotate(2deg); }
.lodging-polaroid:nth-child(3) { transform: rotate(-1deg); }
.lodging-polaroid:hover { position: relative; transform: rotate(0) scale(1.03); }

.lodging-polaroid img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.lodging-polaroid:nth-child(1) img {
  flex: 1;
  min-height: 0;
  aspect-ratio: auto;
}

.lodging-polaroid figcaption {
  padding: 8px 0 12px;
  font-family: var(--font-hand);
  font-size: 1.1rem;
  text-align: center;
}

@media (scripting: enabled) {
  .lodging-polaroid figcaption {
    align-self: center;
    clip-path: inset(0 100% 0 -8px);
    transition: clip-path 0.9s ease-out 1.1s;
  }

  .lodging-polaroid:nth-child(2) figcaption { transition-delay: 1.25s; }
  .lodging-polaroid:nth-child(3) figcaption { transition-delay: 1.4s; }
  .lodging-inner.is-visible .lodging-polaroid figcaption { clip-path: inset(0 -8px 0 -8px); }
}

.lodging-text .link-underline {
  font-size: 0.95rem;
  border-bottom-color: var(--green-leaf);
}

/* Gallery */
.gallery {
  background: var(--cream);
  color: var(--green-dark);
}

.gallery-inner {
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 96px var(--gutter) 120px;
}

.gallery-eyebrow { color: var(--green-leaf); }

.gallery-title {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 4.2vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.gallery-intro {
  max-width: 62ch;
  margin: 0;
  font-size: 1rem;
  line-height: 1.7;
  opacity: 0.88;
  text-wrap: pretty;
}

.gallery-mosaic {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: clamp(140px, 17vw, 220px);
  gap: 16px;
  margin-top: 40px;
}

.gallery-photo {
  margin: 0;
  border-radius: 8px;
  overflow: hidden;
}

.gallery-photo:first-child {
  grid-column: span 2;
  grid-row: span 2;
}

.gallery-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gallery-photo:hover img { transform: scale(1.04); }

.gallery-cta {
  margin-top: 40px;
  text-align: center;
}

.gallery-cta .link-underline {
  font-size: 0.95rem;
  border-bottom-color: var(--green-leaf);
}

@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  .gallery-inner > :is(.gallery-eyebrow, .gallery-title, .gallery-intro) {
    animation: slide-from-left 0.7s cubic-bezier(0.22, 1, 0.36, 1) calc(var(--reveal-step) * 0.1s) both paused;
  }
  .gallery-eyebrow { --reveal-step: 0; }
  .gallery-title { --reveal-step: 1; }
  .gallery-intro { --reveal-step: 2; }
  .gallery-photo:nth-child(1) { --reveal-step: 0; }
  .gallery-photo:nth-child(2) { --reveal-step: 1; }
  .gallery-photo:nth-child(3) { --reveal-step: 2; }
  .gallery-photo:nth-child(4) { --reveal-step: 3; }
  .gallery-photo:nth-child(5) { --reveal-step: 4; }
  .gallery-photo:nth-child(6) { --reveal-step: 5; }
  .gallery-photo:nth-child(7) { --reveal-step: 6; }
  .gallery-photo:nth-child(8) { --reveal-step: 7; }
  .gallery-photo:nth-child(9) { --reveal-step: 8; }

  .gallery-photo {
    animation: gallery-rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) calc(0.3s + var(--reveal-step) * 0.06s) both paused;
  }

  .gallery-cta { animation: gallery-fade 0.5s ease 1.2s both paused; }

  .gallery-inner.is-visible > :is(.gallery-eyebrow, .gallery-title, .gallery-intro),
  .gallery-inner.is-visible .gallery-photo,
  .gallery-inner.is-visible .gallery-cta { animation-play-state: running; }
}

@keyframes gallery-rise { from { opacity: 0; transform: translateY(16px) scale(0.96); } }
@keyframes gallery-fade { from { opacity: 0; } }

/* Reviews */
.reviews {
  background: var(--green-dark);
  color: var(--cream);
}

.reviews-inner {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  align-items: center;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 96px var(--gutter) 112px;
}

.review { margin: 0; }

.review-rating {
  margin: 0 0 16px;
  font-size: 1rem;
  letter-spacing: 0.15em;
  color: var(--green-mint);
}

.reviews-side .review-rating {
  margin-bottom: 8px;
  font-size: 0.8rem;
}

.review blockquote { margin: 0 0 12px; }

.review blockquote p {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.35;
  text-wrap: pretty;
}

.review figcaption { font-size: 0.75rem; }

.review-word {
  opacity: 0;
  transition: opacity 0.4s ease-out;
  transition-delay: calc(var(--review-delay, 0s) + var(--word-index) * 60ms);
}

.reviews-side li:nth-child(1) .review { --review-delay: 0.6s; }
.reviews-side li:nth-child(2) .review { --review-delay: 1.2s; }
.review.is-visible .review-word { opacity: 1; }

.review--featured { padding-right: 64px; }

.review--featured blockquote { margin-bottom: 24px; }

.review--featured blockquote p {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.review--featured figcaption { font-size: 0.85rem; }

.reviews-side {
  display: grid;
  gap: 36px;
  margin: 0;
  padding: 8px 0 8px 56px;
  border-left: 1px solid rgba(253, 246, 234, 0.16);
  list-style: none;
}

/* Responsive */
@media (max-width: 860px) {
  .lodging-inner {
    grid-template-columns: 1fr;
    grid-template-areas: "text" "photos";
  }

  .lodging-photos { grid-template-columns: 1fr 1fr; }

  .lodging-polaroid:nth-child(1) { grid-column: span 2; grid-row: auto; }

  .lodging-polaroid:nth-child(1) img { aspect-ratio: 4 / 3; }

  .hero { min-height: 100svh; }

  .hero-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .welcome {
    grid-template-columns: 1fr;
    gap: 48px;
    padding-top: 64px;
    padding-bottom: 80px;
  }

  .polaroid {
    max-width: 420px;
    margin: 0 auto;
  }

  .gallery-inner {
    padding-top: 64px;
    padding-bottom: 80px;
  }

  .reviews-inner {
    grid-template-columns: 1fr;
    padding-top: 64px;
    padding-bottom: 72px;
  }

  .review--featured { padding: 0 0 36px; }

  .reviews-side {
    padding: 36px 0 0;
    border-top: 1px solid rgba(253, 246, 234, 0.16);
    border-left: 0;
  }

  .gallery-mosaic {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: clamp(120px, 34vw, 220px);
    gap: 12px;
  }
}
