/* Tahanan Realty: crisp and trustworthy. White and sand, deep emerald, a touch of gold. Sora + Inter. */
:root {
  --bg: #ffffff;
  --sand: #f5f2ec;
  --ink: #111a17;
  --muted: #5d6b66;
  --line: #e3e3dc;
  --green: #0f5b46;
  --green-d: #0a4334;
  --green-l: #e4f0eb;
  --gold: #e9c46a;
  --head: "Sora", "Segoe UI", system-ui, sans-serif;
  --body: "Inter", "Segoe UI", system-ui, sans-serif;
  --r: 14px;
  --shadow: 0 1px 2px rgba(17, 26, 23, 0.05), 0 12px 30px rgba(17, 26, 23, 0.08);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; font-family: var(--body); line-height: 1.6; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
body.no-scroll { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
h1, h2, h3 { margin: 0 0 0.7rem; font-family: var(--head); font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.3rem, 5vw, 3.9rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1rem; color: var(--muted); }
.wrap { width: min(1280px, 100% - 2.5rem); margin-inline: auto; }
.skip { position: absolute; left: -999px; z-index: 100; padding: 0.6rem 1rem; background: #fff; }
.skip:focus { left: 1rem; top: 1rem; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.kicker { display: inline-block; margin-bottom: 0.7rem; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--green); }

/* Sample bar */
.gw-bar { color: #fff; background: #071f31; font-size: 0.86rem; }
.gw-bar .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.2rem; padding-block: 0.6rem; }
.gw-tag { padding: 0.2rem 0.6rem; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #ffd9c4; background: rgba(255, 122, 69, 0.2); border-radius: 999px; }
.gw-bar p { margin: 0; color: rgba(255, 255, 255, 0.8); }
.gw-bar a { margin-left: auto; font-weight: 700; color: #ffd9c4; text-decoration: none; }

/* Header */
.head { position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.head-row { display: flex; align-items: center; gap: 2rem; min-height: 70px; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; font-family: var(--head); font-size: 1.2rem; font-weight: 700; text-decoration: none; color: var(--ink); }
.brand b { font-weight: 500; color: var(--green); }
.nav { display: flex; gap: 1.6rem; margin-left: auto; }
.nav a { font-weight: 500; text-decoration: none; color: var(--muted); }
.nav a:hover { color: var(--green); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.8rem 1.4rem; border: 1.5px solid transparent; border-radius: 10px; font-weight: 600; text-decoration: none; cursor: pointer; transition: background 0.2s, border-color 0.2s, color 0.2s; }
.btn-green { color: #fff; background: var(--green); }
.btn-green:hover { background: var(--green-d); }
.btn-line { color: var(--green); border-color: var(--green); background: #fff; }
.btn-line:hover { color: #fff; background: var(--green); }

/* Hero */
.hero { position: relative; display: flex; align-items: flex-end; min-height: 620px; padding: 6rem 0 3rem; color: #fff; isolation: isolate; }
.hero-img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(8, 28, 22, 0.82) 0%, rgba(8, 28, 22, 0.45) 55%, rgba(8, 28, 22, 0.15) 100%); }
.hero h1 { max-width: 640px; color: #fff; }
.hero h1 span { color: var(--gold); }
.hero-inner > p { max-width: 560px; color: rgba(255, 255, 255, 0.85); font-size: 1.08rem; }
.console { max-width: 860px; margin-top: 2rem; padding: 0.6rem; border-radius: 18px; color: var(--ink); background: #fff; box-shadow: 0 30px 70px rgba(0, 0, 0, 0.3); }
.mode { display: inline-flex; margin: 0.3rem 0 0.6rem 0.3rem; padding: 0.25rem; border-radius: 10px; background: var(--sand); }
.mode input, .lender input { position: absolute; opacity: 0; }
.mode span, .lender span { display: inline-block; padding: 0.45rem 1.2rem; border-radius: 8px; font-weight: 600; color: var(--muted); cursor: pointer; }
.mode input:checked + span, .lender input:checked + span { color: #fff; background: var(--green); }
.mode input:focus-visible + span, .lender input:focus-visible + span { outline: 3px solid var(--gold); }
.console-fields { display: grid; grid-template-columns: 1.4fr 1fr 0.8fr auto; gap: 0.4rem; }
.console-fields label { display: grid; gap: 0.1rem; padding: 0.55rem 0.9rem; border-radius: 12px; background: var(--sand); }
.console-fields span { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.console-fields select { padding: 0.1rem 0; border: 0; font-weight: 600; color: var(--ink); background: transparent; cursor: pointer; }
.console-fields select:focus { outline: none; }
.console-fields label:focus-within { box-shadow: inset 0 0 0 2px var(--green); }
.console-fields .btn { padding-inline: 2rem; border-radius: 12px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; margin: 1.6rem 0 0; padding: 0; list-style: none; color: rgba(255, 255, 255, 0.85); font-size: 0.95rem; }
.hero-stats b { color: #fff; }

/* Results */
.results { padding: clamp(3rem, 6vw, 4.5rem) 0; background: var(--sand); }
.res-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.res-bar h2 { margin: 0; }
.res-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.res-tools label { display: flex; align-items: center; gap: 0.4rem; font-size: 0.88rem; color: var(--muted); }
.res-tools select { padding: 0.5rem 0.8rem; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fff; cursor: pointer; }
.view-toggle { display: none; padding: 0.2rem; border-radius: 10px; background: #fff; border: 1px solid var(--line); }
.view-toggle button { padding: 0.4rem 0.9rem; border: 0; border-radius: 8px; font-weight: 600; color: var(--muted); background: none; cursor: pointer; }
.view-toggle button[aria-pressed="true"] { color: #fff; background: var(--green); }
.res-count { margin: 0.4rem 0 1.4rem; }
.res-grid { display: grid; grid-template-columns: 1fr 440px; gap: 1.5rem; align-items: start; }
.res-grid > * { min-width: 0; }
.cards { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }
.card { display: grid; grid-template-columns: 280px 1fr; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r); background: #fff; cursor: pointer; transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s; }
.card:hover, .card.is-hot { border-color: var(--green); box-shadow: var(--shadow); transform: translateY(-2px); }
.card-media { position: relative; }
.card-media img { width: 100%; height: 100%; min-height: 200px; object-fit: cover; }
.badge { position: absolute; left: 0.7rem; top: 0.7rem; padding: 0.2rem 0.6rem; border-radius: 6px; font-size: 0.74rem; font-weight: 700; color: var(--ink); background: var(--gold); }
.badge.rent { color: #fff; background: var(--green); }
.card-body { display: flex; flex-direction: column; padding: 1.2rem 1.3rem; }
.price { font-family: var(--head); font-size: 1.45rem; font-weight: 700; color: var(--green-d); }
.price small { font-family: var(--body); font-size: 0.85rem; font-weight: 500; color: var(--muted); }
.card h3 { margin: 0.2rem 0 0.1rem; font-size: 1.05rem; }
.loc { margin: 0 0 0.8rem; font-size: 0.9rem; }
.specs { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; margin: auto 0 0; padding: 0.8rem 0 0; border-top: 1px solid var(--line); list-style: none; font-size: 0.88rem; color: var(--muted); }
.specs b { color: var(--ink); }
.monthly { margin-top: 0.5rem; font-size: 0.84rem; color: var(--green); font-weight: 500; }
.empty { padding: 3rem 1rem; text-align: center; border: 1px dashed var(--line); border-radius: var(--r); background: #fff; }

/* Map */
.map-wrap { position: sticky; top: 90px; }
.map { position: relative; overflow: hidden; height: min(640px, calc(100vh - 120px)); border-radius: var(--r); border: 1px solid var(--line); }
.map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pins { position: absolute; inset: 0; }
.pin { position: absolute; padding: 0.3rem 0.6rem; border: 2px solid #fff; border-radius: 999px; font-size: 0.78rem; font-weight: 700; white-space: nowrap; color: var(--ink); background: #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18); transform: translate(-50%, -100%); cursor: pointer; transition: transform 0.15s, background 0.15s, color 0.15s; }
.pin::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 10px; height: 10px; background: inherit; border-right: 2px solid #fff; border-bottom: 2px solid #fff; transform: translateX(-50%) rotate(45deg); }
.pin:hover, .pin.is-hot { z-index: 2; color: #fff; background: var(--green); transform: translate(-50%, -100%) scale(1.12); }
.map-note { position: absolute; right: 0.7rem; bottom: 0.5rem; margin: 0; font-size: 0.72rem; }

/* Loan calculator */
.loan { padding: clamp(4rem, 8vw, 6rem) 0; }
.loan-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.loan-notes { margin: 1.2rem 0 0; padding: 0; list-style: none; display: grid; gap: 0.5rem; }
.loan-notes li { display: flex; gap: 0.6rem; color: var(--muted); }
.loan-notes li::before { content: "✓"; flex-shrink: 0; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 0.75rem; color: var(--green); background: var(--green-l); }
.calc { padding: clamp(1.4rem, 3vw, 2rem); border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: var(--shadow); }
.lender { display: inline-flex; flex-wrap: wrap; margin-bottom: 1.2rem; padding: 0.25rem; border-radius: 10px; background: var(--sand); }
.slide { display: block; margin-bottom: 1.1rem; }
.slide span { display: flex; justify-content: space-between; margin-bottom: 0.3rem; font-weight: 500; }
.slide output { font-family: var(--head); font-weight: 600; color: var(--green-d); }
.slide input { width: 100%; accent-color: var(--green); }
.calc-out { margin-top: 0.6rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.big span { display: block; font-size: 0.85rem; color: var(--muted); }
.big strong { font-family: var(--head); font-size: clamp(2rem, 4vw, 2.6rem); color: var(--green-d); }
.split { display: flex; height: 10px; margin: 0.8rem 0 1rem; overflow: hidden; border-radius: 10px; }
.split i { display: block; height: 100%; transition: width 0.3s; }
.split i:first-child, .dp { background: var(--green); }
.split i:last-child, .di { background: var(--gold); }
.calc dl { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem 1.2rem; margin: 0; }
.calc dl div { display: flex; flex-direction: column; }
.calc dt { display: flex; align-items: center; gap: 0.4rem; font-size: 0.82rem; color: var(--muted); }
.calc dd { margin: 0; font-weight: 600; }
.dot { width: 10px; height: 10px; border-radius: 3px; }
.calc-note { margin: 1rem 0 0; font-size: 0.8rem; }

/* Areas */
.areas { padding: clamp(4rem, 8vw, 6rem) 0; background: var(--sand); }
.area-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.8rem; margin-top: 1.4rem; }
.area { display: flex; flex-direction: column; gap: 0.3rem; padding: 1.2rem; text-align: left; border: 1px solid var(--line); border-radius: var(--r); color: var(--ink); background: #fff; cursor: pointer; transition: border-color 0.2s, transform 0.2s; }
.area:hover { border-color: var(--green); transform: translateY(-2px); }
.area b { font-family: var(--head); font-size: 1.1rem; }
.area span { font-size: 0.88rem; color: var(--muted); }
.area em { margin-top: auto; padding-top: 0.6rem; font-style: normal; font-weight: 600; color: var(--green); }

/* Sell */
.sell { padding: clamp(4rem, 8vw, 6rem) 0; }
.sell-grid { display: grid; grid-template-columns: 0.75fr 1.25fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.sell-grid img { width: 100%; aspect-ratio: 5 / 6; object-fit: cover; border-radius: 20px; }
.sell blockquote { margin: 1.2rem 0 1.6rem; padding: 1.1rem 1.3rem; border-left: 4px solid var(--gold); border-radius: 0 12px 12px 0; font-size: 1.05rem; background: var(--sand); }
.sell cite { display: block; margin-top: 0.4rem; font-size: 0.88rem; font-style: normal; color: var(--muted); }
.lic { margin: 1rem 0 0; font-size: 0.82rem; }

/* Footer */
.foot { padding: 3.5rem 0 1.5rem; color: rgba(255, 255, 255, 0.7); background: var(--ink); }
.foot-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 2rem; }
.brand-foot { color: #fff; }
.brand-foot b { color: var(--gold); }
.foot p { margin-top: 0.8rem; color: rgba(255, 255, 255, 0.6); }
.foot h4 { margin: 0 0 0.8rem; color: #fff; }
.foot-grid > div:not(:first-child) { display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.92rem; }
.foot a { text-decoration: none; }
.foot a:hover { color: #fff; }
.foot-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; margin-top: 2.5rem; padding-top: 1.2rem; border-top: 1px solid rgba(255, 255, 255, 0.12); font-size: 0.84rem; }
.foot-bottom a { color: var(--gold); }

/* Detail dialog: slides in from the right */
.detail { width: min(760px, 100%); height: 100%; max-height: none; max-width: none; margin: 0 0 0 auto; padding: 0; border: 0; background: #fff; }
.detail::backdrop { background: rgba(10, 20, 16, 0.55); }
.detail[open] { animation: slideIn 0.35s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } }
.x-btn { position: absolute; top: 0.9rem; right: 0.9rem; z-index: 2; display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%; font-size: 1.5rem; line-height: 1; color: var(--ink); background: rgba(255, 255, 255, 0.95); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15); cursor: pointer; }
.gal-main { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.4rem; padding: 0.4rem; }
.thumbs button { padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; background: none; }
.thumbs button[aria-pressed="true"] { border-color: var(--green); }
.thumbs img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.d-body { padding: 1.2rem 1.6rem 2rem; }
.d-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.d-body .price { font-size: 1.9rem; }
.d-specs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; margin: 1rem 0 1.2rem; padding: 0; list-style: none; }
.d-specs li { padding: 0.8rem; border-radius: 12px; text-align: center; font-size: 0.82rem; color: var(--muted); background: var(--sand); }
.d-specs b { display: block; font-family: var(--head); font-size: 1.15rem; color: var(--ink); }
.feat { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 1.4rem; padding: 0; list-style: none; }
.feat li { padding: 0.3rem 0.8rem; border-radius: 999px; font-size: 0.85rem; color: var(--green-d); background: var(--green-l); }
.d-box { margin-top: 1.2rem; padding: 1.2rem; border: 1px solid var(--line); border-radius: 14px; }
.d-box h3 { margin-bottom: 0.6rem; }
.d-pay { font-family: var(--head); font-size: 1.6rem; font-weight: 700; color: var(--green-d); }
.d-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.field { display: grid; gap: 0.3rem; margin-bottom: 0.7rem; font-size: 0.85rem; font-weight: 600; }
.field input, .field select { width: 100%; padding: 0.65rem 0.8rem; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fff; }
.field input:focus, .field select:focus { outline: none; border-color: var(--green); }
.field [aria-invalid="true"] { border-color: #c0392b; }
.d-err { margin: 0 0 0.6rem; font-size: 0.88rem; font-weight: 600; color: #c0392b; }
.d-ok { padding: 1rem; border-radius: 12px; color: var(--green-d); background: var(--green-l); }
.d-ok strong { display: block; font-family: var(--head); font-size: 1.1rem; }

@media (max-width: 1080px) {
  .nav { display: none; }
  .head-cta { margin-left: auto; }
  .res-grid { grid-template-columns: 1fr; }
  .map-wrap { display: none; position: static; }
  .res-grid.show-map .cards { display: none; }
  .res-grid.show-map .map-wrap { display: block; }
  .map { height: 70vh; }
  .view-toggle { display: inline-flex; }
  .area-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .wrap { width: min(1280px, 100% - 2rem); }
  .gw-bar a { margin-left: 0; }
  .head-cta { padding: 0.6rem 0.9rem; font-size: 0.85rem; }
  .hero { min-height: 0; padding-top: 3rem; }
  .console-fields { grid-template-columns: 1fr 1fr; }
  .console-fields label:first-child { grid-column: span 2; }
  .console-fields .btn { grid-column: span 2; padding-block: 0.9rem; }
  .card { grid-template-columns: 1fr; }
  .card-media img { min-height: 0; aspect-ratio: 16 / 10; }
  .loan-grid, .sell-grid { grid-template-columns: 1fr; }
  .sell-grid img { max-width: 360px; }
  .area-grid { grid-template-columns: 1fr 1fr; }
  .calc dl, .d-row { grid-template-columns: 1fr; }
  .d-specs { grid-template-columns: repeat(2, 1fr); }
  .foot-grid { grid-template-columns: 1fr; }
  .price-cap span, .sort span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Video hero + scroll motion (assets/js/motion.js) */
.video-toggle { position: absolute; right: 1.2rem; bottom: 1.2rem; z-index: 3; display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.45rem 0.85rem 0.45rem 0.7rem; font-family: inherit; font-size: 0.75rem; font-weight: 700; line-height: 1; letter-spacing: 0.02em; color: #fff; background: rgba(0, 0, 0, 0.38); border: 1px solid rgba(255, 255, 255, 0.42); border-radius: 999px; cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: background 0.2s; }
.video-toggle::before { content: ""; width: 10px; height: 11px; background: linear-gradient(90deg, currentColor 0 35%, transparent 35% 65%, currentColor 65%); }
.video-toggle[aria-pressed="true"]::before { background: currentColor; clip-path: polygon(0 0, 100% 50%, 0 100%); }
.video-toggle:hover { background: rgba(0, 0, 0, 0.58); }
.rv { opacity: 0; transform: translateY(32px); transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1), transform 0.9s cubic-bezier(0.22, 1, 0.36, 1) !important; transition-delay: var(--rv-delay, 0s) !important; }
.rv.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .rv { opacity: 1; transform: none; transition: none !important; } }.hero > .video-toggle { top: 1.2rem; bottom: auto; }
