/* Villa Chayofa, ref 1938. Page styles on top of scrollcraft.css.
   The six colour roles are rewritten every frame by villa.js from the time of
   day; the values here are the 08:30 morning state, which is also what a
   visitor without JavaScript gets. */

:root {
  --sc-canvas:     #EAF0F1;
  --sc-surface:    #F6F8F7;
  --sc-ink:        #14191D;
  --sc-ink-soft:   #46525A;
  --sc-accent:     #6F5A1C;
  --sc-accent-ink: #FBF8F1;
  --wash:          #FFF6DE;
  --wash-a:        0;
  --sc-font-display: "Marcellus", "Cormorant Garamond", Georgia, serif;
  --sc-font-text:    "Jost", system-ui, sans-serif;
  --sc-track-tight: -0.012em;
  --sc-track-snug:  -0.004em;
  --sc-shadow-color: 210 30% 8%;
  --bar-h: 6rem;
  --r: 4px;
  --mx: 0; --my: 0;
  --light-ink: #F5F0E6;
  --light-soft: #D7CFC2;
}

body { transition: none; }
.sc-display { font-weight: 400; }
.sc-lede { font-weight: 300; }
.sc-body, .sc-lede { color: inherit; }
.sc-body { color: var(--sc-ink-soft); }
p { margin: 0; }
h1, h2, h3 { font-weight: 400; }

.skip {
  position: fixed; left: var(--sc-4); top: var(--sc-4); z-index: 100;
  padding: var(--sc-2) var(--sc-4); background: var(--sc-ink); color: var(--sc-canvas);
  border-radius: var(--r); transform: translateY(-200%);
}
.skip:focus-visible { transform: none; }

/* ------------------------------------------------------------- buttons -- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.9rem; padding: 0 1.35rem; white-space: nowrap;
  font: 500 0.82rem/1 var(--sc-font-text); letter-spacing: 0.14em; text-transform: uppercase;
  text-decoration: none; border-radius: var(--r);
  background: var(--sc-accent); color: var(--sc-accent-ink);
  box-shadow: var(--sc-e1);
  transition: transform 140ms var(--sc-ease-out), box-shadow 160ms var(--sc-ease-out), filter 160ms var(--sc-ease-out);
}
.btn:active { transform: translateY(1px) scale(0.98); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { box-shadow: var(--sc-e2); filter: brightness(1.08); }
}
.btn--lg { min-height: 3.4rem; padding: 0 2rem; font-size: 0.9rem; }

/* ---------------------------------------------------------------- bar -- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: var(--sc-z-chrome);
  height: var(--bar-h); padding: 0 var(--sc-gutter);
  display: flex; align-items: center; justify-content: space-between;
  pointer-events: none;
}
.bar > * { pointer-events: auto; }
.bar__mark img { height: 60px; width: auto; border-radius: 2px; box-shadow: var(--sc-e1); }
.bar__cta {
  font: 500 0.78rem/1 var(--sc-font-text); letter-spacing: 0.14em; text-transform: uppercase;
  text-decoration: none; padding: 0.8rem 1.1rem; border-radius: var(--r);
  background: var(--sc-accent); color: var(--sc-accent-ink); box-shadow: var(--sc-e1);
  transition: transform 140ms var(--sc-ease-out), filter 160ms var(--sc-ease-out);
}
.bar__cta:active { transform: translateY(1px); }
@media (hover: hover) and (pointer: fine) { .bar__cta:hover { filter: brightness(1.08); } }

/* ---------------------------------------------------------- sun clock -- */
.clock {
  position: fixed; left: max(var(--sc-4), env(safe-area-inset-left)); bottom: max(var(--sc-4), env(safe-area-inset-bottom));
  z-index: var(--sc-z-chrome);
  display: flex; align-items: center; gap: var(--sc-3);
  padding: var(--sc-2) var(--sc-4) var(--sc-2) var(--sc-2);
  border-radius: var(--r);
  background: color-mix(in oklab, var(--sc-canvas) 86%, transparent);
  -webkit-backdrop-filter: blur(10px) saturate(1.2); backdrop-filter: blur(10px) saturate(1.2);
  box-shadow: var(--sc-e2), inset 0 0 0 1px var(--sc-hairline);
  color: var(--sc-ink);
}
.clock__dial { width: 8.75rem; touch-action: none; cursor: grab; border-radius: var(--r); }
.clock__dial:active { cursor: grabbing; }
.clock__dial svg { width: 100%; height: auto; overflow: visible; }
.clock__arc { fill: none; stroke: var(--sc-ink-soft); stroke-width: 1.2; stroke-dasharray: 2 4; opacity: 0.75; }
.clock__arc--under { opacity: 0.35; }
.clock__horizon { stroke: var(--sc-ink); stroke-width: 1; opacity: 0.45; }
.clock__ticks line { stroke: var(--sc-ink); stroke-width: 1.4; opacity: 0.55; }
.clock__ticks line.on { stroke: var(--sc-accent); opacity: 1; stroke-width: 2.2; }
.clock__disc { fill: var(--sun, #E9B949); }
.clock__halo { fill: var(--sun, #E9B949); opacity: 0.22; }
.clock__moon { fill: var(--sc-ink); opacity: var(--moon, 0); }
.clock__read { display: grid; gap: 2px; min-width: 7rem; }
.clock__time { font: 400 1.6rem/1 var(--sc-font-display); letter-spacing: 0.02em; }
.clock__name {
  justify-self: start; padding: 0.3rem 0; background: none; border: 0; cursor: pointer;
  font: 400 0.8rem/1.2 var(--sc-font-text); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--sc-ink-soft); text-decoration: underline; text-decoration-color: var(--sc-hairline-strong);
  text-underline-offset: 0.3em;
}
.clock__name::after { content: " ▴"; font-size: 0.7em; }
@media (hover: hover) and (pointer: fine) { .clock__name:hover { color: var(--sc-ink); } }
.clock__hours {
  position: absolute; left: 0; bottom: calc(100% + var(--sc-2));
  margin: 0; padding: var(--sc-2); list-style: none; min-width: 17rem;
  border-radius: var(--r);
  background: var(--sc-canvas); color: var(--sc-ink);
  box-shadow: var(--sc-e3), inset 0 0 0 1px var(--sc-hairline);
}
.clock__hours a {
  display: flex; gap: var(--sc-3); padding: 0.55rem 0.7rem; border-radius: 3px;
  text-decoration: none; font-size: 0.95rem;
}
.clock__hours a span { font-variant-numeric: tabular-nums; color: var(--sc-ink-soft); }
.clock__hours a[aria-current] { color: var(--sc-accent); }
@media (hover: hover) and (pointer: fine) { .clock__hours a:hover { background: var(--sc-hairline); } }

/* ---------------------------------------------------------- photo wash --
   Every photograph carries the light of the hour: a soft-light wash in the
   colour of the time of day. Part of the sun clock. */
.wash { position: relative; overflow: hidden; margin: 0; }
.wash::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: var(--wash); mix-blend-mode: soft-light; opacity: var(--wash-a);
}
figure { margin: 0; }

/* -------------------------------------------------------- 08:30 hero -- */
.hero { --top: 30svh; }
.hero__stage { background: #B9DCEB; }
.hero__plane { position: absolute; inset: 0; will-change: transform; }
/* The sky plate: the real sky's colours, sampled from the photograph, as a
   clean gradient so nothing behind the house can show a seam. */
.hero__sky {
  inset: -4% -3%;
  background: linear-gradient(to bottom, #5EA4C5 0%, #7DB8D4 22%, #A6D0E3 42%, #C6E1EC 60%, #DDEDF2 78%, #E6F1F3 100%);
  transform: translate3d(calc(var(--mx) * -5px), calc(var(--sc-p, 0) * -5vh + var(--my) * -3px), 0);
}

.hero {
  --t0: calc(var(--bar-h) + 3.2svh);
  --h1: clamp(3.2rem, 1.4rem + 6.4vw, 8.4rem);
}
.hero__title {
  inset: auto;
  top: var(--t0); left: var(--sc-gutter); right: var(--sc-gutter);
  max-width: 50rem;
  color: #12202A;
  transform: translate3d(calc(var(--mx) * -9px), calc(var(--sc-p, 0) * -15vh + var(--my) * -5px), 0);
  opacity: clamp(0, calc(1.25 - var(--sc-p, 0) * 1.9), 1);
}
.hero__name {
  font: 400 var(--h1)/0.92 var(--sc-font-display);
  letter-spacing: -0.015em; margin: 0; white-space: nowrap;
}
/* The front plane starts exactly where the one-line name ends, and moves with
   it, so the two read as one block while sitting either side of the house. */
.hero__front { top: calc(var(--t0) + var(--h1) * 0.92 + var(--sc-4)); }
.hero__line {
  max-width: 34ch;
  font-size: clamp(1.05rem, 0.95rem + 0.45vw, 1.3rem); line-height: 1.45; font-weight: 400;
  color: #1C2D38;
}
.hero__price { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sc-4) var(--sc-5); margin-top: var(--sc-5); }
.hero__price > span { font: 400 clamp(1.5rem, 1.2rem + 1vw, 2.1rem)/1 var(--sc-font-display); letter-spacing: 0.01em; }
.hero .btn { background: #12202A; color: #F4F1EA; }

/* The house is sized by its own aspect, never cropped at the bottom, so there
   is always lawn below the frame however far the plane rises. */
.hero { --rise: 30vh; --hw: max(100vw, calc((100svh - var(--top)) * 1.62)); --hx: 0.5; }
.hero__house { inset: var(--top) auto auto 0; width: 100%; height: auto;
  transform-origin: 50% 70%;
  transform: translate3d(calc(var(--mx) * -16px), calc(var(--sc-p, 0) * var(--rise) * -1), 0) scale(calc(1 + var(--sc-p, 0) * 0.06));
}
.hero__house picture { display: block; }
.hero__house img {
  display: block; max-width: none; width: var(--hw); height: auto;
  margin-left: calc((100vw - var(--hw)) * var(--hx));
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 7%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 7%);
}

.hero__haze {
  background:
    radial-gradient(48% 38% at 96% 0%, rgb(255 244 214 / 0.42), transparent 70%),
    linear-gradient(to top, rgb(234 240 241 / 0.0) 0%, rgb(234 240 241 / 0) 60%);
  mix-blend-mode: screen;
  transform: translate3d(calc(var(--mx) * -26px), calc(var(--sc-p, 0) * -60vh), 0);
  opacity: calc(1 - var(--sc-p, 0) * 0.6);
}
/* the floor of the hero fades into the page ground so the exit has no edge */
.hero__stage::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 16svh; z-index: 2; pointer-events: none;
  background: linear-gradient(to top, var(--sc-canvas), transparent);
  opacity: var(--sc-p, 0);
}

/* -------------------------------------------------------- 10:00 hall -- */
.hall__stage { display: grid; grid-template-columns: minmax(0, 38fr) minmax(0, 62fr); }
.hall__copy { position: relative; padding: calc(var(--bar-h) + var(--sc-6)) var(--sc-gutter) var(--sc-8); }
.hall__copy > div {
  position: absolute; left: var(--sc-gutter); right: var(--sc-6); top: 50%; translate: 0 -50%;
}
.hall__copy .sc-lede { margin-top: var(--sc-5); max-width: 30ch; }
.hall__media { position: relative; }
.hall__shot { position: absolute; inset: 0; }
.hall__shot img { width: 100%; height: 100%; object-fit: cover; max-width: none; }
.hall__shot:first-child img { object-position: 60% 50%; }

/* ------------------------------------------------------- 13:30 lunch -- */
.lunch { padding-block: var(--sc-10) var(--sc-9); }
.lunch__grid {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--sc-5);
  align-items: start;
}
.lunch__kitchen { grid-column: 1 / 9; grid-row: 1; border-radius: var(--r); box-shadow: var(--sc-e2); }
.lunch__kitchen img, .lunch__terrace img { width: 100%; height: auto; }
.lunch__terrace {
  grid-column: 8 / 13; grid-row: 1; margin-top: 34%; z-index: 2;
  border-radius: var(--r); box-shadow: var(--sc-e3);
  outline: 6px solid var(--sc-canvas);
}
.lunch__copy { grid-column: 2 / 8; grid-row: 2; margin-top: var(--sc-8); }
.lunch__copy .sc-body { max-width: 52ch; }

/* --------------------------------------------------- 16:00 the rooms -- */
.rooms__stage { display: flex; align-items: center; }
.rooms__rail {
  display: flex; align-items: flex-start; gap: clamp(1.5rem, 3vw, 3.5rem);
  padding: calc(var(--bar-h) + var(--sc-4)) var(--sc-gutter) var(--sc-6);
}
.rooms__lead { flex: 0 0 clamp(17rem, 26vw, 25rem); align-self: center; }
.rooms__lead .sc-body { margin-top: var(--sc-5); font-size: var(--sc-t-lg); line-height: 1.5; color: var(--sc-ink); font-weight: 300; }
.room { flex: 0 0 clamp(16rem, 25vw, 23rem); }
.room:nth-child(odd) { margin-top: 6svh; }
.room__img { aspect-ratio: 4 / 5; border-radius: var(--r); box-shadow: var(--sc-e2); }
.room__img img { width: 100%; height: 100%; object-fit: cover; max-width: none; }
.room h3 { margin: var(--sc-4) 0 var(--sc-2); font: 400 var(--sc-t-xl)/1.1 var(--sc-font-display); }
.room dl { display: grid; grid-template-columns: auto 1fr; gap: 2px var(--sc-4); margin: 0; font-size: 0.95rem; line-height: 1.45; }
.room dt { color: var(--sc-ink-soft); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.72rem; padding-top: 0.25em; }
.room dd { margin: 0; }
.room--last { margin-right: var(--sc-gutter); }

/* ----------------------------------------------------- 19:15 sunset -- */
.sunset { padding: 0; }
.sunset__frame { position: relative; height: 112svh; overflow: hidden; }
.sunset__img { position: absolute; inset: -12% 0; }
.sunset__img picture, .sunset__img img { width: 100%; height: 100%; max-width: none; }
.sunset__img img { object-fit: cover; object-position: 50% 55%; }
.sunset__frame::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 46%; pointer-events: none;
  background: linear-gradient(to top, rgb(18 12 14 / 0.78), rgb(18 12 14 / 0.32) 48%, transparent);
}
.sunset__copy {
  position: absolute; z-index: 2; left: var(--sc-gutter); right: var(--sc-gutter); bottom: 16svh;
  color: var(--light-ink);
}
.sunset__line { font: 400 clamp(1.8rem, 1.2rem + 2.4vw, 3.6rem)/1.08 var(--sc-font-display); max-width: 20ch; text-wrap: balance; }

/* ------------------------------------------------------- 20:30 dusk -- */
.dusk__stage { background: #0F1520; }
.dusk__frame {
  position: absolute; left: 50%; top: 50%;
  width: max(100vw, 150svh); height: max(66.667vw, 100svh);
  translate: var(--fx, -50%) -50%;
}
.dusk__frame picture, .dusk__frame img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }
.dusk__frame img { object-fit: cover; }
.dusk__day img { filter: brightness(calc(1 - var(--w, 0) * 0.35)) saturate(calc(1 - var(--w, 0) * 0.3)); }
.dusk__night {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(var(--w, 0) * 160% - 60%), transparent calc(var(--w, 0) * 160%));
          mask-image: linear-gradient(to bottom, #000 calc(var(--w, 0) * 160% - 60%), transparent calc(var(--w, 0) * 160%));
}
.dusk__night img { filter: brightness(calc(0.5 + var(--L, 0) * 0.5)) saturate(calc(0.75 + var(--L, 0) * 0.25)); }
.dusk__glow i {
  position: absolute; left: var(--x); top: var(--y); width: 11%; aspect-ratio: 1; translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(255 216 160 / 0.6), rgb(255 186 110 / 0.18) 38%, transparent 68%);
  mix-blend-mode: screen; opacity: var(--L, 0);
}
.dusk__glow i.pool { width: 16%; background: radial-gradient(circle, rgb(140 232 255 / 0.55), rgb(70 190 230 / 0.18) 40%, transparent 70%); }
.dusk__scrim {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(to top right, rgb(10 14 22 / 0.86) 0%, rgb(10 14 22 / 0.55) 28%, rgb(10 14 22 / 0.12) 50%, transparent 64%);
}
.dusk__copy {
  position: absolute; z-index: 4; left: var(--sc-gutter); right: var(--sc-gutter); bottom: clamp(5.5rem, 14svh, 9rem);
  color: var(--light-ink); max-width: 46rem;
}
.dusk__copy h2 { position: absolute; left: 0; bottom: 0; max-width: 14ch; }

/* ------------------------------------------------------ 21:30 night -- */
.night { padding-bottom: 0; }
.night__band { position: relative; height: 74svh; overflow: hidden; }
.night__band picture, .night__band img { width: 100%; height: 100%; max-width: none; }
.night__band img { object-fit: cover; object-position: 50% 62%; }
.night__band::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, var(--sc-canvas) 0%, transparent 40%);
}
.night__grid {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: var(--sc-9);
  margin-top: calc(var(--sc-8) * -1); position: relative; z-index: 2;
  padding-bottom: var(--sc-9);
}
.night__ask .sc-lede { max-width: 32ch; }
.night__actions { margin-top: var(--sc-6) !important; }
.night__direct { list-style: none; margin: var(--sc-5) 0 0; padding: 0; display: grid; gap: var(--sc-2); }
.night__direct a { font-size: 1.1rem; text-decoration-color: var(--sc-hairline-strong); }
.night__direct span { color: var(--sc-ink-soft); font-size: 0.9rem; margin-left: var(--sc-2); }
.night__who { color: var(--sc-ink-soft); font-size: 0.95rem; }
.ledger { margin: 0; border-top: 1px solid var(--sc-hairline-strong); }
.ledger > div {
  display: flex; justify-content: space-between; gap: var(--sc-4);
  padding: 0.72rem 0; border-bottom: 1px solid var(--sc-hairline);
}
.ledger dt { color: var(--sc-ink-soft); }
.ledger dd { margin: 0; text-align: right; }
.ledger > div:first-child dd { font: 400 1.6rem/1 var(--sc-font-display); color: var(--sc-accent); }
.night__also { margin-top: var(--sc-5); color: var(--sc-ink-soft); font-size: 0.95rem; max-width: 58ch; }
.foot {
  display: grid; gap: var(--sc-2); padding-block: var(--sc-6) calc(var(--sc-9) + 3rem);
  border-top: 1px solid var(--sc-hairline); color: var(--sc-ink-soft); font-size: 0.82rem;
}

/* ------------------------------------------------------------ mobile -- */
@media (max-width: 860px) {
  :root { --bar-h: 5rem; }
  .bar__mark img { height: 48px; }
  .bar__cta { padding: 0.75rem 1rem; font-size: 0.74rem; white-space: nowrap; }
  /* The doubled logo and the pill do not fit side by side on a phone. The hero
     carries its own button, so the bar shows the logo over the hero and swaps
     it for the pill once the hero is behind you. */
  .bar__mark, .bar__cta { transition: opacity 200ms var(--sc-ease-out), visibility 0s linear 200ms; }
  .bar__cta { position: absolute; right: var(--sc-gutter); opacity: 0; visibility: hidden; }
  .past-hero .bar__cta { opacity: 1; visibility: visible; transition-delay: 0s; }
  .past-hero .bar__mark { opacity: 0; visibility: hidden; }

  .hero { --top: 43svh; }
  .hero { --t0: calc(var(--bar-h) + 1.5svh); --h1: clamp(2.9rem, 14.5vw, 4.4rem); }
  .hero__line { font-size: 1.02rem; max-width: 30ch; }
  .hero__price { margin-top: var(--sc-4); gap: var(--sc-3) var(--sc-4); }
  .hero { --rise: 17vh; --hw: calc((100svh - var(--top)) * 2); --hx: 0.47; }
  .hero__title { opacity: clamp(0, calc(1 - var(--sc-p, 0) * 2.6), 1); }

  .hall__stage { grid-template-columns: 1fr; grid-template-rows: 52svh 1fr; }
  .hall__media { grid-row: 1; }
  .hall__copy { grid-row: 2; padding: 0; }
  .hall__copy > div { top: var(--sc-6); translate: none; right: var(--sc-gutter); }
  .hall__copy .sc-display { font-size: var(--sc-t-2xl); }
  .hall__copy .sc-lede { margin-top: var(--sc-3); font-size: 1.08rem; }

  .lunch { padding-block: var(--sc-8) var(--sc-8); }
  .lunch__kitchen { grid-column: 1 / 13; }
  .lunch__terrace { grid-column: 5 / 13; grid-row: 2; margin-top: -18%; outline-width: 4px; }
  .lunch__copy { grid-column: 1 / 13; grid-row: 3; margin-top: var(--sc-6); }

  .rooms__lead { flex-basis: 78vw; }
  .room { flex-basis: 74vw; }
  .room:nth-child(odd) { margin-top: 0; }
  .rooms__rail { align-items: center; padding-bottom: 7rem; }

  .sunset__frame { height: 100svh; }
  .sunset__img img { object-position: 30% 55%; }
  .sunset__copy { bottom: 8.5rem; }

  .dusk__frame { --fx: -56%; }
  .dusk__scrim {
    background: linear-gradient(to top, rgb(10 14 22 / 0.92) 0%, rgb(10 14 22 / 0.8) 24%, rgb(10 14 22 / 0.4) 42%, transparent 58%);
  }
  .dusk__copy { bottom: 8.5rem; }
  .dusk__copy h2 { font-size: var(--sc-t-2xl); }

  .night__band { height: 52svh; }
  .night__grid { grid-template-columns: 1fr; gap: var(--sc-8); margin-top: calc(var(--sc-6) * -1); }

  .clock { padding: 8px 14px 8px 8px; gap: var(--sc-3); }
  .clock__dial { width: 8rem; }
  .clock__time { font-size: 1.5rem; }
  .clock__read { min-width: 6.5rem; }
  .clock__name { font-size: 0.82rem; min-height: 2.75rem; }
  .clock__hours { min-width: min(17rem, calc(100vw - 2rem)); }
}

/* ---------------------------------------------------- reduced motion -- */
@media (prefers-reduced-motion: reduce) {
  .hero__plane, .hero__house, .hero__title, .hero__sky, .hero__haze { transform: none !important; }
  .hero__stage::after { opacity: 0; }
  .sunset__img { inset: 0; }
}
