/* Interface principles: one plain typeface, sentence case, solid surfaces, no ornament.
   Everything that sits on the 3D view is an opaque label, so nothing needs a tint, blur or gradient behind it. */
:root {
  --paper: #f6f5f1; --ink: #121212; --text: #33322f; --grey: #6f6d68; --rule: #dcdad4; --white: #ffffff;
  --pad: clamp(14px, 2vw, 28px);
  --font: 'Inter Tight', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; margin: 0; }
html { background: var(--ink); scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }
body { color: var(--ink); font: 400 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
body[data-mode="explore"] { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; box-shadow: 0 0 0 4px var(--ink); }

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; }
body[data-mode="explore"] #scene { cursor: grab; touch-action: none; }
body.dragging #scene { cursor: grabbing; }
#scroll-space { height: 1400vh; }
.fade { position: fixed; inset: 0; background: #000; opacity: 0; visibility: hidden; pointer-events: none; }

/* ---------- shared pieces */
.btn { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 16px; font-size: 14px; font-weight: 500; border-radius: 2px; background: var(--ink); color: var(--white); transition: background .2s, color .2s; }
.btn:hover { background: #2c2c2c; }
.btn.solid { background: var(--white); color: var(--ink); } .btn.solid:hover { background: #e4e2dc; }
.btn.dark { background: var(--ink); color: var(--white); height: 46px; } .btn.dark:hover { background: #2c2c2c; }
.seg { display: inline-flex; padding: 3px; background: var(--ink); border-radius: 3px; }
.seg button { height: 34px; padding: 0 14px; font-size: 14px; font-weight: 500; color: #c9c7c1; border-radius: 2px; transition: background .2s, color .2s; }
.seg button:hover { color: var(--white); }
.seg button.on { background: var(--white); color: var(--ink); }

/* ---------- top bar */
.bar { position: fixed; inset: 0 0 auto 0; z-index: 20; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: var(--pad); pointer-events: none; }
.bar > * { pointer-events: auto; }
.brand { justify-self: start; display: inline-flex; align-items: center; height: 40px; padding: 0 14px; background: var(--ink); color: var(--white); font-size: 15px; font-weight: 600; letter-spacing: -.01em; text-decoration: none; border-radius: 2px; }
.bar .btn { justify-self: end; }

/* ---------- chapter card */
#chapters { position: fixed; z-index: 10; left: var(--pad); bottom: var(--pad); width: min(400px, calc(100vw - 2 * var(--pad))); pointer-events: none; }
.ch { position: absolute; left: 0; bottom: 0; width: 100%; padding: 22px 24px 24px; background: var(--paper); border-radius: 3px; opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity .3s, transform .5s var(--ease), visibility 0s .3s; }
.ch.on { opacity: 1; visibility: visible; transform: none; transition: opacity .45s .1s, transform .6s .1s var(--ease), visibility 0s; pointer-events: auto; }
.kicker { font-size: 13px; color: var(--grey); font-variant-numeric: tabular-nums; }
h2 { font-size: 28px; line-height: 1.1; font-weight: 600; letter-spacing: -.02em; margin: 6px 0 10px; text-wrap: balance; }
.ch.hero { width: min(460px, calc(100vw - 2 * var(--pad))); }
.ch.hero h2 { font-size: clamp(32px, 3vw, 42px); line-height: 1.04; letter-spacing: -.028em; margin: 8px 0 14px; }
.body { color: var(--text); font-size: 15px; line-height: 1.5; text-wrap: pretty; }
dl { margin-top: 16px; }
dl div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-top: 1px solid var(--rule); font-size: 14px; }
dl div:last-child { padding-bottom: 0; }
dt { color: var(--grey); } dd { font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.cta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.cta .btn.solid { background: var(--ink); color: var(--white); } .cta .btn.solid:hover { background: #2c2c2c; }
.cta .btn { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); } .cta .btn:hover { background: #e9e7e1; }

/* ---------- chapter rail */
.rail { position: fixed; z-index: 15; right: var(--pad); top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.rail button { display: flex; align-items: center; gap: 8px; height: 20px; }
.rail i { display: block; width: 10px; height: 10px; background: var(--ink); border: 2px solid var(--white); border-radius: 50%; transition: background .2s, transform .2s; }
.rail button.on i { background: var(--white); border-color: var(--ink); }
.rail button:hover i { transform: scale(1.25); }
.rail span { font-size: 13px; font-weight: 500; color: var(--white); background: var(--ink); padding: 3px 8px; border-radius: 2px; white-space: nowrap; opacity: 0; transform: translateX(4px); transition: opacity .2s, transform .3s var(--ease); pointer-events: none; }
.rail button:hover span, .rail button:focus-visible span { opacity: 1; transform: none; }
body[data-mode="explore"] .rail { display: none; }

/* ---------- time of day, scroll hint */
.tod { position: fixed; z-index: 15; right: var(--pad); bottom: var(--pad); }
.cue { position: fixed; z-index: 10; left: 50%; bottom: var(--pad); transform: translateX(-50%); height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 14px; background: var(--ink); color: var(--white); font-size: 14px; font-weight: 500; border-radius: 2px; opacity: 0; transition: opacity .4s; pointer-events: none; }
.cue::after { content: ''; width: 7px; height: 7px; border-right: 2px solid var(--white); border-bottom: 2px solid var(--white); transform: rotate(45deg) translate(-2px, -2px); animation: cue 1.6s var(--ease) infinite; }
@keyframes cue { 0%, 100% { translate: 0 -1px; } 50% { translate: 0 3px; } }
body.ready.at-top[data-mode="tour"] .cue { opacity: 1; }

/* ---------- explore */
.explore-ui { position: fixed; z-index: 12; left: var(--pad); bottom: var(--pad); display: flex; align-items: flex-end; gap: 10px; opacity: 0; visibility: hidden; transition: opacity .3s, visibility 0s .3s; pointer-events: none; }
body[data-mode="explore"] .explore-ui { opacity: 1; visibility: visible; transition: opacity .4s .4s, visibility 0s; }
.plan { width: clamp(220px, 18vw, 264px); background: var(--paper); border-radius: 3px; pointer-events: auto; }
.plan header { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; font-size: 14px; font-weight: 600; border-bottom: 1px solid var(--rule); }
.plan .toggle { font-size: 13px; font-weight: 500; color: var(--grey); text-decoration: underline; text-underline-offset: 3px; } .plan .toggle:hover { color: var(--ink); }
.plan footer { padding: 10px 14px 12px; font-size: 12.5px; line-height: 1.45; color: var(--grey); border-top: 1px solid var(--rule); }
.plan.min { width: auto; } .plan.min svg, .plan.min footer { display: none; } .plan.min header { border-bottom: 0; gap: 24px; }
.plan svg { display: block; width: 100%; padding: 10px; }
.p-roof { fill: none; stroke: #b9b6ae; stroke-width: 1; } .p-lift { fill: #e6e4de; stroke: #b9b6ae; stroke-width: 1; }
.p-pool { fill: #cfe4e8; stroke: #7fa9b1; stroke-width: 1; }
.p-house { fill: var(--white); stroke: var(--ink); stroke-width: 2.4; } .p-wall { stroke: var(--ink); stroke-width: 2.2; fill: none; } .p-thin { stroke: var(--white); stroke-width: 1.4; stroke-dasharray: 3 2; fill: none; }
.p-furn * { fill: none; stroke: #a9a69e; stroke-width: .8; }
.p-labels g { cursor: pointer; outline: none; } .p-labels rect { fill: transparent; transition: fill .15s; }
.p-labels text { font: 500 12px var(--font); fill: var(--ink); text-anchor: middle; paint-order: stroke; stroke: var(--white); stroke-width: 3px; }
.p-labels g:hover rect, .p-labels g:focus-visible rect { fill: rgb(18 18 18 / .08); }
#plan-cam path { fill: #121212; opacity: .22; } #plan-cam circle { fill: #e5372b; stroke: var(--white); stroke-width: 1.2; }
#info { width: min(320px, 30vw); padding: 16px 18px 18px; background: var(--paper); border-radius: 3px; opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .25s, transform .4s var(--ease), visibility 0s .25s; pointer-events: auto; }
#info.on { opacity: 1; visibility: visible; transform: none; transition: opacity .3s, transform .4s var(--ease), visibility 0s; }
#info h3 { font-size: 17px; font-weight: 600; letter-spacing: -.01em; margin-bottom: 4px; }
#info p { color: var(--text); font-size: 14px; line-height: 1.45; }

.hs { position: fixed; z-index: 13; left: 0; top: 0; display: flex; align-items: center; gap: 6px; margin: -13px 0 0 -13px; opacity: 0; visibility: hidden; transition: opacity .25s, visibility 0s .25s; will-change: transform; }
.hs.on { opacity: 1; visibility: visible; transition: opacity .3s, visibility 0s; }
.hs i { position: relative; width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--white); border: 2px solid var(--ink); transition: transform .2s, background .2s; }
.hs i::before, .hs i::after { content: ''; position: absolute; left: 50%; top: 50%; width: 10px; height: 2px; margin: -1px 0 0 -5px; background: var(--ink); transition: background .2s; }
.hs i::after { transform: rotate(90deg); }
.hs span { font-size: 13px; font-weight: 500; white-space: nowrap; color: var(--white); background: var(--ink); padding: 5px 9px; border-radius: 2px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.hs:hover i, .hs:focus-visible i { background: var(--ink); transform: scale(1.1); } .hs:hover i::before, .hs:hover i::after, .hs:focus-visible i::before, .hs:focus-visible i::after { background: var(--white); }
.hs:hover span, .hs:focus-visible span { opacity: 1; }
/* action markers are plain buttons that say what they do */
.hs.action { margin: -17px 0 0 -12px; gap: 0; }
.hs.action i { display: none; }
.hs.action span { opacity: 1; pointer-events: auto; height: 34px; display: flex; align-items: center; padding: 0 12px; background: var(--white); color: var(--ink); box-shadow: 0 0 0 2px var(--ink); transition: background .2s, color .2s; }
.hs.action:hover span, .hs.action:focus-visible span { background: var(--ink); color: var(--white); }

/* ---------- enquiry */
dialog { margin: auto; width: min(440px, calc(100vw - 24px)); padding: 28px; background: var(--paper); color: var(--ink); border: 0; border-radius: 4px; }
dialog::backdrop { background: rgb(0 0 0 / .6); }
dialog[open] { display: grid; animation: rise .3s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
dialog h2 { font-size: 26px; margin: 0 0 8px; padding-right: 56px; }
dialog .close { position: absolute; top: 26px; right: 28px; font-size: 14px; font-weight: 500; color: var(--grey); text-decoration: underline; text-underline-offset: 3px; } dialog .close:hover { color: var(--ink); }
dialog :focus-visible { outline: 2px solid var(--ink); box-shadow: none; }
dialog .ask, dialog .thanks { grid-area: 1 / 1; transition: opacity .3s, visibility 0s .3s; }
dialog .thanks { align-self: center; opacity: 0; visibility: hidden; }
dialog.sent .ask { opacity: 0; visibility: hidden; }
dialog.sent .thanks { opacity: 1; visibility: visible; transition: opacity .4s .2s, visibility 0s; }
.note { font-size: 13px; color: var(--grey); } dialog .note { margin-top: 12px; }
form { display: grid; gap: 14px; margin-top: 20px; }
label { display: grid; gap: 5px; }
label span { font-size: 14px; font-weight: 500; }
input { font: 400 16px var(--font); color: var(--ink); background: var(--white); border: 1px solid #b9b6ae; border-radius: 2px; height: 44px; padding: 0 12px; transition: border-color .15s; }
input::placeholder { color: #9a978f; }
input:focus { outline: none; border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
label em { display: none; font-style: normal; font-size: 13px; color: #b3261e; }
label.bad em { display: block; } label.bad input { border-color: #b3261e; }
form .btn { margin-top: 6px; }

/* ---------- loader */
.loader { position: fixed; inset: 0; z-index: 50; background: var(--ink); color: var(--white); display: grid; place-items: center; transition: opacity .8s .15s, visibility 0s .95s; }
.loader.done { opacity: 0; visibility: hidden; }
.loader .box { width: min(280px, 70vw); display: grid; gap: 12px; }
.loader strong { font-size: 20px; font-weight: 600; letter-spacing: -.015em; }
.loader .progress { height: 2px; background: #3a3a3a; }
.loader .progress i { display: block; height: 100%; background: var(--white); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease); }
.loader .meta { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: #b5b3ad; font-variant-numeric: tabular-nums; }
.loader.failed .progress, .loader.failed .meta > span:last-child { display: none; }
.bar, .tod, .rail { opacity: 0; transition: opacity .6s .4s; } body.ready .bar, body.ready .tod, body.ready .rail { opacity: 1; }

@media (max-width: 760px) {
  .bar { grid-template-columns: 1fr auto; row-gap: 8px; } .bar .btn { display: none; } .modes { justify-self: end; }
  .rail, .cue { display: none; }
  .tod { left: var(--pad); right: auto; top: calc(var(--pad) + 48px); bottom: auto; }
  h2 { font-size: 24px; } .ch.hero h2 { font-size: 28px; } .ch { padding: 16px 18px 18px; }
  .explore-ui { flex-direction: column-reverse; align-items: flex-start; } .plan footer { display: none; } #info { width: calc(100vw - 2 * var(--pad)); }
}
@media (prefers-reduced-motion: reduce) { .ch, #info, dialog[open] { transition: none; animation: none; } .cue::after { animation: none; } }
