/* Walkthrough & HD Photo Gallery — supports both:
   A) Classic High-Resolution Photo Gallery Mode (#project-gallery-stage)
   B) Sticky Altura-Style Room-by-Room 3D Camera Fly-Through (#tour)
   Plus iPhone Dynamic Island with 1-Click Mode Switcher and
   a SINGLE Unified Window for Floorplan Before/After -> 3D Maquette Assembly with Tweezers. */

.tour {
  --tour-h: calc(100svh - 2 * var(--inset));
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --font-thin: "Inter", ui-sans-serif, system-ui, sans-serif;
  --tour-ink: #ffffff;
  --tour-ink-dim: rgba(255, 255, 255, 0.84);
  --tour-pad: clamp(16px, 2.4vw, 36px);
  position: relative;
  height: 1850svh;
}

body.is-gallery-mode .tour {
  display: none !important;
}

body:not(.is-gallery-mode) .project-gallery {
  display: none !important;
}

.tour__sticky {
  position: sticky;
  top: var(--inset);
  height: var(--tour-h);
  min-height: 320px;
  border-radius: var(--radius);
  overflow: hidden;
  isolation: isolate;
  background: #101216;
  color: var(--tour-ink);
}

.tour__canvas,
.tour__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.tour__poster { object-fit: cover; z-index: 0; }
.tour__canvas { z-index: 1; }
.tour.is-live .tour__poster { visibility: hidden; }

/* Subtle vignette only at very bottom edge so 92% of the room photo stays crystal clear */
.tour__shade {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(8, 10, 14, 0.24) 0%, rgba(8, 10, 14, 0) 12%),
    linear-gradient(0deg, rgba(8, 10, 14, 0.24) 0%, rgba(8, 10, 14, 0) 14%);
}

/* ==========================================================================
   iPhone DYNAMIC ISLAND COLLAPSIBLE DOT MENU (.island-nav)
   Folds into a compact obsidian capsule at top-center with mode switcher
   ========================================================================== */

.island-nav {
  position: absolute;
  top: clamp(10px, 1.4vw, 18px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: calc(100% - 16px);
}

.island-nav--project {
  position: fixed;
  top: clamp(12px, 1.6vw, 22px);
}

.island-nav__pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(10, 12, 14, 0.92);
  border: 1px solid rgba(229, 195, 145, 0.34);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.58), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  color: #f7f3eb;
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.25s;
}

.island-nav__pill:hover {
  border-color: rgba(229, 195, 145, 0.58);
}

.island-nav__back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff !important;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.island-nav__back:hover {
  background: #ffffff;
  color: #0d0f12 !important;
}

/* Collapsible Dynamic Island Main Menu on Both Desktop and Mobile */
.island-nav--landing .island-nav__toggle {
  display: inline-flex;
}

.island-nav--landing .island-nav__tray {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 999px;
}

@media (max-width: 760px) {
  .island-nav--landing .island-nav__tray {
    border-radius: 22px;
  }
}

.island-mode-switch {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.island-mode-btn {
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: rgba(247, 243, 235, 0.88) !important;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.island-mode-btn.is-active {
  background: #c9a97c !important;
  color: #141510 !important;
}

.island-nav__toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 10px 0 8px;
  border-radius: 999px;
  background: transparent;
  border: 0;
  color: #ffffff !important;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
}

.island-nav__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c9a97c;
  box-shadow: 0 0 10px rgba(229, 195, 145, 0.85);
  flex: none;
}

.island-nav__current {
  max-width: min(300px, 42vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #f7f3eb !important;
}

.island-nav__dots-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  font-size: 10px;
  color: #e5c391 !important;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.island-nav.is-open .island-nav__dots-icon {
  transform: rotate(180deg);
  background: #c9a97c;
  color: #0d0f12 !important;
}

/* Expanded Dynamic Island Tray (Always high-contrast ivory text on obsidian glass in both themes!) */
.island-nav__tray {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 22px;
  background: rgba(10, 12, 15, 0.96);
  border: 1px solid rgba(229, 195, 145, 0.42);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.68);
  color: #f7f3eb !important;
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: min(760px, 92vw);
  transform-origin: 50% 0%;
  animation: islandExpand 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.island-nav__tray[hidden] {
  display: none !important;
}

@keyframes islandExpand {
  from {
    opacity: 0;
    transform: scale(0.88) translateY(-6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.island-nav__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.island-nav__links .nav__link {
  height: 30px;
  padding: 0 12px;
  font-size: 12.5px;
  border-radius: 999px;
  color: #f7f3eb !important;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-shadow: none;
}

.island-nav__links .nav__link:hover {
  background: rgba(229, 195, 145, 0.24);
  color: #ffffff !important;
}

.island-nav__links .nav__link.is-active {
  background: #c9a97c !important;
  color: #141510 !important;
  border-color: #c9a97c !important;
  font-weight: 600;
}

.island-nav__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: #ffffff;
  color: #0d0f12 !important;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* ==========================================================================
   MODE A1: HIGH-RESOLUTION PHOTO GALLERY (#project-gallery-stage)
   Crisp native portrait & landscape photographs without 3D fly-through
   ========================================================================== */

.project-gallery {
  padding-top: clamp(92px, 8vw, 118px);
  padding-bottom: 24px;
}

.project-gallery__container {
  width: min(1440px, 100%);
  margin-inline: auto;
  padding: clamp(20px, 3vw, 48px);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface) 0%, var(--page) 100%);
  border: 1px solid var(--line-strong);
}

.project-gallery__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.project-gallery__title {
  font-family: var(--font-ui);
  font-weight: 200;
  font-size: clamp(2rem, 3.6vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.032em;
  text-transform: uppercase;
  color: var(--ink);
}

.project-gallery__sub {
  margin-top: 8px;
  font-size: clamp(14.5px, 1.1vw, 18px);
  color: var(--accent, #c9a97c);
}

.project-gallery__head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.gallery-viewer {
  margin-top: 24px;
  padding: clamp(14px, 2vw, 24px);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
}

.gallery-viewer__stage {
  position: relative;
  width: 100%;
  height: clamp(360px, 66svh, 680px);
  border-radius: 12px;
  overflow: hidden;
  background: #0b0c09;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: max-width 0.25s ease;
}

@media (min-width: 901px) {
  .gallery-viewer__stage.is-portrait-photo {
    max-width: 640px;
    margin-inline: auto;
  }
}

.gallery-viewer__figure {
  width: 100%;
  height: 100%;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: zoom-in;
}

.gallery-viewer__img,
.gallery-viewer__video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 6px;
  transition: opacity 0.25s ease;
}

.gallery-viewer__zoom-btn {
  position: absolute;
  bottom: 14px;
  right: 14px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  background: rgba(14, 15, 12, 0.86);
  border: 1px solid rgba(201, 169, 124, 0.62);
  color: #f7f3eb;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.gallery-viewer__zoom-btn:hover {
  background: #c9a97c;
  color: #141510;
  border-color: #c9a97c;
}

.gallery-viewer__cap-zoom {
  margin-left: auto;
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface-card);
  color: var(--accent, #c9a97c);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.gallery-viewer__cap-zoom:hover {
  background: var(--accent, #c9a97c);
  color: #141510;
}
html[data-theme="light"] .gallery-viewer__cap-zoom:hover {
  color: #f7f3eb !important;
}

.gallery-viewer__video[hidden],
.gallery-viewer__img[hidden] {
  display: none !important;
}

.gallery-viewer__living-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(14, 16, 12, 0.86);
  border: 1px solid rgba(201, 169, 124, 0.65);
  color: #f6dfc0;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.gallery-viewer__living-badge[hidden] {
  display: none !important;
}

.gallery-viewer__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(14, 15, 12, 0.78);
  color: #f7f3eb;
  font-size: 18px;
  cursor: pointer;
  display: grid;
  place-items: center;
  backdrop-filter: blur(10px);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.gallery-viewer__nav:hover {
  background: #c9a97c;
  color: #141510;
  border-color: #c9a97c;
}

.gallery-viewer__nav--prev { left: 14px; }
.gallery-viewer__nav--next { right: 14px; }

.gallery-viewer__counter {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(14, 15, 12, 0.82);
  border: 1px solid rgba(201, 169, 124, 0.45);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #dfc39b;
}

.gallery-viewer__caption {
  margin-top: 12px;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--surface);
  border-left: 3px solid var(--accent, #c9a97c);
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.gallery-viewer__cap-title {
  margin: 0;
  font-size: clamp(15px, 1.15vw, 17.5px);
  font-weight: 500;
  color: var(--ink);
}

.gallery-viewer__cap-sub {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-dim);
}

.gallery-thumbs {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

.gallery-thumb {
  position: relative;
  flex: 0 0 86px;
  height: 62px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  background: #141612;
  padding: 0;
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 0.2s, border-color 0.2s, transform 0.2s;
}

.gallery-thumb:hover,
.gallery-thumb.is-active {
  opacity: 1;
  border-color: var(--accent, #c9a97c);
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-thumb__live-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #dfc39b;
  box-shadow: 0 0 8px rgba(223, 195, 155, 0.95);
}

.gallery-lookbook-head {
  margin-top: 40px;
  margin-bottom: 20px;
}

.gallery-lookbook-title {
  font-size: clamp(1.35rem, 2vw, 2rem);
  font-weight: 300;
  color: var(--ink);
}

.gallery-editorial-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 24px);
  align-items: stretch;
  margin-top: 32px;
}

.gal-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color 0.25s, transform 0.25s;
}

.gal-card:hover {
  border-color: var(--accent, #c9a97c);
  transform: translateY(-2px);
}

.gal-card__media {
  position: relative;
  width: 100%;
  background: #0b0c09;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.gal-card--landscape .gal-card__media {
  aspect-ratio: 16 / 10;
}

.gal-card--portrait .gal-card__media {
  aspect-ratio: 3 / 4;
}

.gal-card__media img,
.gal-card__media video {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  object-position: center;
  display: block;
}

@media (min-width: 901px) {
  .gal-card--full {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 7fr 5fr;
    align-items: stretch;
  }
  .gal-card--full.gal-card--portrait {
    grid-template-columns: 5fr 7fr;
  }
  .gal-card--full .gal-card__media {
    height: 100%;
    min-height: 360px;
  }
  .gal-card--full .gal-card__body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(24px, 3vw, 40px);
  }
  .gal-card--full .gal-card__title {
    font-size: clamp(18px, 1.5vw, 24px);
    margin-top: 8px;
  }
  .gal-card--full .gal-card__sub {
    font-size: 14.5px;
    margin-top: 10px;
  }
}

.gal-card__living-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(14, 16, 12, 0.84);
  border: 1px solid rgba(201, 169, 124, 0.62);
  color: #f6dfc0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  backdrop-filter: blur(8px);
}

.gal-card__body {
  padding: 16px 18px;
  flex: 1 1 auto;
}

.gal-card__title {
  margin-top: 4px;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
}

.gal-card__sub {
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-dim);
}

/* ==========================================================================
   LITERARY DESIGNER CAPTIONS (.tour__beats & .beat--caption)
   ========================================================================== */

.tour__beats {
  position: absolute;
  inset: 0;
  z-index: 4;
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: none;
}

.beat,
.beat--caption,
.beat--intro,
.beat--left,
.beat--right,
.beat--low-left,
.beat--low-right,
.beat--end {
  --o: 0;
  --b: 6px;
  --y: 10px;
  position: absolute;
  left: var(--tour-pad);
  bottom: clamp(18px, 2.5vw, 28px);
  right: auto;
  top: auto;
  translate: none;
  max-width: min(390px, calc(100% - 2 * var(--tour-pad)));
  padding: 9px 14px;
  border-radius: 13px;
  background: rgba(8, 10, 14, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-left: 3px solid var(--accent, #e5c391);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(14px) saturate(135%);
  -webkit-backdrop-filter: blur(14px) saturate(135%);
  text-align: left;
  opacity: var(--o);
  filter: blur(var(--b));
  transform: translate3d(0, var(--y), 0);
  will-change: opacity, filter, transform;
}

.beat.is-on {
  pointer-events: auto;
}

.beat--cta-only {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  padding: 0 !important;
}

.beat--cta-only .beat__cta {
  margin-top: 0;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.beat__kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent, #e5c391);
  margin-bottom: 2px;
}

.beat__title,
.beat__title--xl {
  margin: 0;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: clamp(14px, 1.1vw, 16.5px);
  line-height: 1.22;
  letter-spacing: -0.015em;
  text-transform: none;
  color: #ffffff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

.beat__sub {
  margin: 2px 0 0;
  font-family: var(--font-ui);
  font-size: clamp(11.5px, 0.85vw, 12.8px);
  font-weight: 400;
  line-height: 1.38;
  letter-spacing: 0;
  text-transform: none;
  color: rgba(255, 255, 255, 0.78);
}

.beat__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 11px;
  padding: 8px 15px;
  border-radius: 999px;
  background: #c9a97c;
  color: #141510 !important;
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  text-shadow: none;
  border: 0;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.beat__cta:hover {
  background: #ffffff;
  color: #141510 !important;
  transform: translateY(-1px);
}

/* ---------- Tour Controls: Step Prev/Next, Transition Lock & Fullscreen HD Lightbox ---------- */

.tour__controls {
  position: absolute;
  right: var(--tour-pad);
  bottom: clamp(18px, 2.5vw, 28px);
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  border-radius: 999px;
  background: rgba(8, 10, 14, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
}

.tour-ctrl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #f7f3eb;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.tour-ctrl-btn:hover {
  background: rgba(201, 169, 124, 0.28);
  border-color: #c9a97c;
}

.tour-ctrl-btn--lock.is-locked {
  background: #c9a97c;
  border-color: #c9a97c;
  color: #141510;
  font-weight: 600;
}

.tour-ctrl-btn--expand {
  border-color: rgba(201, 169, 124, 0.5);
  color: #f6dfc0;
}

/* ---------- Progress Bar at Very Bottom Edge ---------- */

.tour__progress {
  position: absolute;
  z-index: 5;
  left: var(--tour-pad);
  right: var(--tour-pad);
  bottom: 8px;
  width: auto;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

.tour__progress span {
  display: block;
  height: 100%;
  background: var(--accent, #e5c391);
  transform-origin: 0 50%;
  transform: scaleX(var(--p, 0));
}

.tour__dot {
  display: none;
}

/* ==========================================================================
   MOBILE PORTRAIT ROTATE-TO-LANDSCAPE PROMPT OVERLAY (.rotate-overlay)
   Only shown if user explicitly enters 3D Tour mode on a vertical phone
   ========================================================================== */

.rotate-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(8, 10, 14, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: none;
  place-items: center;
  padding: 24px;
  text-align: center;
}

@media (max-width: 900px) and (orientation: portrait) {
  body.is-tour-open:not(.is-gallery-mode):not(.is-portrait-tour-allowed) .rotate-overlay {
    display: grid;
  }
}

.rotate-overlay__card {
  max-width: 380px;
  width: 100%;
  padding: 28px 22px;
  border-radius: 24px;
  background: rgba(20, 23, 28, 0.95);
  border: 1px solid rgba(229, 195, 145, 0.38);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
  display: grid;
  justify-items: center;
  gap: 14px;
}

.rotate-overlay__icon {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(229, 195, 145, 0.12);
  border: 1px solid rgba(229, 195, 145, 0.35);
  display: grid;
  place-items: center;
  color: var(--accent, #e5c391);
}

.rotate-overlay__svg {
  width: 34px;
  height: 34px;
  animation: rotatePhoneHint 2.6s ease-in-out infinite;
}

@keyframes rotatePhoneHint {
  0%, 18% { transform: rotate(0deg); }
  55%, 82% { transform: rotate(-90deg); }
  100% { transform: rotate(0deg); }
}

.rotate-overlay__eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent, #e5c391);
}

.rotate-overlay__title {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.25;
  color: #ffffff;
}

.rotate-overlay__sub {
  font-size: 13.5px;
  line-height: 1.52;
  color: rgba(255, 255, 255, 0.76);
}

.rotate-overlay__actions {
  margin-top: 6px;
  width: 100%;
  display: grid;
  gap: 8px;
}

.rotate-overlay__btn-primary {
  width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 999px;
  background: #c9a97c;
  color: #141510 !important;
  border: 0;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.rotate-overlay__btn-ghost {
  width: 100%;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 12.5px;
  cursor: pointer;
}

/* ==========================================================================
   FINALE SECTION: PROJECT STORY + SINGLE UNIFIED FLOORPLAN / 3D MAQUETTE WINDOW
   ========================================================================== */

.tour-finale {
  position: relative;
  z-index: 6;
  margin-top: -10svh;
  padding-top: 4svh;
  padding-bottom: 48px;
}

body.is-gallery-mode .tour-finale {
  margin-top: 0;
  padding-top: 8px;
}

.tour-finale__card {
  width: min(1440px, 100%);
  margin-inline: auto;
  padding: clamp(28px, 4vw, 64px);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface) 0%, var(--page) 100%);
  border: 1px solid var(--line-strong);
  box-shadow: 0 -24px 80px rgba(0, 0, 0, 0.42);
}

.finale-story {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: clamp(28px, 4vw, 64px);
  align-items: start;
}

.finale-story__title {
  font-family: var(--font-thin);
  font-weight: 200;
  font-size: clamp(2.2rem, 4vw, 4.2rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  color: var(--ink);
}

.finale-story__sub {
  margin-top: 12px;
  font-size: clamp(16px, 1.2vw, 20px);
  line-height: 1.45;
  color: var(--accent);
}

.finale-task-box {
  margin-top: 24px;
  padding: 20px 22px;
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
  border: 1px solid var(--line-strong);
}

.finale-task-box__lbl {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 8px;
}

.finale-task-box p {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink);
}

.finale-story__paragraphs {
  display: grid;
  gap: 18px;
  font-size: clamp(15.5px, 1.08vw, 18px);
  line-height: 1.72;
  color: var(--ink-dim);
}

/* ---------- SINGLE UNIFIED WINDOW: BEFORE PLAN -> AFTER PLAN -> 3D INTERIOR RENDER ---------- */

.finale-floorplan {
  margin-top: 56px;
  padding-top: 48px;
  border-top: 1px solid var(--line-strong);
  scroll-margin-top: 68px;
}

.finale-floorplan__head {
  display: grid;
  grid-template-columns: 6fr 6fr;
  gap: 28px;
  align-items: end;
  margin-bottom: 28px;
}

.finale-floorplan__title {
  font-size: clamp(1.5rem, 2.3vw, 2.35rem);
  font-weight: 300;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.finale-floorplan__summary {
  font-size: 15px;
  line-height: 1.62;
  color: var(--ink-dim);
}

.ufp-card {
  max-width: 1120px;
  margin-inline: auto;
  padding: clamp(16px, 2.4vw, 28px);
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
}

.ufp-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.ufp-phases {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ufp-phase {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-dim);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.ufp-phase__num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
}

.ufp-phase.is-active {
  background: var(--accent);
  color: #141510;
  border-color: var(--accent);
  font-weight: 600;
}

.ufp-phase.is-active .ufp-phase__num {
  color: #141510;
}
html[data-theme="light"] .ufp-phase.is-active,
html[data-theme="light"] .ufp-phase.is-active .ufp-phase__num {
  color: #f7f3eb;
}

.ufp-card__hint {
  font-size: 12.5px;
  color: var(--accent);
}

/* The Single Interactive Stage Window */
.ufp-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--line-strong);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  user-select: none;
}

.ufp-stage__after,
.ufp-stage__before {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #ffffff;
}

.ufp-stage__after-wrap,
.ufp-stage__before-wrap {
  position: absolute;
  inset: 0;
  z-index: 2;
  clip-path: inset(0 calc(100% - var(--split-pos, 50%)) 0 0);
}

/* Layer 3: 3D Interior Render directly on top of the furnished floorplan in the same window! */
.ufp-stage__maq-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: #ffffff;
  opacity: var(--maq-opacity, 0);
  pointer-events: none;
  transition: opacity 0.32s ease;
}

.ufp-stage__maq-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ufp-stage__divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--split-pos, 50%);
  width: 2.5px;
  background: var(--accent);
  transform: translateX(-1px);
  pointer-events: none;
  z-index: 4;
  transition: opacity 0.25s ease;
}

.ufp-stage.is-maq-full .ufp-stage__divider {
  opacity: 0.35;
}

.ufp-stage__handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #c9a97c;
  color: #141510;
  font-weight: 700;
  font-size: 16px;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
}

.ufp-stage__badge {
  position: absolute;
  top: 14px;
  z-index: 5;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(14, 15, 12, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #f7f3eb;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  pointer-events: none;
  backdrop-filter: blur(8px);
}

.ufp-stage__badge--left { left: 14px; }
.ufp-stage__badge--right {
  right: 14px;
  border-color: rgba(201, 169, 124, 0.55);
  color: #dfc39b;
}

.ufp-stage__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
  z-index: 6;
  margin: 0;
}

.ufp-timeline-bar {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
}

.fp-explication {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.fp-exp-box {
  padding: 14px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.fp-exp-box--after {
  border-color: var(--line-strong);
}

.fp-exp-box strong {
  display: block;
  font-size: 12.5px;
  color: var(--accent);
  margin-bottom: 6px;
}

.fp-exp-box p {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-dim);
}

/* Finale Navigation Bar */

.finale-nav-bar {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.finale-nav-bar__right {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ==========================================================================
   FULL-SCREEN ZOOMABLE HD PHOTO LIGHTBOX (#photo-lightbox)
   Click any photo to view full uncropped HD, zoom 1x..3x, pan, and close via ✕
   ========================================================================== */

.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 240;
  background: rgba(7, 8, 10, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #f7f3eb;
  user-select: none;
  animation: lightboxFadeIn 0.2s ease-out;
}

.photo-lightbox[hidden] {
  display: none !important;
}

@keyframes lightboxFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.photo-lightbox__topbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: clamp(12px, 1.8vw, 20px) clamp(14px, 2.4vw, 28px);
  background: linear-gradient(180deg, rgba(8, 10, 12, 0.92) 0%, rgba(8, 10, 12, 0) 100%);
}

.photo-lightbox__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.photo-lightbox__counter {
  flex: none;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(201, 169, 124, 0.18);
  border: 1px solid rgba(201, 169, 124, 0.55);
  color: #dfc39b;
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.photo-lightbox__titles {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.photo-lightbox__title {
  font-size: clamp(14px, 1.15vw, 17px);
  font-weight: 500;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photo-lightbox__sub {
  font-size: 12px;
  color: rgba(247, 243, 235, 0.74);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photo-lightbox__actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.photo-lightbox__zoom-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.photo-lightbox__btn {
  min-width: 34px;
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: #f7f3eb;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.photo-lightbox__btn:hover {
  background: rgba(201, 169, 124, 0.3);
  color: #ffffff;
}

.photo-lightbox__btn--scale {
  min-width: 54px;
  font-size: 11.5px;
  color: #dfc39b;
}

.photo-lightbox__close {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(201, 169, 124, 0.65);
  background: #c9a97c;
  color: #141510;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  transition: transform 0.2s, background 0.2s;
}

.photo-lightbox__close:hover {
  background: #ffffff;
  transform: scale(1.06);
}

.photo-lightbox__stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 6px clamp(12px, 4vw, 64px);
}

.photo-lightbox__canvas-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: zoom-in;
  touch-action: none;
}

.photo-lightbox.is-zoomed .photo-lightbox__canvas-wrap {
  cursor: grab;
}

.photo-lightbox.is-dragging .photo-lightbox__canvas-wrap {
  cursor: grabbing;
}

.photo-lightbox__img,
.photo-lightbox__video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65);
  transform-origin: center center;
  transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.photo-lightbox__img[hidden],
.photo-lightbox__video[hidden] {
  display: none !important;
}

.photo-lightbox.is-dragging .photo-lightbox__img,
.photo-lightbox.is-dragging .photo-lightbox__video {
  transition: none;
}

.photo-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(14, 15, 12, 0.82);
  color: #f7f3eb;
  font-size: 18px;
  cursor: pointer;
  display: grid;
  place-items: center;
  backdrop-filter: blur(10px);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.photo-lightbox__nav:hover {
  background: #c9a97c;
  color: #141510;
  border-color: #c9a97c;
}

.photo-lightbox__nav--prev { left: clamp(10px, 1.8vw, 24px); }
.photo-lightbox__nav--next { right: clamp(10px, 1.8vw, 24px); }

.photo-lightbox__hint {
  position: relative;
  z-index: 5;
  text-align: center;
  padding: 10px 16px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(247, 243, 235, 0.72);
  background: linear-gradient(0deg, rgba(8, 10, 12, 0.9) 0%, rgba(8, 10, 12, 0) 100%);
}

/* ---------- Responsive ---------- */

@media (max-width: 1040px) {
  .finale-story,
  .finale-floorplan__head,
  .gallery-editorial-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile Landscape Cinema Mode (when phone is rotated horizontally) */
@media (max-height: 540px) and (orientation: landscape) {
  .island-nav {
    top: 8px;
  }
  .island-nav__pill {
    min-height: 30px;
    padding: 2px 5px;
  }
  .island-nav__back,
  .island-nav__toggle {
    height: 24px;
    font-size: 11px;
  }
  .island-mode-btn {
    height: 20px;
    padding: 0 7px;
    font-size: 10px;
  }
  .beat,
  .beat--caption {
    left: 14px;
    bottom: 14px;
    max-width: min(350px, 52vw);
    padding: 8px 12px;
    border-radius: 12px;
  }
  .tour__controls {
    right: 14px;
    bottom: 14px;
    padding: 4px 6px;
  }
  .tour-ctrl-btn {
    height: 28px;
    padding: 0 9px;
    font-size: 11px;
  }
  .beat__kicker {
    font-size: 9.5px;
    margin-bottom: 3px;
  }
  .beat__title {
    font-size: 13.5px;
  }
  .beat__sub {
    font-size: 11.5px;
    margin-top: 3px;
  }
}

/* Mobile Portrait Mode */
@media (max-aspect-ratio: 9/10), (max-width: 700px) {
  .tour {
    --tour-pad: 12px;
    height: 1550svh;
  }
  .island-nav {
    max-width: calc(100vw - 20px);
  }
  .island-nav--landing {
    top: 10px;
  }
  .island-nav--landing .island-nav__pill {
    gap: 4px;
    padding: 3px 5px;
    min-height: 34px;
    max-width: calc(100vw - 24px);
  }
  .island-nav--landing .island-nav__owner-name {
    display: none;
  }
  .island-nav--landing .island-nav__back {
    height: 26px;
    padding: 0 9px;
    font-size: 11px;
  }
  .island-nav--landing .theme-switch-btn {
    height: 25px;
    padding: 0 8px;
    font-size: 10.5px;
    gap: 5px;
  }
  .island-nav--landing .island-nav__toggle {
    height: 26px;
    padding: 0 7px 0 6px;
    font-size: 11px;
    gap: 5px;
  }
  .island-nav--project {
    top: 8px;
  }
  .island-nav--project .island-nav__pill {
    gap: 3px;
    padding: 3px 5px;
    min-height: 34px;
    max-width: calc(100vw - 20px);
  }
  .island-nav--project .island-nav__current {
    display: none;
  }
  .island-nav--project .island-nav__toggle {
    padding: 0 4px;
    gap: 4px;
  }
  .island-nav__back {
    height: 26px;
    padding: 0 8px;
    font-size: 11px;
  }
  .island-mode-btn {
    height: 22px;
    padding: 0 7px;
    font-size: 10.5px;
  }
  .island-nav--project .theme-switch-btn {
    height: 24px;
    padding: 0 7px;
    font-size: 10.5px;
    gap: 4px;
  }
  .island-nav--project .theme-switch-btn [data-theme-label] {
    display: none !important;
  }
  .project-gallery {
    padding-top: 62px;
  }
  .gallery-viewer__living-badge {
    top: 10px;
    left: 10px;
    padding: 4px 9px;
    font-size: 9.5px;
    max-width: 66%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .gallery-viewer__counter {
    top: 10px;
    right: 10px;
    padding: 4px 9px;
    font-size: 10px;
  }
  .gallery-viewer__zoom-btn {
    bottom: 10px;
    right: 10px;
    height: 30px;
    padding: 0 10px;
    font-size: 11px;
  }
  .project-gallery__container {
    padding: 18px 14px;
  }
  .gallery-viewer__stage {
    height: auto;
    min-height: 230px;
    max-height: 70svh;
  }
  .gallery-viewer__img,
  .gallery-viewer__video {
    width: 100%;
    height: auto;
    max-height: 68svh;
    object-fit: contain;
  }
  .gallery-viewer__nav {
    width: 36px;
    height: 36px;
    font-size: 15px;
  }
  .ufp-stage__badge {
    top: 8px;
    padding: 4px 8px;
    font-size: 9px;
    letter-spacing: 0.04em;
    max-width: 45%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .ufp-stage__badge--left { left: 8px; }
  .ufp-stage__badge--right { right: 8px; }
  .ufp-stage__handle {
    width: 34px;
    height: 34px;
    font-size: 13px;
  }
  .tour__controls {
    left: 12px;
    right: 12px;
    bottom: 18px;
    justify-content: space-between;
    padding: 4px 6px;
  }
  .tour-ctrl-btn {
    height: 29px;
    padding: 0 9px;
    font-size: 11px;
  }
  .beat--cta-only {
    left: 12px;
    right: auto;
    bottom: 62px;
  }
  .beat,
  .beat--caption {
    left: 12px;
    right: 12px;
    bottom: 18px;
    max-width: none;
    padding: 9px 13px;
  }
  .beat__title {
    font-size: 14px;
  }
  .beat__sub {
    font-size: 11.5px;
  }
  .photo-lightbox__topbar {
    padding: 10px 12px;
  }
  .photo-lightbox__sub {
    display: none;
  }
  .photo-lightbox__close {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  .photo-lightbox__nav {
    width: 38px;
    height: 38px;
    font-size: 16px;
  }
  .fp-explication {
    grid-template-columns: 1fr;
  }
  .ufp-phase {
    height: 32px;
    padding: 0 10px;
    font-size: 11px;
  }
}
