/* Tower Road Residences, concept site. One theme (dark navy), one accent (white on image). */
:root {
  --navy: #0c101c;
  --navy-2: #141a2b;
  --ink: #f2efe9;
  --ink-dim: rgba(242, 239, 233, 0.72);
  --hair: rgba(255, 255, 255, 0.88);
  --wash: rgba(255, 255, 255, 0.42);
  --serif: "Cormorant Garamond", "Didot", Georgia, serif;
  --sans: "Inter Tight", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --film-vh: 900; /* scroll length of the film in vh */
}

* { box-sizing: border-box; }
html { background: var(--navy); color: var(--ink); }
/* overflow-x:hidden on html/body would break position:sticky; the stage clips its own overflow instead */
#film { overflow: clip; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background: var(--navy);
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }

/* Poster under the canvas: the first frame, visible before any frame has arrived */
.poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 52%; }
#film-canvas { opacity: 0; transition: opacity 300ms linear; }
#film-canvas.ready { opacity: 1; }

/* Header: one line, 64px, transparent over the film */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  height: 64px; padding: 0 clamp(16px, 3vw, 40px);
  display: flex; align-items: center; justify-content: space-between;
  mix-blend-mode: difference; color: #fff;
}
.brand { font-family: var(--serif); font-size: 20px; letter-spacing: 0.02em; }
.top-link { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.85; background: none; border: 0; color: inherit; padding: 0; cursor: pointer; }
.top-link:hover { opacity: 1; }

/* Film section: tall scroll track with a sticky stage */
#film { position: relative; height: calc(var(--film-vh) * 1vh); }
.stage { position: sticky; top: 0; height: 100dvh; overflow: hidden; width: 100%; }
#film-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* Title over the clouds. Max 4 text elements: headline + one line. */
.title {
  position: absolute; left: clamp(16px, 5vw, 80px); bottom: clamp(48px, 12vh, 140px);
  max-width: 40ch; z-index: 3; pointer-events: none;
  text-shadow: 0 1px 24px rgba(40, 20, 30, 0.35);
}
.title h1 {
  font-family: var(--serif); font-weight: 400; margin: 0 0 10px;
  font-size: clamp(40px, 6.5vw, 96px); line-height: 0.98; letter-spacing: -0.005em;
}
.title p { margin: 0; font-size: clamp(14px, 1.2vw, 18px); color: rgba(255,255,255,0.86); max-width: 34ch; }

.concept {
  position: absolute; left: clamp(16px, 3vw, 40px); bottom: 18px; z-index: 3; margin: 0;
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.55);
  pointer-events: none;
}

/* Hover layer: positioned by JS to the exact drawn-frame rectangle (cover fit), so % coordinates match the 2000x1116 frame */
.hover-layer {
  position: absolute; z-index: 4; pointer-events: none;
  opacity: 0; transition: opacity 400ms var(--ease);
}
.hover-layer.active { opacity: 1; }
.hover-layer.active .flat { pointer-events: auto; }
.flat {
  position: absolute; border-radius: 2px;
  background: var(--wash);
  border: 1.5px solid var(--hair);
  opacity: 0; transform: scale(0.96);
  transition: opacity 180ms var(--ease), transform 220ms var(--ease);
  cursor: pointer;
}
.flat::after { /* soft inner highlight, like light on glass */
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), inset 0 0 18px rgba(255,255,255,0.25);
}
.flat.on, .flat:focus-visible { opacity: 1; transform: scale(1); outline: none; }

/* The hairline from the flat out to the sky, with a dot at the flat end */
.guide {
  position: absolute; height: 1.5px; background: var(--hair);
  transform-origin: var(--origin, left center); transform: scaleX(0);
  opacity: 0; transition: transform 320ms var(--ease), opacity 120ms linear;
}
.guide::after {
  content: ""; position: absolute; top: 50%; width: 7px; height: 7px; border-radius: 50%;
  background: #fff; transform: translate(-50%, -50%);
}
.guide.from-left::after { left: 100%; }
.guide.from-right::after { left: 0; }
.guide.on { transform: scaleX(1); opacity: 1; }

/* Price tag in the sky */
.tag {
  position: absolute; z-index: 5; pointer-events: none;
  opacity: 0; transform: translateY(6px);
  transition: opacity 220ms var(--ease) 60ms, transform 320ms var(--ease) 60ms;
  text-shadow: 0 1px 20px rgba(30, 20, 30, 0.35);
}
.tag.on { opacity: 1; transform: translateY(0); }
.tag.on .pill { pointer-events: auto; }
.tag.right { text-align: left; }
.tag.left { text-align: right; }
.tag-price {
  font-family: var(--serif); font-weight: 400; line-height: 0.9;
  font-size: clamp(36px, 5.6vw, 96px); letter-spacing: -0.01em; color: #fff;
  font-variant-numeric: lining-nums; white-space: nowrap;
}
.tag-meta { overflow-wrap: normal; }
.tag-meta { margin-top: 8px; font-size: clamp(12px, 1vw, 15px); color: rgba(255,255,255,0.9); }
.pill {
  margin-top: 16px; display: inline-block;
  padding: 11px 22px; border-radius: 999px; border: 0;
  background: #fff; color: #10131c; font-size: 14px; font-weight: 500; letter-spacing: 0.01em;
  cursor: pointer; white-space: nowrap;
  transition: transform 160ms var(--ease), box-shadow 200ms var(--ease);
  box-shadow: 0 6px 24px rgba(10, 10, 20, 0.25);
}
.pill:hover { transform: translateY(-1px); box-shadow: 0 10px 30px rgba(10, 10, 20, 0.3); }
.pill:active { transform: translateY(0) scale(0.98); }

/* Phones: no sky beside the tower, so the price becomes a bottom sheet (fixed to the viewport, not the frame) */
.tag.sheet {
  position: fixed; left: 16px; right: 16px; top: auto; bottom: 24px; width: auto; max-width: none;
  text-align: left; padding: 18px 20px 20px;
  background: rgba(12, 16, 28, 0.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.14); border-radius: 16px; text-shadow: none;
}
.tag.sheet .tag-price { font-size: 44px; }
.tag.sheet .tag-meta { margin-top: 6px; color: var(--ink-dim); }
.tag.sheet .pill { margin-top: 14px; }
@media (prefers-reduced-transparency: reduce) { .tag.sheet { background: rgba(12,16,28,0.96); backdrop-filter: none; } }

@media (max-width: 767px) {
  :root { --film-vh: 700; }
  .title { bottom: 22vh; }
  .top { height: 56px; }
  .tag-price { font-size: clamp(34px, 11vw, 56px); }
  .pill { padding: 10px 18px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .flat, .guide, .tag, .pill { transition: none; }
  .guide { transform: none; }
}

/* ---------- Phase 3: floor plan panel ---------- */
/* Fixed over the film. GSAP slides it in from the side of the chosen flat while the film slides out the other way. */
.plan {
  position: fixed; inset: 0; z-index: 20;
  background: #080b14; color: var(--ink);
  transform: translateX(100vw); visibility: hidden;
  overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.plan.open { visibility: visible; }
.plan-inner { min-height: 100dvh; display: flex; flex-direction: column; padding: 0 clamp(16px, 4vw, 56px) 48px; }
/* The price stays on top: the header is sticky inside the panel and shrinks once the page scrolls */
.plan-top {
  position: sticky; top: 0; z-index: 6;
  display: flex; justify-content: space-between; align-items: flex-end; gap: 24px;
  padding: 92px 0 18px; margin: 0 0 clamp(8px, 2vh, 20px);
  background: linear-gradient(#080b14 calc(100% - 18px), rgba(8, 11, 20, 0));
  transition: padding 360ms var(--ease);
}
.plan-price {
  font-family: var(--serif); font-weight: 400; line-height: 0.9; letter-spacing: -0.01em;
  font-size: clamp(44px, 6vw, 92px); white-space: nowrap; font-variant-numeric: lining-nums;
  transition: font-size 360ms var(--ease);
}
.plan-meta { margin-top: 10px; font-size: clamp(13px, 1vw, 15px); color: var(--ink-dim); transition: opacity 200ms var(--ease), margin 360ms var(--ease); }
.plan-top.compact { padding: 72px 0 12px; align-items: center; }
.plan-top.compact .plan-price { font-size: 34px; }
.plan-top.compact .plan-meta { margin-top: 4px; font-size: 12px; }
.plan-top.compact .back { margin-bottom: 0; }
.back {
  flex: none; background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.28); border-radius: 999px;
  padding: 11px 20px; font-size: 14px; cursor: pointer; margin-bottom: 6px;
  transition: border-color 160ms var(--ease), transform 160ms var(--ease);
}
.back:hover { border-color: rgba(255,255,255,0.7); }
.back:active { transform: scale(0.98); }

.plan-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: clamp(24px, 4vw, 56px); align-items: start; }
.plan-stage { min-width: 0; }
.plan-figure { position: relative; }
.plan-figure svg { display: block; width: 100%; height: auto; overflow: visible; }
.plan-hint { margin: 14px 0 0; font-size: 13px; color: rgba(242,239,233,0.5); }

/* Rooms: a dark wash falls over the plan while a room is hot; that room is re-drawn bright, lifted and outlined */
.dim { fill: #04060d; opacity: 0; transition: opacity 280ms var(--ease); pointer-events: none; }
.plan-figure.hot .dim { opacity: 0.62; }
.room { transform-box: view-box; transition: transform 340ms var(--ease), filter 340ms var(--ease); cursor: pointer; outline: none; }
.room.on { transform: scale(1.035); filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.65)); }
.room-img { opacity: 0; transition: opacity 220ms var(--ease); pointer-events: none; }
.room.on .room-img { opacity: 1; }
.room-line { fill: none; stroke: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; opacity: 0; transition: opacity 220ms var(--ease); pointer-events: none; }
.room.on .room-line, .room:focus-visible .room-line { opacity: 1; }
.room-hit { fill: #fff; fill-opacity: 0; stroke: none; }

/* Measurement card at the room's centre */
.room-tip {
  position: absolute; z-index: 3; pointer-events: none;
  transform: translate(-50%, -50%) translateY(8px); opacity: 0;
  transition: opacity 200ms var(--ease) 60ms, transform 320ms var(--ease) 60ms;
  background: rgba(255,255,255,0.96); color: #10131c; border-radius: 10px; padding: 12px 16px 13px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45); text-align: center; white-space: nowrap;
}
.room-tip.on { opacity: 1; transform: translate(-50%, -50%) translateY(0); }
.tip-name { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: #5a5f6e; }
.tip-dims { font-family: var(--serif); font-size: 30px; line-height: 1; margin-top: 4px; font-variant-numeric: lining-nums; }
.tip-area { font-size: 13px; margin-top: 4px; color: #2c3040; }

/* Rail: levels and rooms */
.plan-rail { position: sticky; top: 92px; }
.rail-label { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(242,239,233,0.5); margin: 0 0 10px; }
.rail { list-style: none; margin: 0 0 28px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.rail button {
  width: 100%; padding: 9px 0; border-radius: 8px; border: 1px solid rgba(255,255,255,0.14); background: transparent; color: var(--ink);
  font-size: 14px; cursor: pointer; font-variant-numeric: tabular-nums; transition: background 160ms var(--ease), border-color 160ms var(--ease);
}
.rail button:hover { border-color: rgba(255,255,255,0.5); }
.rail button.cur { background: #fff; color: #10131c; border-color: #fff; }
.rooms-list { list-style: none; margin: 0; padding: 0; }
.rooms-list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid rgba(255,255,255,0.1); font-size: 14px; cursor: pointer; transition: color 160ms var(--ease); }
.rooms-list li span:last-child { color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.rooms-list li.on { color: #fff; }
.rooms-list li.on span:last-child { color: #fff; }
.rooms-list li.total { border-top: 1px solid rgba(255,255,255,0.28); cursor: default; }

/* The price that flies from the sky to the top of the plan during the slide */
.fly-price {
  position: fixed; z-index: 45; pointer-events: none; margin: 0;
  font-family: var(--serif); font-weight: 400; line-height: 0.9; letter-spacing: -0.01em; color: #fff; white-space: nowrap;
  font-variant-numeric: lining-nums; text-shadow: 0 1px 20px rgba(30, 20, 30, 0.35);
}

@media (max-width: 900px) {
  .plan-body { grid-template-columns: 1fr; }
  .plan-rail { position: static; }
  .rail { grid-template-columns: repeat(9, 1fr); gap: 4px; }
  .rail button { padding: 8px 0; font-size: 13px; }
}
@media (max-width: 767px) {
  .plan-inner { padding: 76px 16px 40px; }
  .plan-top { align-items: flex-start; flex-direction: column; gap: 14px; }
  .plan-price { font-size: 48px; }
  .back { margin: 0; padding: 9px 16px; font-size: 13px; }
  /* phones: the plan is small, so the card sits under it instead of over the room */
  .room-tip { left: 50% !important; top: 100% !important; transform: translate(-50%, 12px) translateY(6px); padding: 10px 14px 11px; }
  .room-tip.on { transform: translate(-50%, 12px); }
  .tip-dims { font-size: 24px; }
  .plan-hint { margin-top: 112px; }
  .plan-hint { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .room, .room-img, .room-line, .dim, .room-tip { transition: none; }
  .room.on { transform: none; }
}


/* ---------- Phase 4: apartment details, scrolled inside the plan ---------- */
.details { margin-top: clamp(56px, 10vh, 120px); }
.d-sec { padding: clamp(40px, 7vh, 80px) 0; border-top: 1px solid rgba(255,255,255,0.1); }
.d-sec.two { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 5vw, 80px); align-items: start; }
.d-head h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(32px, 3.6vw, 52px); line-height: 1; margin: 0 0 12px; letter-spacing: -0.005em; }
.d-head p { margin: 0; color: var(--ink-dim); max-width: 42ch; font-size: 15px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Photos: one wide, then pairs */
.photos { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 28px; }
.photo { margin: 0; position: relative; overflow: hidden; border-radius: 6px; background: var(--navy-2); }
.photo.wide { grid-column: 1 / -1; }
.photo img { display: block; width: 100%; height: 100%; aspect-ratio: 16 / 9; object-fit: cover; transform: scale(1.02); transition: transform 900ms var(--ease); }
.photo.wide img { aspect-ratio: 21 / 9; }
.photo:hover img { transform: scale(1.05); }
.photo figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 36px 18px 14px;
  display: flex; justify-content: space-between; font-size: 13px; color: #fff;
  background: linear-gradient(rgba(8,11,20,0), rgba(8,11,20,0.6));
}
.photo figcaption span:last-child { font-family: var(--serif); font-size: 17px; opacity: 0.9; }

/* Materials: swatches are CSS, no images */
.materials { list-style: none; margin: 0; padding: 0; }
.materials li { display: flex; gap: 18px; align-items: center; padding: 16px 0; border-top: 1px solid rgba(255,255,255,0.1); }
.materials li:first-child { border-top: 0; padding-top: 0; }
.materials b { display: block; font-weight: 500; font-size: 16px; }
.materials small { display: block; color: var(--ink-dim); font-size: 13px; margin-top: 2px; }
.swatch { flex: none; width: 56px; height: 56px; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12); }
.s-lime { background: linear-gradient(135deg, #e8d9b5, #cdbb8d 60%, #e3d3ad); }
.s-gall { background: linear-gradient(90deg, #2f5a3f 50%, #7a2f33 50%); }
.s-oak { background: repeating-linear-gradient(90deg, #c9a97e 0 9px, #b8976b 9px 14px, #d1b48b 14px 20px); }
.s-glass { background: linear-gradient(160deg, #9ec3d6, #4f7f99 55%, #dbe9f1); }
.s-cool { background: linear-gradient(180deg, #e9e4da 0 70%, #8fb3c4 70%); }

.benefits { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.benefits li { padding: 10px 16px; border: 1px solid rgba(255,255,255,0.18); border-radius: 999px; font-size: 14px; }

/* Map: Leaflet with dark Carto tiles, pins are small white dots */
.map-wrap { border-radius: 6px; overflow: hidden; background: var(--navy-2); }
.map { width: 100%; aspect-ratio: 4 / 3; min-height: 320px; background: #121826; }
.leaflet-container { font-family: var(--sans); background: #121826; }
.leaflet-tile-pane { filter: invert(1) hue-rotate(195deg) brightness(0.72) contrast(0.95) saturate(0.35); }
.leaflet-control-attribution { background: rgba(8,11,20,0.7) !important; color: rgba(242,239,233,0.55) !important; font-size: 10px !important; }
.leaflet-control-attribution a { color: rgba(242,239,233,0.8) !important; }
.leaflet-bar a { background: #141a2b !important; color: #fff !important; border-color: rgba(255,255,255,0.15) !important; }
.pin-site { width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 6px rgba(255,255,255,0.22), 0 0 0 14px rgba(255,255,255,0.08); }
.pin { width: 10px; height: 10px; border-radius: 50%; background: #fff; opacity: 0.9; box-shadow: 0 0 0 4px rgba(255,255,255,0.18); }
.leaflet-popup-content-wrapper { background: #fff; color: #10131c; border-radius: 8px; box-shadow: 0 12px 30px rgba(0,0,0,0.5); }
.leaflet-popup-content { margin: 10px 14px; font-size: 13px; line-height: 1.4; }
.leaflet-popup-content b { font-family: var(--serif); font-weight: 400; font-size: 18px; display: block; }
.leaflet-popup-tip { background: #fff; }
.places { list-style: none; margin: 22px 0 0; padding: 0; }
.places li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid rgba(255,255,255,0.1); font-size: 14px; cursor: pointer; }
.places li:hover, .places li.on { color: #fff; }
.places li span:last-child { color: var(--ink-dim); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Booking form */
.book-form { margin-top: 28px; max-width: 720px; }
.seg { display: inline-flex; border: 1px solid rgba(255,255,255,0.22); border-radius: 999px; padding: 3px; margin-bottom: 22px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: block; padding: 9px 18px; border-radius: 999px; font-size: 14px; cursor: pointer; color: var(--ink-dim); transition: background 160ms var(--ease), color 160ms var(--ease); }
.seg input:checked + span { background: #fff; color: #10131c; }
.seg input:focus-visible + span { outline: 2px solid #fff; outline-offset: 2px; }
.fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 22px; }
.fields label { display: block; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-dim); }
.fields input, .fields select {
  display: block; width: 100%; margin-top: 8px; padding: 12px 14px; border-radius: 8px; color: #fff;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.18); font: inherit; font-size: 15px; letter-spacing: 0; text-transform: none;
}
.fields select option { color: #10131c; }
.fields input:focus, .fields select:focus { outline: none; border-color: rgba(255,255,255,0.7); }
.fields label.bad input { border-color: #e2a3a3; }
.pill.big { padding: 14px 28px; font-size: 15px; margin: 0; }
.form-note { margin: 16px 0 0; font-size: 13px; color: rgba(242,239,233,0.5); max-width: 60ch; }
.form-note.ok { color: #fff; }

.d-end { padding: clamp(40px, 8vh, 80px) 0 20px; border-top: 1px solid rgba(255,255,255,0.1); display: flex; justify-content: center; }
.big-back { padding: 14px 26px; font-size: 15px; margin: 0; }

@media (max-width: 900px) {
  .d-sec.two { grid-template-columns: 1fr; }
  .fields { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .plan-top { padding: 76px 0 14px; }
  .plan-top.compact { padding: 62px 0 10px; align-items: flex-start; }
  .plan-top.compact .plan-price { font-size: 28px; }
  .plan-top.compact .plan-meta { display: none; }
  .plan-top.compact .back { position: absolute; right: 0; bottom: 10px; }
  .photos { grid-template-columns: 1fr; }
  .photo.wide img { aspect-ratio: 16 / 9; }
  .seg { display: flex; }
  .seg label { flex: 1; } .seg span { text-align: center; }
  .map { min-height: 280px; }
}


/* ---------- Phase 5: circle back, cues, phones ---------- */
/* scroll cue over the clouds: a word and a hairline with a travelling dot; fades with the title */
.cue {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 3; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(255,255,255,0.8);
}
.cue i { display: block; width: 1px; height: 44px; background: rgba(255,255,255,0.28); position: relative; overflow: hidden; }
.cue i::after { content: ""; position: absolute; left: 0; top: -12px; width: 1px; height: 12px; background: #fff; animation: cue-drop 1.6s var(--ease) infinite; }
@keyframes cue-drop { 0% { top: -12px; } 70%, 100% { top: 44px; } }

/* tap hint for touch screens on the final frame */
.tap-hint {
  position: absolute; left: 50%; top: 76px; transform: translateX(-50%) translateY(-6px); z-index: 3; margin: 0; pointer-events: none;
  padding: 8px 14px; border-radius: 999px; background: rgba(12,16,28,0.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.18); font-size: 12px; letter-spacing: 0.06em; color: #fff; white-space: nowrap;
  opacity: 0; transition: opacity 400ms var(--ease), transform 500ms var(--ease);
}
.tap-hint.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* end of the plan page: the way back, with a track that fills as you keep scrolling */
.d-end { flex-direction: column; align-items: center; gap: 14px; padding-bottom: clamp(60px, 14vh, 140px); }
.end-hint { margin: 6px 0 0; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(242,239,233,0.45); }
.end-track { width: 160px; height: 1px; background: rgba(255,255,255,0.14); overflow: hidden; }
.end-track span { display: block; height: 100%; width: 100%; background: #fff; transform: scaleX(0); transform-origin: left center; transition: transform 120ms linear; }
.end-concept { margin: 28px 0 0; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(242,239,233,0.35); text-align: center; }

@media (max-width: 767px) {
  .cue { bottom: 18px; }
  .cue i { height: 32px; }
  .tap-hint { top: 64px; }
}
@media (prefers-reduced-motion: reduce) { .cue i::after { animation: none; top: 16px; } }


/* ---------- Captions beside the tower while it is built (scroll-timed, opacity set by JS) ---------- */
.caps { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.cap {
  position: absolute; top: 34%; max-width: min(24vw, 420px); opacity: 0; transform: translateY(14px);
  text-shadow: 0 1px 24px rgba(40, 20, 30, 0.4); will-change: opacity, transform;
}
.cap.left { left: clamp(16px, 6vw, 110px); text-align: left; }
.cap.right { right: clamp(16px, 6vw, 110px); text-align: right; }
.cap b { display: block; font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 5.4vw, 96px); line-height: 0.95; letter-spacing: -0.01em; color: #fff; }
.cap span { display: block; margin-top: 10px; font-size: clamp(12px, 1.05vw, 17px); color: rgba(255,255,255,0.88); max-width: 24ch; }
.cap.right span { margin-left: auto; }
@media (max-width: 767px) {
  .cap { top: auto; bottom: 20vh; max-width: 70vw; }
  .cap.left, .cap.right { left: 16px; right: auto; text-align: left; }
  .cap.right span { margin-left: 0; }
  .cap b { font-size: 40px; }
}

/* The 18 windows breathe once when the film stops, so the visitor knows where to hover */
.hover-layer.breathe .flat { opacity: 0.6; transform: scale(1); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }


/* ---------- Walkthrough video (details, same for every flat) ---------- */
.walk-frame { position: relative; margin: 28px 0 0; border-radius: 6px; overflow: hidden; background: var(--navy-2); }
.walk-frame video { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #121826; }
.walk-frame figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 36px 18px 14px; pointer-events: none;
  display: flex; justify-content: space-between; font-size: 13px; color: #fff;
  background: linear-gradient(rgba(8,11,20,0), rgba(8,11,20,0.6));
}
.walk-frame figcaption span:last-child { font-variant-numeric: tabular-nums; opacity: 0.85; }
.walk-btn {
  position: absolute; right: 14px; top: 14px; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.35); background: rgba(8,11,20,0.55); color: #fff; cursor: pointer;
  display: grid; place-items: center; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: background 160ms var(--ease), transform 160ms var(--ease);
}
.walk-btn:hover { background: rgba(8,11,20,0.8); }
.walk-btn:active { transform: scale(0.94); }
.walk-ic { width: 12px; height: 14px; border-left: 4px solid #fff; border-right: 4px solid #fff; }
.walk-btn.paused .walk-ic { width: 0; height: 0; border: 0; border-left: 13px solid #fff; border-top: 8px solid transparent; border-bottom: 8px solid transparent; margin-left: 4px; }
@media (prefers-reduced-transparency: reduce) { .walk-btn { background: rgba(8,11,20,0.92); backdrop-filter: none; } }
