/* WOLO Mont Kiara: styles for the interaction layer (wolo.js, tower.js). Loaded after style.css. */

/* Images never leave their frame: width/height attributes are only hints for the browser. */
img { max-width: 100%; }
.layout-card img, .plan-panel img { height: auto; }

.scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 120; pointer-events: none; }
.scroll-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--color-gold), var(--color-gold-light)); transform: scaleX(0); transform-origin: left center; }

.hero__scroll { position: absolute; left: 50%; bottom: 18px; z-index: 2; width: 26px; height: 42px; margin-left: -13px; border: 1.5px solid rgba(255, 255, 255, 0.55); border-radius: 14px; }
.hero__scroll span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--color-gold-light); animation: wolo-scroll 1.8s ease-in-out infinite; }
@keyframes wolo-scroll { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(14px); opacity: 0; } 100% { transform: translateY(0); opacity: 0; } }

/* Children of a .stagger row rise in one after another once their section is on screen. */
.wolo-js section:not(.hero) .stagger > * { opacity: 0; transform: translateY(22px); transition: opacity 0.6s ease, transform 0.6s ease, border-color 0.2s; }
.wolo-js section.is-visible .stagger > * { opacity: 1; transform: none; }
.wolo-js section.is-visible .stagger > *:nth-child(2) { transition-delay: 0.08s; }
.wolo-js section.is-visible .stagger > *:nth-child(3) { transition-delay: 0.16s; }
.wolo-js section.is-visible .stagger > *:nth-child(4) { transition-delay: 0.24s; }
.wolo-js section.is-visible .stagger > *:nth-child(5) { transition-delay: 0.32s; }
.wolo-js section.is-visible .stagger > *:nth-child(6) { transition-delay: 0.4s; }
.wolo-js section.is-visible .stagger > *:nth-child(n+7) { transition-delay: 0.48s; }

@media (hover: hover) {
  .wolo-js section.is-visible .card:hover { transform: translateY(-4px); border-color: rgba(201, 162, 93, 0.55); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35); transition-delay: 0s; }
  .photo-tile .media-photo img { transition: transform 0.6s ease; }
  .photo-tile:hover .media-photo img { transform: scale(1.05); }
}
img[data-zoom] { cursor: zoom-in; }
img[data-zoom]:focus-visible, .plan-tab:focus-visible, .tower__zone:focus-visible { outline: 2px solid var(--color-gold-light); outline-offset: 3px; }

/* Floor-plan tabs */
.plan-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; }
.plan-tab { padding: 10px 22px; border: 1px solid var(--color-border); border-radius: 999px; background: transparent; color: var(--color-ink-muted); font: inherit; font-size: 0.9rem; cursor: pointer; transition: background 0.2s, color 0.2s, border-color 0.2s; }
.plan-tab.is-active { background: var(--color-gold); border-color: var(--color-gold); color: #0b0c0f; font-weight: 600; }
.plan-panels { max-width: 860px; margin: 28px auto 0; }
.plan-panel { margin: 0 0 24px; border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; background: var(--color-bg); }
.wolo-js .plan-panel { margin-bottom: 0; }
.wolo-js .plan-panel.is-active { animation: wolo-fade 0.45s ease; }
@keyframes wolo-fade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.plan-panel__img { display: flex; align-items: center; justify-content: center; background: #fff; padding: 12px; }
.plan-panel__img img { display: block; width: auto; max-width: 100%; max-height: min(68vh, 620px); object-fit: contain; }
.plan-panel figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 16px 20px; border-top: 1px solid var(--color-border); font-size: 0.9rem; color: var(--color-ink-muted); }
.plan-panel figcaption b { font-size: 1.05rem; color: var(--color-ink); }
.plan-panel figcaption em { margin-left: auto; font-style: normal; font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-gold); }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; background: rgba(6, 7, 9, 0.94); padding: 56px 12px 64px; }
.lightbox.is-open { display: flex; animation: wolo-fade 0.25s ease; }
.has-lightbox, .has-lightbox body { overflow: hidden; }
.lightbox__stage { max-width: 100%; max-height: 100%; overflow: auto; display: flex; -webkit-overflow-scrolling: touch; }
.lightbox__stage img { display: block; margin: auto; width: auto; height: auto; max-width: min(100%, 1400px); max-height: calc(100vh - 130px); object-fit: contain; border-radius: 6px; cursor: zoom-in; background: #fff; }
.lightbox__stage.is-zoomed { align-items: flex-start; justify-content: flex-start; }
.lightbox__stage.is-zoomed img { max-width: none; max-height: none; width: 220%; cursor: zoom-out; }
.lightbox__btn { position: absolute; z-index: 2; width: 44px; height: 44px; border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 50%; background: rgba(11, 12, 15, 0.7); color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.lightbox__close { top: 10px; right: 12px; }
.lightbox__prev { left: 10px; top: 50%; margin-top: -22px; }
.lightbox__next { right: 10px; top: 50%; margin-top: -22px; }
.lightbox__cap { position: absolute; left: 0; right: 0; bottom: 14px; margin: 0; padding: 0 16px; text-align: center; font-size: 0.85rem; color: rgba(255, 255, 255, 0.8); }

/* 3D tower */
.tower { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; max-width: 980px; margin: 24px auto 0; }
.tower__stage { position: relative; height: 560px; border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; background: radial-gradient(ellipse at 50% 75%, rgba(201, 162, 93, 0.12), transparent 65%), var(--color-surface); }
.tower__stage canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; cursor: grab; opacity: 0; transition: opacity 0.6s ease; }
.tower__stage canvas:active { cursor: grabbing; }
.tower__stage.is-ready canvas { opacity: 1; }
.tower__stage.is-unavailable { display: none; }
.tower__zones { display: flex; flex-direction: column; gap: 8px; }
.tower__zone { display: grid; grid-template-columns: 14px 1fr auto; align-items: center; gap: 12px; width: 100%; padding: 13px 16px; border: 1px solid var(--color-border); border-radius: var(--radius); background: transparent; color: var(--color-ink-muted); font: inherit; text-align: left; cursor: pointer; transition: border-color 0.2s, background 0.2s, color 0.2s; }
.tower__zone i { width: 14px; height: 14px; border-radius: 3px; }
.tower__zone b { font-weight: 600; color: var(--color-ink); }
.tower__zone span { font-size: 0.82rem; white-space: nowrap; }
.tower__zone.is-active { border-color: var(--color-gold); background: rgba(201, 162, 93, 0.1); }
.tower__detail { min-height: 4.8em; margin: 18px 0 0; line-height: 1.6; color: var(--color-ink); }
.tower__note { margin: 10px 0 0; font-size: 0.78rem; color: var(--color-ink-muted); }

/* Film */
.film { max-width: 980px; margin: 0 auto; border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; background: #000; }
.film video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }

.swipe-dots { display: none; }

@media (max-width: 860px) {
  .tower { grid-template-columns: 1fr; gap: 20px; }
  .tower__stage { height: min(62vh, 440px); }
}
@media (max-width: 600px) {
  /* Long stacks become swipe rows: one card in view, the next one peeking in from the right. */
  .swipe { display: flex !important; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin: 0 -24px; padding: 4px 24px 6px; scroll-padding-left: 24px; }
  .swipe::-webkit-scrollbar { display: none; }
  .swipe > * { flex: 0 0 82%; min-width: 0; scroll-snap-align: start; }
  .facility-grid.swipe > * { flex-basis: 70%; }
  .swipe-dots { display: flex; justify-content: center; gap: 7px; margin-top: 16px; }
  .swipe-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--color-border); transition: background 0.2s, transform 0.2s; }
  .swipe-dots i.is-on { background: var(--color-gold); transform: scale(1.35); }
  .wolo-js section.is-visible .swipe.stagger > * { transition-delay: 0s; }
  .plan-tab { padding: 9px 16px; font-size: 0.85rem; }
  .plan-panel__img { padding: 8px; }
  .plan-panel__img img { max-height: 58vh; }
  .plan-panel figcaption em { margin-left: 0; width: 100%; }
  /* Key facts and distances: label above value, so long values never squeeze the label. */
  .proximity-list li { flex-direction: column; gap: 3px; }
  .proximity-list li b { text-align: left; }
  .lightbox { padding: 56px 6px 70px; }
  .lightbox__prev, .lightbox__next { top: auto; bottom: 14px; margin-top: 0; }
  .lightbox__cap { bottom: 66px; }
  .hero__scroll { display: none; }
  .tower__zone { padding: 11px 13px; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .wolo-js section:not(.hero) .stagger > * { opacity: 1; transform: none; transition: none; }
  .hero__scroll span, .wolo-js .plan-panel.is-active, .lightbox.is-open { animation: none; }
}


/* ---- Review pass (UI and UX audits, 2026-10-06) ---- */
html { scroll-padding-top: 96px; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--color-gold-light); outline-offset: 3px; }

/* Primary action: solid gold, so it reads as the button on a dark photo. */
.hero__cta .btn, .price-band .btn, #sales-gallery .btn, .facts-cta .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 30px; background: var(--color-gold); border-color: var(--color-gold); color: #0b0c0f; font-weight: 700; }
.hero__cta .btn:hover, .price-band .btn:hover, #sales-gallery .btn:hover, .facts-cta .btn:hover { background: var(--color-gold-light); border-color: var(--color-gold-light); color: #0b0c0f; }
.facts-cta { margin-top: 32px; text-align: center; }
.cta-hint { max-width: 520px; margin: 14px auto 0; font-size: 0.85rem; line-height: 1.55; color: #a9aebb; text-align: center; }
.plan-ask { margin-left: auto; padding: 8px 16px; border: 1px solid var(--color-gold); border-radius: 999px; font-size: 0.82rem; font-weight: 600; color: var(--color-gold-light); text-decoration: none; white-space: nowrap; }
.plan-ask:hover { background: var(--color-gold); color: #0b0c0f; }
.plan-panel figcaption em { margin-left: 0; width: 100%; }
.plan-panel__img { background: #f4f1ea; padding: 20px; }
.plan-panel__img img { background: #f4f1ea; }

/* Hero: keep the headline off the tower on wide screens; stronger scrim behind it on phones. */
@media (min-width: 1024px) {
  .hero__content { margin-left: auto; margin-right: 0; max-width: 620px; }
}
:lang(ja) .hero h1, :lang(zh-Hans) .hero h1, :lang(zh-Hant) .hero h1 { word-break: keep-all; overflow-wrap: anywhere; line-break: strict; }
.hero h1 { text-wrap: balance; }
.hero h1 em { display: block; }

/* Facilities: seven tiles as 2 + 5 across four columns, no orphan. */
@media (min-width: 961px) {
  .facility-grid { grid-template-columns: repeat(4, 1fr); }
  .facility-grid > :first-child { grid-column: span 2; }
  .facility-grid > :first-child .facility__photo { aspect-ratio: auto; height: calc(100% - 34px); min-height: 180px; }
}

/* Floating contact: circles on desktop, a labelled bar on phones. */
.contact-float__label { display: none; }
.whatsapp-float { display: flex; align-items: center; justify-content: center; }
.whatsapp-float svg { width: 28px; height: 28px; display: block; }
.has-lightbox .contact-float { display: none; }
.credential-stat__num { font-variant-numeric: tabular-nums; }
.tower__stage { border-color: rgba(201, 162, 93, 0.25); background: radial-gradient(ellipse at 50% 82%, rgba(201, 162, 93, 0.2), transparent 60%), #0b0c0f; }
.swipe { overscroll-behavior-x: contain; }

@media (max-width: 768px) {
  .hero__overlay { background: linear-gradient(180deg, rgba(11, 12, 15, 0) 0%, rgba(11, 12, 15, 0.1) 30%, rgba(11, 12, 15, 0.78) 52%, rgba(11, 12, 15, 0.96) 74%, var(--color-bg) 100%); }
  .hero h1 { font-size: clamp(1.85rem, 8.2vw, 2.4rem); line-height: 1.14; }
  .hero h1 em { color: var(--color-gold-light); }
  .hero__content .eyebrow { color: var(--color-gold-light); letter-spacing: 0.14em; }
}
@media (max-width: 600px) {
  body { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  .contact-float { left: 0; right: 0; bottom: 0; flex-direction: row-reverse; align-items: stretch; gap: 10px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: rgba(11, 12, 15, 0.97); border-top: 1px solid var(--color-border); }
  .contact-float .whatsapp-float, .contact-float .wechat-float { width: auto; height: 50px; border-radius: 10px; animation: none; box-shadow: none; font-size: 0.95rem; font-weight: 700; text-decoration: none; }
  .contact-float .whatsapp-float { flex: 2; gap: 8px; color: #fff; }
  .contact-float .wechat-float { flex: 1; }
  .contact-float .whatsapp-float::before, .contact-float .whatsapp-float::after, .contact-float .wechat-float::before, .contact-float .wechat-float::after { display: none; }
  .contact-float .whatsapp-float svg { width: 22px; height: 22px; }
  .contact-float__label { display: inline; }
  .contact-float__short { display: none; }
  .contact-float .wechat-popover { position: absolute; right: 12px; bottom: calc(100% + 10px); }
  .hero__note { padding-right: 0; }
  .hero { padding-bottom: 28px; }

  .nav__logo strong { display: none; }
  .lang-switch a { padding: 9px 9px; font-size: 0.74rem; min-height: 38px; display: inline-flex; align-items: center; }

  .section { padding: 52px 0; }
  .section-head .lede { text-align: left; font-size: 1rem; line-height: 1.65; }
  .card--compact { text-align: left; }
  .card--compact p { font-size: 0.92rem; line-height: 1.6; }
  .swipe > * { flex-basis: 86%; }
  .section-note, .tower__note, .footer-disclosure { font-size: 0.82rem; color: #a9aebb; }
  .credential-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 16px; }
  .plan-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .plan-tab { padding: 0 4px; min-height: 44px; font-size: 0.8rem; }
  .plan-ask { margin-left: 0; }
  .plan-panel__img { padding: 10px; }
  .faq-item { padding: 16px 18px; }
  .faq-item summary { min-height: 44px; font-size: 1rem; }

  /* Tower: slim canvas beside the list, so the whole section fits one screen. */
  .tower { grid-template-columns: 112px minmax(0, 1fr); gap: 14px; align-items: stretch; }
  .tower__stage { height: auto; min-height: 380px; }
  .tower__zone { grid-template-columns: 12px 1fr; gap: 4px 10px; padding: 10px 12px; }
  .tower__zone i { width: 12px; height: 12px; }
  .tower__zone span { grid-column: 2; white-space: normal; }
  .tower__detail { min-height: 0; font-size: 0.92rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn--beam::before, .whatsapp-float, .wechat-float { animation: none !important; }
}

/* Primary buttons: the template's animated edge stays, the face turns gold. */
.hero__cta .btn--beam::after, .price-band .btn--beam::after, #sales-gallery .btn--beam::after, .facts-cta .btn--beam::after { background: var(--color-gold); transition: background 0.2s; }
.hero__cta .btn--beam:hover::after, .price-band .btn--beam:hover::after, #sales-gallery .btn--beam:hover::after, .facts-cta .btn--beam:hover::after { background: var(--color-gold-light); }
.hero__cta .btn--beam::before, .price-band .btn--beam::before, #sales-gallery .btn--beam::before, .facts-cta .btn--beam::before { background: conic-gradient(from 0deg, transparent 0%, transparent 80%, #fff 92%, #fff 100%); }
/* Desktop headline: name on one line, promise beneath it, clear of the header. */
@media (min-width: 1024px) {
  .hero h1 { font-size: clamp(2.2rem, 3.6vw, 3.25rem); text-wrap: wrap; }
  .hero h1 em { font-size: 0.82em; line-height: 1.18; margin-top: 6px; text-wrap: balance; }
}
@media (max-width: 600px) {
  .hero { padding-bottom: 28px; min-height: calc(100svh - 70px); }
}
