/* DanDan-Ku Villa. One fixed stage of photos behind a normally scrolling page. */

:root {
  --ink: #14110e;
  --ink-2: #1c1814;
  --ivory: #f6f0e6;
  --ivory-dim: rgba(246, 240, 230, .78);
  --ivory-faint: rgba(246, 240, 230, .56);
  --line: rgba(246, 240, 230, .16);
  --gold: #c9a46a;
  --gold-hi: #e6cc94;
  --gold-lo: #9c773f;
  --glass: rgba(20, 17, 14, .5);
  --serif: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --sans: "Jost", "Futura", "Century Gothic", "Segoe UI", system-ui, sans-serif;
  --mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --gutter: clamp(16px, 5vw, 80px);
  --topbar: 76px;
  --bar: 0px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--ink); }
html.is-locked { overflow: hidden; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--ivory);
  font: 300 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img { max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.mono { font-family: var(--mono); font-weight: 400; }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; }

.skip {
  position: fixed; left: 16px; top: -60px; z-index: 100;
  padding: 10px 16px; background: var(--ivory); color: var(--ink); text-decoration: none;
}
.skip:focus { top: 16px; }

/* ---------- loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-content: center; justify-items: center; gap: 28px;
  background: var(--ink);
  transition: opacity 1s var(--ease) .2s, visibility 0s linear 1.2s;
}
.no-js .loader, .is-ready .loader { opacity: 0; visibility: hidden; }
.loader__mark { display: grid; justify-items: center; }
.loader__v, .brand__v, .hero__v {
  font: 400 11px/1 var(--sans); letter-spacing: .5em; text-transform: uppercase; color: var(--gold-hi);
  padding-left: .5em;
}
.loader__name { font: italic 400 min(clamp(56px, 9vw, 96px), (100vw - 32px) / 4.7)/1 var(--serif); margin-bottom: 14px; }
.loader__bar { width: min(220px, 60vw); height: 1px; background: var(--line); overflow: hidden; }
.loader__bar i { display: block; height: 100%; background: var(--gold-hi); transform: scaleX(0); transform-origin: 0 50%; transition: transform .5s var(--ease); }
.loader__pct { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--ivory-faint); }

/* ---------- stage ---------- */
.stage {
  position: fixed; left: 0; top: 0; z-index: 0;
  width: 100%; height: 100vh; height: 100lvh;
  overflow: hidden; background: var(--ink);
}
.no-js .stage { background: var(--ink) url("media/02.webp") center / cover no-repeat; }
.scene { position: absolute; inset: 0; visibility: hidden; opacity: 0; }
.scene.is-vis { visibility: visible; }
.frame { position: absolute; left: 0; top: 0; width: 100%; height: 100%; will-change: transform; }
.frame__in { position: absolute; inset: 0; animation: breathe 22s ease-in-out infinite alternate; }
.frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
@keyframes breathe { from { transform: scale(1); } to { transform: scale(1.025); } }

.stage__veil {
  position: absolute; inset: 0; z-index: 5; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(12, 10, 8, .55) 0, rgba(12, 10, 8, 0) 22%, rgba(12, 10, 8, 0) 60%, rgba(12, 10, 8, .55) 100%),
    radial-gradient(120% 90% at 50% 45%, rgba(12, 10, 8, 0) 55%, rgba(12, 10, 8, .5) 100%);
}
.stage__dip, .stage__shade { position: absolute; inset: 0; z-index: 4; pointer-events: none; background: #0d0b09; opacity: 0; }
.stage__grain {
  position: absolute; inset: -50%; z-index: 7; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* the chapter number that passes by between rooms */
.stage__card {
  position: absolute; inset: 0; z-index: 6; pointer-events: none;
  display: grid; place-content: center; justify-items: center; gap: 4px;
  opacity: 0;
}
.stage__num {
  font: italic 400 clamp(120px, 20vw, 300px)/.9 var(--serif);
  color: rgba(246, 240, 230, .16); -webkit-text-stroke: 1.5px rgba(246, 240, 230, .92);
  text-shadow: 0 0 60px rgba(0, 0, 0, .35);
}
.stage__title { font: 400 12px/1 var(--mono); letter-spacing: .4em; text-transform: uppercase; color: var(--ivory); padding-left: .4em; text-shadow: 0 1px 12px rgba(0, 0, 0, .7); }

/* mosaic for the finale */
.mosaic { position: absolute; display: grid; transform-origin: 50% 50%; will-change: transform; }
.mosaic__tile { overflow: hidden; background: var(--ink-2); }
.mosaic__tile img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ---------- labels on the photos ---------- */
.pin { position: absolute; left: calc(var(--x) * 100%); top: calc(var(--y) * 100%); width: 0; height: 0; opacity: 0; transition: opacity .5s var(--ease); }
.pin__in { position: absolute; left: 0; top: 0; transform: scale(var(--inv, 1)); transform-origin: 0 0; }
.pin__dot {
  position: absolute; left: -6px; top: -6px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--gold-hi); box-shadow: 0 0 0 4px rgba(230, 204, 148, .22), 0 2px 10px rgba(0, 0, 0, .4);
}
.pin__dot::after {
  content: ""; position: absolute; inset: -9px; border-radius: 50%;
  border: 1px solid rgba(230, 204, 148, .7); animation: ping 2.6s var(--ease) infinite;
}
@keyframes ping { 0% { transform: scale(.4); opacity: 1; } 80%, 100% { transform: scale(1.5); opacity: 0; } }
.pin__line {
  position: absolute; top: 0; left: 12px; width: 40px; height: 1px;
  background: linear-gradient(90deg, var(--gold-hi), rgba(230, 204, 148, .25));
  transform: scaleX(0); transform-origin: 0 0; transition: transform .7s var(--ease);
}
.pin__label {
  position: absolute; top: -15px; left: 56px; white-space: nowrap;
  font: 400 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ivory);
  padding: 9px 12px; background: rgba(16, 13, 10, .62); border: 1px solid rgba(246, 240, 230, .2);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transform: translateX(-6px); transition: transform .7s var(--ease);
}
.pin.is-left .pin__line { left: auto; right: 12px; transform-origin: 100% 0; background: linear-gradient(270deg, var(--gold-hi), rgba(230, 204, 148, .25)); }
.pin.is-left .pin__label { left: auto; right: 56px; transform: translateX(6px); }
.scene.pins-on .pin.ok { opacity: 1; transition-delay: calc(var(--i) * 160ms + 250ms); }
.scene.pins-on .pin.ok .pin__line { transform: scaleX(1); transition-delay: calc(var(--i) * 160ms + 300ms); }
.scene.pins-on .pin.ok .pin__label { transform: none; transition-delay: calc(var(--i) * 160ms + 350ms); }

/* ---------- top bar ---------- */
.topbar {
  position: fixed; left: 0; right: 0; top: 0; z-index: 40;
  height: calc(var(--topbar) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) var(--gutter) 0;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  transition: background .6s var(--ease);
}
.topbar::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .6s var(--ease);
  background: linear-gradient(180deg, rgba(14, 12, 10, .78), rgba(14, 12, 10, .42));
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(246, 240, 230, .08);
}
.topbar.is-solid::before { opacity: 1; }
.brand { display: flex; align-items: baseline; gap: 6px; padding-block: 10px; text-decoration: none; }
.brand__name { font: italic 500 28px/1 var(--serif); letter-spacing: .01em; }
.topbar__right { display: flex; align-items: center; gap: clamp(10px, 1.6vw, 22px); }
.topbar__gallery {
  display: inline-flex; align-items: center; gap: 9px; min-height: 40px; padding: 0 18px 0 15px; border: 1px solid var(--ivory); border-radius: 999px;
  background: var(--ivory); color: var(--ink); cursor: pointer; box-shadow: 0 6px 22px rgba(0, 0, 0, .28);
  font: 500 11px/1 var(--sans); letter-spacing: .22em; text-transform: uppercase;
  transition: background .3s, border-color .3s, transform .3s var(--ease);
}
.topbar__gallery:hover { background: var(--gold-hi); border-color: var(--gold-hi); transform: translateY(-1px); }
.topbar__gallery svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.topbar__book {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 18px; border: 1px solid var(--gold-hi); border-radius: 999px;
  font: 500 11px/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--gold-hi); text-decoration: none;
  transition: background .3s, color .3s;
}
.topbar__book:hover { background: var(--gold-hi); color: var(--ink); }
.progress {
  position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; background: var(--gold-hi);
  transform: scaleX(0); transform-origin: 0 50%; opacity: .8;
}

/* ---------- chapter rail ---------- */
.rail { position: fixed; right: clamp(16px, 2vw, 32px); top: 50%; z-index: 30; transform: translateY(-50%); }
.rail ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; align-items: flex-end; }
.rail a {
  display: flex; align-items: center; gap: 10px; padding: 7px 0;
  font: 400 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ivory-faint); text-decoration: none;
  transition: color .4s;
}
.rail .rail__name { opacity: 0; transform: translateX(8px); transition: opacity .4s var(--ease), transform .4s var(--ease); text-shadow: 0 1px 8px rgba(0, 0, 0, .6); }
.rail .rail__tick { width: 16px; height: 1px; background: currentColor; transition: width .4s var(--ease); }
.rail a:hover, .rail a.is-active { color: var(--gold-hi); }
.rail a:hover .rail__name, .rail a.is-active .rail__name { opacity: 1; transform: none; }
.rail a.is-active .rail__tick { width: 34px; }

/* ---------- chapters and cards ---------- */
main { position: relative; z-index: 10; }
.chapter { position: relative; display: flex; padding: 55vh var(--gutter); padding-block: 55svh; }
.chapter[data-side="right"] { justify-content: flex-end; }
.chapter[data-side="right"] .card { margin-right: clamp(0px, 10vw, 170px); }
.card {
  width: min(440px, 100%);
  padding: 34px 34px 28px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.15); backdrop-filter: blur(18px) saturate(1.15);
  border: 1px solid var(--line); border-radius: 4px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
}
.card__num {
  display: flex; align-items: center; gap: 14px; margin: 0;
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--gold-hi);
}
.card__num span { color: var(--ivory-dim); }
.card__num::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.card__title { margin: 18px 0; font: 500 clamp(34px, 3.3vw, 48px)/1.04 var(--serif); letter-spacing: -.005em; }
.card__inset { margin: 0 0 20px; aspect-ratio: 3 / 2; overflow: hidden; border-radius: 2px; background: var(--ink-2); }
.card__inset img { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); transition: transform 1.8s var(--ease); }
.card.is-in .card__inset img { transform: scale(1); }
.card__story { margin: 0 0 20px; color: var(--ivory-dim); }
.card__details { list-style: none; margin: 0 0 20px; padding: 0; }
.card__details li { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.45; }
.card__details li::before { content: ""; flex: none; width: 5px; height: 5px; margin-top: .55em; border-radius: 50%; background: var(--gold); }
.card__flow { margin: 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 11px; line-height: 1.6; letter-spacing: .06em; color: var(--ivory-faint); }

.js .card > * { opacity: 0; transform: translateY(16px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js .card.is-in > * { opacity: 1; transform: none; }
.js .card.is-in > :nth-child(2) { transition-delay: .07s; }
.js .card.is-in > :nth-child(3) { transition-delay: .14s; }
.js .card.is-in > :nth-child(4) { transition-delay: .21s; }
.js .card.is-in > :nth-child(5) { transition-delay: .28s; }
.js .card.is-in > :nth-child(n+6) { transition-delay: .35s; }

/* nearby places, swipeable */
.places {
  display: flex; gap: 10px; margin: 0 -34px 20px; padding: 2px 34px 6px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 34px;
  overscroll-behavior-x: contain; scrollbar-width: none;
}
.places::-webkit-scrollbar { display: none; }
.places figure { flex: 0 0 38%; margin: 0; scroll-snap-align: start; }
.places img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 2px; background: var(--ink-2); }
.places figcaption { margin-top: 8px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ivory-dim); }

/* ---------- hero ---------- */
/* Opening screen: Book button top-left, title block bottom-left, summary card beside it.
   Narrower screens stack them: button, title, card. */
.chapter--hero {
  min-height: 100vh; min-height: 100svh;
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto auto;
  align-items: end; row-gap: 32px;
  padding: calc(var(--topbar) + 28px) var(--gutter) clamp(64px, 10vh, 120px);
}
.chapter--hero > .book-pill { grid-row: 1; align-self: start; justify-self: start; }
.chapter--hero > .hero { grid-row: 3; }
.chapter--hero > .card--hero { grid-row: 4; justify-self: start; }
@media (min-width: 1200px) {
  .chapter--hero {
    grid-template-columns: minmax(0, min(560px, 40vw)) minmax(0, 1fr); grid-template-rows: auto 1fr;
    column-gap: clamp(40px, 4vw, 80px);
    padding-right: calc(var(--gutter) + 110px); /* keeps the card clear of the chapter list */
  }
  .chapter--hero > .book-pill { grid-column: 1 / -1; }
  .chapter--hero > .hero { grid-column: 1; grid-row: 2; }
  .chapter--hero > .card--hero { grid-column: 2; grid-row: 2; }
}
@media (min-width: 1200px) and (max-height: 760px) {
  .chapter--hero { row-gap: 16px; padding-top: calc(var(--topbar) + 12px); padding-bottom: 44px; }
  .hero__eyebrow { margin-bottom: 14px; }
  .hero__meta { margin-bottom: 22px; }
}
/* on laptop widths the card reaches the floating Book button's column, so sit just above it */
@media (min-width: 1200px) and (max-width: 1600px) {
  .chapter--hero { padding-bottom: max(112px, 10vh); }
}

/* the summary card (same content as the closing card), about 1.6 : 1 */
.card--hero { width: min(600px, 100%); padding: 30px 34px; text-align: center; background: rgba(16, 13, 10, .58); container-type: inline-size; }
/* when the card is narrow, trim it so it keeps a wide, calm shape instead of growing tall */
@container (max-width: 460px) { /* measured inside the card's padding: a card under ~530px wide */
  .card--hero .finale__lede, .card--hero .cta-more { display: none; }
  .card--hero .card__title { margin-bottom: 18px; }
}
.card--hero .card__num::before { content: ""; flex: 1; height: 1px; background: var(--line); }
.card--hero .card__title { margin: 14px 0 10px; font-size: clamp(34px, 2.8vw, 44px); }
.card--hero .finale__lede { max-width: 440px; margin: 0 auto 20px; font-size: 15px; line-height: 1.55; }
.card--hero .stats { margin-bottom: 22px; }
.card--hero .stats div { padding: 14px 6px; }
.card--hero .stats dd { font-size: clamp(30px, 2.6vw, 38px); }
.card--hero .finale__ctas { gap: 10px; }
.card--hero .finale__ctas > * { flex: 1 1 auto; min-height: 48px; padding: 0 20px; font-size: 11px; letter-spacing: .18em; }
.js .card--hero { opacity: 0; transform: translateY(24px); }
.js.is-ready .card--hero { opacity: 1; transform: none; transition: opacity 1.2s var(--ease) 1.1s, transform 1.2s var(--ease) 1.1s; }
.chapter--hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(12, 10, 8, .62) 0%, rgba(12, 10, 8, .28) 42%, rgba(12, 10, 8, 0) 70%),
    linear-gradient(0deg, rgba(12, 10, 8, .5) 0%, rgba(12, 10, 8, 0) 55%);
}
.hero { max-width: 760px; will-change: opacity, transform; }
.hero__eyebrow { margin: 0 0 22px; font-size: 11px; letter-spacing: .32em; text-transform: uppercase; color: var(--ivory-dim); }
.hero__title { margin: 0 0 24px; display: grid; }
.hero__v { font-size: 13px; margin-top: 18px; }
.hero__name { font: italic 400 min(clamp(76px, 13vw, 190px), (100vw - 2 * var(--gutter)) / 4.7)/.88 var(--serif); letter-spacing: -.01em; margin-left: -.04em; }
.hero__sub { max-width: 520px; margin: 0 0 26px; font-size: clamp(17px, 1.4vw, 20px); color: var(--ivory-dim); }
.hero__meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0 0 40px; padding: 0; list-style: none; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ivory-dim); }
.hero__meta b { font-weight: 400; color: var(--gold-hi); }
.hero__cue {
  display: inline-flex; align-items: center; gap: 16px; min-height: 44px;
  font: 400 11px/1 var(--mono); letter-spacing: .26em; text-transform: uppercase; color: var(--ivory); text-decoration: none;
}
.hero__cue i { position: relative; width: 64px; height: 1px; background: rgba(246, 240, 230, .3); overflow: hidden; }
.hero__cue i::after { content: ""; position: absolute; inset: 0; background: var(--gold-hi); animation: cue 2.4s var(--ease) infinite; }
@keyframes cue { 0% { transform: translateX(-100%); } 60%, 100% { transform: translateX(100%); } }

/* hero entrance after the loader */
.js .hero > * { opacity: 0; transform: translateY(24px); }
.js.is-ready .hero > * { opacity: 1; transform: none; transition: opacity 1.2s var(--ease), transform 1.2s var(--ease); }
.js.is-ready .hero > :nth-child(1) { transition-delay: .5s; }
.js.is-ready .hero > :nth-child(2) { transition-delay: .62s; }
.js.is-ready .hero > :nth-child(3) { transition-delay: .78s; }
.js.is-ready .hero > :nth-child(4) { transition-delay: .9s; }
.js.is-ready .hero > :nth-child(5) { transition-delay: 1.05s; }

/* ---------- finale ---------- */
.chapter--finale { justify-content: center; padding-top: 150vh; padding-top: 150svh; padding-bottom: 40vh; padding-bottom: 40svh; }
.card--finale { width: min(640px, 100%); padding: 44px 44px 40px; text-align: center; background: rgba(16, 13, 10, .62); }
.card--finale .card__num::before { content: ""; flex: 1; height: 1px; background: var(--line); }
.card--finale .card__title { font-size: clamp(40px, 4.4vw, 64px); }
.finale__lede { max-width: 480px; margin: 0 auto 28px; color: var(--ivory-dim); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 0 32px; border-block: 1px solid var(--line); }
.stats div { display: flex; flex-direction: column-reverse; gap: 6px; padding: 20px 6px; }
.stats div + div { border-left: 1px solid var(--line); }
.stats dd { margin: 0; font: 400 clamp(34px, 3.4vw, 46px)/1 var(--serif); color: var(--ivory); }
.stats dt { font: 400 10px/1.3 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--ivory-faint); }
.finale__ctas { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

/* ---------- buttons ---------- */
.btn-gold, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 0 30px; border-radius: 999px; cursor: pointer; text-decoration: none;
  font: 500 12px/1 var(--sans); letter-spacing: .22em; text-transform: uppercase;
}
.btn-gold {
  position: relative; overflow: hidden; border: 0; color: #1b150d;
  background: linear-gradient(135deg, var(--gold-hi) 0%, var(--gold) 48%, var(--gold-lo) 100%);
  box-shadow: 0 12px 34px rgba(201, 164, 106, .3), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.btn-ghost { border: 1px solid rgba(246, 240, 230, .35); background: rgba(14, 12, 10, .2); color: var(--ivory); transition: border-color .3s, background .3s; }
.btn-ghost:hover { border-color: var(--ivory); background: rgba(246, 240, 230, .06); }
.btn-wide { width: 100%; }

/* ---------- booking buttons: the persistent one (bottom right) and the hero one (top left) ---------- */
.book-fab, .book-pill {
  display: flex; align-items: center; gap: 14px; min-height: 66px; padding: 10px 28px 10px 11px;
  border-radius: 999px; overflow: hidden; text-decoration: none; color: #1b150d;
  background: linear-gradient(135deg, var(--gold-hi) 0%, var(--gold) 50%, var(--gold-lo) 100%);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45), 0 6px 24px rgba(201, 164, 106, .35), inset 0 1px 0 rgba(255, 255, 255, .5);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.book-fab {
  position: fixed; z-index: 45;
  right: clamp(16px, 2vw, 32px); bottom: calc(clamp(16px, 3vh, 30px) + env(safe-area-inset-bottom));
}
.book-pill { position: relative; width: max-content; min-height: 74px; gap: 16px; padding: 12px 34px 12px 12px; }
.book-pill .book-fab__icon { width: 50px; height: 50px; }
.book-pill .book-fab__icon svg { width: 24px; height: 24px; }
.book-pill .book-fab__text b { font-size: 16px; }
.book-pill .book-fab__text small { font-size: 11px; }
.js .book-pill { opacity: 0; transform: translateY(-12px); }
.js.is-ready .book-pill { opacity: 1; transform: none; transition: opacity 1s var(--ease) .4s, transform 1s var(--ease) .4s, box-shadow .4s var(--ease); }
.book-fab:hover, .js.is-ready .book-pill:hover { transform: translateY(-2px); box-shadow: 0 22px 60px rgba(0, 0, 0, .5), 0 8px 30px rgba(201, 164, 106, .45), inset 0 1px 0 rgba(255, 255, 255, .5); }
.book-fab::after, .book-pill::after, .btn-gold::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 40%;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .55), rgba(255, 255, 255, 0));
  transform: translateX(-150%) skewX(-18deg); animation: sheen 7s var(--ease) infinite 2s; pointer-events: none;
}
@keyframes sheen { 0%, 78% { transform: translateX(-150%) skewX(-18deg); } 100% { transform: translateX(320%) skewX(-18deg); } }
.book-fab__icon { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: #1b150d; color: var(--gold-hi); }
.book-fab__icon svg { width: 22px; height: 22px; fill: currentColor; }
.book-fab__text b { display: block; font: 500 14px/1.1 var(--sans); letter-spacing: .22em; text-transform: uppercase; }
.book-fab__text small { display: block; margin-top: 4px; font: 400 10px/1.2 var(--mono); letter-spacing: .16em; text-transform: uppercase; opacity: .72; }

/* ---------- footer ---------- */
.footer {
  position: relative; z-index: 10; display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px;
  padding: 90px var(--gutter) calc(130px + env(safe-area-inset-bottom));
  background: var(--ink); border-top: 1px solid var(--line);
}
.footer__brand { display: grid; justify-items: start; gap: 12px; }
.footer__name { font: italic 400 min(clamp(56px, 8vw, 104px), (100vw - 2 * var(--gutter)) / 4.7)/.9 var(--serif); }
.footer__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 28px; max-width: 980px; }
.footer h3 { margin: 0 0 10px; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-hi); }
.footer p { margin: 0; color: var(--ivory-dim); font-size: 15px; line-height: 1.8; }
.footer a { text-decoration: none; border-bottom: 1px solid var(--line); transition: border-color .3s; }
.footer a:hover { border-color: var(--gold-hi); }
.footer__fine { font-size: 11px !important; letter-spacing: .14em; text-transform: uppercase; color: var(--ivory-faint) !important; }

/* ---------- booking sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; }
.sheet[hidden], .gallery[hidden], .lightbox[hidden] { display: none; }
.sheet__backdrop { position: absolute; inset: 0; background: rgba(8, 7, 5, .62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade .4s var(--ease); }
.sheet__panel {
  position: relative; width: min(480px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto;
  padding: 38px 34px 28px; border-radius: 6px; background: var(--ivory); color: var(--ink);
  box-shadow: 0 40px 120px rgba(0, 0, 0, .5); animation: rise .5s var(--ease);
}
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }
.sheet__x { position: absolute; right: 10px; top: 10px; width: 44px; height: 44px; border: 0; background: none; font-size: 28px; line-height: 1; color: rgba(20, 17, 14, .6); cursor: pointer; }
.sheet__eyebrow { margin: 0 0 10px; font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--gold-lo); }
.sheet__title { margin: 0 0 10px; font: italic 500 40px/1 var(--serif); }
.sheet__lede { margin: 0 0 24px; font-size: 15px; color: rgba(20, 17, 14, .72); }
.sheet__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.field { display: grid; gap: 6px; }
.field span { font: 400 10px/1.2 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: rgba(20, 17, 14, .62); }
.field em { font-style: normal; text-transform: none; letter-spacing: .04em; }
.field input, .field select {
  width: 100%; min-height: 48px; padding: 0 12px; border: 1px solid rgba(20, 17, 14, .18); border-radius: 3px;
  background: #fffdf9; color: var(--ink); font: 400 16px/1 var(--sans); color-scheme: light;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--gold-lo); box-shadow: 0 0 0 3px rgba(201, 164, 106, .25); }
.sheet__error { min-height: 1.2em; margin: 0 0 10px; font-size: 13px; color: #9b2c1f; }
.sheet__fine { margin: 14px 0 0; text-align: center; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: rgba(20, 17, 14, .5); }

/* ---------- gallery ---------- */
.gallery { position: fixed; inset: 0; z-index: 70; overflow-y: auto; overscroll-behavior: contain; background: rgba(12, 10, 8, .97); animation: fade .4s var(--ease); }
.gallery__bar {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 20px;
  padding: calc(14px + env(safe-area-inset-top)) var(--gutter) 14px;
  background: rgba(12, 10, 8, .9); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.gallery__title { margin: 0; font: italic 500 24px/1 var(--serif); white-space: nowrap; }
.gallery__title .mono { font: 400 11px/1 var(--mono); font-style: normal; letter-spacing: .14em; color: var(--ivory-faint); }
.gallery__tabs { display: flex; gap: 6px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.gallery__tabs::-webkit-scrollbar { display: none; }
.gallery__tabs button {
  flex: none; min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: none; cursor: pointer;
  font: 400 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ivory-dim);
}
.gallery__tabs button:hover { border-color: var(--gold-hi); color: var(--gold-hi); }
.gallery__close, .lightbox__close { flex: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: none; font-size: 24px; line-height: 1; cursor: pointer; }
.gallery__body { padding: 10px var(--gutter) 120px; }
.gallery__section { scroll-margin-top: 90px; }
.gallery__section h3 { margin: 48px 0 18px; font: italic 400 34px/1 var(--serif); }
.gallery__section h3 span { margin-left: 10px; font: 400 11px/1 var(--mono); font-style: normal; letter-spacing: .14em; color: var(--ivory-faint); }
.gallery__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.gallery__grid button { display: block; padding: 0; border: 0; background: var(--ink-2); aspect-ratio: 3 / 2; overflow: hidden; cursor: zoom-in; }
.gallery__grid img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease), opacity .6s; }
.gallery__grid button:hover img { transform: scale(1.04); }

.lightbox { position: fixed; inset: 0; z-index: 75; display: grid; place-items: center; background: rgba(8, 7, 5, .97); animation: fade .3s var(--ease); touch-action: pan-y; }
.lightbox__fig { margin: 0; display: grid; justify-items: center; gap: 14px; }
.lightbox__fig img { display: block; max-width: min(92vw, 1200px); max-height: 80vh; max-height: 80dvh; object-fit: contain; }
.lightbox__fig figcaption { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ivory-faint); }
.lightbox__btn {
  position: absolute; top: 50%; width: 52px; height: 52px; margin-top: -26px; border: 1px solid var(--line); border-radius: 50%;
  background: rgba(14, 12, 10, .5); font: 300 30px/1 var(--serif); cursor: pointer;
}
.lightbox__prev { left: clamp(10px, 3vw, 40px); }
.lightbox__next { right: clamp(10px, 3vw, 40px); }
.lightbox__close { position: absolute; right: 16px; top: calc(16px + env(safe-area-inset-top)); }

/* ---------- tablets ---------- */
@media (max-width: 1100px) {
  .rail { display: none; }
  .chapter[data-side="right"] .card { margin-right: 0; }
  .book-fab .book-fab__text small { display: none; }
}

/* ---------- phones ---------- */
@media (max-width: 820px) {
  :root { --topbar: 60px; --bar: calc(64px + env(safe-area-inset-bottom)); }
  body { font-size: 16px; }
  .topbar__book { display: none; }
  .brand__name { font-size: 24px; }
  .topbar__gallery { padding: 0 15px 0 13px; }

  .chapter, .chapter[data-side="right"] { justify-content: center; padding: 70vh 16px 50vh; padding-block: 70svh 50svh; }
  .card { padding: 22px 20px 18px; }
  .card__title { margin: 14px 0; font-size: clamp(30px, 8.4vw, 38px); }
  .card__inset { display: none; }
  .card__story { margin-bottom: 16px; font-size: 16px; }
  .card__details li { padding: 8px 0; }
  .places { margin: 0 -20px 16px; padding: 2px 20px 6px; scroll-padding-inline: 20px; }
  .places figure { flex-basis: 42%; }

  .chapter--hero { row-gap: 28px; padding: calc(var(--topbar) + 22px) 16px calc(var(--bar) + 28px); }
  .hero { padding-inline: 4px; }
  .hero__meta { gap: 6px 16px; margin-bottom: 20px; }
  .book-pill { min-height: 60px; gap: 12px; padding: 9px 24px 9px 9px; }
  .book-pill .book-fab__icon { width: 42px; height: 42px; }
  .book-pill .book-fab__text b { font-size: 14px; }
  .card--hero { padding: 24px 20px 20px; }

  .chapter--finale { padding-top: 140svh; }
  .card--finale { padding: 30px 20px 24px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats div:nth-child(3) { border-left: 0; }
  .stats div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .finale__ctas > * { width: 100%; }

  .book-fab {
    left: 0; right: 0; bottom: 0; justify-content: center; gap: 12px;
    min-height: var(--bar); padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
    border-radius: 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .5);
  }
  .book-fab:hover { transform: none; }
  .book-fab .book-fab__icon { width: 38px; height: 38px; }
  .book-fab .book-fab__text { display: flex; align-items: baseline; gap: 10px; }
  .book-fab .book-fab__text small { display: inline; margin: 0; }
  .footer { padding-bottom: calc(var(--bar) + 60px); }

  .pin__line { width: 22px; }
  .pin__label { left: 38px; font-size: 10px; padding: 7px 9px; top: -13px; }
  .pin.is-left .pin__label { right: 38px; }

  .sheet { place-items: end stretch; padding: 0; }
  .sheet__panel { width: 100%; max-height: 92dvh; border-radius: 14px 14px 0 0; padding: 30px 20px calc(22px + env(safe-area-inset-bottom)); }
  .sheet__title { font-size: 34px; }
  .sheet__row { grid-template-columns: 1fr; gap: 12px; margin-bottom: 12px; }

  .gallery__bar { flex-wrap: wrap; gap: 10px 14px; }
  .gallery__title { flex: 1; }
  .gallery__tabs { order: 3; flex-basis: 100%; }
  .gallery__grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .gallery__section h3 { font-size: 28px; margin-top: 36px; }
  .lightbox__btn { top: auto; bottom: calc(24px + env(safe-area-inset-bottom)); margin: 0; }
}

/* ---------- phones on their side: compact cards, booking pill instead of the bar ---------- */
@media (max-width: 920px) and (max-height: 500px) {
  :root { --topbar: 56px; --bar: 0px; }
  .chapter { justify-content: flex-start; padding: 60vh 16px; padding-block: 60svh; }
  .chapter[data-side="right"] { justify-content: flex-end; }
  .card { width: min(400px, 58vw); padding: 16px 18px 14px; }
  .card__title { margin: 10px 0; font-size: 26px; }
  .card__story { margin-bottom: 10px; font-size: 14px; line-height: 1.5; }
  .card__details { margin-bottom: 8px; }
  .card__details li { padding: 5px 0; font-size: 13px; }
  .card__flow, .places { display: none; }
  .chapter--hero { padding: calc(var(--topbar) + 10px) 20px 24px; }
  .hero__name { font-size: 64px; }
  .hero__sub, .hero__eyebrow { display: none; }
  .hero__meta { margin-bottom: 10px; }
  .chapter--finale { padding-top: 130svh; }
  .card--finale { width: min(560px, 90vw); }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .stats div:nth-child(3) { border-left: 1px solid var(--line); }
  .stats div:nth-child(n+3) { border-top: 0; }
  .finale__ctas > * { width: auto; }
  .book-fab {
    left: auto; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
    min-height: 52px; padding: 6px 20px 6px 7px; border-radius: 999px;
  }
  .book-fab .book-fab__text small { display: none; }
  .card--hero { width: min(560px, 90vw); }
  .footer { padding-bottom: 90px; }
}

@media (pointer: coarse) {
  .footer a { display: inline-block; padding-block: 10px; margin-block: -10px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .frame__in, .pin__dot::after, .book-fab::after, .book-pill::after, .btn-gold::after, .hero__cue i::after { animation: none; }
  .js .card > *, .js .hero > *, .js.is-ready .hero > *, .js .book-pill, .js .card--hero { opacity: 1; transform: none; transition: none; }
  .card__inset img { transform: none; transition: none; }
}

/* ---------- the name "DanDan-Ku" never breaks at its hyphens ---------- */
.loader__name, .brand__name, .hero__name, .footer__name, .gallery__title { white-space: nowrap; }
/* On phones the top bar is tight: "Villa" sits above the name, and the name shrinks a little on the narrowest screens. */
@media (max-width: 820px) {
  .topbar { gap: 10px; }
  .brand { display: grid; gap: 4px; padding-block: 8px; }
  .brand .brand__v, .footer__brand .brand__v { display: block; font-size: 10px; }
}
/* Each room card shows its story and its amenity list. The small extra photo shows only when the screen is tall
   enough for the whole card; the full-screen photo behind the card and the Gallery still show every room. */
@media (min-width: 821px) and (max-height: 960px) {
  .card__inset { display: none; }
}
/* From 1200px the hero name shares the row with the "At a glance" card: keep the name inside its own column. */
@media (min-width: 1200px) {
  .hero__name { font-size: min(clamp(76px, 13vw, 190px), min(560px, 40vw) / 4.7); }
}
