/* Floor plans, the suite explorer and the stacked house. Ported from the August demo and
   recoloured: rust replaces the old pink as the "this one" colour. */

/* ---------- plans ---------- */
.fp-set { display: grid; gap: clamp(56px, 7vw, 96px); }
.fp { position: relative; max-width: 980px; margin-inline: auto; width: 100%; container-type: inline-size; }
.fp svg { width: 100%; height: auto; display: block; overflow: visible; }
@container (max-width: 430px) { .fp-label, .fp-sub { display: none; } }
.fp__head { margin-bottom: 24px; display: grid; gap: 10px; }
.fp__head h3 { font-size: clamp(1.8rem, 3vw, 2.6rem); }
.fp__head p { max-width: 58ch; }
.fp__pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.fp-pill { text-decoration: none; padding: 8px 14px; border: 1px solid rgba(25,50,133,.35); font-size: .68rem; transition: background .2s ease, color .2s ease, border-color .2s ease; }
.fp-pill:hover, .fp-pill:focus-visible, .fp-pill[data-lit] { background: var(--rust); border-color: var(--rust); color: #fff; }

.fp-region { transition: opacity .25s ease; }
svg[data-fp]:not([data-fp-lock]) .fp-region[data-region] { cursor: pointer; }
.fp-region .fp-fill { transition: fill .25s ease, stroke-width .2s ease; stroke: var(--rust); stroke-width: 0; }
svg[data-fp]:not([data-fp-lock]) .fp-region[data-region]:hover .fp-fill,
svg[data-fp] .fp-region[data-region]:focus-visible .fp-fill { stroke-width: 6; }
svg[data-fp] .fp-region[data-region]:focus { outline: none; }
svg[data-fp] .fp-region[data-hl='true'] .fp-fill { fill: var(--rust); }
svg[data-fp] .fp-region[data-hl='true'] .fp-label,
svg[data-fp] .fp-region[data-hl='true'] .fp-sub { fill: #fff; }
svg[data-fp][data-hl-any='true'] .fp-region:not([data-hl='true']) { opacity: .5; }

/* the photo card that appears over a space */
.fp-card { position: absolute; z-index: 5; width: min(270px, 62vw); background: var(--white); outline: 1px solid rgba(25,50,133,.18); pointer-events: none; opacity: 0; transform: translate(-50%, 6px); transition: opacity .2s ease, transform .2s ease; }
.fp[data-card='true'] .fp-card { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.fp-card[data-owner]:not([data-owner=""]) { cursor: pointer; }
@container (max-width: 560px) {
  .fp-card { position: static; display: none; width: 100%; margin-top: 16px; transform: none; }
  .fp[data-card='true'] .fp-card { display: block; transform: none; }
}
.fp-card__media { aspect-ratio: 4 / 3; background: var(--linen); }
.fp-card__media img { width: 100%; height: 100%; object-fit: cover; }
.fp-card__body { padding: 12px 16px 14px; display: grid; gap: 4px; }
.fp-card__body strong { font-weight: 400; font-size: 1.15rem; }
.fp-card__body .label { color: var(--rust); font-size: .62rem; }

/* legend */
.fp-legend { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); margin-bottom: clamp(48px, 6vw, 72px); }
.fp-key { display: flex; gap: 14px; align-items: flex-start; }
.fp-key div { display: grid; gap: 4px; }
.fp-key strong { font-weight: 400; font-size: .72rem; }
.fp-key span { font-size: .95rem; line-height: 1.5; }
.fp-key__chip { flex: none; width: 30px; height: 30px; border: 1px solid rgba(25,50,133,.25); }
.fp-key[data-kind='unit'] .fp-key__chip { background: #193285; }
.fp-key[data-kind='private'] .fp-key__chip { background: #E1BBA0; }
.fp-key[data-kind='shared'] .fp-key__chip { background: repeating-linear-gradient(45deg, #DCE6F7 0 5px, #a9b6dc 5px 7px); }

/* the "where it sits" plan */
.fp--mini { margin: 0; }
.fp__cap { text-align: center; padding: 10px 0 4px; font-size: .62rem; color: rgba(25,50,133,.75); }

/* ---------- explorer: pick a suite ---------- */
.explorer { display: grid; gap: clamp(24px, 3vw, 48px); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 940px) { .explorer { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: start; } }
.building { display: flex; flex-direction: column; gap: 12px; }
.floor { border: 1px solid rgba(25,50,133,.18); background: var(--white); padding: 22px 24px 24px; transition: border-color .25s ease; }
.floor[data-active='true'] { border-color: var(--kelp); outline: 1px solid var(--kelp); }
.floor__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.floor__name { font-size: 1.6rem; }
.floor__head .label { font-size: .62rem; color: var(--rust); }
.floor__blurb { font-size: .98rem; margin-bottom: 16px; max-width: 52ch; }
.floor__units { display: flex; gap: 8px; flex-wrap: wrap; }
.unit-chip { flex: 1 1 0; min-width: 96px; display: grid; justify-items: center; gap: 4px; padding: 12px 10px 12px; background: transparent; border: 1px solid rgba(25,50,133,.3); color: var(--midnight); cursor: pointer; font: inherit; transition: background .2s ease, color .2s ease, border-color .2s ease; }
.unit-chip[data-span='3'] { flex-grow: 3; }
.unit-chip .script { font-size: 2rem; line-height: 1; }
.unit-chip .label { font-size: .58rem; opacity: .8; }
.unit-chip:hover, .unit-chip[data-active='true'], .unit-chip[data-lit] { background: var(--midnight); border-color: var(--midnight); color: var(--cream); }
.unit-chip[data-active='true'] .script { color: var(--sand); }
.unit-detail { background: var(--white); border: 1px solid rgba(25,50,133,.18); position: sticky; top: 96px; }
.unit-detail__media { aspect-ratio: 16 / 10; background: var(--linen); overflow: hidden; }
.unit-detail__media img { width: 100%; height: 100%; object-fit: cover; }
.unit-detail__body { padding: 26px 28px 28px; display: grid; gap: 12px; }
.unit-detail__body > .label:first-child { color: var(--rust); }
.unit-detail__body h3.script { font-size: 3.6rem; line-height: .9; color: var(--kelp); }
.unit-detail__spec { font-size: .62rem; }
.unit-detail__facts { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .62rem; color: var(--rust); }
.unit-detail__cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.unit-detail .fp--mini { border-top: 1px solid rgba(25,50,133,.14); padding-top: 14px; margin-top: 6px; }
@media (max-width: 939px) { .unit-detail { position: static; } }

/* ---------- the stacked house ---------- */
/* Three floors drawn as slabs in 3D. The section is tall and the stage sticks: scrolling lifts
   the top floor away, then the middle, until all three hang apart and every room can be hovered. */
.stack { position: relative; background: var(--midnight); color: var(--cream); height: 460vh; }
.stack__stage { position: sticky; top: 0; height: 100vh; overflow: hidden; display: grid; grid-template-columns: minmax(300px, 34rem) minmax(0, 1fr); }
.stack__copy { position: relative; z-index: 3; padding: 120px 0 56px var(--gutter); display: grid; align-content: center; gap: 28px; }
.stack__steps { position: relative; min-height: 15rem; }
.stack__step { position: absolute; inset: 0 0 auto 0; opacity: 0; transform: translateY(-10px); transition: opacity .22s ease, transform .3s ease; pointer-events: none; }
/* the old caption leaves before the new one arrives, so they never sit on top of each other */
.stack__step.is-on { opacity: 1; transform: none; pointer-events: auto; transition: opacity .5s ease .22s, transform .7s cubic-bezier(.2,.7,.2,1) .22s; }
.stack__step:not(.is-on) { transform: translateY(14px); }
.stack__step .label { color: var(--sand); }
.stack__step h2 { font-size: clamp(2.4rem, 4.2vw, 4rem); line-height: .95; margin: 16px 0 18px; }
.stack__step h2 em { color: var(--sand); display: block; }
.stack__step p { max-width: 26rem; color: rgba(249,242,237,.88); }
.stack .fp__pills { margin-top: 18px; }
.stack .fp-pill { color: var(--cream); border-color: rgba(249,242,237,.4); }
.stack__card { position: absolute; z-index: 4; left: var(--gutter); bottom: 44px; display: grid; grid-template-columns: 132px 1fr; gap: 0; background: var(--cream); color: var(--midnight); width: min(100%, 26rem); opacity: 0; transform: translateY(8px); transition: opacity .2s ease, transform .2s ease; pointer-events: none; }
.stack[data-card='true'] .stack__card { opacity: 1; transform: none; pointer-events: auto; }
.stack__card .fp-card__media { aspect-ratio: 1; }
.stack__card .fp-card__body { align-content: center; }
.stack__card:not(:has(.fp-card__media)) { grid-template-columns: 1fr; }
.stack__progress { display: flex; gap: 6px; }
.stack__progress i { width: 28px; height: 2px; background: rgba(249,242,237,.25); transition: background .4s ease; }
.stack__progress i.is-on { background: var(--sand); }

.stack__scene { position: relative; margin-top: 88px; perspective: 2400px; perspective-origin: 50% 30%; } /* clear of the top bar */
.stack__level { position: absolute; left: 50%; top: 50%; width: var(--w, 480px); transform: translate(-50%, -50%) translateY(var(--y, 0px)); transition: opacity .5s ease; will-change: transform; }
.stack__plate { transform: rotateX(57deg) rotateZ(-36deg); transform-style: preserve-3d; background: var(--white); padding: 2.2%; outline: 1px solid rgba(249,242,237,.5); }
/* slab edge: a darker sheet a few pixels under the plan reads as thickness, not shadow */
.stack__plate::before { content: ''; position: absolute; inset: 0; background: #0f2061; transform: translateZ(-14px); }
.stack__plate svg { position: relative; width: 100%; height: auto; display: block; }
.stack__tag { position: absolute; right: -6%; top: 50%; transform: translateY(-50%); text-align: left; font-size: .64rem; color: var(--sand); white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .5s ease; }
.stack__level.is-out .stack__tag { opacity: 1; }
.stack__level.is-dim { opacity: .38; }
.stack .fp-mark, .stack .fp-water text { display: none; }
.stack__narrow { display: none; }

/* phones and small tablets: no sticky scene, the three floors simply follow one another */
@media (max-width: 860px), (max-height: 560px) {
  .stack { height: auto; padding-block: 88px; }
  .stack__stage { position: static; height: auto; display: block; overflow: visible; }
  .stack__copy { padding: 0 var(--gutter) 24px; }
  .stack__steps { min-height: 0; }
  .stack__step { position: static; opacity: 1; transform: none; pointer-events: auto; }
  .stack__step:not(:first-child), .stack__progress, .stack__wide { display: none; }
  .stack__narrow { display: inline; }
  .stack__scene { margin-top: 0; perspective: 1400px; padding: 0 var(--gutter); display: grid; gap: 8px; }
  .stack__level { position: relative; left: auto; top: auto; width: 82%; margin: 0 auto; transform: none !important; }
  .stack__tag { position: static; display: block; transform: none; opacity: 1; margin: 0 0 -8px; font-size: .7rem; }
  .stack__card { position: sticky; bottom: 12px; margin: 16px auto 0; z-index: 4; width: calc(100% - 2 * var(--gutter)); }
}
@media (prefers-reduced-motion: reduce) {
  .fp-card, .stack__step, .stack__card { transition: none; }
}

/* phones: the small labels step up to a readable size */
@media (max-width: 760px) {
  .fp-pill, .fp__cap, .floor__head .label, .unit-chip .label, .unit-detail__spec, .unit-detail__facts, .fp-card__body .label { font-size: .72rem; letter-spacing: .12em; }
}
