/* Heritage 100 Penthouse: a floor plan you can step into.
   Paper while it is a drawing; blueprint night and neon once it comes alive. Ink and night are
   Real Portfolio Partners' navy. */
:root {
  --paper: #f7f5f1;
  --ink: #0f2645;
  --ink-soft: #46546b;
  --night: #0b1a31;
  --night-raised: rgba(11, 26, 49, 0.62);
  --neon: #ccf2ff;
  --plan-line: #99c4fa;
  --fg: var(--ink);
  --fg-soft: var(--ink-soft);
  --bg: var(--paper);
  --rule: rgba(15, 38, 69, 0.26);
  --dock: rgba(247, 245, 241, 0.78);
  --primary-bg: var(--ink);
  --primary-fg: var(--paper);
  --gutter: 16px;
  font-family: "Hanken Grotesk", "Avenir Next", "Segoe UI", sans-serif;
  color-scheme: light dark;
}

/* the chrome turns to night as the dark wave reaches it, not when the button is pressed */
body[data-theme="night"] {
  --fg: #e8eef8;
  --fg-soft: #a9b6cc;
  --bg: var(--night);
  --rule: rgba(204, 242, 255, 0.3);
  --dock: var(--night-raised);
  --primary-bg: var(--neon);
  --primary-fg: var(--night);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  transition: background-color 600ms ease, color 600ms ease;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ---------- stage: the 3D plan, the AI walk on top of it, the room label on top of that ---------- */
.sheet { position: fixed; inset: 0; }
.stage { position: absolute; inset: 0; overflow: hidden; background: var(--bg); transition: background-color 600ms ease; }
.stage > canvas, .stage > video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#scene { touch-action: none; transition: opacity 220ms ease; }
#scene.dim { opacity: 0; }
#walk { object-fit: cover; opacity: 0; pointer-events: none; background: transparent; }
#label { pointer-events: none; }

.loading {
  position: absolute; inset: 0; margin: 0;
  display: grid; place-items: center;
  font-size: 16px; font-weight: 500; color: var(--fg-soft);
}
body:not([data-state="loading"]) .loading { display: none; }

.pin {
  position: absolute; left: 0; top: 0;
  transform: translate(-50%, -50%);
  min-height: 44px; padding: 10px 18px;
  border: 1.5px solid var(--neon); border-radius: 999px;
  background: rgba(11, 26, 49, 0.55);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: var(--neon);
  font: 700 15px/1 inherit; font-family: inherit; letter-spacing: 0.01em; white-space: nowrap;
  cursor: pointer;
  transition: transform 100ms ease-out, background-color 100ms ease-out;
}
.pin:active { transform: translate(-50%, -50%) scale(0.96); background: rgba(204, 242, 255, 0.18); }

.pins, .spots { position: absolute; inset: 0; pointer-events: none; }
.pins > * { pointer-events: auto; }
.pins .pin { min-height: 40px; padding: 8px 14px; font-size: 14px; }

/* over a ring that leads into another room: that room's name */
.spot {
  position: absolute; left: 0; top: 0;
  transform: translate(-50%, -130%);
  padding: 6px 11px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.5); color: #fff;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-size: 13px; font-weight: 700; letter-spacing: 0.01em; white-space: nowrap;
  pointer-events: auto; cursor: pointer;
}
/* where you're standing */
.roomchip {
  position: absolute; left: 50%; transform: translateX(-50%);
  top: calc(env(safe-area-inset-top) + var(--gutter) + 72px);
  margin: 0; padding: 7px 14px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.45); color: #fff;
  font-size: 14px; font-weight: 700; letter-spacing: 0.01em; white-space: nowrap;
  pointer-events: none;
}

.tag {
  position: absolute; top: calc(env(safe-area-inset-top) + var(--gutter)); right: var(--gutter);
  margin: 0; padding: 7px 12px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.45); color: #fff;
  font-size: 13px; font-weight: 500; letter-spacing: 0.01em;
  opacity: 0; transition: opacity 400ms ease;
}
.tag.on { opacity: 1; }

/* ---------- title block: drawn like the one on an architect's sheet ----------
   On phones it is one slim row (name, then who shows it), so it stays clear of the plan. */
.title-block {
  position: absolute; top: calc(env(safe-area-inset-top) + var(--gutter)); left: var(--gutter); right: var(--gutter);
  display: flex; align-items: stretch;
  border: 1px solid var(--rule);
  color: var(--fg);
  background: rgba(247, 245, 241, 0.82);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  transition: border-color 600ms ease, color 600ms ease, background-color 600ms ease;
}
/* over the neon model and the AI footage the block needs a dark backing to stay readable */
body[data-theme="night"] .title-block {
  background: rgba(11, 26, 49, 0.5);
  -webkit-backdrop-filter: blur(14px) saturate(150%); backdrop-filter: blur(14px) saturate(150%);
}
.title-block h1 {
  flex: 1; align-self: center;
  margin: 0; padding: 9px 12px;
  font-size: 19px; line-height: 1.1; font-weight: 700; letter-spacing: -0.015em;
}
.title-block p { margin: 0; padding: 0 12px; font-size: 15px; line-height: 1.35; font-weight: 500; }
.title-block .sub { display: none; }
.title-block .small { font-size: 11px; letter-spacing: 0.02em; color: var(--fg-soft); }
.title-block .by {
  flex: none; display: flex; flex-direction: column; justify-content: center;
  border-left: 1px solid var(--rule); padding: 7px 12px 8px;
}
.title-block .by span { display: block; margin-bottom: 3px; }
.logo { display: block; width: 112px; height: auto; }
.logo-light, body[data-theme="night"] .logo-ink { display: none; }
body[data-theme="night"] .logo-light { display: block; }

/* ---------- dock: what you can do now ---------- */
.dock {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 14px var(--gutter) calc(env(safe-area-inset-bottom) + var(--gutter));
  background: var(--dock);
  -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
  border-top: 1px solid var(--rule);
  transition: background-color 600ms ease, border-color 600ms ease;
}
.hint { margin: 0 0 12px; font-size: 16px; line-height: 1.4; font-weight: 500; color: var(--fg); max-width: 34em; }
.hint:empty { display: none; }
.hint small { display: block; margin-top: 4px; font-size: 13px; color: var(--fg-soft); letter-spacing: 0.01em; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions > * { flex: 1 1 auto; }

button, .actions a {
  font-family: inherit;
  min-height: 48px; padding: 12px 20px;
  border-radius: 14px;
  font-size: 16px; font-weight: 700; letter-spacing: 0;
  text-align: center; text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 100ms ease-out, opacity 200ms ease, background-color 600ms ease, color 600ms ease;
}
button:active, .actions a:active { transform: scale(0.97); }
button:focus-visible, .actions a:focus-visible, .pin:focus-visible, .credit:focus-visible { outline: 2px solid var(--plan-line); outline-offset: 3px; }
button[disabled] { opacity: 0.45; cursor: default; }
button[disabled]:active { transform: none; }
.primary { border: 0; background: var(--primary-bg); color: var(--primary-fg); }
.quiet { border: 1px solid var(--rule); background: transparent; color: var(--fg); display: inline-flex; align-items: center; justify-content: center; }
[hidden] { display: none !important; }

/* in a room: Rooms and Back share a row, Ask takes the next */
body[data-state="room"] .actions > #rooms, body[data-state="glide"] .actions > #rooms { flex: 0 0 auto; }
.rooms-menu {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-top: 10px;
}
.rooms-menu[hidden] { display: none; }
.rooms-menu button {
  min-height: 44px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--rule); background: transparent; color: var(--fg);
  font-size: 15px; font-weight: 700;
}

/* ---------- the end: who built the experience (Owlake), shown once you're standing in the room ---------- */
.credit {
  display: none;
  align-items: center; gap: 10px;
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--rule);
  color: var(--fg); text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
body[data-state="room"] .credit { display: flex; animation: credit-in 600ms 300ms ease both; }
@keyframes credit-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.owl { width: 28px; height: 28px; flex: none; color: var(--neon); }
.credit-text { font-size: 13px; line-height: 1.3; color: var(--fg-soft); }
.credit-text strong { display: block; font-size: 15px; font-weight: 700; color: var(--fg); }
.credit-text small { display: block; font-size: 12px; }
.qr { margin-left: auto; flex: none; width: 64px; height: 64px; padding: 0; background: #fff; border-radius: 8px; overflow: hidden; }
.qr svg { display: block; width: 100%; height: 100%; }

/* ---------- phones, in a room: the dock shrinks to one line of buttons so the floor (and its rings) stays in view ---------- */
.narrow { display: none; }
@media (max-width: 899px), (max-aspect-ratio: 1/1) {
  body[data-state="room"] .dock, body[data-state="glide"] .dock { padding-top: 10px; }
  body[data-state="room"] .hint, body[data-state="glide"] .hint { margin-bottom: 8px; font-size: 15px; }
  body[data-state="room"] .hint small, body[data-state="glide"] .hint small { display: none; }
  body[data-state="room"] .actions, body[data-state="glide"] .actions { flex-wrap: nowrap; gap: 8px; }
  body[data-state="room"] .actions > *, body[data-state="glide"] .actions > * {
    flex: 1 1 0; min-height: 44px; padding: 10px 6px; font-size: 15px; border-radius: 12px; white-space: nowrap;
  }
  body[data-state="room"] .wide, body[data-state="glide"] .wide { display: none; }
  body[data-state="room"] .narrow, body[data-state="glide"] .narrow { display: inline; }
  .credit { margin-top: 8px; padding-top: 8px; gap: 8px; }
  .owl { width: 22px; height: 22px; }
  .credit-text { font-size: 12px; }
  .credit-text strong { display: inline; font-size: 13px; }
  .credit-text small { display: none; }
  .qr { width: 44px; height: 44px; border-radius: 6px; }
}

/* ---------- wide screens: a portrait stage, title block and dock beside it like a drawing sheet ---------- */
@media (min-width: 900px) and (min-aspect-ratio: 1/1) {
  .sheet {
    display: grid;
    grid-template-columns: 1fr auto minmax(300px, 360px) 1fr;
    grid-template-rows: auto 1fr;
    column-gap: 40px;
    padding: 24px;
  }
  .stage {
    position: relative; grid-column: 2; grid-row: 1 / span 2;
    height: calc(100dvh - 48px); aspect-ratio: 9 / 16;
    border-radius: 20px;
    box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.45);
  }
  .title-block { position: static; grid-column: 3; grid-row: 1; align-self: start; display: block; }
  .title-block, body[data-theme="night"] .title-block { background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .title-block h1 { font-size: 34px; line-height: 1.05; padding: 10px 12px 9px; letter-spacing: -0.02em; }
  .title-block .sub { display: block; border-top: 1px solid var(--rule); padding-top: 8px; padding-bottom: 8px; }
  .title-block .small { font-size: 13px; letter-spacing: 0.01em; }
  .title-block .by { display: block; border-left: 0; border-top: 1px solid var(--rule); padding: 8px 12px 10px; }
  .title-block .by span { margin-bottom: 6px; }
  .logo { width: 190px; }
  .dock {
    position: static; grid-column: 3; grid-row: 2; align-self: end;
    padding: 0; background: none; border: 0;
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .actions { flex-direction: column; }
  .credit { margin-top: 20px; padding-top: 16px; }
  .roomchip { top: var(--gutter); }
  .qr { width: 96px; height: 96px; }
}

@media (prefers-reduced-motion: reduce) {
  body, .stage, .title-block, .dock, button, .actions a { transition: opacity 200ms ease; }
  button:active, .actions a:active { transform: none; }
  body[data-state="room"] .credit { animation: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .dock { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--bg); }
  .pin, .title-block, body[data-theme="night"] .title-block { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--bg); }
}
@media (prefers-contrast: more) {
  :root { --rule: currentColor; }
}
