/* ===== WARNA & FONT (tukar sini kalau nak ubah rupa) ===== */
:root {
  --ink: #141414;      /* hitam tulisan */
  --mute: #7a7670;     /* kelabu */
  --line: #d9d5cc;     /* garisan halus */
  --paper: #f5f2ec;    /* background krim */
  --white: #fff;
  --wa: #25d366;
  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--sans); color: var(--ink); background: var(--paper); line-height: 1.6; font-size: 15px; padding-bottom: 84px; }
img { max-width: 100%; display: block; }
a { color: inherit; }
em { font-style: italic; }

/* ===== BAHASA: sorok bahasa yang tak dipilih ===== */
html[lang="ms"] .en { display: none !important; }
html[lang="en"] .bm { display: none !important; }

/* ===== HEADER ===== */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: var(--paper); border-bottom: 1px solid var(--ink); }
.logo { font-family: var(--serif); font-size: 22px; text-decoration: none; letter-spacing: -.01em; }
.lang { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--mute); }
.lang button { border: 0; background: none; font: 500 12px var(--sans); letter-spacing: .12em; color: var(--mute); cursor: pointer; padding: 4px; }
.lang button.active { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

/* ===== LABEL KECIL ===== */
.meta-row, .sec-head, figcaption, .specs span, .tiny {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
}

/* ===== HERO ===== */
.hero { padding: 18px 16px 40px; max-width: 1100px; margin: 0 auto; }
.meta-row { display: flex; justify-content: space-between; color: var(--mute); padding-bottom: 14px; border-bottom: 1px solid var(--line); }
h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(56px, 17vw, 150px); line-height: .9; letter-spacing: -.03em; margin: 22px 0 22px; }
h1 em { font-weight: 400; }
.hero-fig img { width: 100%; aspect-ratio: 4/5; object-fit: cover; }
figcaption { display: flex; flex-wrap: wrap; gap: 2px 10px; color: var(--mute); padding-top: 8px; }
figcaption span:first-child { color: var(--ink); white-space: nowrap; }
.hero-foot { display: grid; gap: 20px; margin-top: 24px; }
.lede { font-family: var(--serif); font-size: 24px; line-height: 1.25; }
.hero-price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 12px 0; }
.hero-price .big { font-family: var(--serif); font-size: 44px; line-height: 1; }
.hero-price .big small { font-family: var(--sans); font-size: 13px; }
.hero-price .rating { margin-left: auto; font-size: 13px; font-weight: 500; }

/* ===== BUTANG ===== */
.btn { display: inline-flex; justify-content: space-between; align-items: center; gap: 16px; background: var(--ink); color: var(--paper); text-decoration: none; padding: 16px 20px; font-weight: 500; letter-spacing: .02em; }
.btn i { font-style: normal; font-size: 18px; }
.btn.light { background: var(--paper); color: var(--ink); }
.wa-float { position: fixed; left: 16px; right: 16px; bottom: 14px; z-index: 20; display: flex; justify-content: center; align-items: center; gap: 10px; background: var(--ink); color: var(--paper); text-decoration: none; padding: 16px; font-weight: 500; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--wa); box-shadow: 0 0 0 4px rgba(37,211,102,.25); }

/* ===== SPEC ===== */
.specs { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); max-width: 1100px; margin: 0 auto; }
.specs div { padding: 20px 16px; border-bottom: 1px solid var(--line); }
.specs div:nth-child(odd) { border-right: 1px solid var(--line); }
.specs strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 48px; line-height: 1; }
.specs strong em { font-size: 20px; margin-left: 3px; }
.specs span { color: var(--mute); }

/* ===== SECTION UMUM ===== */
.block { padding: 64px 16px; max-width: 1100px; margin: 0 auto; }
.sec-head { display: flex; gap: 14px; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--ink); margin-bottom: 20px; }
.sec-head .num { font-weight: 600; }
h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(42px, 12vw, 84px); line-height: .95; letter-spacing: -.02em; margin-bottom: 28px; }
.block > .lede { margin-bottom: 24px; max-width: 34ch; }
.tiny { color: var(--mute); margin: 10px 0 28px; text-transform: none; letter-spacing: 0; font-size: 12px; }
.solo { margin-top: 8px; }

/* ===== HARGA ===== */
.rate-table { border-top: 1px solid var(--ink); }
.rate-row { display: flex; justify-content: space-between; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--line); }
.rate-row p:first-child { font-family: var(--serif); font-size: 26px; line-height: 1.1; }
.rate-row small { display: block; font-family: var(--sans); font-size: 12px; color: var(--mute); }
.amount { font-family: var(--serif); font-size: 52px; line-height: 1; }
.amount small { font-family: var(--sans); font-size: 13px; }
.notes { list-style: none; margin-top: 22px; counter-reset: n; }
.notes li { counter-increment: n; display: flex; gap: 14px; padding: 7px 0; color: #3a3833; }
.notes li::before { content: "(" counter(n) ")"; font-family: var(--serif); font-style: italic; color: var(--mute); }

/* ===== GALLERY (susun macam majalah) ===== */
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 12px; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; object-fit: cover; }
.g-tall { grid-column: span 2; }
.g-tall img { aspect-ratio: 4/5; }
.g-a img { aspect-ratio: 3/4; }
.g-b { margin-top: 48px !important; }
.g-b img { aspect-ratio: 3/4; }
.g-wide { grid-column: span 2; }
.g-wide img { aspect-ratio: 16/10; }

/* Gambar terakhir gallery: penuh lebar kat phone, satu kolum kat desktop */
.g-end { grid-column: span 2; }
.g-end img { aspect-ratio: 16/10; }
@media (min-width: 820px) { .g-end { grid-column: span 1; } .g-end img { aspect-ratio: auto; height: 100%; } }

/* ===== BACKDROP: macam gulungan paper ===== */
.rolls { display: flex; gap: 3px; height: 220px; }
.roll { flex: 1; position: relative; border: 1px solid rgba(0,0,0,.08); transition: flex .3s; }
.roll span { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%) rotate(180deg); writing-mode: vertical-rl; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.roll:hover, .roll:focus { flex: 3; }

/* ===== EQUIPMENT ===== */
details { border-bottom: 1px solid var(--line); }
details:first-of-type { border-top: 1px solid var(--ink); }
summary { padding: 18px 0; font-family: var(--serif); font-size: 26px; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-family: var(--sans); font-size: 20px; font-weight: 300; }
details[open] summary::after { content: "−"; }
.kit { list-style: none; padding-bottom: 18px; }
.kit li { display: flex; align-items: baseline; gap: 8px; padding: 5px 0; }
.kit li::after { content: ""; order: 1; flex: 1; border-bottom: 1px dotted var(--mute); transform: translateY(-4px); }
.kit b { order: 2; font-weight: 500; white-space: nowrap; }
details > p { padding: 0 0 20px; color: #3a3833; max-width: 60ch; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 36px; }
.pair img { aspect-ratio: 1; object-fit: cover; }

/* ===== FASILITI ===== */
.facility { list-style: none; columns: 2; column-gap: 20px; border-top: 1px solid var(--ink); }
.facility li { break-inside: avoid; font-family: var(--serif); font-size: 22px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.plan { max-width: 440px; margin: 36px auto 0; }

/* ===== BOOKING (section gelap) ===== */
.block.dark { background: var(--ink); color: var(--paper); max-width: none; }
.block.dark > * { max-width: 1068px; margin-left: auto; margin-right: auto; }
.block.dark .sec-head { border-color: var(--paper); }
.steps { list-style: none; margin-bottom: 32px; }
.steps li { display: grid; grid-template-columns: 64px 1fr; gap: 8px; padding: 20px 0; border-top: 1px solid rgba(245,242,236,.25); }
.steps b { font-family: var(--serif); font-weight: 400; font-size: 40px; line-height: 1; font-style: italic; }
.steps strong { font-family: var(--serif); font-weight: 400; font-size: 26px; display: block; line-height: 1.15; margin-bottom: 4px; }
.steps p { color: rgba(245,242,236,.7); }
.block.dark .btn { margin-left: 0; }

/* ===== LOKASI ===== */
address { font-style: normal; font-family: var(--serif); font-size: 28px; line-height: 1.2; margin-bottom: 24px; }
.map { width: 100%; height: 300px; border: 1px solid var(--ink); filter: grayscale(1) contrast(1.05); }

/* ===== FOOTER ===== */
footer { border-top: 1px solid var(--ink); text-align: center; padding: 40px 16px 24px; color: var(--mute); font-size: 13px; }
.foot-logo { font-family: var(--serif); font-size: clamp(44px, 14vw, 120px); line-height: 1; color: var(--ink); margin-bottom: 12px; letter-spacing: -.02em; }

/* ===== DESKTOP ===== */
@media (min-width: 820px) {
  body { font-size: 16px; }
  .hero { padding-top: 28px; }
  .hero-fig img { aspect-ratio: 16/9; }
  .hero-foot { grid-template-columns: 1.3fr 1fr; align-items: end; }
  .hero-foot .btn { grid-column: 2; }
  .specs { grid-template-columns: repeat(4, 1fr); }
  .specs div { border-bottom: 0; border-right: 1px solid var(--line); }
  .specs div:last-child { border-right: 0; }
  .gallery { grid-template-columns: repeat(3, 1fr); gap: 36px 20px; }
  .g-tall { grid-column: span 1; grid-row: span 2; }
  .g-tall img { height: 100%; aspect-ratio: auto; }
  .g-wide { grid-column: span 2; }
  .rolls { height: 320px; }
  .facility { columns: 3; }
  .pair { gap: 20px; }
  .wa-float { left: auto; right: 24px; bottom: 24px; padding: 14px 22px; }
}

/* =========================================================
   ANIMATION BILA SCROLL
   Hanya aktif bila app.js letak class "anim" pada <html>.
   Kalau phone set "reduce motion", class ni tak diletak.
   ========================================================= */
.hero-media { overflow: hidden; }

/* 1. Tajuk naik dari bawah */
html.anim .rv-up { opacity: 0; transform: translateY(48px); transition: opacity .9s ease, transform 1s cubic-bezier(.2,.7,.2,1); }
html.anim .rv-up.in { opacity: 1; transform: none; }

/* 2. Gambar terbuka macam tirai + zoom out */
html.anim .rv-img img { clip-path: inset(100% 0 0 0); transform: scale(1.18); transition: clip-path 1.2s cubic-bezier(.7,0,.2,1), transform 1.8s cubic-bezier(.2,.7,.2,1); }
html.anim .rv-img.in img { clip-path: inset(0 0 0 0); transform: scale(1); }
html.anim .rv-img figcaption { opacity: 0; transition: opacity .8s ease .6s; }
html.anim .rv-img.in figcaption { opacity: 1; }

/* 3. Garisan label section melukis dari kiri */
html.anim .sec-head { border-bottom-color: transparent; position: relative; }
html.anim .sec-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform 1.2s cubic-bezier(.7,0,.2,1); }
html.anim .sec-head.in::after { transform: scaleX(1); }
html.anim .sec-head > * { opacity: 0; transition: opacity .6s ease .3s; }
html.anim .sec-head.in > * { opacity: 1; }

/* 5. Jalur backdrop dibuka satu-satu dari atas */
html.anim .rolls .roll { transform: scaleY(0); transform-origin: top; transition: transform .9s cubic-bezier(.7,0,.2,1), flex .3s; }
html.anim .rolls.in .roll { transform: scaleY(1); }

/* 6. Parallax hero: gambar besar sikit supaya tak nampak tepi masa bergerak */
html.anim .hero-media img { transform: translateY(var(--py, 0px)) scale(1.12); will-change: transform; }

/* Hero masuk masa page buka */
html.anim .hero-media { clip-path: inset(100% 0 0 0); transition: clip-path 1.4s cubic-bezier(.7,0,.2,1) .3s; }
html.anim .hero.in .hero-media { clip-path: inset(0 0 0 0); }

/* =========================================================
   WARNA BLOCK: EARTHY (olive + sand)
   Tukar dua warna ni je kalau nak cuba mood lain
   ========================================================= */
:root {
  --olive: #55583a;      /* olive green, macam paper backdrop */
  --olive-ink: #f1ede2;  /* tulisan atas olive */
  --sand: #e8e0cf;       /* cream gelap sikit */
}

/* Section jadi jalur penuh lebar */
#harga, #fasiliti { max-width: none; }
#harga > *, #fasiliti > * { max-width: 1068px; margin-left: auto; margin-right: auto; }

/* Strip spec: olive */
.specs { background: var(--olive); color: var(--olive-ink); max-width: none; border-color: var(--olive); }
.specs div { border-color: rgba(241,237,226,.22) !important; }
.specs span { color: rgba(241,237,226,.7); }
@media (min-width: 820px) {
  .specs { padding: 0 max(16px, calc((100% - 1068px) / 2)); }
}

/* Harga: sand */
#harga { background: var(--sand); }

/* Fasiliti: olive */
#fasiliti { background: var(--olive); color: var(--olive-ink); }
#fasiliti .facility { border-top-color: var(--olive-ink); }
#fasiliti .facility li { border-bottom-color: rgba(241,237,226,.22); }
#fasiliti figcaption { color: rgba(241,237,226,.65); }
#fasiliti figcaption span:first-child { color: var(--olive-ink); }

/* Footer: sand */
footer { background: var(--sand); }

/* Gambar layout (floor plan): jalur putih penuh lebar, gambar di tengah */
#fasiliti { padding-bottom: 0; }
#fasiliti .plan {
  max-width: none; margin-top: 40px; padding: 48px 0;
  background: var(--white);
  box-shadow: 0 0 0 100vmax var(--white);  /* putih sampai tepi skrin */
  clip-path: inset(0 -100vmax);
}
#fasiliti .plan img { max-width: min(440px, 100%); margin: 0 auto; }
#fasiliti .plan figcaption { justify-content: center; color: var(--mute); }
#fasiliti .plan figcaption span:first-child { color: var(--ink); }
.map-link { margin-top: 16px; }
