/* =========================================================
   LUX HOMES — Inspired glass + 3D spatial real estate
   ========================================================= */

:root {
  --ink: #0d141c;
  --ink-soft: #1c2a38;
  --sand: #f3ebe1;
  --sand-bright: #fbf7f1;
  --copper: #c9853c;
  --copper-bright: #e0a45a;
  --sea: #4a7f90;
  --sea-deep: #244854;
  --glass: rgba(255, 255, 255, 0.1);
  --glass-strong: rgba(18, 28, 38, 0.55);
  --glass-edge: rgba(255, 255, 255, 0.22);
  --panel: rgba(251, 247, 241, 0.94);
  --text: #14202b;
  --muted: #5c6b7a;
  --white: #ffffff;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.38);
  --radius: 1.55rem;
  --font-display: "Fraunces", Georgia, serif;
  --font-ui: "Sora", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-ui);
  color: var(--sand-bright);
  background: #070b10;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

.scene-page {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  isolation: isolate;
  padding-bottom: 1.5rem;
}

.scene-page__bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(120deg, rgba(8, 14, 20, 0.55), rgba(8, 14, 20, 0.25)),
    url("../images/dining-ocean-bg.jpg") center / cover no-repeat;
  transform: scale(1.04);
  filter: saturate(1.08) contrast(1.05);
}

.scene-page__wash {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 55% 45% at 20% 25%, rgba(74, 127, 144, 0.28), transparent 60%),
    radial-gradient(ellipse 50% 40% at 85% 75%, rgba(201, 133, 60, 0.2), transparent 55%),
    linear-gradient(180deg, rgba(7, 11, 16, 0.35), rgba(7, 11, 16, 0.72));
  pointer-events: none;
}

.glass {
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(1.3);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.glass-strong {
  background: var(--glass-strong);
  backdrop-filter: blur(28px) saturate(1.35);
  -webkit-backdrop-filter: blur(28px) saturate(1.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.glass-dark {
  background: rgba(10, 16, 22, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px);
}

.glass-panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow);
  color: var(--text);
}

.browser-chip {
  width: fit-content;
  margin: 0.85rem auto 0.55rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  font-size: 0.75rem;
  color: rgba(251, 247, 241, 0.9);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(1180px, calc(100% - 1.5rem));
  margin: 0 auto;
  padding: 0.7rem 1rem;
  border-radius: 999px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--sand-bright);
}

.brand__mark {
  width: 2.05rem;
  height: 2.05rem;
  border-radius: 0.6rem;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: linear-gradient(145deg, #f6e7d2, var(--copper-bright));
  box-shadow: 0 8px 20px rgba(201, 133, 60, 0.35);
}

.brand__name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.topbar__nav {
  display: flex;
  gap: 0.25rem;
}

.topbar__nav button {
  border: 0;
  background: transparent;
  color: rgba(251, 247, 241, 0.7);
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  transition: 0.2s ease;
}

.topbar__nav button:hover,
.topbar__nav button.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.search {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: min(240px, 38vw);
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  color: var(--sand-bright);
}

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
}

.search input::placeholder {
  color: rgba(251, 247, 241, 0.45);
}

.avatar {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(224, 164, 90, 0.75);
}

.workspace {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: clamp(0.9rem, 2vw, 1.4rem);
  width: min(1180px, calc(100% - 1.5rem));
  margin: 1rem auto 0;
  align-items: start;
}

.stage {
  position: relative;
  border-radius: calc(var(--radius) + 0.2rem);
  overflow: hidden;
  min-height: min(74vh, 760px);
}

.stage__canvas-wrap {
  position: absolute;
  inset: 0;
}

.stage__canvas-wrap canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.model__photo {
  display: none;
}

.stage__overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem 1.1rem 1.15rem;
  background: linear-gradient(180deg, rgba(8, 12, 18, 0.28) 0%, transparent 24%, transparent 68%, rgba(8, 12, 18, 0.5) 100%);
}

.stage__badge {
  pointer-events: auto;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: rgba(12, 18, 26, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--sand-bright);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
}

.stage__badge span {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #5bd6a2;
  box-shadow: 0 0 10px #5bd6a2;
}

.stage__controls {
  pointer-events: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ctrl-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(12, 18, 26, 0.62);
  color: var(--sand-bright);
  border-radius: 999px;
  padding: 0.62rem 0.95rem;
  cursor: pointer;
  backdrop-filter: blur(14px);
  transition: 0.2s ease;
  font-size: 0.76rem;
  font-weight: 600;
}

.ctrl-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(224, 164, 90, 0.55);
}

.ctrl-btn.is-active {
  background: linear-gradient(135deg, var(--copper), var(--copper-bright));
  color: var(--ink);
  border-color: transparent;
}

.stage__hint {
  margin: 0.5rem 0 0;
  color: rgba(251, 247, 241, 0.65);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

.stage__loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--sand-bright);
  background: rgba(8, 12, 18, 0.5);
  backdrop-filter: blur(6px);
  z-index: 5;
  transition: opacity 0.35s ease;
  text-align: center;
}

.stage__loading.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  backdrop-filter: none;
}

.spinner {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--copper-bright);
  animation: spin 0.8s linear infinite;
  margin: 0 auto 0.75rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.insight {
  min-height: 0;
}

.card {
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem 1.3rem;
  max-height: calc(100vh - 7.5rem);
  overflow: auto;
  scrollbar-width: thin;
}

.eyebrow {
  margin: 0 0 0.3rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--copper);
}

.property-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.3vw, 2.05rem);
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink);
}

.address {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.price {
  margin: 0.55rem 0 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--copper);
}

.hero-thumb {
  margin-top: 0.95rem;
  border-radius: 1rem;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.hero-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.95rem;
}

.stat {
  background: rgba(16, 21, 28, 0.06);
  border: 1px solid rgba(16, 21, 28, 0.08);
  border-radius: 0.85rem;
  padding: 0.7rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.stat svg {
  width: 1.05rem;
  height: 1.05rem;
  color: var(--sea);
}

.section-label {
  margin: 1rem 0 0.3rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sea-deep);
}

.desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.tours-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 1.15rem 0 0.65rem;
}

.tours-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
}

.tours-head p {
  margin: 0.2rem 0 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.tour-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.tour-card {
  position: relative;
  border-radius: 0.95rem;
  overflow: hidden;
  aspect-ratio: 4 / 3.05;
  isolation: isolate;
  border: 1px solid rgba(16, 21, 28, 0.08);
  background: #dfe6ea;
}

.tour-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}

.tour-card:hover img {
  transform: scale(1.06);
}

.tour-card__label {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 2;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

.tour-card__cta {
  position: absolute;
  left: 0.4rem;
  right: 0.4rem;
  bottom: 0.4rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 0.48rem 0.55rem;
  background: rgba(16, 21, 28, 0.62);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: 0.2s ease;
}

.tour-card__cta:hover {
  background: rgba(201, 133, 60, 0.92);
  transform: translateY(-1px);
}

.tour-card__cta svg {
  width: 0.85rem;
  height: 0.85rem;
  flex-shrink: 0;
}

.tour-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 14, 20, 0.72), transparent 52%);
  z-index: 1;
  pointer-events: none;
}

.tour-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(6, 10, 14, 0.78);
  backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.tour-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.tour-modal__dialog.tour-dialog {
  width: min(1180px, 100%);
  height: min(760px, 94vh);
  display: grid;
  grid-template-rows: 4px auto 1fr;
  border-radius: 1.35rem;
  overflow: hidden;
  background: #0f161d;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.25s ease;
}

.tour-modal.is-open .tour-modal__dialog {
  transform: none;
}

.tour-progress {
  background: rgba(255, 255, 255, 0.08);
}

.tour-progress span {
  display: block;
  height: 100%;
  width: 20%;
  background: linear-gradient(90deg, var(--copper), var(--copper-bright));
  transition: width 0.35s ease;
}

.tour-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--sand-bright);
}

.tour-kicker {
  margin: 0 0 0.15rem;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--copper-bright);
  font-weight: 700;
}

.tour-modal__header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
}

.tour-modal__header p {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  color: rgba(251, 247, 241, 0.6);
}

.icon-close {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  cursor: pointer;
}

.tour-dialog__body {
  min-height: 0;
  display: grid;
  grid-template-columns: 1.55fr 0.9fr;
}

.tour-modal__viewport {
  position: relative;
  min-height: 0;
  background: radial-gradient(ellipse at center, #2a3b4a, #101820);
}

.tour-modal__viewport canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.tour-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.1rem 1.15rem 1rem;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
  color: var(--sand-bright);
  overflow: auto;
}

.tour-panel__eyebrow {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(251, 247, 241, 0.5);
}

.tour-panel__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
}

.tour-panel__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tour-panel__meta span {
  font-size: 0.72rem;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(251, 247, 241, 0.82);
}

.tour-panel__desc {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.55;
  color: rgba(251, 247, 241, 0.72);
  flex: 1;
}

.tour-panel__nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.tour-nav-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--sand-bright);
  border-radius: 0.75rem;
  padding: 0.7rem 0.8rem;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
}

.tour-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.tour-nav-btn--primary {
  background: linear-gradient(135deg, var(--copper), var(--copper-bright));
  color: var(--ink);
  border-color: transparent;
}

.tour-modal__footer {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.tour-chip {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(251, 247, 241, 0.85);
  border-radius: 0.65rem;
  padding: 0.5rem 0.7rem;
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 600;
  text-align: left;
}

.tour-chip.is-active {
  background: rgba(224, 164, 90, 0.2);
  border-color: rgba(224, 164, 90, 0.55);
  color: var(--sand-bright);
}

@media (max-width: 900px) {
  .tour-dialog__body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(240px, 52%) auto;
  }

  .tour-panel {
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .tour-modal__footer {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

@media (max-width: 980px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .stage {
    min-height: 54vh;
  }

  .card {
    max-height: none;
  }

  .topbar__nav {
    display: none;
  }
}

@media (max-width: 640px) {
  .search {
    display: none;
  }

  .tour-grid {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
