/* CHAYASIRI Rama 2 */
:root {
  --navy: #0D1627;
  --navy-deep: #080F1C;
  --navy-lift: #14213A;
  --gold: #E9BC71;
  --gold-soft: rgba(233, 188, 113, .38);
  --gold-faint: rgba(233, 188, 113, .16);
  --ivory: #F4EEE1;
  --mute: #BDB6A6;
  --frame: 14px;
  --gutter: clamp(1.25rem, 5vw, 5rem);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.65, 0, .2, 1);
  --serif: "Bodoni Moda", "Trirong", serif;
  --thai-serif: "Trirong", "Bodoni Moda", serif;
  --sans: "Anuphan", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-color: var(--gold-soft) var(--navy-deep); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--navy);
  color: var(--ivory);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 1.0625rem;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, dl, dd, figure { margin: 0; }
ul { padding: 0; list-style: none; }
::selection { background: var(--gold); color: var(--navy); }
:focus-visible { outline: 1px solid var(--gold); outline-offset: 4px; }

.skip { position: fixed; left: 24px; top: -80px; z-index: 100; background: var(--gold); color: var(--navy); padding: .5rem 1rem; font-weight: 500; }
.skip:focus { top: 24px; }

.wrap { width: min(100% - var(--gutter) * 2, 1320px); margin-inline: auto; }

/* ---------- type ---------- */
.display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.5rem, 6vw, 5.25rem);
  line-height: 1.04;
  letter-spacing: -.015em;
  color: var(--gold);
  text-wrap: balance;
}
.thai-display {
  font-family: var(--thai-serif);
  font-weight: 300;
  font-size: clamp(2.1rem, 4.8vw, 4.25rem);
  line-height: 1.3;
  color: var(--gold);
  text-wrap: balance;
}
.thai-head {
  font-family: var(--thai-serif);
  font-weight: 300;
  font-size: clamp(1.3rem, 2.1vw, 1.85rem);
  line-height: 1.55;
  color: var(--ivory);
  text-wrap: balance;
}
.body { color: var(--mute); max-width: 34em; text-wrap: pretty; }
.body.wide { max-width: 44em; }

/* ---------- frame (the sales kit's gold line) ---------- */
.frame {
  position: fixed; inset: var(--frame); z-index: 60; pointer-events: none;
  border: 1px solid var(--gold-soft);
}
.frame i {
  position: absolute; right: -2px; top: 0; width: 3px; height: 56px; background: var(--gold);
  transform: translateY(calc(var(--scroll, 0) * (100vh - var(--frame) * 2 - 56px)));
}
.js .frame { animation: frame-in 2.6s var(--ease) both; }
@keyframes frame-in { from { inset: 0; opacity: 0; } }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 2rem;
  padding: calc(var(--frame) + 14px) calc(var(--frame) + clamp(1rem, 3vw, 2.5rem)) 14px;
  transition: background-color .5s var(--ease), transform .6s var(--ease);
}
.nav.scrolled { background: var(--navy); }
.nav.scrolled::after { content: ""; position: absolute; inset: auto var(--frame) 0; height: 1px; background: var(--gold-faint); }
.brand { display: grid; justify-items: center; line-height: 1; }
.brand-name { font-family: var(--serif); font-weight: 500; font-size: 1.4rem; letter-spacing: .06em; color: var(--gold); }
.brand-sub {
  display: flex; align-items: center; gap: .5em; margin-top: .35rem;
  font-size: .6875rem; font-weight: 400; letter-spacing: .3em; color: var(--gold); width: 100%;
}
.brand-sub::before, .brand-sub::after { content: ""; flex: 1; height: 1px; background: var(--gold-soft); }
.nav-links { display: flex; gap: clamp(1.25rem, 3vw, 2.75rem); font-size: .95rem; font-weight: 400; }
.nav-links a { position: relative; padding: .4rem 0; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--gold);
  transform: scaleX(0); transform-origin: right; transition: transform .5s var(--ease);
}
.nav-links a:hover::after, .nav-links a:focus-visible::after { transform: scaleX(1); transform-origin: left; }

/* ---------- buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; gap: .7rem;
  padding: .95rem 1.6rem; border: 1px solid var(--gold);
  color: var(--navy); font-weight: 500; font-size: 1rem; line-height: 1.4; white-space: nowrap;
  isolation: isolate; overflow: hidden; transition: color .45s var(--ease);
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--gold);
  transform-origin: bottom; transition: transform .55s var(--ease);
}
.btn:hover, .btn:focus-visible { color: var(--gold); }
.btn:hover::before, .btn:focus-visible::before { transform: scaleY(0); transform-origin: top; }
.btn:active { translate: 0 1px; }
.btn-sm { padding: .55rem 1.1rem; font-size: .95rem; font-variant-numeric: tabular-nums; }
.btn-short { display: none; }
.ico { width: 1.05em; height: 1.05em; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; flex: none; }
.link { position: relative; padding: .4rem 0; font-weight: 400; color: var(--ivory); }
.link::after { content: ""; position: absolute; inset: auto 0 0; height: 1px; background: var(--gold); transform-origin: left; transition: transform .5s var(--ease); }
.link:hover::after { transform: scaleX(.35); }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100svh; display: grid; align-items: end; overflow: clip; }
.hero-media { position: absolute; inset: 0; }
.hero-media img {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 58%;
  transform: translateY(calc(var(--p, 0) * 14%)) scale(calc(1.06 + var(--p, 0) * .1));
}
.js .hero-media { animation: hero-in 3.6s var(--ease) both; }
@keyframes hero-in { from { transform: scale(1.1); filter: brightness(.3); } }
.hero-media::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(13,22,39,.72) 0%, rgba(13,22,39,0) 26%),
    linear-gradient(0deg, var(--navy) 2%, rgba(13,22,39,.82) 26%, rgba(13,22,39,0) 62%);
}
.hero-copy {
  position: relative; z-index: 2;
  padding: 0 calc(var(--frame) + var(--gutter)) clamp(3.5rem, 9vh, 6.5rem);
  opacity: calc(1 - var(--p, 0) * 1.6);
  transform: translateY(calc(var(--p, 0) * -60px));
}
.hero-title {
  font-family: var(--thai-serif); font-weight: 300;
  font-size: clamp(2.05rem, 5.4vw, 5rem); line-height: 1.28;
  max-width: 16em;
}
.hero-title em { font-style: normal; color: var(--gold); white-space: nowrap; }
.hero-title .ln { display: block; overflow: hidden; padding-block: .12em; margin-block: -.12em; }
.hero-title .ln > span { display: block; }
.js .hero-title .ln > span { animation: line-up 1.9s var(--ease) .6s both; }
.js .hero-title .ln:nth-child(2) > span { animation-delay: .8s; }
@keyframes line-up { from { transform: translateY(115%); } }
.hero-lead { margin-top: 1.4rem; max-width: 30em; color: var(--ivory); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem 2rem; margin-top: 2rem; }
.js .hero-spec, .js .hero-lead, .js .hero-actions { animation: fade-up 1.8s var(--ease) 1.25s both; }
.js .hero-lead { animation-delay: 1.4s; }
.js .hero-actions { animation-delay: 1.55s; }
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } }

.cue {
  position: absolute; z-index: 2; right: calc(var(--frame) + var(--gutter)); bottom: clamp(2.5rem, 7vh, 5rem);
  display: grid; justify-items: center; gap: .9rem; font-size: .85rem; color: var(--gold);
  writing-mode: vertical-rl; opacity: calc(1 - var(--p, 0) * 3);
}
.cue i { width: 1px; height: 72px; background: var(--gold-soft); position: relative; overflow: hidden; }
.cue i::after { content: ""; position: absolute; inset: 0; background: var(--gold); animation: cue 2.4s var(--ease) infinite; }
@keyframes cue { from { transform: translateY(-100%); } to { transform: translateY(100%); } }

/* ---------- shared section rhythm ---------- */
section.gate, section.bigger, section.house, section.site, section.loc { padding-block: clamp(5.5rem, 13vh, 10rem); }

.rules { margin-top: 2.5rem; }
.rules li, .rooms > div {
  position: relative; display: flex; justify-content: space-between; align-items: baseline; gap: 1.5rem;
  padding: .95rem 0;
}
.rules li::after, .rooms > div::after {
  content: ""; position: absolute; inset: auto 0 0; height: 1px; background: var(--gold-soft); transform-origin: left;
}
.rules li span:last-child { font-family: var(--serif); font-style: italic; color: var(--gold); font-size: 1rem; white-space: nowrap; }
.rooms dt { color: var(--ivory); }
.rooms dd { font-family: var(--sans); font-weight: 400; font-size: 1rem; color: var(--gold); font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }

figure[data-reveal="wipe"], .scene { overflow: hidden; }
figure[data-reveal="wipe"] img { width: 100%; height: 116%; object-fit: cover; }

/* ---------- gate ---------- */
.gate-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2.5rem, 6vw, 6rem); align-items: center; }
.gate-copy .thai-head { margin-top: 1.5rem; }
.gate-copy .body { margin-top: 1.25rem; }
.gate-photo { aspect-ratio: 4 / 4.4; margin-right: calc(var(--gutter) * -1); }

/* ---------- bigger ---------- */
.bigger { background: var(--navy-deep); }
.bigger-grid {
  display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr) minmax(180px, 2.4fr);
  gap: clamp(2rem, 4.5vw, 4.5rem); align-items: center;
}
.bigger-photo { aspect-ratio: 5 / 6; margin-left: calc(var(--gutter) * -1); }
.bigger-copy .thai-head { margin-top: 1.5rem; }
.bigger-copy .body { margin-top: 1.25rem; }
.footprint svg { width: 100%; max-width: 250px; margin-inline: auto; overflow: visible; }
.footprint path, .footprint rect { fill: none; stroke: var(--gold); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-dasharray: 1; }
.footprint .storey { stroke: var(--gold-soft); stroke-dasharray: .012 .012; }
.footprint text { fill: var(--gold); font-family: var(--sans); font-size: 15px; font-weight: 400; }
.footprint .t-big { font-family: var(--serif); font-size: 62px; }
.footprint .t-unit { font-size: 17px; fill: var(--ivory); }

/* ---------- house ---------- */
.house-intro { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(1.5rem, 5vw, 5rem); align-items: end; margin-bottom: clamp(3.5rem, 9vh, 7rem); }
.scene { position: relative; height: min(92svh, 62vw); min-height: 320px; }
.scene img { width: 100%; height: 118%; object-fit: cover; }
.scene figcaption, .suite figcaption {
  font-size: .9rem; color: var(--mute);
}
.scene figcaption {
  position: absolute; left: calc(var(--frame) + var(--gutter)); bottom: 1.5rem;
  padding: .35rem .9rem; background: var(--navy); color: var(--ivory);
}
.floor { padding-top: 0; }
.floor + .floor { margin-top: clamp(5rem, 12vh, 9rem); }
.floor-grid {
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); gap: clamp(2rem, 7vw, 7rem);
  align-items: center; padding-top: clamp(4rem, 10vh, 7.5rem);
}
.floor.flip .floor-grid { grid-template-columns: minmax(0, 6fr) minmax(0, 4fr); padding-top: 0; }
.floor.flip .plan { order: 2; }
.plan img { height: min(76vh, 640px); width: auto; margin-inline: auto; filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .45)); }
.floor-info h3 {
  display: flex; align-items: baseline; gap: 1.1rem;
  font-family: var(--thai-serif); font-weight: 300; font-size: clamp(1.5rem, 2.4vw, 2rem); color: var(--gold);
}
.floor-info .num { font-family: var(--serif); font-size: clamp(4.5rem, 9vw, 6rem); line-height: .8; }
.floor-info .thai-head { margin-top: 1.5rem; max-width: 22em; }
.floor-info .rooms { margin-top: 2rem; max-width: 30rem; }

.lift {
  position: fixed; z-index: 40; right: calc(var(--frame) + 18px); top: 50%; translate: 0 -50%;
  display: grid; justify-items: center; gap: .15rem;
  opacity: 0; visibility: hidden; transition: opacity .5s var(--ease), visibility .5s;
}
.lift.on { opacity: 1; visibility: visible; }
.lift a {
  width: 2.5rem; height: 2.5rem; display: grid; place-items: center;
  font-family: var(--serif); font-size: 1.1rem; color: var(--mute); border: 1px solid transparent;
  transition: color .4s var(--ease), border-color .4s var(--ease), background-color .4s var(--ease);
}
.lift a:hover { color: var(--gold); }
.lift a.on { color: var(--navy); background: var(--gold); }
.lift span { font-size: .75rem; color: var(--gold); margin-top: .3rem; }

/* suite: pinned sideways walk */
.suite { margin-top: clamp(4rem, 10vh, 7rem); }
.suite-pin { position: sticky; top: 0; height: 100svh; overflow: hidden; display: grid; align-content: center; }
.suite-track {
  display: flex; align-items: center; gap: clamp(1.5rem, 4vw, 4rem); width: max-content;
  padding-inline: calc(var(--frame) + var(--gutter)); will-change: transform;
}
.suite-lead { width: min(78vw, 26rem); flex: none; }
.suite-lead .thai-head { margin-top: 1.25rem; }
.suite figure { flex: none; }
.suite figure img { height: min(62svh, 620px); width: auto; max-width: none; }
.suite figcaption { display: flex; justify-content: space-between; gap: 1rem; padding-top: .9rem; color: var(--ivory); }
.suite figcaption span { color: var(--gold); font-weight: 400; }
.suite-bar { position: absolute; left: calc(var(--frame) + var(--gutter)); right: calc(var(--frame) + var(--gutter)); bottom: clamp(2.2rem, 6vh, 4rem); height: 1px; background: var(--gold-faint); }
.suite-bar i { position: absolute; inset: 0; background: var(--gold); transform-origin: left; transform: scaleX(var(--sp, 0)); }
.suite.static .suite-pin { position: static; height: auto; padding-block: 2rem; }
.suite.static .suite-track { overflow-x: auto; width: auto; }
.suite.static .suite-bar { display: none; }

/* ---------- site plan ---------- */
.site { background: var(--navy-deep); }
.site-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.site-copy .body { margin-top: 1.5rem; }
.site-copy .rules li span:last-child { font-style: normal; font-family: var(--sans); font-weight: 400; }
.site-map img { width: 100%; }

/* ---------- location ---------- */
.loc-head { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(1.5rem, 5vw, 5rem); align-items: end; }
.loc-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(2.5rem, 6vw, 6rem); margin-top: clamp(3rem, 8vh, 5.5rem); align-items: start; }
.map { position: sticky; top: 110px; }
.map svg { width: 100%; height: auto; border: 1px solid var(--gold-soft); background: var(--navy-deep); }
.map .road { fill: none; stroke: #B79660; stroke-width: 30; }
.map .road.dash { stroke-dasharray: 9 7; }
.map .arc { stroke-width: 26; }
.map .route { fill: none; stroke: var(--navy-deep); stroke-width: 3; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--mp, 1)); }
.map text { font-family: var(--sans); font-size: 14px; fill: var(--gold); }
.map .lbl text { font-size: 13.5px; }
.map .lbl .on { fill: var(--navy-deep); font-weight: 500; }
.map .soi { fill: var(--ivory); }
.map .place circle { fill: var(--gold); }
.map .pin path { fill: var(--ivory); }
.map .pin circle { fill: var(--navy-deep); }
.map .pin text { font-family: var(--serif); font-size: 19px; letter-spacing: .08em; fill: var(--ivory); }
.map .pin { transform-box: fill-box; }
.map figcaption { margin-top: .8rem; font-size: .85rem; color: var(--mute); }
.near { display: grid; gap: 2.75rem; }
.near h3 { font-family: var(--thai-serif); font-weight: 400; font-size: 1.35rem; color: var(--gold); margin-bottom: .4rem; }
.near .rooms > div { padding: .7rem 0; }
.near .rooms > div::after { background: var(--gold-faint); }

.gmap { margin-top: clamp(3.5rem, 9vh, 6.5rem); }
.gmap-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem 2rem; margin-bottom: 1.75rem; }
.gmap iframe { display: block; width: 100%; height: clamp(320px, 56vh, 560px); border: 1px solid var(--gold-soft); background: var(--navy-deep); }
.btn-ghost { color: var(--gold); }
.btn-ghost::before { transform: scaleY(0); transform-origin: top; }
.btn-ghost:hover, .btn-ghost:focus-visible { color: var(--navy); }
.btn-ghost:hover::before, .btn-ghost:focus-visible::before { transform: scaleY(1); transform-origin: bottom; }
.reach { display: grid; grid-template-columns: auto minmax(0, 24rem); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; margin-top: clamp(2.5rem, 6vh, 4rem); text-align: left; }
.reach-qr img { width: 148px; height: 148px; padding: 8px; background: #fff; }
.reach-qr figcaption { margin-top: .7rem; font-size: .85rem; color: var(--mute); text-align: center; }
.reach-list { margin-top: 0; }
.reach-list li { padding: 0; }
.reach-list a { display: flex; justify-content: space-between; align-items: baseline; gap: 1.5rem; width: 100%; padding: .95rem 0; transition: padding .6s var(--ease); }
.reach-list a:hover, .reach-list a:focus-visible { padding-inline: .6rem; }
.reach-list a span:last-child { font-family: var(--sans); font-style: normal; font-weight: 400; }

/* ---------- close ---------- */
.close { position: relative; min-height: 100svh; display: grid; align-items: center; overflow: clip; text-align: center; }
.close-media { position: absolute; inset: 0; }
.close-media img { width: 100%; height: 124%; object-fit: cover; object-position: 50% 60%; }
.close-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, var(--navy) 0%, rgba(13,22,39,.86) 38%, rgba(13,22,39,.78) 70%, var(--navy-deep) 100%); }
.close-copy { position: relative; display: grid; justify-items: center; padding-block: 7rem; }
.close-copy .body { margin-top: 1.25rem; color: var(--ivory); }
.tel {
  margin-top: 1.5rem; font-family: var(--serif); font-size: clamp(2.6rem, 9vw, 6rem); line-height: 1.1;
  color: var(--gold); font-variant-numeric: lining-nums; letter-spacing: .01em;
  background: linear-gradient(var(--gold), var(--gold)) no-repeat 0 100% / 0 1px; transition: background-size .7s var(--ease);
}
.tel:hover, .tel:focus-visible { background-size: 100% 1px; }
.close-copy .btn { margin-top: 2.25rem; }

/* ---------- footer ---------- */
.foot { background: var(--navy-deep); padding: 3.5rem 0 calc(var(--frame) + 2.5rem); font-size: .95rem; color: var(--mute); }
.foot-grid { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem 3rem; }
.foot .brand { width: max-content; }
.foot .fine { font-size: .85rem; }

/* ---------- scroll reveals (only when JS runs) ---------- */
.js [data-reveal] { transition-delay: var(--d, 0s); }
.js [data-reveal="rise"] { opacity: 0; transform: translateY(18px); transition: opacity 1.6s var(--ease) var(--d, 0s), transform 1.8s var(--ease) var(--d, 0s); }
.js [data-reveal="rise"].in { opacity: 1; transform: none; }
.js [data-reveal="mask"] .mask-in { display: block; clip-path: inset(0 0 100% 0); transform: translateY(.45em); transition: clip-path 1.7s var(--ease-io), transform 1.9s var(--ease); }
.js [data-reveal="mask"].in .mask-in { clip-path: inset(-.4em -.2em -.45em -.2em); transform: none; }
.js [data-reveal="wipe"] > img { clip-path: inset(0 0 100% 0); scale: 1.14; transition: clip-path 2s var(--ease-io), scale 3s var(--ease); }
.js [data-reveal="wipe"].in > img { clip-path: inset(0); scale: 1; }
.js [data-reveal="rule"] > * { opacity: 0; transform: translateY(10px); transition: opacity 1.4s var(--ease) calc(var(--d, 0s) + .25s), transform 1.4s var(--ease) calc(var(--d, 0s) + .25s); }
.js [data-reveal="rule"]::after { transform: scaleX(0); transition: transform 1.8s var(--ease-io) var(--d, 0s); }
.js [data-reveal="rule"].in > * { opacity: 1; transform: none; }
.js [data-reveal="rule"].in::after { transform: none; }
.js [data-reveal="draw"] path, .js [data-reveal="draw"] rect { stroke-dashoffset: 1; transition: stroke-dashoffset 2.2s var(--ease); }
.js [data-reveal="draw"] .storey { stroke-dashoffset: 0; opacity: 0; transition: opacity 1s var(--ease) 1.4s; }
.js [data-reveal="draw"] text { opacity: 0; transition: opacity 1s var(--ease) 1.1s; }
.js [data-reveal="draw"].in path, .js [data-reveal="draw"].in rect { stroke-dashoffset: 0; }
.js [data-reveal="draw"].in .storey, .js [data-reveal="draw"].in text { opacity: 1; }
.js [data-reveal="unroll"] > img { clip-path: polygon(0 0, 0 0, 0 100%, 0 100%); transition: clip-path 2.4s var(--ease); }
.js [data-reveal="unroll"].in > img { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
.js .map .pin { opacity: 0; translate: 0 -14px; transition: opacity .8s var(--ease), translate .9s var(--ease); }
.js .map.arrived .pin { opacity: 1; translate: 0 0; }

/* ---------- spec line ---------- */
.spec { display: flex; flex-wrap: wrap; gap: .35rem 0; font-family: var(--thai-serif); font-weight: 400; font-size: clamp(1.05rem, 1.7vw, 1.45rem); line-height: 1.5; color: var(--gold); }
.spec span { white-space: nowrap; }
.spec span + span { margin-left: 1.1em; padding-left: 1.1em; background: linear-gradient(var(--gold-soft), var(--gold-soft)) no-repeat 0 55% / 1px 1em; }
.hero-spec { margin-top: 1.5rem; }
.close-copy .spec { margin-top: 1.5rem; justify-content: center; }

/* ---------- floor plan viewer ---------- */
.plan-open { position: relative; display: block; margin-inline: auto; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: zoom-in; }
.plan-open img { transition: scale 1.2s var(--ease); }
.plan-open:hover img, .plan-open:focus-visible img { scale: 1.025; }
.plan-hint { display: flex; align-items: center; justify-content: center; gap: .5rem; margin-top: 1.4rem; font-size: .9rem; font-weight: 400; color: var(--gold); }
.viewer { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--navy-deep); color: var(--ivory); overflow: hidden; }
.viewer::backdrop { background: var(--navy-deep); }
.viewer[open] { display: grid; grid-template-rows: auto 1fr auto; animation: viewer-in .7s var(--ease) both; }
@keyframes viewer-in { from { opacity: 0; } }
.viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem clamp(1rem, 3vw, 2.5rem); border-bottom: 1px solid var(--gold-faint); }
.viewer-title { font-family: var(--thai-serif); font-size: 1.25rem; color: var(--gold); }
.viewer-tools { display: flex; align-items: center; gap: .5rem; }
.viewer-tools button { display: grid; place-items: center; min-width: 2.75rem; height: 2.75rem; padding: 0 .8rem; border: 1px solid var(--gold-soft); background: none; color: var(--gold); font: inherit; font-size: .9rem; font-weight: 400; cursor: pointer; transition: background-color .4s var(--ease), color .4s var(--ease); }
.viewer-tools button:hover, .viewer-tools button:focus-visible { background: var(--gold); color: var(--navy); }
.viewer-tools button:disabled { opacity: .35; pointer-events: none; }
.viewer-stage { position: relative; overflow: hidden; display: grid; place-items: center; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.viewer-stage.dragging { cursor: grabbing; }
.viewer-stage img { max-width: 92%; max-height: 92%; width: auto; height: 92%; object-fit: contain; will-change: transform; transition: transform .45s var(--ease); -webkit-user-drag: none; }
.viewer-stage.dragging img { transition: none; }
.viewer-help { padding: .8rem 1rem calc(.8rem + env(safe-area-inset-bottom)); text-align: center; font-size: .85rem; color: var(--mute); border-top: 1px solid var(--gold-faint); }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .bigger-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .bigger-photo { grid-column: 1 / -1; aspect-ratio: 16 / 10; margin-inline: calc(var(--gutter) * -1); }
  .lift { display: none; }
}
@media (max-width: 820px) {
  :root { --frame: 8px; }
  body { font-size: 1rem; }
  .nav { padding-top: calc(var(--frame) + 10px); padding-bottom: 10px; }
  .nav-links { display: none; }
  .btn-long { display: none; }
  .btn-short { display: inline; }
  .brand-name { font-size: 1.2rem; }
  .cue { display: none; }
  .gate-grid, .house-intro, .floor-grid, .floor.flip .floor-grid, .site-grid, .loc-head, .loc-grid { grid-template-columns: minmax(0, 1fr); }
  .gate-photo { margin-inline: calc(var(--gutter) * -1); aspect-ratio: 4 / 3.4; }
  .floor.flip .plan { order: 0; }
  .plan img { height: min(64vh, 520px); }
  .scene { height: 62vw; }
  .scene figcaption { left: var(--gutter); bottom: 1rem; }
  .map { position: static; }
  .suite figure img { width: 84vw; height: auto; max-height: 60svh; object-fit: cover; }
  .map { overflow-x: auto; }
  .map svg { min-width: 640px; }
  .foot-grid { flex-direction: column; align-items: flex-start; }
  .reach { grid-template-columns: minmax(0, 1fr); width: 100%; }
  .reach-qr { display: none; }
  .viewer-reset { display: none; }
}
@media (max-width: 560px) {
  .bigger-grid { grid-template-columns: minmax(0, 1fr); }
  .footprint svg { max-width: 210px; }
  .btn { white-space: normal; }
  .hero-actions .btn { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js [data-reveal], .js [data-reveal] > *, .js [data-reveal] .mask-in, .js [data-reveal] > img, .js [data-reveal]::after, .js [data-reveal] path, .js [data-reveal] rect, .js [data-reveal] text, .js .map .pin {
    opacity: 1 !important; transform: none !important; filter: none !important; clip-path: none !important; scale: 1 !important; stroke-dashoffset: 0 !important; translate: 0 0 !important;
  }
  .hero-media img, .hero-copy { transform: none; opacity: 1; }
}
