/* TIRTA — jungle pool villas (concept 05, WATER)
   pool #2a8c8c · shallow #8fd3cf · sun cream #f6f1e7 · deep teal ink #0f2a2c */

@font-face { font-family: "Fraunces"; src: url("fonts/fraunces.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("fonts/fraunces-italic.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter Tight"; src: url("fonts/inter-tight.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --pool: #2a8c8c;
  --pool-deep: #1d6a6b;
  --shallow: #8fd3cf;
  --cream: #f6f1e7;
  --mist: #e4ece7;
  --ink: #0f2a2c;
  --ink-soft: #3d5a5b;

  --display: "Fraunces", Georgia, serif;
  --body: "Inter Tight", system-ui, sans-serif;

  --gutter: clamp(1.125rem, 4vw, 3.5rem);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --fs-hero: clamp(3.4rem, 11vw, 12rem);
  --fs-h2: clamp(2.6rem, 6.4vw, 6.6rem);
  --fs-h3: clamp(2rem, 3.6vw, 3.6rem);
  --fs-lead: clamp(1.7rem, 3.6vw, 3.6rem);
}

*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, p, figure, ul { margin: 0; padding: 0; }
ul { list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }

html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--shallow); color: var(--ink); }
:focus-visible { outline: 2px solid var(--pool); outline-offset: 4px; }

.display {
  font-family: var(--display);
  font-weight: 300;
  line-height: 0.95;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 144;
}
.display em { font-style: italic; font-weight: 300; color: var(--pool); }
.label {
  font-family: var(--body);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-decoration: none;
}
.visually-hidden, .defs {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: fixed; top: 1rem; left: 1rem; z-index: 200;
  padding: 0.7rem 1rem; background: var(--ink); color: var(--cream);
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* PRELOADER ------------------------------------------------------------ */
.pre { display: none; }
.motion .pre {
  display: block;
  position: fixed; inset: 0; z-index: 150;
  background: var(--cream);
  pointer-events: none;
}
.pre__water {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 0%;
  background: var(--pool);
}
.pre__wave {
  position: absolute; left: 0; bottom: calc(100% - 1px);
  width: 200%; height: 46px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 46' preserveAspectRatio='none'%3E%3Cpath d='M0 23 C50 0 150 0 200 23 S350 46 400 23 V46 H0Z' fill='%232a8c8c'/%3E%3C/svg%3E") repeat-x;
  background-size: 50% 100%;
  animation: wave 2.2s linear infinite;
}
.pre__wave::after {
  content: ""; position: absolute; inset: 0;
  background: inherit; background-size: 50% 100%;
  opacity: 0.45; transform: translateY(6px) scaleY(0.8);
  animation: wave 3.4s linear infinite reverse;
}
@keyframes wave { to { transform: translateX(-50%); } }
.pre__info {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: var(--gutter);
  display: flex; justify-content: space-between; align-items: flex-end;
  color: var(--ink);
  mix-blend-mode: difference;
  filter: invert(1);
}
.pre__count { font-size: clamp(4rem, 14vw, 12rem); font-variant-numeric: tabular-nums; }

/* HEADER --------------------------------------------------------------- */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem var(--gutter);
  color: var(--cream);
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease), transform 0.6s var(--ease);
}
.header.is-solid { background: rgb(15 42 44 / 0.82); backdrop-filter: blur(10px); }
.header.is-hidden { transform: translateY(-100%); }
.wordmark {
  font-family: var(--display); font-weight: 300; text-transform: uppercase;
  letter-spacing: 0.32em; text-decoration: none; line-height: 1;
}
.header__logo { font-size: 1.35rem; padding-left: 0.32em; }
.header__nav { display: none; gap: 2.4rem; }
.header__nav a, .header__book { position: relative; padding-block: 0.4rem; }
.header__nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform 0.6s var(--ease);
}
.header__nav a:hover::after, .header__nav a:focus-visible::after { transform: scaleX(1); transform-origin: left; }
.header__book {
  padding: 0.75rem 1.3rem; border: 1px solid currentColor; border-radius: 999px;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}
.header__book:hover { background: var(--cream); color: var(--ink); }
@media (min-width: 900px) { .header__nav { display: flex; } }

/* HERO ----------------------------------------------------------------- */
.hero {
  position: relative; min-height: 100svh;
  display: grid; align-items: end;
  color: var(--cream); overflow: hidden; isolation: isolate;
  background: var(--ink);
}
.hero__media { position: absolute; inset: -3%; z-index: -2; }
.hero__img { width: 100%; height: 100%; object-fit: cover; }
.hero__img--water { display: none; }
.motion .hero__img--water {
  display: block; position: absolute; inset: 0;
  clip-path: inset(64% 0 0 0);  /* refined in script.js to follow the pool edge */
  filter: url(#ripple);
}
.hero__shade {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to top, rgb(15 42 44 / 0.85) 0%, rgb(15 42 44 / 0.1) 55%, rgb(15 42 44 / 0.5) 100%);
}
.hero__content {
  width: 100%;
  padding: 8rem var(--gutter) var(--gutter);
  display: grid; gap: clamp(1.5rem, 3vw, 2.5rem);
}
.hero__kicker { opacity: 0.85; }
.hero__title { font-size: var(--fs-hero); max-width: 12ch; }
.hero__title em { color: var(--shallow); }
.hero__foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 1.5rem;
  padding-top: 1.5rem; border-top: 1px solid rgb(246 241 231 / 0.3);
}
.hero__note { max-width: 34ch; opacity: 0.9; }
.hero__scroll { display: inline-flex; align-items: center; gap: 0.8rem; }
.hero__scroll::before {
  content: ""; width: 2.5rem; height: 1px; background: currentColor;
  animation: drift 2.6s var(--ease) infinite;
  transform-origin: left;
}
@keyframes drift { 0% { transform: scaleX(0); } 50% { transform: scaleX(1); } 100% { transform: scaleX(1); opacity: 0; } }

/* INTRO ---------------------------------------------------------------- */
.intro {
  display: grid; gap: clamp(2.5rem, 6vw, 5rem);
  padding: clamp(6rem, 14vw, 12rem) var(--gutter);
}
.intro__text { font-size: var(--fs-lead); line-height: 1.1; max-width: 22ch; }
.intro__img { width: min(100%, 560px); justify-self: end; overflow: hidden; border-radius: 2px; }
@media (min-width: 900px) {
  .intro { grid-template-columns: 1.4fr 1fr; align-items: end; }
}

/* WATERLINE REVEAL ------------------------------------------------------ */
[data-waterline] { overflow: hidden; }
[data-waterline] img { width: 100%; height: 100%; object-fit: cover; }
.motion [data-waterline] { clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0 100%); }

/* SPLIT ---------------------------------------------------------------- */
.split {
  position: relative;
  display: grid;
  background: var(--mist);
  color: var(--ink);
}
.split__sticky {
  position: sticky; top: 0; z-index: 2;
  padding: 5.5rem var(--gutter) 1.25rem;
  background: inherit;
}
.split__texts { display: grid; }
.chapter-text { grid-area: 1 / 1; display: grid; gap: 0.9rem; align-content: start; }
.chapter-text h3 { font-size: var(--fs-h3); }
.chapter-text p:not(.label) { max-width: 38ch; color: inherit; opacity: 0.85; }
.js .chapter-text { opacity: 0; visibility: hidden; transition: opacity 0.8s var(--ease), visibility 0.8s; }
.js .chapter-text.is-active { opacity: 1; visibility: visible; }
.js .chapter-text .display { transform: translateY(0.4em); transition: transform 1s var(--ease); }
.js .chapter-text.is-active .display { transform: none; }
.split__meter { display: none; }
.split__images { padding: 2rem var(--gutter) clamp(4rem, 10vw, 8rem); display: grid; gap: clamp(4rem, 12vw, 9rem); }
.chapter { display: grid; gap: 1.25rem; }
.chapter__img--wide { aspect-ratio: 3 / 2; }
.chapter__img--tall { aspect-ratio: 2 / 3; width: 82%; }
.chapter__img--small { aspect-ratio: 3 / 2; width: 70%; justify-self: end; }

@media (min-width: 900px) {
  .split { grid-template-columns: 0.9fr 1.1fr; }
  .split__sticky {
    height: 100vh; display: grid; align-content: center;
    padding: 0 var(--gutter); background: none;
  }
  .split__meter {
    display: block; position: absolute; left: var(--gutter); bottom: 3rem;
    width: 9rem; height: 1px; background: color-mix(in srgb, currentColor 25%, transparent);
  }
  .split__meter span { display: block; height: 100%; background: currentColor; transform: scaleX(0); transform-origin: left; }
  .split__images { padding: 20vh var(--gutter) 20vh 0; gap: 30vh; }
  .chapter { gap: 2rem; }
  .chapter__img--small { width: 58%; margin-top: -12%; position: relative; z-index: 1; box-shadow: 0 30px 60px -30px rgb(15 42 44 / 0.5); }
  .chapter__img--tall { width: 66%; }
}

/* ACCORDION ------------------------------------------------------------- */
.around { padding: clamp(6rem, 14vw, 12rem) var(--gutter); background: var(--cream); }
.around__head { display: grid; gap: 1.25rem; margin-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.around__head h2 { font-size: var(--fs-h2); }
.panels { display: grid; gap: 0.75rem; }
.panel {
  position: relative; overflow: hidden; border-radius: 3px;
  height: 52vw; min-height: 240px;
  color: var(--cream); cursor: pointer; outline-offset: 3px;
  background: var(--ink);
}
.panel img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--ease), opacity 0.8s var(--ease); }
.panel::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgb(15 42 44 / 0.8), transparent 60%);
}
.panel__body { position: absolute; left: 1.25rem; right: 1.25rem; bottom: 1.25rem; z-index: 1; display: grid; gap: 0.4rem; }
.panel__body h3 { font-size: clamp(1.8rem, 2.6vw, 2.8rem); white-space: nowrap; }
.panel__body p { max-width: 30ch; font-size: 0.95rem; }

@media (min-width: 900px) {
  .panels { display: flex; height: min(78vh, 760px); gap: 0.75rem; }
  .panel { flex: 1 1 0; height: auto; min-height: 0; transition: flex-grow 1.1s var(--ease); }
  .panel.is-open { flex-grow: 5; }
  .panel img { opacity: 0.7; transform: scale(1.15); }
  .panel.is-open img { opacity: 1; transform: scale(1); }
  .panel__body p { opacity: 0; transform: translateY(1rem); transition: opacity 0.6s var(--ease), transform 0.8s var(--ease); }
  .panel.is-open .panel__body p { opacity: 1; transform: none; transition-delay: 0.35s; }
  .panel:not(.is-open) .panel__body h3 {
    position: absolute; left: 0; bottom: 3.2rem;
    transform: rotate(-90deg); transform-origin: left bottom; translate: 1.6rem 0;
    font-size: 1.6rem;
  }
}

/* ROOMS ---------------------------------------------------------------- */
.rooms { padding: 0 var(--gutter) clamp(6rem, 14vw, 12rem); background: var(--cream); }
.rooms__head { display: grid; gap: 1.25rem; margin-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.rooms__head h2 { font-size: var(--fs-h2); }
.rooms__grid { display: grid; gap: clamp(3rem, 6vw, 4rem); }
.room { display: grid; gap: 0.9rem; align-content: start; }
.room__img { aspect-ratio: 4 / 5; margin-bottom: 0.6rem; border-radius: 2px; }
.room__img img { transition: transform 1.4s var(--ease); }
.room:hover .room__img img { transform: scale(1.05); }
.room h3 { font-size: clamp(2rem, 3vw, 2.8rem); }
.room p:not(.label) { color: var(--ink-soft); max-width: 36ch; }
.room__tags { color: var(--pool-deep); }
@media (min-width: 900px) {
  .rooms__grid { grid-template-columns: repeat(3, 1fr); column-gap: 2.5rem; }
  .room:nth-child(2) { margin-top: 8rem; }
  .room:nth-child(3) { margin-top: 3rem; }
}

/* BOOK ----------------------------------------------------------------- */
.book {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100svh; display: grid; align-items: center;
  padding: 8rem var(--gutter);
  color: var(--cream); background: var(--ink);
}
.book__bg { position: absolute; inset: 0; z-index: -2; }
.book__bg img { width: 100%; height: 100%; object-fit: cover; opacity: 0.55; }
.book::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(ellipse at 30% 60%, rgb(15 42 44 / 0.35), rgb(15 42 44 / 0.9));
}
.book__inner { display: grid; gap: 1.5rem; max-width: 980px; }
.book h2 { font-size: var(--fs-h2); }
.book h2 em { color: var(--shallow); }

.booking {
  margin-top: 1.5rem;
  display: grid; gap: 1rem;
  padding: 1.25rem; border: 1px solid rgb(246 241 231 / 0.25); border-radius: 4px;
  background: rgb(15 42 44 / 0.45); backdrop-filter: blur(8px);
}
.booking__field { display: grid; gap: 0.4rem; }
.booking__field .label { opacity: 0.75; }
.booking input, .booking select {
  width: 100%; padding: 0.7rem 0; border: 0; border-bottom: 1px solid rgb(246 241 231 / 0.4);
  background: transparent; color-scheme: dark; border-radius: 0;
}
.booking select option { color: var(--ink); }
.booking__submit {
  justify-self: start; padding: 1.1rem 1.8rem; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--shallow); color: var(--ink);
  transition: background-color 0.4s var(--ease), transform 0.4s var(--ease);
}
.booking__submit:hover { background: var(--cream); transform: translateY(-2px); }
.booking__note { grid-column: 1 / -1; min-height: 1.4em; font-size: 0.95rem; }
.booking__note:empty { display: none; }
@media (min-width: 760px) {
  .booking { grid-template-columns: 1fr 1fr 0.7fr auto; align-items: end; gap: 1.5rem; padding: 1.75rem; }
}

/* BADGE ---------------------------------------------------------------- */
.badge {
  position: fixed; right: var(--gutter); bottom: var(--gutter); z-index: 55;
  width: 104px; height: 104px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--ink); background: var(--shallow);
  text-decoration: none;
  box-shadow: 0 18px 40px -18px rgb(15 42 44 / 0.6);
  transition: background-color 0.4s var(--ease), opacity 0.5s var(--ease), scale 0.5s var(--ease);
}
.badge:hover { background: var(--cream); }
.badge.is-away { opacity: 0; scale: 0.6; pointer-events: none; }
.badge__ring { position: absolute; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); }
.badge__ring text { font: 500 15.5px var(--body); letter-spacing: 0.22em; text-transform: uppercase; fill: currentColor; }
.badge__core { font-size: 1.4rem; }
@media (min-width: 900px) { .badge { width: 132px; height: 132px; } }
/* Without motion the badge never hides, so keep the hero's bottom line clear of it */
html:not(.motion) .hero__foot { padding-right: calc(104px + var(--gutter)); }
@media (min-width: 900px) { html:not(.motion) .hero__foot { padding-right: calc(132px + var(--gutter)); } }

/* FOOTER --------------------------------------------------------------- */
.footer { background: var(--ink); color: var(--cream); padding: clamp(4rem, 10vw, 7rem) var(--gutter) var(--gutter); display: grid; gap: 3rem; }
.footer__logo { font-size: clamp(4.5rem, 21vw, 22rem); letter-spacing: 0.12em; color: var(--shallow); opacity: 0.92; margin-left: -0.04em; }
.footer__row {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
  padding-top: 1.5rem; border-top: 1px solid rgb(246 241 231 / 0.2); opacity: 0.8;
}
.footer__row a { text-decoration: none; }
.footer__row a:hover { color: var(--shallow); }

/* SplitText masks ------------------------------------------------------- */
.motion [data-lines] { visibility: hidden; }
.motion [data-lines].is-split { visibility: visible; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
}
