/* SaaReeYaa I (Sareya I on the plan): the floor plan you can step into.
   Paper and ink while it is a drawing; blueprint night and neon once it comes alive (as in Rose's Saareeyaa reel). */
:root {
  --paper: #f5f5f3;
  --ink: #1b1d23;
  --ink-soft: #5a5d66;
  --night: #0e1728;
  --night-raised: rgba(14, 23, 40, 0.62);
  --neon: #ccf2ff;
  --plan-line: #99c4fa;
  --fg: var(--ink);
  --fg-soft: var(--ink-soft);
  --bg: var(--paper);
  --rule: rgba(27, 29, 35, 0.28);
  --dock: rgba(245, 245, 243, 0.74);
  --primary-bg: var(--ink);
  --primary-fg: var(--paper);
  --gutter: 16px;
  font-family: "Satoshi", "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(14, 23, 40, 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); }

.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 ---------- */
.title-block {
  position: absolute; top: calc(env(safe-area-inset-top) + var(--gutter)); left: var(--gutter);
  min-width: 168px;
  border: 1px solid var(--rule);
  color: var(--fg);
  transition: border-color 600ms ease, color 600ms ease;
}
/* over the neon model and the AI footage the block needs its own backing to stay readable */
body[data-theme="night"] .title-block {
  background: rgba(14, 23, 40, 0.5);
  -webkit-backdrop-filter: blur(14px) saturate(150%); backdrop-filter: blur(14px) saturate(150%);
}
.title-block h1 {
  margin: 0; padding: 10px 12px 9px;
  font-size: 26px; line-height: 1.05; font-weight: 700; letter-spacing: -0.02em;
}
.title-block p { margin: 0; padding: 0 12px; font-size: 15px; line-height: 1.35; font-weight: 500; }
.title-block h1 + p { border-top: 1px solid var(--rule); padding-top: 8px; }
.title-block .small { font-size: 13px; letter-spacing: 0.01em; color: var(--fg-soft); padding-bottom: 8px; }
.title-block .by { border-top: 1px solid var(--rule); padding-top: 7px; padding-bottom: 8px; }
.title-block h1:has(.logo) { padding: 11px 12px 10px; line-height: 0; }
.logo { display: block; width: 144px; 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; }

/* ---------- 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: the credit stays one slim line so the room stays in view */
@media (max-width: 899px), (max-aspect-ratio: 1/1) {
  .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; }
  body[data-theme="night"] .title-block { background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .title-block h1 { font-size: 34px; }
  .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; }
  .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, body[data-theme="night"] .title-block { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--night); }
}
@media (prefers-contrast: more) {
  :root { --rule: currentColor; }
}
