/* Mayaban Lake Retreat — 3D tech demo (throwaway). */
:root {
  --forest: #1f3a2c;
  --leaf: #2f5a43;
  --moss: #5f8a63;
  --sage: #a9bfa0;
  --cream: #f7f3ea;
  --sand: #ebe3d2;
  --ink: #22261f;
  --ink-soft: #565c50;
  --gold: #b98a4a;
  --white: #fffdf8;
  --haze: #c9d3c4;
  --radius: 18px;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(16px, 5vw, 72px);
  --bar-h: 64px;
  --ribbon-h: 30px;              /* set from the real ribbon by app.js (it wraps on phones) */
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cream); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.65; overflow-x: clip; }
img, canvas { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.12; margin: 0 0 .5em; letter-spacing: -.01em; }
h2 { font-size: clamp(30px, 4.6vw, 56px); }
h2 em { font-style: italic; color: var(--leaf); }
p { margin: 0 0 1em; }
button { font: inherit; color: inherit; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--moss); margin-bottom: 14px; }
.muted { color: var(--ink-soft); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 26px; border-radius: 999px; font-size: 14px; font-weight: 600; letter-spacing: .04em; text-decoration: none; border: 1.5px solid transparent; cursor: pointer; transition: background .2s, color .2s; }
.btn-solid { background: var(--forest); color: var(--white); }
.btn-solid:hover { background: var(--leaf); }
.btn-line { background: transparent; border-color: currentColor; }
.btn-small { min-height: 40px; padding: 0 18px; font-size: 13px; }
.btn-glass { background: rgba(20, 32, 24, .55); color: var(--white); border-color: rgba(255,255,255,.35); backdrop-filter: blur(6px); }

.demo-ribbon { position: fixed; inset: auto 0 0 0; z-index: 60; background: rgba(31, 58, 44, .92); color: var(--cream); font-size: 12px; text-align: center; padding: 6px 12px; }

.topbar { position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--bar-h); display: flex; align-items: center; gap: 24px; padding: 0 var(--gutter); color: var(--white); transition: background .35s, color .35s; }
.topbar.solid { background: rgba(247, 243, 234, .94); color: var(--ink); box-shadow: 0 1px 0 rgba(0,0,0,.06); backdrop-filter: blur(8px); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; color: inherit; }
.brand-mark { width: 26px; height: 26px; border-radius: 50% 50% 50% 0; background: var(--sage); box-shadow: inset -6px -6px 0 var(--leaf); transform: rotate(-45deg); }
.brand-name { font-family: var(--serif); font-size: 22px; }
.topnav { display: flex; gap: 22px; font-size: 13px; font-weight: 500; letter-spacing: .06em; }
.topnav a { text-decoration: none; color: inherit; opacity: .88; }
.topbar .btn-solid { background: var(--white); color: var(--forest); }
.topbar.solid .btn-solid { background: var(--forest); color: var(--white); }

/* ---------- Hero (copied from prototype 1, shortened) ---------- */
.hero { position: relative; height: 340vh; background: #10180f; }
.hero-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.hero-canvas, .hero-still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-canvas { z-index: 1; }
.hero-shade { position: absolute; inset: 0; z-index: 2; background: linear-gradient(180deg, rgba(10,20,12,.45) 0%, rgba(10,20,12,.05) 38%, rgba(10,20,12,.15) 62%, rgba(10,20,12,.62) 100%); }
.hero-captions { position: absolute; inset: 0; z-index: 3; color: var(--white); }
.cap { position: absolute; left: var(--gutter); right: var(--gutter); margin: 0; text-shadow: 0 2px 24px rgba(0,0,0,.35); transition: opacity .2s linear; }
.cap-1 { bottom: 14vh; bottom: max(14svh, calc(var(--ribbon-h) + 64px)); max-width: 760px; }
.cap-1 .eyebrow { color: var(--sand); }
.cap-1 h1 { font-size: clamp(46px, 8.4vw, 116px); margin-bottom: 18px; }
.cap-1 h1 em { color: var(--sand); }
.cap-1 .lede { font-size: clamp(16px, 1.6vw, 20px); max-width: 520px; }
.cap-2, .cap-3 { top: 50%; translate: 0 -50%; font-family: var(--serif); font-size: clamp(30px, 5vw, 66px); line-height: 1.15; opacity: 0; }
.cap-3 { text-align: right; }
.scroll-hint { position: absolute; z-index: 3; left: 50%; bottom: max(46px, calc(var(--ribbon-h) + 14px)); translate: -50% 0; color: var(--white); font-size: 11px; letter-spacing: .3em; text-transform: uppercase; display: flex; flex-direction: column; align-items: center; gap: 8px; opacity: .85; }
.scroll-hint span { width: 1px; height: 38px; background: linear-gradient(var(--white), transparent); animation: drip 1.8s ease-in-out infinite; transform-origin: top; }
@keyframes drip { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* ---------- Welcome ---------- */
.welcome { max-width: 900px; margin: 0 auto; padding: clamp(80px, 12vw, 150px) var(--gutter); text-align: center; }
.welcome p.muted { max-width: 620px; margin: 0 auto; }

/* ---------- Depth-parallax stay ---------- */
.stay { position: relative; height: 480vh; background: #111; }
.stay-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; color: var(--white); }
.stay-canvas, .stay-fallback { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stay-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8,14,10,.62) 0%, rgba(8,14,10,.18) 46%, rgba(8,14,10,0) 70%), linear-gradient(0deg, rgba(8,14,10,.5), rgba(8,14,10,0) 40%); pointer-events: none; }
.stay-copy { position: absolute; left: var(--gutter); bottom: 16vh; bottom: max(16svh, calc(var(--ribbon-h) + 24px)); max-width: 440px; }
.stay-copy .eyebrow { color: var(--sand); }
.stay-slides { display: grid; }
.stay-slide { grid-area: 1 / 1; opacity: 0; transform: translateY(14px); transition: opacity .5s, transform .5s; text-shadow: 0 2px 20px rgba(0,0,0,.4); }
.stay-slide.is-on { opacity: 1; transform: none; }
.stay-slide h2 { color: var(--white); }
.tech-note { position: absolute; right: var(--gutter); top: calc(var(--bar-h) + 18px); max-width: 300px; font-size: 12px; line-height: 1.5; padding: 8px 12px; border-radius: 10px; background: rgba(10,18,12,.5); backdrop-filter: blur(6px); margin: 0; }
.stay-dots { position: absolute; right: 24px; top: 50%; translate: 0 -50%; display: grid; gap: 10px; }
.stay-dots span { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.35); transition: background .3s, transform .3s; }
.stay-dots span.on { background: var(--white); transform: scale(1.3); }

/* ---------- Explore the grounds (3D map) ---------- */
.explore { position: relative; height: 420vh; background: #c6d0c0; }
.explore-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: radial-gradient(ellipse at 50% 30%, #dfe6da 0%, #b9c6b4 70%); }
.map-canvas, .map-fallback { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.map-canvas { touch-action: pan-y; cursor: grab; outline: none; }
.map-canvas:active { cursor: grabbing; }
.explore.active .map-canvas { touch-action: none; }
.map-intro { position: absolute; left: var(--gutter); right: var(--gutter); top: calc(var(--bar-h) + 6vh); top: calc(var(--bar-h) + 6svh); color: var(--white); text-shadow: 0 2px 22px rgba(0,0,0,.45); max-width: 520px; transition: opacity .4s; pointer-events: none; }
.map-intro .eyebrow { color: var(--sand); }
.map-intro h2 { color: var(--white); }
.map-intro h2 em { color: var(--sand); }
.map-pins { position: absolute; inset: 0; pointer-events: none; }
.pin { position: absolute; left: 0; top: 0; pointer-events: auto; display: flex; flex-direction: column; align-items: center; transform: translate(-50%, -100%); border: 0; padding: 0; background: none; cursor: pointer; transition: opacity .3s; }
.pin-label { white-space: nowrap; font-size: 12px; font-weight: 600; letter-spacing: .06em; color: var(--forest); background: var(--white); padding: 6px 12px; border-radius: 999px; box-shadow: 0 6px 18px -6px rgba(0,0,0,.45); }
.pin-stem { width: 2px; height: 26px; background: linear-gradient(var(--white), rgba(255,255,255,.2)); }
.pin-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); border: 2px solid var(--white); margin-top: -2px; }
.pin:hover .pin-label, .pin.on .pin-label { background: var(--forest); color: var(--white); }
.map-hint { position: absolute; left: 50%; bottom: max(58px, calc(var(--ribbon-h) + 26px)); translate: -50% 0; color: var(--white); font-size: 13px; font-weight: 500; letter-spacing: .04em; background: rgba(15,25,18,.55); padding: 8px 16px; border-radius: 999px; backdrop-filter: blur(6px); white-space: nowrap; opacity: 0; transition: opacity .4s; pointer-events: none; }
.map-hint.show { opacity: 1; }
.map-tools { position: absolute; right: var(--gutter); top: calc(var(--bar-h) + 16px); display: flex; gap: 8px; }
.map-label { position: absolute; left: 16px; bottom: max(40px, calc(var(--ribbon-h) + 8px)); margin: 0; font-size: 11px; color: var(--white); background: rgba(15,25,18,.55); padding: 4px 10px; border-radius: 6px; }
.pin-card { position: absolute; z-index: 2; right: var(--gutter); bottom: max(70px, calc(var(--ribbon-h) + 38px)); width: min(360px, calc(100vw - 32px)); background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: 0 30px 60px -24px rgba(0,0,0,.55); animation: rise .35s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
.pin-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.pin-body { padding: 16px 20px 18px; }
.pin-body h3 { font-size: 24px; margin-bottom: 6px; }
.pin-body p { margin: 0; font-size: 14px; color: var(--ink-soft); }
.pin-close { position: absolute; right: 10px; top: 10px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); font-size: 22px; line-height: 1; cursor: pointer; }
.map-fallback { transition: opacity .4s; }
.map-static-list { position: absolute; inset: auto var(--gutter) max(70px, calc(var(--ribbon-h) + 38px)); display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Closing ---------- */
.closing { text-align: center; padding: clamp(90px, 12vw, 160px) var(--gutter) clamp(110px, 12vw, 170px); background: var(--forest); color: var(--cream); }
.closing h2 em { color: var(--sage); }
.closing .btn-solid { background: var(--white); color: var(--forest); }

/* ---------- Enquiry dialog ---------- */
.enquiry { border: 0; border-radius: var(--radius); padding: 0; width: min(420px, calc(100vw - 32px)); box-shadow: 0 40px 80px -30px rgba(0,0,0,.6); }
.enquiry::backdrop { background: rgba(10, 18, 12, .55); }
.enquiry-form { padding: 28px; display: grid; gap: 14px; }
.enquiry-form h2 { font-size: 30px; margin: 0; }
.enquiry-form label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; }
.enquiry-form input { font: inherit; font-weight: 400; padding: 12px 14px; border: 1.5px solid rgba(31,58,44,.3); border-radius: 12px; background: var(--white); }
.enq-error { color: #a23b2a; font-size: 14px; margin: 0; }
.enq-thanks { color: var(--leaf); font-size: 14px; margin: 0; }
.enq-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- Phone ---------- */
@media (max-width: 760px) {
  .topnav { display: none; }
  .stay-copy { right: var(--gutter); bottom: max(12svh, calc(var(--ribbon-h) + 24px)); }
  .stay-copy h2 { font-size: clamp(28px, 8.4vw, 40px); }
  .stay-slide p { font-size: 15px; line-height: 1.55; }
  .cap-1 h1 { font-size: clamp(40px, 12.5vw, 64px); }
  .cap-2, .cap-3 { font-size: clamp(26px, 8vw, 40px); }
  .demo-ribbon { font-size: 11px; padding: 5px 10px; line-height: 1.45; }
  .tech-note { left: var(--gutter); right: var(--gutter); max-width: none; font-size: 11px; }
  .stay-dots { right: 10px; }
  .map-intro { top: calc(var(--bar-h) + 3vh); }
  .map-tools { top: calc(var(--bar-h) + 10px); right: 16px; }
  .map-label { bottom: calc(var(--ribbon-h) + 8px); }
  .pin-card { left: 16px; right: 16px; width: auto; bottom: calc(var(--ribbon-h) + 12px); max-height: calc(100svh - var(--bar-h) - var(--ribbon-h) - 24px); overflow-y: auto; }
  .pin-card img { aspect-ratio: 16 / 8; }
  .pin-label { font-size: 11px; padding: 5px 9px; }
  .pin-stem { height: 18px; }
  .map-hint { bottom: calc(var(--ribbon-h) + 40px); font-size: 12px; white-space: normal; text-align: center; width: max-content; max-width: calc(100vw - 32px); }
  .map-static-list { inset: auto 16px calc(var(--ribbon-h) + 40px); }
  .explore.card-open .map-hint, .explore.card-open .map-label { opacity: 0; visibility: hidden; }
}

/* Touch screens: every control at least 44 px (WCAG 2.5.5 / platform guidance). */
@media (pointer: coarse) {
  .btn-small { min-height: 44px; }
  .brand { min-height: 44px; }
  .pin-close { width: 44px; height: 44px; right: 8px; top: 8px; }
  .pin-label { padding: 8px 12px; }
  .stay-dots { display: none; }
  .map-static-list .pin-label { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; }
}

/* Landscape phones: short screens — smaller type, captions lower, the tech note hidden. */
@media (max-height: 500px) and (orientation: landscape) {
  :root { --bar-h: 52px; }
  .topnav { display: none; }
  .cap-1 { bottom: calc(var(--ribbon-h) + 26px); max-width: 70%; }
  .cap-1 .eyebrow { margin-bottom: 6px; }
  .cap-1 h1 { font-size: clamp(32px, 11svh, 52px); margin-bottom: 8px; }
  .cap-1 .lede { font-size: 14px; margin: 0; }
  .cap-2, .cap-3 { font-size: clamp(22px, 9svh, 36px); }
  .scroll-hint { display: none; }
  h2 { font-size: clamp(26px, 10svh, 40px); }
  .stay-copy { bottom: calc(var(--ribbon-h) + 14px); max-width: 52%; }
  .stay-slide p { font-size: 14px; line-height: 1.5; margin-bottom: 0; }
  .tech-note { display: none; }
  .map-intro { top: calc(var(--bar-h) + 10px); }
  .map-intro .eyebrow { margin-bottom: 4px; }
  .map-tools { top: calc(var(--bar-h) + 8px); }
  .pin-card { display: grid; grid-template-columns: 38% minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); width: min(560px, calc(100vw - 32px)); height: min(210px, calc(100svh - var(--bar-h) - var(--ribbon-h) - 16px)); bottom: calc(var(--ribbon-h) + 8px); }
  .pin-card img { aspect-ratio: auto; width: 100%; height: 100%; min-height: 0; object-fit: cover; }
  .pin-body { padding: 12px 52px 12px 16px; overflow-y: auto; }
  .pin-body h3 { font-size: 20px; }
  .pin-body p { font-size: 13px; }
  .enquiry-form { padding: 18px 22px; gap: 10px; }
  .enquiry { max-height: calc(100svh - 16px); }
  .explore.card-open .map-tools, .explore.card-open .map-hint, .explore.card-open .map-label { visibility: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-hint span { animation: none; }
  .hero { height: auto; }
  .hero-sticky { position: relative; }
  .hero-canvas { display: none; }
  .cap-2, .cap-3 { display: none; }
  .stay { height: auto; }
  .stay-slide, .pin-card { transition: none; animation: none; }
  .explore { height: auto; }
  .explore-sticky { position: relative; }
}

/* static fallbacks (reduced motion or no WebGL) */
.stay.static { height: auto; padding: clamp(60px, 9vw, 120px) var(--gutter); }
.stay-static { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; color: var(--white); }
.stay-static figure { margin: 0; border-radius: var(--radius); overflow: hidden; background: #1c241e; }
.stay-static img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.stay-static figcaption { padding: 14px 18px 18px; }
.stay-static h2 { font-size: 26px; color: var(--white); }
.explore.static { height: auto; }
.explore.static .explore-sticky { position: relative; }
