:root {
  --ink: #2b2723;
  --muted: #6f665c;
  --paper: rgba(250, 247, 241, 0.92);
  --line: rgba(43, 39, 35, 0.12);
  --accent: #b08d57;
  --sage: #6e7f5c;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #e9e2d4; color: var(--ink);
  font: 15px/1.4 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-user-select: none; user-select: none; }
canvas#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.card { position: fixed; background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 6px 24px rgba(43, 39, 35, 0.12); backdrop-filter: blur(8px); }
.hidden { display: none !important; }

#title { top: calc(var(--site-top, 0px) + 16px); left: 16px; padding: 12px 16px; max-width: calc(100% - 32px); }
#title .eyebrow { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
#title h1 { margin: 2px 0 4px; font-size: 20px; font-weight: 600; }
#home-facts { font-size: 13px; color: var(--muted); }
#title .seg { margin-top: 8px; width: max-content; max-width: 100%; }
#title .seg button { padding: 6px 10px; font-size: 13px; }

/* guided tour: stop card with back / next */
#tour { left: 0; right: 0; margin: 0 auto; bottom: 86px; display: flex; align-items: center; gap: 6px; padding: 6px;
  width: min(460px, calc(100% - 32px)); }
#tour button { flex: none; width: 44px; height: 44px; border: 0; border-radius: 10px; background: rgba(43, 39, 35, 0.06);
  color: var(--ink); font: 400 26px/1 system-ui, sans-serif; cursor: pointer; }
#tour button:hover { background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.tour-text { flex: 1; min-width: 0; text-align: center; padding: 0 4px; }
#tour-step { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
#tour-name { font-size: 16px; font-weight: 600; }
#tour-note { font-size: 13px; color: var(--muted); }

/* centred with auto margins, not left:50% + translate (that caps the bar at half the screen and wraps it into rows) */
#bar { left: 0; right: 0; margin: 0 auto; width: max-content; bottom: 18px; display: flex; gap: 10px; padding: 8px; flex-wrap: wrap;
  justify-content: center; max-width: calc(100% - 32px); }
.seg { display: flex; background: rgba(43, 39, 35, 0.06); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; color: var(--ink); font: inherit; font-weight: 500; padding: 9px 14px;
  border-radius: 8px; cursor: pointer; min-width: 44px; }
.seg button.on { background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }

/* how-to: an ⓘ button, and the card it opens (by itself once per mode, then only on request) */
#info-btn { top: calc(var(--site-top, 0px) + 16px); right: 16px; width: 40px; height: 40px; padding: 0; border-radius: 50%; z-index: 3; cursor: pointer;
  font: italic 600 19px/1 Georgia, "Times New Roman", serif; color: var(--ink); }
#info-btn[aria-expanded="true"] { background: #fff; }
#hint { top: calc(var(--site-top, 0px) + 64px); right: 16px; width: 300px; max-width: calc(100% - 32px); padding: 12px 40px 12px 14px; z-index: 3;
  font-size: 13px; color: var(--ink); }
#hint-title { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
#hint ul { margin: 0; padding-left: 18px; }
#hint li { margin: 4px 0; }
#hint b { font-weight: 600; }
#hint-close { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border: 0; border-radius: 8px;
  background: transparent; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; }
#room-toast { top: 50%; left: 50%; transform: translate(-50%, -160%); padding: 8px 16px; font-weight: 600; letter-spacing: .04em;
  pointer-events: none; transition: opacity .4s; }
#room-toast small { font-weight: 400; color: var(--muted); margin-left: 8px; }

#labels { position: fixed; inset: 0; pointer-events: none; }
.lbl { position: absolute; transform: translate(-50%, -50%); background: rgba(250, 247, 241, .88); border: 1px solid var(--line);
  border-radius: 8px; padding: 3px 8px; font-size: 11px; font-weight: 600; letter-spacing: .03em; white-space: nowrap; text-align: center; }
.lbl small { display: block; font-weight: 400; color: var(--muted); font-size: 10px; }
.lbl.ground { border: 1.5px solid var(--c); }

/* split units: a card per home, in the colour of its outline in the model */
#unit-cards { position: fixed; inset: 0; pointer-events: none; z-index: 2; }
#unit-cards .ucard { position: absolute; pointer-events: auto; width: 236px; padding: 9px 12px 10px; }
.u-here { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.u-name { display: flex; align-items: center; gap: 7px; font-size: 16px; font-weight: 600; }
.u-name::before { content: ''; flex: none; width: 12px; height: 12px; border-radius: 3px; background: var(--c); }
.u-about { font-size: 13px; margin-top: 1px; }
.u-facts { font-size: 12px; color: var(--muted); }
.u-btns { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.u-btns button { border: 0; border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13px; font-weight: 600; text-align: left;
  cursor: pointer; background: rgba(43, 39, 35, 0.06); color: var(--ink); }
.u-btns .u-go { background: var(--c); color: #fff; }
.u-btns button:hover { box-shadow: 0 1px 4px rgba(0, 0, 0, .15); }

.stick { position: fixed; bottom: 96px; width: 120px; height: 120px; border-radius: 50%;
  background: rgba(250, 247, 241, .35); border: 1px solid rgba(255, 255, 255, .6); display: none; touch-action: none; }
#stick { left: 28px; }
#lookstick { right: 28px; }
.stick::after { content: attr(data-label); position: absolute; left: 0; right: 0; top: 100%; margin-top: 6px; text-align: center;
  font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .55); }
.knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%;
  background: var(--paper); box-shadow: 0 2px 8px rgba(0, 0, 0, .2); pointer-events: none; }
body.touch.walking .stick { display: block; }
#jumpbtn { display: none; right: 50px; bottom: 246px; width: 72px; height: 72px; padding: 0; border-radius: 50%; touch-action: none;
  font: 600 13px/1 "Inter", system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); cursor: pointer; }
#jumpbtn:active { background: #fff; transform: scale(.94); }
body.touch.walking #jumpbtn { display: block; }

/* under the pool's surface for a moment after a splash: a blue-green wash over the view, under the controls */
#underwater { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity .12s;
  background: radial-gradient(ellipse at 50% 30%, rgba(90, 185, 195, .35), rgba(18, 88, 105, .62)); backdrop-filter: blur(2px); }
body.underwater #underwater { opacity: 1; }

#loading { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #e9e2d4; z-index: 10; }
#loading .bar { width: 220px; height: 4px; background: rgba(43, 39, 35, .1); border-radius: 2px; overflow: hidden; }
#progress { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
#loading p { color: var(--muted); font-size: 13px; }

@media (max-width: 640px) {
  #title { padding: 10px 12px; } #title h1 { font-size: 17px; }
  #hint { top: calc(var(--site-top, 0px) + 158px); left: 16px; right: 16px; width: auto; max-width: none; }   /* under the title card + exterior switch */
  body.walking #info-btn { top: calc(var(--site-top, 0px) + 130px); }   /* under the stop card */
  body.walking #hint { top: calc(var(--site-top, 0px) + 178px); }
  .seg button { padding: 9px 11px; }
  /* walking on a phone: the stop card takes the title's place at the top; the sticks own the bottom corners */
  body.walking #title { display: none; }
  #tour { top: calc(var(--site-top, 0px) + 16px); bottom: auto; }
  #tour-note { font-size: 12px; }
  /* split units on a phone: the two cards side by side above the bar */
  #unit-cards.docked { inset: auto 0 auto 0; display: flex; align-items: flex-end; gap: 8px; justify-content: center; padding: 0 12px; }
  #unit-cards.docked .ucard { position: static; width: auto; flex: 1 1 0; max-width: 220px; padding: 8px 10px; }
  #unit-cards.docked .u-name { font-size: 15px; }
  #unit-cards.docked .u-about { font-size: 12px; }
  #unit-cards.docked .u-facts { font-size: 11px; }
  #unit-cards.docked .u-btns button { padding: 7px 9px; }
  .lbl.ground { font-size: 10px; padding: 2px 6px; }
}

/* the block (?block=<id>): name pins over the homes you can walk into, their card, and the loading pill */
.lbl.pin { pointer-events: auto; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink); padding: 5px 10px; }
.lbl.pin:hover { background: #fff; }
#block-card { right: 16px; top: calc(var(--site-top, 0px) + 68px); width: 256px; padding: 10px 12px 12px; z-index: 2; --c: #6f7f5f; }
#block-card .u-name { padding-right: 28px; }
#block-card .u-pool { margin: 8px 0 2px; width: max-content; }
#block-card .u-pool button { padding: 6px 10px; font-size: 13px; }
#block-card .u-btns button:not(.u-go) { background: rgba(43, 39, 35, 0.06); color: var(--ink); }
#block-card .u-link { font-size: 12px; color: var(--muted); text-decoration: none; padding: 4px 2px 0; }
#block-card .u-link:hover { color: var(--ink); }
.bc-close { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent;
  font-size: 20px; line-height: 1; color: var(--muted); cursor: pointer; }
#go-in { top: calc(var(--site-top, 0px) + 16px); left: 50%; transform: translateX(-50%); padding: 11px 18px; border: 0; background: #6f7f5f; color: #fff;
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; z-index: 3; }
#go-in:hover { background: #5f6f50; }
#go-in:disabled { background: #8a967c; cursor: default; }
#to-block { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 500; color: var(--muted); text-decoration: none; }
#to-block:hover { color: var(--ink); }
@media (max-width: 640px) {
  #block-card { left: 16px; right: 16px; width: auto; top: auto; bottom: 104px; }
  #go-in { top: auto; bottom: 168px; }
}

/* Homes list on the block page (11/01): every home and its units */
#homes-btn { display: block; margin-top: 8px; border: 0; border-radius: 8px; padding: 6px 12px; font: inherit; font-size: 13px; font-weight: 600;
  background: #6f7f5f; color: #fff; cursor: pointer; }
#homes-list { right: 16px; top: calc(var(--site-top, 0px) + 68px); width: 300px; max-height: calc(100% - 160px - var(--site-top, 0px)); overflow-y: auto; padding: 10px 12px 12px; z-index: 3; }
#homes-list .hl-group { margin: 10px 0 4px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
#homes-list .hl-home { margin-bottom: 6px; }
#homes-list .hl-name { display: block; width: 100%; text-align: left; border: 0; border-radius: 8px; padding: 7px 9px; font: inherit; font-size: 14px;
  font-weight: 600; background: rgba(43, 39, 35, 0.06); color: var(--ink); cursor: pointer; }
#homes-list .hl-name small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
#homes-list .hl-units { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 0 10px; }
#homes-list .hl-unit { border: 0; border-radius: 8px; padding: 5px 9px; font: inherit; font-size: 12px; font-weight: 600; background: #6f7f5f; color: #fff; cursor: pointer; }
@media (max-width: 640px) { #homes-list { left: 16px; right: 16px; width: auto; top: auto; bottom: 96px; max-height: 55vh; } }
@media (max-width: 640px) { .lbl.pin { font-size: 11px; padding: 3px 7px; } }

/* a building's homes: each one's name in its colour on the street side (Daniel 11/02), and its floors when pulled apart */
.lbl.unit-tag { background: var(--c); color: #fff; border: none; font-size: 12px; padding: 3px 9px; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.lbl.floor-tag { border-left: 4px solid var(--c, var(--ink)); font-size: 11px; }
@media (max-width: 640px) { .lbl.unit-tag { font-size: 11px; padding: 2px 7px; } .lbl.floor-tag { font-size: 10px; } }

/* the Overview button in the bar (block page) */
#overview-btn { font-weight: 600; }

/* a computer's block page: the title card is a menu down the left side, the Homes list always open in it (Daniel 11/02) */
body.sidebar { --side: 300px; }
body.sidebar #title { top: var(--site-top, 0px); left: 0; bottom: 0; width: var(--side); max-width: none; border-radius: 0;
  border-width: 0 1px 0 0; padding: 18px 16px 24px; overflow-y: auto; -webkit-user-select: text; user-select: text; }
body.sidebar #homes-btn { display: none; }
body.sidebar .side-nav { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 4px; }
body.sidebar .side-nav button { border: 0; border-radius: 8px; padding: 9px 12px; font: inherit; font-size: 14px; font-weight: 600; text-align: left;
  background: #6f7f5f; color: #fff; cursor: pointer; }
body.sidebar .side-nav button + button { background: rgba(43, 39, 35, 0.07); color: var(--ink); }
body.sidebar .side-nav button:hover { box-shadow: 0 1px 4px rgba(0, 0, 0, .15); }
body.sidebar #homes-list { margin-top: 6px; width: auto; max-height: none; padding: 0; overflow: visible; }
body.sidebar #homes-list .bc-close, body.sidebar #homes-list > .u-name { display: none; }
body.sidebar #bar, body.sidebar #tour { left: var(--side); }
body.sidebar #go-in, body.sidebar #room-toast { left: calc(50% + var(--side) / 2); }
