:root {
  --accent: #C1121F;
  --sand: #C8B293;
  --ink: #0e0f11;
  --glass: rgba(14, 15, 17, 0.58);
  --glass-strong: rgba(14, 15, 17, 0.78);
  --line: rgba(255, 255, 255, 0.14);
  --text: #fff;
  --muted: rgba(255, 255, 255, 0.68);
  --radius: 14px;
  --gutter: 20px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
[dir="rtl"] { --font: 'Baloo Bhaijaan 2', 'Plus Jakarta Sans', system-ui, sans-serif; }
* { box-sizing: border-box; letter-spacing: 0; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--ink); color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
.i { width: 18px; height: 18px; fill: currentColor; flex: none; }
[dir="rtl"] .steps .i, [dir="rtl"] .walk-tag::after { transform: scaleX(-1); }

#pano { position: absolute; inset: 0; cursor: grab; transition: filter .1s linear; }
#pano:active { cursor: grabbing; }
.shade { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,.45), rgba(0,0,0,0) 22%, rgba(0,0,0,0) 55%, rgba(0,0,0,.6)); }

/* ---------- top bar ---------- */
.top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 16px;
  padding: calc(var(--gutter) + env(safe-area-inset-top)) var(--gutter) 0; pointer-events: none; }
.top > * { pointer-events: auto; }
.brand img { height: 26px; display: block; }
.brand__text { font-weight: 700; font-size: 18px; }
.top__title { padding-inline-start: 16px; border-inline-start: 1px solid var(--line); min-width: 0; }
.top__project { font-weight: 600; font-size: 15px; line-height: 1.2; }
.top__zone { font-size: 13px; color: var(--muted); }
.top__actions { margin-inline-start: auto; display: flex; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  font-size: 14px; font-weight: 600; text-decoration: none; color: var(--text); transition: background .2s, border-color .2s; }
.chip:hover { background: var(--glass-strong); border-color: rgba(255,255,255,.3); }
.chip--icon { width: 40px; padding: 0; justify-content: center; }
#btn-guide .i--pause { display: none; }
#btn-guide[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); }
#btn-guide[aria-pressed="true"] .i--play { display: none; }
#btn-guide[aria-pressed="true"] .i--pause { display: block; }

/* ---------- room card ---------- */
.card { position: absolute; left: var(--gutter); right: var(--gutter); bottom: calc(var(--dock-h, 196px) + 16px);
  max-width: 560px; pointer-events: none; transition: bottom .35s var(--ease); }
[dir="rtl"] .card { left: auto; }
.card__count { font-size: 13px; color: var(--sand); font-weight: 600; font-variant-numeric: tabular-nums; }
.card__name { margin: 4px 0 6px; font-size: clamp(26px, 3.4vw, 40px); line-height: 1.1; font-weight: 600; text-shadow: 0 2px 18px rgba(0,0,0,.35); }
.card__caption { margin: 0; font-size: 15px; line-height: 1.5; color: rgba(255,255,255,.86); text-shadow: 0 1px 12px rgba(0,0,0,.5); }
.card.is-in .card__name, .card.is-in .card__caption, .card.is-in .card__count { animation: rise .6s var(--ease) both; }
.card.is-in .card__caption { animation-delay: .08s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- dock ---------- */
.dock { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px var(--gutter) calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(10,10,12,.82), rgba(10,10,12,.55)); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line); transition: transform .35s var(--ease); }
body.dock-closed .dock { transform: translateY(calc(100% - 64px - env(safe-area-inset-bottom))); }
.dock { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "zones steps toggle" "strip strip strip"; align-items: center; column-gap: 12px; }
.zones { grid-area: zones; } .steps { grid-area: steps; } .dock__toggle { grid-area: toggle; } .strip { grid-area: strip; }
.zones { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.zones::-webkit-scrollbar { display: none; }
.zone { height: 36px; padding: 0 14px; border-radius: 999px; border: 0; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap; }
.zone:hover { color: var(--text); }
.zone[aria-selected="true"] { background: rgba(255,255,255,.12); color: var(--text); }
.steps { display: flex; gap: 6px; }
.step { height: 36px; min-width: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 10px;
  border-radius: 999px; border: 1px solid var(--line); background: transparent; font-size: 14px; font-weight: 600; }
.step--next { background: var(--text); color: var(--ink); border-color: var(--text); padding: 0 12px 0 16px; }
[dir="rtl"] .step--next { padding: 0 16px 0 12px; }
.step:disabled { opacity: .35; cursor: default; }
.dock__toggle { height: 36px; padding: 0 12px; border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; }
.strip { list-style: none; margin: 12px 0 0; padding: 0 0 4px; display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent; }
.strip li { flex: none; scroll-snap-align: start; }
.thumb { position: relative; display: block; width: 168px; aspect-ratio: 16 / 9; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: #222; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s var(--ease), filter .3s; filter: saturate(.9) brightness(.82); }
.thumb:hover img { transform: scale(1.06); filter: none; }
.thumb::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 2px transparent; transition: box-shadow .2s; }
.thumb[aria-current="true"]::after { box-shadow: inset 0 0 0 2px var(--text); }
.thumb[aria-current="true"] img { filter: none; }
.thumb__n { position: absolute; top: 6px; inset-inline-start: 8px; font-size: 11px; font-weight: 700; color: rgba(255,255,255,.85); }
.thumb__name { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 7px; font-size: 13px; font-weight: 600; text-align: start;
  background: linear-gradient(to top, rgba(0,0,0,.75), transparent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guide-bar { position: absolute; left: 0; right: 0; top: -1px; height: 2px; }
.guide-bar span { display: block; height: 100%; width: 0; background: var(--accent); }

/* ---------- floor discs ---------- */
.walk-disc { position: relative; width: 0; height: 0; padding: 0; margin: 0; border: 0; background: none; }
/* zero-size anchor so the floor tilt pivots around the disc's centre */
.walk-disc__body { position: absolute; left: -95px; top: -95px; width: 190px; height: 190px; border-radius: 50%; }
.walk-disc__ring { position: absolute; inset: 0; border-radius: 50%; border: 8px solid rgba(255,255,255,.92);
  background: radial-gradient(circle, rgba(255,255,255,.18) 0, rgba(255,255,255,.08) 60%, transparent 61%);
  box-shadow: 0 0 24px rgba(0,0,0,.35), inset 0 0 18px rgba(0,0,0,.25); transition: transform .25s var(--ease), border-color .2s, background .2s; }
.walk-disc__dot { position: absolute; inset: 42%; border-radius: 50%; background: rgba(255,255,255,.9); transition: transform .25s var(--ease); }
.walk-disc__body::before { content: ''; position: absolute; inset: -10%; border-radius: 50%; border: 3px solid rgba(255,255,255,.55); animation: pulse 2.6s ease-out infinite; }
.walk-disc.is-hover .walk-disc__ring { transform: scale(1.12); border-color: #fff; background: radial-gradient(circle, rgba(193,18,31,.55) 0, rgba(193,18,31,.35) 60%, transparent 61%); }
.walk-disc.is-hover .walk-disc__dot { transform: scale(1.4); }
@keyframes pulse { 0% { transform: scale(.85); opacity: .9; } 70%, 100% { transform: scale(1.35); opacity: 0; } }
.walk-tag { transform: translate(-50%, -100%); display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 0;
  background: rgba(14,15,17,.62); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap;
  opacity: .78; transition: opacity .2s, background .2s; }
.walk-tag::after { content: ''; width: 7px; height: 7px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: rotate(45deg); }
.walk-tag.is-hover { opacity: 1; background: var(--accent); }
body.is-moving .walk-disc, body.is-moving .walk-tag { opacity: 0; pointer-events: none; transition: opacity .15s; }
body.has-intro .walk-disc, body.has-intro .walk-tag { opacity: 0; }

/* ---------- intro ---------- */
.intro { position: absolute; inset: 0; display: grid; place-items: center; padding: var(--gutter);
  background: radial-gradient(ellipse at center, rgba(0,0,0,.25), rgba(0,0,0,.72)); transition: opacity .45s var(--ease); z-index: 5; }
.intro.is-out { opacity: 0; pointer-events: none; }
.intro__panel { max-width: 520px; text-align: center; animation: rise .8s var(--ease) both; }
.intro__eyebrow { color: var(--sand); font-size: 14px; font-weight: 600; }
.intro__title { margin: 10px 0 8px; font-size: clamp(38px, 6vw, 64px); line-height: 1.05; font-weight: 600; }
.intro__meta { margin: 0 0 28px; color: rgba(255,255,255,.82); font-size: 16px; }
.intro__actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.btn { height: 50px; padding: 0 26px; border-radius: 999px; font-size: 15px; font-weight: 600; border: 1px solid transparent; transition: transform .2s var(--ease), background .2s; }
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--ghost { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.35); color: #fff; backdrop-filter: blur(10px); }
.intro__how { margin: 22px 0 0; font-size: 13px; color: var(--muted); }
body.has-intro .card, body.has-intro .dock, body.has-intro .top__title { opacity: 0; pointer-events: none; }
.card, .dock, .top__title { transition: opacity .4s var(--ease), transform .35s var(--ease), bottom .35s var(--ease); }

/* ---------- toast + edit ---------- */
.toast { position: absolute; top: 84px; left: 50%; transform: translate(-50%, -8px); opacity: 0; padding: 10px 18px; border-radius: 999px;
  background: var(--glass-strong); backdrop-filter: blur(12px); font-size: 14px; font-weight: 500; transition: opacity .3s, transform .3s var(--ease); white-space: nowrap; max-width: calc(100% - 32px); overflow: hidden; text-overflow: ellipsis; }
.toast.is-in { opacity: 1; transform: translate(-50%, 0); }
.edit-readout { position: absolute; top: 84px; left: var(--gutter); padding: 8px 12px; background: var(--accent); color: #fff; font: 13px/1.4 ui-monospace, monospace; border-radius: 8px; white-space: pre; z-index: 6; }

/* ---------- small screens ---------- */
@media (max-width: 720px) {
  :root { --gutter: 14px; }
  .top__title { display: none; }
  #btn-guide span { display: none; }
  #btn-guide { width: 40px; padding: 0; justify-content: center; }
  .step--next span { display: none; }
  .step--next { padding: 0 10px; }
  .dock { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "steps toggle" "zones zones" "strip strip"; row-gap: 10px; }
  .steps { justify-self: start; }
  .zone { padding: 0 10px; font-size: 13px; }
  .thumb { width: 132px; }
  .card__caption { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
