/* Andaman chart: sea-tint ground, buff land, hydrographic navy ink, magenta for notes and actions */
:root {
  --sea-0: #f2f8f8;
  --sea-1: #dcedf0;
  --sea-2: #c3e2e9;
  --land: #ecdcad;
  --land-ink: #67522c;
  --land-light: #f3e6bf;
  --water-ink: #3a7891;
  --ink: #15283b;
  --ink-soft: #46596b;
  --rule: #9fb9c6;
  --navy: #14263a;
  --magenta: #a3136c;
  --magenta-dark: #7e0d53;
  --magenta-bright: #c2187f;
  --navy-soft: #9fb2c2;
  --navy-text: #c9d6e0;
  --model-ground: #e9f2f3;
  --paper: #fbfcfb;

  --serif: "Spectral", "Noto Serif Thai", "Songti SC", "Noto Serif SC", serif;
  --sans: "Fira Sans Condensed", "Noto Sans Thai", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --section: clamp(72px, 11vw, 150px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--sea-0); color: var(--ink); font: 400 1.0625rem/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
::selection { background: var(--magenta); color: var(--paper); }
:focus-visible { outline: 2px solid var(--magenta); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; text-wrap: balance; hyphens: auto; margin: 0; }
h2 { font-size: clamp(2rem, 4.4vw, 3.4rem); line-height: 1.05; margin-bottom: .6em; }
p { margin: 0 0 1em; max-width: 68ch; text-wrap: pretty; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 820px; }

/* Graduated border: alternating ink and paper segments, as on a chart's neatline */
.graduated { position: relative; border: 1px solid var(--ink); }
.graduated::before {
  content: ""; position: absolute; inset: -7px; border: 1px solid var(--ink); pointer-events: none;
  background:
    repeating-linear-gradient(90deg, var(--ink) 0 48px, transparent 48px 96px) top / 100% 6px no-repeat,
    repeating-linear-gradient(90deg, var(--ink) 0 48px, transparent 48px 96px) bottom / 100% 6px no-repeat,
    repeating-linear-gradient(0deg, var(--ink) 0 48px, transparent 48px 96px) left / 6px 100% no-repeat,
    repeating-linear-gradient(0deg, var(--ink) 0 48px, transparent 48px 96px) right / 6px 100% no-repeat;
}

/* Bar */
.bar { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 0 24px; padding: 2px var(--gutter); background: color-mix(in srgb, var(--sea-0) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.brand { font: 600 1.15rem/1 var(--serif); text-decoration: none; white-space: nowrap; padding: 14px 0; }
.nav { display: flex; gap: 22px; margin-left: auto; font-size: .95rem; }
.nav a { text-decoration: none; color: var(--ink-soft); }
.nav a:hover { color: var(--ink); text-decoration: underline; }
.langs { display: flex; gap: 2px; }
.langs a { display: inline-flex; align-items: center; text-decoration: none; font: 500 .82rem/1 var(--sans); color: var(--ink-soft); border: 1px solid transparent; border-radius: 4px; padding: 7px 8px; min-height: 44px; }
.langs a:hover { color: var(--ink); border-color: var(--rule); }
.langs a[aria-current="page"] { color: var(--paper); background: var(--ink); }
@media (max-width: 860px) { .nav { display: none; } .langs { margin-left: auto; } }
@media (max-width: 420px) { .brand { font-size: 1rem; } .langs a { padding: 7px 6px; } }

/* Hero: the villa as the chart's large inset, with the title cartouche set over its edge */
.hero { position: relative; padding: 28px var(--gutter) clamp(40px, 6vw, 72px); overflow: hidden; background: linear-gradient(180deg, var(--sea-0), var(--sea-1)); }
.contours { position: absolute; inset: 0; width: 100%; height: 100%; }
.contours path { fill: none; stroke: var(--rule); stroke-width: 1; opacity: .7; }
.neatline { position: relative; max-width: 1360px; margin: 0 auto; display: grid; grid-template-columns: repeat(12, 1fr); align-items: end; min-height: min(calc(100svh - 120px), 860px); }
.inset { grid-column: 4 / -1; grid-row: 1; margin: 0; align-self: stretch; display: flex; flex-direction: column; }
.inset img { flex: 1; width: 100%; min-height: 0; object-fit: cover; border: 1px solid var(--ink); outline: 7px solid var(--paper); outline-offset: 0; box-shadow: 0 0 0 8px var(--ink); }
.inset figcaption { font: italic 400 .95rem/1.3 var(--serif); color: var(--ink-soft); margin-top: 18px; text-align: right; }
.cartouche { grid-column: 1 / 7; grid-row: 1; align-self: end; margin-bottom: clamp(56px, 8vw, 96px); background: var(--paper); padding: clamp(24px, 3.2vw, 44px); box-shadow: 0 18px 50px rgb(21 40 59 / .18); }
.cartouche.graduated::before { inset: -8px; }
.cartouche h1 { font-size: clamp(2.6rem, 6.4vw, 5.6rem); line-height: .95; letter-spacing: -.025em; }
.h1-sub { display: block; font-style: italic; font-weight: 400; font-size: .42em; letter-spacing: 0; margin-top: .25em; color: var(--ink-soft); }
.promise { font: 400 clamp(1.15rem, 1.7vw, 1.4rem)/1.35 var(--serif); margin: 1.1em 0 .4em; }
.place { color: var(--ink-soft); font-size: .95rem; letter-spacing: .02em; }
.price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 1.2em 0; padding-top: 1em; border-top: 1px solid var(--rule); }
.price-label { font-size: .9rem; color: var(--ink-soft); }
.price-value { font: 600 clamp(1.5rem, 2.4vw, 2rem)/1 var(--sans); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.actions { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; }
.cta { display: inline-flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 22px; background: var(--magenta); color: var(--paper); font: 600 1rem/1.2 var(--sans); text-decoration: none; border-radius: 3px; transition: background .2s; }
.cta:hover { background: var(--magenta-dark); }
.cta-2 { font-weight: 500; color: var(--magenta); min-height: 44px; display: inline-flex; align-items: center; }
.direct { margin: 1em 0 0; font-size: .9rem; color: var(--ink-soft); }
@media (max-width: 860px) {
  .neatline { display: block; min-height: 0; }
  .inset img { aspect-ratio: 4 / 3; flex: none; }
  .inset figcaption { text-align: left; margin-top: 16px; }
  .cartouche { margin: -40px 10px 0; position: relative; }
}

/* Villa plates */
.villa { padding: var(--section) 0; }
.villa-text { columns: 2 22rem; column-gap: 48px; margin-bottom: clamp(40px, 6vw, 80px); }
.villa-text p { break-inside: avoid; }
.lead { font: 400 1.3rem/1.45 var(--serif); }
/* Gallery: one large photo and four small, the listing-site pattern buyers know; every photo opens full screen */
.mosaic { position: relative; display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: repeat(2, clamp(150px, 19vw, 270px)); gap: 8px; }
.mosaic .shot:first-child { grid-row: span 2; }
.shot { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; overflow: hidden; cursor: zoom-in; }
.shot img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.shot:hover img { transform: scale(1.025); }
.mosaic .all { position: absolute; right: 14px; bottom: 14px; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; font: 500 1rem/1 var(--sans); color: var(--ink); background: var(--paper); border: 1px solid var(--ink); border-radius: 4px; cursor: pointer; box-shadow: 0 2px 10px rgb(21 40 59 / .25); }
.mosaic-caps { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 12px 0 0; padding: 0; list-style: none; font: italic 400 .95rem/1.3 var(--serif); color: var(--ink-soft); }
@media (max-width: 720px) {
  .mosaic { grid-template-columns: 1fr 1fr; grid-template-rows: 58vw 34vw 34vw; }
  .mosaic .shot:first-child { grid-column: 1 / -1; grid-row: auto; }
}

.viewer, .all-photos { width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; }
.viewer[open] { display: grid; grid-template-rows: auto 1fr auto; background: #0c1621; color: var(--paper); }
.viewer::backdrop, .all-photos::backdrop { background: transparent; }
.viewer header, .viewer footer, .all-photos header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px var(--gutter); }
.viewer footer { padding-bottom: 18px; }
.viewer-stage { display: grid; place-items: center; min-height: 0; padding: 0 var(--gutter); }
.viewer-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer p { margin: 0; text-align: center; font: italic 400 1.05rem/1.3 var(--serif); }
.round { flex: none; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; border: 1px solid currentColor; background: none; color: inherit; cursor: pointer; }
.all-photos { background: var(--sea-0); color: var(--ink); }
.all-photos header { position: sticky; top: 0; z-index: 1; background: var(--sea-0); }
.all-photos h2 { font-size: 1.8rem; margin: 0; }
.all-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 10px; padding: 0 var(--gutter) 40px; }
.all-grid h3 { grid-column: 1 / -1; font-size: 1.45rem; margin: 20px 0 0; }
.all-grid .shot { aspect-ratio: 3 / 2; }

/* Plan and 3D model */
.plan { padding: var(--section) 0; background: var(--sea-1); border-block: 1px solid var(--rule); }
.plan-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 32px; }
.plan-head p { color: var(--ink-soft); }
.model { position: relative; height: min(78svh, 760px); min-height: 480px; margin: 12px var(--gutter) 0; max-width: 1360px; overflow: hidden; background: var(--model-ground); border: 1px solid var(--ink); }
@media (min-width: 1460px) { .model { margin-inline: auto; } }
.model canvas { display: block; touch-action: none; }
.model:focus { outline: none; }
.model-labels { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.tag { pointer-events: auto; display: inline-flex; align-items: center; gap: 6px; font: 500 13px/1 var(--sans); color: var(--ink); background: var(--paper); border: 0; border-radius: 999px; padding: 4px 11px 4px 4px; cursor: pointer; box-shadow: 0 2px 8px rgb(21 40 59 / .2); white-space: nowrap; transition: background .2s, color .2s; }
.tag-n, .rl-n, .panel-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--paper); font: 600 12px/1 var(--sans); font-variant-numeric: tabular-nums; flex: none; }
.tag:hover, .tag[aria-pressed="true"] { background: var(--magenta); color: var(--paper); }
.tag:hover .tag-n, .tag[aria-pressed="true"] .tag-n { background: var(--paper); color: var(--magenta); }
@media (max-width: 720px) { .tag-name { display: none; } .tag { padding: 4px; } }

.panel { position: absolute; z-index: 1; top: 14px; right: 14px; bottom: 14px; width: min(400px, calc(100% - 28px)); background: var(--paper); border: 1px solid var(--ink); box-shadow: 0 12px 40px rgb(21 40 59 / .22); display: flex; flex-direction: column; overflow: hidden; transition: transform .45s cubic-bezier(.16, 1, .3, 1), opacity .3s; }
.panel[hidden] { display: flex; transform: translateX(calc(100% + 24px)); opacity: 0; pointer-events: none; }
.panel header { padding: 18px 18px 12px; display: flex; gap: 12px; align-items: start; }
.panel-n { width: 30px; height: 30px; font-size: 14px; background: var(--magenta); margin-top: 2px; }
.panel h3 { font-size: 1.45rem; line-height: 1.15; }
.panel-note { margin: .3rem 0 0; color: var(--ink-soft); font-size: .95rem; line-height: 1.45; }
.panel-close { margin-left: auto; flex: none; width: 44px; height: 44px; border: 1px solid var(--rule); border-radius: 50%; background: var(--paper); color: var(--ink); cursor: pointer; display: grid; place-items: center; }
.panel-close:hover { background: var(--ink); color: var(--paper); }
.panel-photos { flex: 1; overflow-y: auto; padding: 0 18px 18px; display: grid; gap: 10px; align-content: start; }
.panel-photos img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: var(--sea-1); }
@media (max-width: 720px) {
  .model { margin-inline: 0; border-inline: 0; height: 80svh; }
  .panel { top: auto; left: 10px; right: 10px; bottom: 10px; width: auto; max-height: 58%; }
  .panel[hidden] { transform: translateY(calc(100% + 24px)); }
  .panel-photos { grid-auto-flow: column; grid-auto-columns: 82%; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; }
  .panel-photos img { scroll-snap-align: start; }
}

.room-list { list-style: none; padding: 0; margin: 28px 0 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 24px; }
.room-list button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 6px 0; background: none; border: 0; border-bottom: 1px solid var(--rule); font: 500 1rem/1.2 var(--sans); color: var(--ink); text-align: left; cursor: pointer; }
.room-list button:hover, .room-list button[aria-pressed="true"] { color: var(--magenta); }
.room-list button[aria-pressed="true"] .rl-n { background: var(--magenta); }
.credit { font: italic 400 .95rem/1.4 var(--serif); color: var(--ink-soft); }

/* Particulars as chart notes */
.specs { padding: var(--section) 0; }
.notes { list-style: none; padding: 0; margin: 0; columns: 2 20rem; column-gap: 56px; counter-reset: note; }
.notes li { break-inside: avoid; counter-increment: note; display: flex; gap: 16px; padding: 14px 0; border-top: 1px solid var(--rule); font: 400 1.2rem/1.35 var(--serif); }
.notes li::before { content: counter(note); font: 500 .85rem/1.9 var(--sans); color: var(--magenta); min-width: 1.4em; font-variant-numeric: tabular-nums; }

/* Rental */
.rental { padding: 0 0 var(--section); }
.caution { margin-top: 1.6em; padding: 16px 18px; border: 1px solid var(--magenta); color: var(--magenta-dark); font-size: .95rem; }

/* Location schematic */
.location { padding: var(--section) 0; background: var(--land); }
.location-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.places { padding: 0; margin: 1.4em 0 0; list-style: none; }
.places li { padding: 10px 0; border-top: 1px solid color-mix(in srgb, var(--land-ink) 40%, transparent); }
.chart { margin: 0; }
.map { height: clamp(420px, 62vh, 620px); border: 1px solid var(--ink); background: var(--sea-1); z-index: 0; }
.map .leaflet-control-attribution { font: 400 11px var(--sans); }
.map-label { font: 500 13px/1.2 var(--sans); color: var(--ink); background: var(--paper); border: 0; border-radius: 3px; box-shadow: 0 2px 6px rgb(21 40 59 / .2); padding: 4px 8px; }
.map-label::before { display: none; }
.map-villa { font: 600 15px/1.25 var(--serif); color: var(--paper); background: var(--magenta); text-align: center; }
.map-villa span { font: 400 12px var(--sans); }
.chart figcaption { font: italic 400 .95rem/1.4 var(--serif); color: var(--land-ink); margin-top: 10px; }
.chart figcaption a { font-style: normal; font-family: var(--sans); font-weight: 500; color: var(--magenta-dark); white-space: nowrap; }
@media (max-width: 860px) { .location-grid { grid-template-columns: 1fr; } }

/* Contact: the close, on navy */
.contact { padding: var(--section) 0; background: var(--navy); color: var(--paper); }
.contact ::selection { background: var(--paper); color: var(--navy); }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.contact .price { border-top-color: rgb(255 255 255 / .25); }
.contact .price-label, .contact p { color: var(--navy-text); }
.contact .price-value { color: var(--paper); font-size: clamp(2rem, 3.6vw, 3rem); }
.contact-card { border: 1px solid rgb(255 255 255 / .3); padding: clamp(22px, 3vw, 36px); }
.contact-card .cta { width: 100%; justify-content: center; background: var(--magenta-bright); }
.contact-card .cta:hover { background: var(--magenta); }
.contact dl { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0 20px; margin: 24px 0; }
.contact dt { color: var(--navy-text); font-size: .95rem; }
.contact dd a { display: inline-block; padding: 12px 0; }
.contact dd { margin: 0; font-weight: 500; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.contact .small { font-size: .9rem; line-height: 1.5; }
:focus-visible:where(.contact *) { outline-color: var(--paper); }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } .contact dl { grid-template-columns: 1fr; gap: 2px; } .contact dd { margin-bottom: 10px; } }

.foot { background: var(--navy); color: var(--navy-soft); border-top: 1px solid rgb(255 255 255 / .15); padding: 24px var(--gutter) 96px; font-size: .9rem; text-align: center; }

/* Mobile WhatsApp dock */
.dock { position: fixed; z-index: 30; left: 12px; right: 12px; bottom: 12px; display: none; align-items: center; justify-content: center; gap: 10px; min-height: 52px; background: var(--magenta); color: var(--paper); font: 600 1rem/1 var(--sans); text-decoration: none; border-radius: 4px; box-shadow: 0 8px 24px rgb(21 40 59 / .3); transform: translateY(140%); transition: transform .35s cubic-bezier(.16, 1, .3, 1); }
@media (max-width: 720px) { .dock { display: flex; } }
.dock.show:not(.room-open .dock) { transform: none; }
@media (prefers-reduced-motion: reduce) { .dock, .panel, .tag, .cta, .shot img { transition: none; } }
