/* Self-hosted (OFL) latin subsets: no render-blocking round trip to Google, and the two text faces
   are preloaded by each page. Alfa Slab One only paints the 3D sale sign. */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url('../assets/fonts/fraunces-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../assets/fonts/instrument-sans-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'Alfa Slab One';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/alfa-slab-one-latin.woff2') format('woff2');
}

:root {
  /* dusk ink: the violet the hero sky sinks into, so the page reads as the same evening */
  --noche: #1d1530;
  --noche-deep: #120c1f;
  --luna: #f3e3b3;
  /* sunset orange: the sale accent, same as the paint on the beach sign */
  --sol: #ef8a4c;
  --sol-text: #f5a46f;
  --text: #efe8d8;
  --muted: rgba(239, 232, 216, 0.72);
  --line: rgba(243, 227, 179, 0.16);
  --container: min(1180px, 92vw);
  --display: 'Fraunces', Georgia, serif;
  --body: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: clamp(15px, 0.3vw + 14px, 17px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Lenis (js/scroll.js) owns smooth scrolling; native smooth scroll only when it is not running. */
html:not(.lenis) {
  scroll-behavior: smooth;
}

html.lenis,
html.lenis body {
  height: auto;
}

.lenis-stopped {
  overflow: hidden;
}

html {
  background: var(--noche-deep);
  color: var(--text);
}

/* The night behind the page: a fixed layer, not background-attachment: fixed, which iOS Safari
   ignores (the gradient would stretch over the whole page height). lvh: it stays put while the
   toolbar slides away. */
html::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100lvh;
  z-index: -1;
  /* Picks up where the 3D sky leaves off (violet dusk, sampled from the scene at the end of the
     hero): a faint moon high up, deep dusk ink in the middle, the last ember of the sun low down. */
  background:
    radial-gradient(30% 24% at 80% 6%, rgba(243, 227, 179, 0.1), transparent 70%),
    radial-gradient(120% 46% at 50% 110%, rgba(239, 138, 76, 0.26), transparent 62%),
    linear-gradient(180deg, #2f2145 0%, #1d1530 38%, #140e22 62%, #2a1a35 86%, #46263d 100%);
  pointer-events: none;
}

body {
  margin: 0;
  font-family: var(--body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* height: auto, or the width/height attributes (there for layout stability) pin the height and
   every aspect-ratio below is ignored: object-fit then crops the photos into tall strips. */
img,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 350;
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0;
}

h2 {
  font-size: clamp(2.2rem, 4.4vw, 3.6rem);
  margin-bottom: 18px;
}

p {
  margin: 0 0 1em;
}

:focus-visible {
  outline: 2px solid var(--luna);
  outline-offset: 3px;
}

.container {
  width: var(--container);
  margin: 0 auto;
}

#world {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  z-index: 0;
}

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 1;
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: 600 0.95rem/1 var(--body);
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button--moon {
  background: var(--luna);
  color: var(--noche);
}

.button--ghost {
  border-color: rgba(243, 227, 179, 0.5);
  color: var(--text);
}

.button--ghost:hover {
  background: rgba(243, 227, 179, 0.1);
}

.button--sol {
  background: var(--sol);
  color: #1b1007;
}

.text-link {
  border-bottom: 1px solid rgba(239, 232, 216, 0.5);
  padding-bottom: 2px;
}

.text-link:hover {
  color: var(--luna);
  border-color: var(--luna);
}

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  background: linear-gradient(180deg, rgba(14, 10, 26, 0.7), rgba(14, 10, 26, 0));
  transition: background 0.3s ease;
}

.site-header.is-scrolled {
  background: rgba(14, 10, 26, 0.82);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.header-row {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 18px 0;
}

.brand img {
  height: 34px;
  width: auto;
}

.nav {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-left: auto;
}

.nav a {
  color: var(--muted);
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.nav a:hover {
  color: var(--luna);
}

/* For sale: the one link that is a sunset pill, with a slow ping to catch the eye. */
.nav .nav-sale {
  padding: 7px 15px;
  border-radius: 999px;
  background: var(--sol);
  color: #1b1007;
  font-weight: 600;
  animation: sale-ping 2.6s ease-out infinite;
}

.nav .nav-sale:hover {
  background: var(--sol-text);
  color: #1b1007;
}

.nav .nav-sale[aria-current] {
  animation: none;
}

@keyframes sale-ping {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 138, 76, 0.6);
  }
  70%,
  100% {
    box-shadow: 0 0 0 12px rgba(239, 138, 76, 0);
  }
}

/* Phones only (see the 900px breakpoint): For sale and Book a stay ride along the bottom. */
.cta-bar {
  display: none;
}

/* ---------- Loader ---------- */

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 26px;
  background: radial-gradient(circle at 50% 45%, var(--noche), var(--noche-deep) 70%);
  transition: opacity 0.7s ease, visibility 0s 0.7s;
  animation: loader-out 0.7s ease 4s forwards; /* never longer than 4 s, even without JS */
}

.page-loader img {
  width: 96px;
  height: 96px;
  animation: loader-breathe 1.6s ease-in-out infinite alternate;
}

/* A thin moonlit line sweeping under the logo. */
.page-loader::after {
  content: '';
  width: 120px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--luna), transparent) 0 0 / 50% 100% no-repeat;
  animation: loader-sweep 1.3s ease-in-out infinite;
}

html:is(.has-world, .page-ready) .page-loader {
  opacity: 0;
  visibility: hidden;
}

@keyframes loader-out {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes loader-breathe {
  from {
    transform: scale(0.94);
    opacity: 0.75;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes loader-sweep {
  from {
    background-position: -100% 0;
  }
  to {
    background-position: 200% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-loader img,
  .page-loader::after,
  .nav .nav-sale {
    animation: none;
  }
}

.header-book {
  padding: 10px 20px;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  background: none;
  border: 0;
  cursor: pointer;
}

.menu-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle--open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle--open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle--open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-content: end;
  gap: 40px;
  padding: 120px 0 48px;
}

/* A soft pool of shade behind the copy so it reads over the bright sea. Feathered on every side and
   masked at the bottom, so it never shows as a box or a line. */
.hero::before {
  content: '';
  position: absolute;
  inset: 0 0 -10vh;
  background:
    radial-gradient(ellipse 60% 72% at 16% 58%, rgba(14, 10, 26, 0.76), rgba(14, 10, 26, 0.56) 50%, transparent 100%),
    linear-gradient(90deg, rgba(14, 10, 26, 0.5), rgba(14, 10, 26, 0.3) 35%, transparent 62%);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 12%, #000 75%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 12%, #000 75%, transparent);
  pointer-events: none;
}

/* Poster: the first frame of the 3D scene, shown until WebGL is ready, then cross-faded away. */
.hero-poster {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: -1;
  transition: opacity 1.2s ease, visibility 0s 1.2s;
}

.hero-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

html.has-world .hero-poster {
  opacity: 0;
  visibility: hidden;
}

/* The 3D sale sign, as a button (js/world.js places it over the board every frame, in hero
   coordinates, clipped to the hero's bottom edge). */
.hero-sign {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  cursor: pointer;
}

.hero-sign.is-inactive {
  visibility: hidden;
  pointer-events: none;
}

.hero-sign:focus-visible {
  outline: 2px solid var(--luna);
  outline-offset: 8px;
}

/* The copy sits above the sign's hit area, so its links always win where they overlap while the
   page scrolls. The wrappers let clicks through; their contents take them. */
.hero-copy {
  position: relative;
  z-index: 3;
}

.hero-copy > * {
  pointer-events: auto;
}

.hero-copy,
.hero-copy .hero-actions {
  pointer-events: none;
}

.hero-actions > * {
  pointer-events: auto;
}

.hero h1 {
  font-size: clamp(3.6rem, 9.5vw, 9rem);
  font-weight: 300;
  line-height: 0.9;
  letter-spacing: -0.03em;
  max-width: 9ch;
  text-shadow: 0 4px 40px rgba(0, 0, 0, 0.35);
}

/* A soft shadow keeps the smaller hero text crisp where a wave crest passes behind it. */
.hero h1 span,
.hero-lead,
.hero-sale-link {
  text-shadow: 0 1px 12px rgba(10, 8, 24, 0.55);
}

.hero h1 span {
  display: block;
  margin-top: 18px;
  font: 500 clamp(1rem, 1.4vw, 1.2rem) / 1.4 var(--body);
  letter-spacing: 0.01em;
  color: var(--luna);
}

.hero-lead {
  max-width: 44ch;
  margin-top: 18px;
  color: rgba(239, 232, 216, 0.94);
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 26px 0 22px;
}

.hero-sale-link {
  display: inline-grid;
  gap: 2px;
  padding-left: 14px;
  border-left: 3px solid var(--sol);
  font-size: 0.95rem;
}

.hero-sale-link strong {
  color: var(--sol-text);
  font-weight: 700;
}

.hero-sale-link span {
  color: rgba(239, 232, 216, 0.94);
}

.hero-sale-link:hover span {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hero-facts {
  position: relative;
  display: flex;
  gap: clamp(24px, 5vw, 64px);
  margin: 0 auto;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.hero-facts div {
  display: grid;
}

.hero-facts dt {
  font: 300 2rem/1 var(--display);
  color: var(--luna);
}

.hero-facts dd {
  margin: 4px 0 0;
  color: rgba(239, 232, 216, 0.9);
  font-size: 0.88rem;
}

/* ---------- Sections and panels ---------- */

.section {
  padding: 10vh 0;
  scroll-margin-top: 40px;
}

.panel {
  background: rgba(22, 15, 35, 0.64);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  backdrop-filter: blur(16px) saturate(1.15);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: clamp(26px, 5vw, 64px);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.6);
}

.section-head {
  max-width: 62ch;
  margin-bottom: 36px;
}

.section-head p {
  color: var(--muted);
}

/* Windows where the page steps aside and the 3D evening shows through. */
.interlude {
  min-height: 75vh;
  display: grid;
  place-items: center;
  padding: 0 6vw;
}

.interlude--sale {
  align-content: center;
  gap: 22px;
}

.interlude--sale .text-link {
  color: var(--sol-text);
  border-color: rgba(239, 138, 76, 0.6);
}

.interlude p {
  max-width: 20ch;
  margin: 0;
  text-align: center;
  font: italic 300 clamp(1.9rem, 4.2vw, 3.4rem) / 1.15 var(--display);
  color: var(--luna);
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.5);
}

/* ---------- Bungalows ---------- */

.rooms-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.room-card {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}

.room-card-image {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  overflow: hidden;
}

.room-card-image img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.room-card-image:hover img {
  transform: scale(1.04);
}

.room-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 18px 18px 20px;
}

.room-body h3 {
  font-size: 1.7rem;
  margin-bottom: 8px;
}

.room-body p {
  color: var(--muted);
  font-size: 0.93rem;
}

.room-thumbs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: auto;
}

.room-thumbs img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  cursor: zoom-in;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

.room-thumbs img:hover {
  opacity: 1;
}

/* ---------- Life here ---------- */

.story-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.story-copy > p {
  color: var(--muted);
}

.story-points {
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}

.story-points li {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.moments-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.moments-chip {
  padding: 9px 16px;
  border: 1px solid rgba(243, 227, 179, 0.4);
  border-radius: 999px;
  background: none;
  color: var(--text);
  font: 500 0.88rem var(--body);
  cursor: pointer;
}

.moments-chip.is-active {
  background: var(--luna);
  border-color: var(--luna);
  color: var(--noche);
}

.story-media {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
  gap: 14px;
}

.moments-inline-stage {
  position: relative;
  margin: 0;
}

.moments-inline-stage video {
  width: 100%;
  aspect-ratio: 9 / 15;
  object-fit: cover;
  border-radius: 18px;
}

.aerial video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 18px;
}

.moments-inline-caption {
  position: absolute;
  left: 16px;
  bottom: 14px;
  font-size: 0.9rem;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.7);
}

.story-grid {
  display: grid;
  gap: 14px;
}

.story-grid figure {
  position: relative;
  margin: 0;
}

.story-grid img {
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 14px;
}

.story-grid figcaption {
  position: absolute;
  left: 12px;
  bottom: 10px;
  font-size: 0.85rem;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.8);
}

/* ---------- For sale ---------- */

.section--sale .panel {
  border-color: rgba(239, 138, 76, 0.35);
}

.sale-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.sale-media {
  position: relative;
  align-self: start;
  margin: 0;
}

@media (min-width: 901px) {
  .sale-media {
    position: sticky;
    top: 110px;
  }
}

.sale-media::before {
  content: '';
  position: absolute;
  inset: 14px -14px -14px 14px;
  border: 1px solid rgba(239, 138, 76, 0.55);
  border-radius: 18px;
  pointer-events: none;
}

.sale-media :is(img, video) {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 18px;
}

/* The drone stills side by side, one at a time: it opens on the lot outlined; the rest are a swipe
   (or the button) away. */
.sale-slides {
  position: relative;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  border-radius: 18px;
}

.sale-slides::-webkit-scrollbar {
  display: none;
}

.sale-slides img {
  flex: 0 0 100%;
  scroll-snap-align: start;
}

.sale-more {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(14, 10, 26, 0.72);
  color: var(--text);
  font: 600 0.85rem/1 var(--body);
  cursor: pointer;
}

.sale-more:hover {
  background: rgba(14, 10, 26, 0.9);
}

.sale-media-caption {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 16px;
  margin: 0;
  font: italic 400 1.1rem/1.35 var(--display);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
}

.sale-copy h2 {
  font-size: clamp(2.4rem, 4.8vw, 4.2rem);
}

.sale-copy h2:focus {
  outline: none;
}

.sale-lead {
  font-size: 1.1rem;
}

.sale-price {
  margin: 22px 0 14px;
  color: var(--sol-text);
  font-size: 1.05rem;
}

.sale-price strong {
  display: block;
  font: 350 clamp(2rem, 3.6vw, 2.8rem) / 1.1 var(--display);
  color: var(--luna);
  font-variant-numeric: tabular-nums;
}

.sale-subhead {
  margin: 22px 0 8px;
  color: var(--sol-text);
  font-weight: 600;
}

.sale-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.45;
}

.sale-facts li {
  padding-left: 12px;
  border-left: 2px solid rgba(239, 138, 76, 0.5);
}

.sale-facts strong {
  color: var(--text);
}

.sale-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  margin: 28px 0 18px;
}

.sale-note {
  color: var(--muted);
  font-size: 0.85rem;
}

.sale-note a {
  color: var(--luna);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Sale page (for-sale/index.html) ---------- */

/* The poster melts into the page's dusk at the bottom; the scene (js/sale-page.js) stays behind the
   whole page, like the home's, and fades in as the poster fades out. */
.sale-hero .hero-poster {
  -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent);
  mask-image: linear-gradient(180deg, #000 72%, transparent);
}

.sale-world {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  z-index: 0;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.sale-world.is-ready {
  opacity: 1;
}

/* The sun starts its walk on the left, above the copy: keep the shade low, behind the text only. */
@media (min-aspect-ratio: 4/5) {
  .sale-hero::before {
    background:
      radial-gradient(ellipse 58% 46% at 18% 76%, rgba(14, 10, 26, 0.74), rgba(14, 10, 26, 0.5) 50%, transparent 100%),
      linear-gradient(90deg, rgba(14, 10, 26, 0.42), rgba(14, 10, 26, 0.22) 35%, transparent 60%);
    -webkit-mask-image: linear-gradient(180deg, transparent 45%, #000 62%, #000 85%, transparent);
    mask-image: linear-gradient(180deg, transparent 45%, #000 62%, #000 85%, transparent);
  }
}

.sale-eyebrow {
  margin-bottom: 14px;
  color: var(--sol-text);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.85rem;
  text-shadow: 0 1px 3px rgba(10, 8, 24, 0.85), 0 0 18px rgba(10, 8, 24, 0.7);
}

.sale-hero h1 {
  max-width: 12ch;
  font-size: clamp(3rem, 7vw, 6.4rem);
}

/* The house's name in its hand-lettered wordmark, the same as the header's (both heroes). */
.title-wordmark {
  display: block;
  width: min(100%, 700px);
  height: auto;
  margin-bottom: 0.15em;
}

.hero h1 .title-wordmark {
  width: min(86vw, 700px);
}

.sale-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 14px;
}

.sale-gallery figure {
  position: relative;
  margin: 0;
}

.sale-gallery img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 14px;
}

.sale-gallery figcaption {
  position: absolute;
  left: 12px;
  bottom: 10px;
  font-size: 0.85rem;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.8);
}

.sale-contact {
  text-align: center;
}

.sale-contact > p {
  color: var(--muted);
}

.sale-contact .sale-actions {
  justify-content: center;
}

.sale-back {
  display: inline-block;
  margin-top: 8px;
}

/* Transition from the hero sign to the sale page (js/world.js): stays closed over the page change. */
.sale-curtain {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--noche);
  pointer-events: none;
  clip-path: circle(0 at var(--x, 50%) var(--y, 50%));
  transition: clip-path 0.75s cubic-bezier(0.76, 0, 0.24, 1);
}

.sale-curtain.is-open {
  clip-path: circle(150vmax at var(--x, 50%) var(--y, 50%));
}

/* One orchestrated reveal for [data-reveal] blocks. Visible by default: js/main.js adds .reveal-ready
   right before it starts observing, then .is-revealed. */
.reveal-ready .sale-media :is(img, video) {
  clip-path: inset(0 100% 0 0 round 18px);
  transition: clip-path 1.3s cubic-bezier(0.76, 0, 0.24, 1);
}

.reveal-ready .sale-media::before,
.reveal-ready .sale-media-caption {
  opacity: 0;
  transform: translate(-10px, -10px);
  transition: opacity 0.8s ease 1s, transform 0.8s ease 1s;
}

.reveal-ready .sale-copy > *,
.reveal-ready .sale-facts li {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: calc(0.35s + var(--i, 0) * 90ms);
}

.reveal-ready.is-revealed .sale-media :is(img, video) {
  clip-path: inset(0 0 0 0 round 18px);
}

.reveal-ready.is-revealed .sale-media::before,
.reveal-ready.is-revealed .sale-media-caption,
.reveal-ready.is-revealed .sale-copy > *,
.reveal-ready.is-revealed .sale-facts li {
  opacity: 1;
  transform: none;
}

/* ---------- Gallery strip ---------- */

.gallery-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(78%, 380px);
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(243, 227, 179, 0.4) transparent;
}

.gallery-strip figure {
  margin: 0;
  scroll-snap-align: start;
}

.gallery-strip img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 14px;
}

/* With JS (js/main.js): the same photos stand in a ring that turns in 3D; js sets each card's
   transform, opacity, and stacking. */
.gallery-strip.is-ring {
  --card: clamp(150px, 24vw, 260px);
  position: relative;
  display: block;
  height: calc(var(--card) * 4 / 3 + 40px);
  overflow: hidden;
  padding: 20px 0;
  perspective: 1400px;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
}

.gallery-strip.is-ring:active {
  cursor: grabbing;
}

.gallery-strip.is-ring figure {
  position: absolute;
  left: 50%;
  width: var(--card);
  margin-left: calc(var(--card) / -2);
}

.gallery-strip.is-ring img {
  box-shadow: 0 18px 50px rgba(5, 4, 14, 0.55);
  -webkit-user-drag: none;
}

.gallery-controls {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 10px;
}

.gallery-controls[hidden] {
  display: none;
}

/* ---------- Reviews ---------- */

.review-carousel {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.review-viewport {
  overflow: hidden;
  border-radius: 14px;
}

.review-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.review-slide {
  flex: 0 0 100%;
  height: min(520px, 70vh); /* reserved up front so lazy images never shift the page mid-scroll */
  margin: 0;
  display: grid;
  place-items: center;
}

.review-slide img {
  max-height: 100%;
  width: auto;
  object-fit: contain;
  border-radius: 10px;
}

.carousel-button {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(243, 227, 179, 0.4);
  border-radius: 50%;
  background: none;
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
}

.carousel-button:hover {
  background: rgba(243, 227, 179, 0.1);
}

.carousel-dots {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  margin-top: 6px;
}

/* An 8 px dot inside a 24 px target. */
.carousel-dot {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(243, 227, 179, 0.3) 0 4px, transparent 4.5px);
  cursor: pointer;
}

.carousel-dot.is-active {
  background: radial-gradient(circle, var(--luna) 0 4px, transparent 4.5px);
}

/* ---------- Location + contact ---------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}

.buying h3 {
  font-size: 1.6rem;
  margin-bottom: 12px;
}

.split > div > p {
  color: var(--muted);
}

.plain-list {
  margin: 0 0 26px;
  padding: 0;
  list-style: none;
}

.plain-list li {
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.map-frame iframe {
  display: block;
  width: 100%;
  height: 420px;
  border: 0;
  border-radius: 18px;
  /* night-tinted map to match the page */
  filter: invert(0.9) hue-rotate(180deg) saturate(0.7) brightness(0.95);
}

.contact-details {
  display: grid;
  gap: 8px;
}

.contact-details a {
  color: var(--luna);
  overflow-wrap: anywhere; /* the Gmail address is long for a phone */
}

.contact-form {
  display: grid;
  gap: 14px;
}

.contact-form label {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--muted);
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(243, 227, 179, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font: 400 1rem var(--body);
}

.contact-form option {
  color: var(--noche);
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--luna);
  outline-offset: 1px;
}

.contact-form .button {
  justify-self: start;
}

.form-note {
  color: var(--muted);
  font-size: 0.82rem;
}

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
}

.lightbox.is-open {
  display: grid;
  place-items: center;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 8, 16, 0.9);
}

.lightbox-dialog {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: min(1100px, 94vw);
}

.lightbox-stage img {
  max-height: 80vh;
  margin: 0 auto;
  border-radius: 12px;
}

.lightbox-caption {
  margin-top: 10px;
  text-align: center;
  color: var(--muted);
}

.lightbox-close,
.lightbox-nav {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(243, 227, 179, 0.4);
  border-radius: 50%;
  background: rgba(22, 15, 35, 0.8);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
}

.lightbox-close {
  position: absolute;
  top: -58px;
  right: 0;
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 40px 0 60px;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px 32px;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-row p {
  margin: 0;
}

.footer-logo {
  width: 56px;
  height: 56px;
}

.social {
  display: flex;
  gap: 18px;
  margin-left: auto;
}

.social a:hover,
.footer-links a:hover {
  color: var(--luna);
}

/* The guides and policies: a full-width line under the logo and the social links. */
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  flex-basis: 100%;
}

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .rooms-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .nav {
    position: absolute;
    top: 100%;
    left: 4vw;
    right: 4vw;
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 14px;
    background: rgba(22, 15, 35, 0.96);
    border: 1px solid var(--line);
    border-radius: 18px;
  }

  .nav.nav--open {
    display: flex;
  }

  .nav a {
    padding: 10px 8px;
    font-size: 1.05rem;
  }

  .header-book {
    margin-left: auto;
  }

  .menu-toggle {
    display: flex;
  }

  .nav .nav-sale {
    align-self: flex-start;
  }

  .cta-bar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 19;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(14, 10, 26, 0.82);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    transform: translateY(calc(100% + 24px));
    transition: transform 0.35s ease;
  }

  .cta-bar .button {
    padding: 12px 10px;
    white-space: nowrap;
  }

  html.show-cta .cta-bar {
    transform: none;
  }

  /* The bar carries Book a stay once it is up; the footer clears it. */
  html.show-cta .header-book {
    visibility: hidden;
  }

  .site-footer {
    padding-bottom: 90px;
  }

  .story-layout,
  .sale-layout,
  .split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .header-row {
    gap: 14px;
  }

  .brand img {
    height: 26px;
  }

  .header-book {
    padding: 9px 14px;
    font-size: 0.85rem;
  }

  /* The top half of the hero belongs to the sign on the beach; the copy starts below it. */
  .hero {
    align-content: start;
    gap: 26px;
    padding-top: 56svh;
  }

  .hero h1 {
    font-size: 3.4rem;
  }

  .hero-actions .button {
    flex: 1 1 auto;
  }

  .hero::before {
    background: linear-gradient(180deg, transparent 36svh, rgba(10, 8, 24, 0.66) 52svh, rgba(10, 8, 24, 0.8) 68svh, rgba(10, 8, 24, 0.8) calc(100% - 16svh), transparent);
    -webkit-mask-image: none;
    mask-image: none;
  }

  /* The sale page's sun sits at about 48svh: start the shade below it, still above the copy (56svh). */
  .sale-hero::before {
    background: linear-gradient(180deg, transparent 47svh, rgba(10, 8, 24, 0.66) 57svh, rgba(10, 8, 24, 0.8) 68svh, rgba(10, 8, 24, 0.8) calc(100% - 16svh), transparent);
  }

  .hero-facts dt {
    font-size: 1.6rem;
  }

  .rooms-grid {
    grid-template-columns: 1fr;
  }

  .story-media {
    grid-template-columns: 1fr;
  }

  .story-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .story-grid figcaption {
    display: none;
  }

  .review-carousel {
    grid-template-columns: 1fr;
  }

  .carousel-button {
    display: none;
  }

  .map-frame iframe {
    height: 320px;
  }

  .social {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
