:root {
  --paper: #f2ede3;
  --paper-2: #e8e1d4;
  --ink: #1c2420;
  --muted: #5f645c;
  --line: #d6cdbd;
  --accent: #84612f;
  --on-accent: #fbf7f0;
  --faint: #9a9c92;
  --serif: "Zodiak", Georgia, "Times New Roman", serif;
  --sans: "Switzer", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --ease-io: cubic-bezier(.65, 0, .25, 1);
  --g: 20px;
  --bar: 56px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; overflow: hidden;
  background: var(--paper); color: var(--ink);
  font: 400 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
  display: grid; grid-template-rows: var(--bar) minmax(0, 1fr);
  height: 100svh;
}
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
[hidden] { display: none !important; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 500; }

.h-xl { font: 400 40px/1.02 var(--serif); letter-spacing: -0.02em; }
.h-l { font: 400 28px/1.1 var(--serif); letter-spacing: -0.015em; }
.meta { color: var(--muted); font-size: 14px; margin-top: 6px; }
.fine { color: var(--faint); font-size: 12.5px; line-height: 1.45; }
.fine a { color: var(--muted); }
.g-h { font: 500 13px/1 var(--sans); color: var(--muted); margin-bottom: 12px; }

.primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px; padding: 0 22px;
  background: var(--ink); color: var(--paper);
  font-weight: 500; font-size: 15.5px; border-radius: 2px;
  transition: background .2s, transform .15s var(--ease);
}
.primary:hover { background: #33302b; }
.primary:active { transform: scale(.985); }
.primary svg { width: 18px; height: 18px; }
.primary.wide { width: 100%; }

/* ---------- the app bar ---------- */
.bar {
  position: relative; z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 var(--g);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.bar-l { display: flex; align-items: center; gap: 6px; min-width: 0; }
.brand { font: 500 19px/1 var(--serif); text-decoration: none; letter-spacing: -0.01em; white-space: nowrap; }
.back { display: none; width: 40px; height: 40px; margin-left: -10px; place-items: center; color: var(--ink); }
.back svg { width: 22px; height: 22px; }
.trail { display: none; align-items: center; gap: 10px; font-size: 14px; }
.trail button { color: var(--muted); padding: 8px 0; white-space: nowrap; transition: color .2s; }
.trail button:hover { color: var(--ink); }
.trail button[aria-current="page"] { color: var(--ink); }
.trail .sep { color: var(--line); }
.bar-title { display: none; font: 500 16px/1 var(--sans); white-space: nowrap; }
.bar-r { justify-self: end; font-size: 14px; color: var(--muted); padding: 10px 0; }
.bar-r:hover { color: var(--ink); }

/* trail shows only the levels you have reached */
body[data-view="tower"] .trail > :nth-child(n+2) { display: none; }
body[data-view="flat"] .trail > :nth-child(n+4) { display: none; }

/* ---------- views ---------- */
.views { position: relative; overflow: hidden; }
.view { position: absolute; inset: 0; }
.view.leaving { pointer-events: none; }
.view.fade-in { animation: fadeIn .55s var(--ease) both; }
.view.fade-out { animation: fadeOut .45s var(--ease-io) both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }

.scene { position: absolute; inset: 0; overflow: hidden; background: #c9cfd3; container-type: size; }
.scene-paper { background: var(--paper); }
.cover, .fit { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.cover img, .fit img { width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }
.marks { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.mark {
  fill: transparent; stroke: transparent; stroke-width: 1.5; vector-effect: non-scaling-stroke;
  transition: fill .25s, stroke .25s; pointer-events: auto; cursor: pointer;
}
.mark.is-key { fill: rgba(142, 63, 34, .16); stroke: var(--accent); stroke-width: 2; }
.mark.is-key:hover, .mark.is-key.hot { fill: rgba(142, 63, 34, .26); }
.mark.room:hover, .mark.room.hot { fill: rgba(29, 27, 24, .06); stroke: rgba(29, 27, 24, .55); }
.draw { stroke-dasharray: 1000; animation: draw 1.4s .35s var(--ease) both; }
@keyframes draw { from { stroke-dashoffset: 1000; } to { stroke-dashoffset: 0; } }

/* callouts: a small paper label tied to the thing it names */
.callout {
  position: absolute; z-index: 2;
  display: grid; gap: 2px; text-align: left;
  padding: 10px 14px 11px; min-width: 150px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 2px;
  transform: translate(14px, -50%);
  box-shadow: 0 1px 0 rgba(29, 27, 24, .04);
  transition: transform .2s var(--ease), border-color .2s;
}
.callout::before { /* the leader */
  content: ""; position: absolute; right: 100%; top: 50%; width: 14px; height: 1px; background: var(--accent);
}
.callout.flip::before { right: auto; left: 100%; }
.callout.above::before { right: auto; left: var(--lx, 50%); top: 100%; width: 1px; height: 14px; }
.callout:hover { border-color: var(--accent); }
.callout-k { font-size: 12px; color: var(--muted); }
.callout-v { font: 400 19px/1.15 var(--serif); }
.callout-go { font-size: 13px; font-weight: 500; color: var(--accent); margin-top: 3px; }
.callout-go::after { content: " \2192"; }
.callout-sm { min-width: 0; padding: 8px 12px 9px; }
.callout-sm .callout-v { font-size: 17px; }
.room-tip {
  position: absolute; z-index: 2; pointer-events: none;
  padding: 5px 9px; font-size: 13px; background: var(--ink); color: var(--paper); border-radius: 2px;
  transform: translate(-50%, -50%); opacity: 0; transition: opacity .15s;
}
.room-tip.on { opacity: 1; }

.card { background: var(--paper); }
.unit {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin: 22px 0 20px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.unit-k { font-weight: 500; }
.unit-v { font-size: 14px; color: var(--muted); }
.unit-plan { width: 64px; height: 44px; color: var(--muted); flex: none; }
.tower-card .primary { width: 100%; }
.tower-card .fine { margin-top: 14px; }

/* rooms list */
.rooms { list-style: none; margin: 22px 0 18px; padding: 0; border-top: 1px solid var(--line); }
.rooms li { border-bottom: 1px solid var(--line); }
.rooms button {
  width: 100%; display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 12px;
  padding: 12px 0; text-align: left; transition: color .2s;
}
.rooms .r-n { font-size: 15px; }
.rooms .r-d { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rooms button:hover .r-n, .rooms button.hot .r-n { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
.rooms .is-key .r-n { font: 400 20px/1.2 var(--serif); }
.rooms .is-key .r-d { color: var(--accent); font-weight: 500; font-size: 13.5px; }
.rooms .is-key .r-d::after { content: " \2192"; }

/* ---------- kitchen ---------- */
.v-kitchen { display: grid; }
.stage { position: relative; overflow: hidden; background: var(--paper-2); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.photo {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .5s var(--ease);
}
.photo.on { opacity: 1; }
.photo.quick { transition-duration: .12s; }
.hold {
  position: absolute; left: 16px; top: 16px; font-size: 12.5px; padding: 5px 9px;
  background: rgba(29, 27, 24, .72); color: var(--paper); border-radius: 2px; opacity: 0; transition: opacity .12s;
}
.stage.holding .hold { opacity: 1; }

.panel { position: relative; display: flex; flex-direction: column; min-height: 0; background: var(--paper); }
.panel-head { padding: 28px 32px 0; }
.groups { position: relative; flex: 1; min-height: 0; }
.group { padding: 0 32px; }
.opts { position: relative; display: grid; gap: 10px; }
.opts-3 { grid-template-columns: repeat(3, 1fr); }
.opts-2 { grid-template-columns: repeat(2, 1fr); }
.opt { position: relative; display: grid; gap: 8px; text-align: left; font-size: 14px; color: var(--muted); padding: 5px; transition: color .2s; }
.opt img { width: 100%; background: var(--paper-2); border-radius: 1px; }
.opt span { padding-left: 1px; line-height: 1.2; }
.opt[aria-checked="true"] { color: var(--ink); }
.thumb img { aspect-ratio: 3 / 2; object-fit: cover; }
.thumb span { font: 400 16px/1.15 var(--serif); }
.board img { aspect-ratio: 5 / 4; object-fit: cover; }
.slab img { aspect-ratio: 3 / 1; object-fit: cover; }
.sel {
  position: absolute; left: 0; top: 0; pointer-events: none;
  border: 1.5px solid var(--ink); border-radius: 2px;
  transition: transform .42s var(--ease), width .42s var(--ease), height .42s var(--ease);
}
.note { font-size: 13.5px; color: var(--muted); margin-top: 8px; min-height: 2.9em; }

.panel-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 32px calc(18px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
.price { display: grid; text-align: left; gap: 1px; }
.price-v { font: 400 30px/1.05 var(--serif); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price-k { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.price-k u { text-underline-offset: 2px; text-decoration-color: var(--line); }
.tick-in { animation: tick .45s var(--ease); }
@keyframes tick { from { transform: translateY(35%); opacity: 0; } to { transform: none; opacity: 1; } }
#next { white-space: nowrap; }

/* rail: phone only */
.rail { position: relative; display: none; }

/* ---------- review ---------- */
.review {
  position: absolute; inset: 0; z-index: 5; background: var(--paper);
  transform: translateX(100%); transition: transform .5s var(--ease);
  display: flex; flex-direction: column;
}
.review.open { transform: none; }
.review-scroll { overflow-y: auto; overscroll-behavior: contain; flex: 1; padding: 0 32px 32px; }
.review-top { position: sticky; top: 0; z-index: 2; background: var(--paper); padding: 18px 0 12px; }
.link-back { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--muted); margin-left: -6px; padding: 6px; }
.link-back svg { width: 18px; height: 18px; }
.link-back:hover { color: var(--ink); }
.sheet { border: 1px solid var(--line); background: #f7f3ec; }
.sheet-photo { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: none; }
.sheet-body { padding: 20px 20px 18px; }
.materials { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.materials li { display: flex; align-items: center; gap: 12px; }
.materials img, .materials svg { width: 44px; height: 44px; object-fit: cover; flex: none; border-radius: 1px; color: var(--muted); }
.materials span { display: grid; line-height: 1.25; }
.materials b { font-weight: 500; font-size: 15px; }
.materials i { font-style: normal; font-size: 13px; color: var(--muted); }
.total { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.total-v { font: 400 34px/1.05 var(--serif); letter-spacing: -0.01em; }
.total-k { font-size: 13px; color: var(--muted); margin-top: 6px; }

.send { margin-top: 30px; }
.seg-field { border: 0; margin: 0 0 18px; padding: 0; }
.seg-field legend { font-size: 14.5px; margin-bottom: 8px; padding: 0; }
.seg {
  position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  border: 1px solid var(--line); border-radius: 2px; padding: 3px;
}
.seg button { position: relative; z-index: 1; height: 40px; font-size: 14px; color: var(--muted); transition: color .3s; }
.seg button[aria-checked="true"] { color: var(--paper); }
.seg-sel {
  position: absolute; top: 3px; bottom: 3px; left: 0; background: var(--ink); border-radius: 1px;
  transition: transform .42s var(--ease), width .42s var(--ease); opacity: 0;
}
.seg.has .seg-sel { opacity: 1; }
.seg.missing { border-color: var(--accent); }

.fields { display: grid; gap: 4px; margin-top: 6px; }
.field { position: relative; display: grid; grid-template-columns: 70px 1fr; align-items: center; border-bottom: 1px solid var(--line); }
.field::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1.5px; background: var(--ink);
  transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
}
.field:focus-within::after { transform: scaleX(1); }
.field.missing::after { transform: scaleX(1); background: var(--accent); }
.field span { font-size: 14px; color: var(--muted); }
.field input { font: 400 17px/1 var(--sans); color: var(--ink); border: 0; background: transparent; padding: 15px 0; outline: none; min-width: 0; }
.err { color: var(--accent); font-size: 13.5px; min-height: 1.5em; margin-top: 8px; }
.msg { margin: 8px 0 18px; }
.msg-k { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.bubble {
  position: relative; white-space: pre-line; font-size: 14px; line-height: 1.45;
  background: #e2f1d9; color: #1f2a1b; padding: 11px 13px; border-radius: 2px 10px 10px 10px; max-width: 92%;
}

/* ---------- dialogs ---------- */
.dlg {
  border: 0; padding: 28px; width: min(480px, calc(100vw - 32px)); max-height: calc(100svh - 48px);
  background: var(--paper); color: var(--ink); border-radius: 2px;
}
.dlg::backdrop { background: rgba(29, 27, 24, .45); }
.dlg[open] { animation: dlgIn .35s var(--ease); }
@keyframes dlgIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.dlg > * + * { margin-top: 14px; }
.sum { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; margin: 18px 0; font-size: 14.5px; }
.sum dt { color: var(--muted); }
.sum dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.sum .sum-t { border-top: 1px solid var(--line); padding-top: 10px; font-weight: 500; color: var(--ink); }
.studio-work { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.studio-work img { aspect-ratio: 4 / 5; object-fit: cover; }
.studio-contact { font-size: 14.5px; line-height: 1.6; }

/* =================================================================== phone */
@media (max-width: 899px) {
  .v-tower .scene { bottom: auto; height: calc(100% - var(--card-h, 300px) + 14px); }
  .tower-card, .flat-card {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
    padding: 22px var(--g) calc(18px + env(safe-area-inset-bottom));
    border-radius: 14px 14px 0 0; border-top: 1px solid var(--line);
  }
  .h-xl { font-size: 32px; }
  .unit { margin: 16px 0 14px; padding: 12px 0; }
  .tower-card .fine { display: none; }

  .v-flat .scene { bottom: auto; height: 50%; }
  .flat-card { top: calc(50% - 14px); overflow-y: auto; overscroll-behavior: contain; }
  .rooms { margin: 14px 0; }
  .rooms button { padding: 10px 0; }

  .v-kitchen { grid-template-rows: minmax(180px, 1fr) auto; }
  .panel-head { display: none; }
  .rail {
    display: grid; grid-template-columns: repeat(3, 1fr);
    border-bottom: 1px solid var(--line);
  }
  .rail button { display: grid; gap: 1px; padding: 12px var(--g) 11px; text-align: left; font-size: 13px; color: var(--muted); }
  .rail button[aria-selected="true"] { color: var(--ink); }
  .rail-v { font-size: 14.5px; color: var(--ink); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rail-line { position: absolute; left: 0; bottom: -1px; height: 2px; background: var(--ink); transition: transform .42s var(--ease), width .42s var(--ease); }
  .groups { display: grid; overflow: hidden; }
  .group { grid-area: 1 / 1; padding: 16px var(--g) 0; transition: transform .45s var(--ease), opacity .3s; }
  .group .g-h { display: none; }
  .group:not(.is-on) { opacity: 0; pointer-events: none; transform: translateX(var(--from, 24px)); visibility: hidden; transition: transform .45s var(--ease), opacity .3s, visibility 0s .45s; }
  .note { min-height: 2.9em; margin-bottom: 4px; }
  .panel-foot { padding: 12px var(--g) calc(14px + env(safe-area-inset-bottom)); }
  .price-v { font-size: 25px; }
  .primary { height: 50px; padding: 0 18px; }

  .back { display: grid; }
  body[data-view="tower"] .back { display: none; }
  body:not([data-view="tower"]) .brand { display: none; }
  body:not([data-view="tower"]) .bar-title { display: block; }
  .bar { grid-template-columns: auto 1fr auto; gap: 4px; }

  .review { position: fixed; inset: 0; z-index: 30; transform: translateY(100%); }
  .review.open { transform: none; }
  .review-scroll { padding: 0 var(--g) 28px; }
  .sheet-photo { display: block; }
  .h-l { font-size: 26px; }
}

/* ================================================================= desktop */
@media (min-width: 900px) {
  :root { --bar: 64px; --g: 32px; }
  .trail { display: flex; }
  .tower-card {
    position: absolute; left: 32px; bottom: 32px; width: 384px; padding: 30px 30px 24px;
    border: 1px solid var(--line); border-radius: 2px;
  }
  .v-flat { display: grid; grid-template-columns: 400px minmax(0, 1fr); }
  .v-flat .scene { position: relative; grid-column: 2; grid-row: 1; }
  .flat-card { grid-column: 1; grid-row: 1; padding: 36px 32px 28px; border-right: 1px solid var(--line); overflow-y: auto; }
  .v-kitchen { grid-template-columns: minmax(0, 1fr) 440px; }
  .panel { border-left: 1px solid var(--line); }
  .groups { overflow-y: auto; padding: 22px 0 8px; display: grid; gap: 22px; align-content: start; }
  .rail { display: none; }
}
@media (min-width: 900px) and (max-height: 820px) {
  .note { min-height: 0; }
  .groups { gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0s !important; transition-duration: 0s !important; }
}

/* ---------- your flat lights up; the rest steps back ---------- */
.layer { position: absolute; inset: 0; width: 100%; height: 100%; }
.cover .base, .fit .base { transition: filter 1.6s var(--ease), opacity 1.6s var(--ease); }
.lit { opacity: 0; transition: opacity 1.6s var(--ease); pointer-events: none; }
#tower-lit, #tower-lit-eve { -webkit-mask: url(../flats/tower-mask.png) 0 0 / 100% 100% no-repeat; mask: url(../flats/tower-mask.png) 0 0 / 100% 100% no-repeat; }
/* evening: the dusk render fades in over the day one; the flat's own light swaps with it */
.eve { opacity: 0; transition: opacity 1.1s var(--ease), filter 1.6s var(--ease); }
.scene.evening .eve { opacity: 1; }
.scene.focus.evening #tower-lit { opacity: 0; }
.scene:not(.evening) #tower-lit-eve { opacity: 0; }
/* at dusk most homes glow, so the rest of the building steps further back for yours to read */
.scene.focus.evening .cover .base { filter: brightness(.5) saturate(.75); }
.light-field { margin: 18px 0 16px; }
.light-field legend { font-size: 13px; color: var(--muted); }
#kitchen-lit { -webkit-mask: url(../flats/bc-3a-kitchen-mask.png) 0 0 / 100% 100% no-repeat; mask: url(../flats/bc-3a-kitchen-mask.png) 0 0 / 100% 100% no-repeat; }
.scene.focus .cover .base { filter: brightness(.74) saturate(.82); }
.scene.focus .fit .base { filter: grayscale(.7) contrast(.94); opacity: .72; }
.scene.focus .lit { opacity: 1; }
.scene.focus.hot .cover .base { filter: brightness(.66) saturate(.78); }
.mark.is-key { fill: transparent; stroke: transparent; }
.mark.is-key:hover, .mark.is-key.hot { fill: transparent; }

/* ---------- the films ---------- */
.film { object-fit: cover; opacity: 0; pointer-events: none; transition: opacity .18s linear; background: transparent; }
.film.on { opacity: 1; }
.filming .callout, .filming .room-tip { opacity: 0; transition: opacity .25s; }
.v-tower.filming .card { opacity: 0; transform: translateY(8px); transition: opacity .3s, transform .3s var(--ease); }
/* the flat film sits on paper: feather its edges so no rectangle shows */
.fit .film {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent), linear-gradient(180deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent), linear-gradient(180deg, transparent, #000 8%, #000 92%, transparent);
  mask-composite: intersect;
}

/* ---------- layout tiles ---------- */
.plan { align-content: start; }
.plan svg { width: 100%; aspect-ratio: 3 / 2; background: var(--paper-2); padding: 10px 14px; fill: none; stroke: var(--muted); stroke-width: 1.4; stroke-linejoin: round; transition: stroke .2s, fill .2s; }
.plan[aria-checked="true"] svg { stroke: var(--ink); fill: rgba(29, 27, 24, .06); }
.plan span { font: 400 16px/1.15 var(--serif); }
.plan i { display: block; font: 400 12px/1.3 var(--sans); font-style: normal; color: var(--muted); margin-top: 2px; }
.mat-plan { width: 44px; height: 44px; flex: none; display: grid; place-items: center; background: var(--paper-2); }
.mat-plan svg { width: 36px; height: 26px; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; }
@media (max-width: 899px) {
  .rail { grid-template-columns: repeat(4, 1fr); }
  .rail button { padding: 12px 12px 11px; }
  .rail button:first-child { padding-left: var(--g); }
}

/* rooms you can stand in */
.rooms .is-walk .r-d { display: flex; align-items: baseline; gap: 12px; }
.rooms .is-walk .r-d em { font-style: normal; color: var(--accent); font-weight: 500; font-size: 13.5px; }
.rooms .is-walk .r-d em::after { content: " \2192"; }

/* the doorway mark: an arched opening that is also the n of Nela */
.brand { display: inline-flex; align-items: center; gap: 10px; }
.logo-mark { width: 24px; height: 24px; flex: none; color: var(--ink); }
