/* Homepage: the photograph is the furniture. Scroll opens the doors. */
.cabinet-home { overflow-x: hidden; background: #030201; }
.scroll-track { height: 320vh; }
html:has(body.cabinet-home),
body.cabinet-home {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
html:has(body.cabinet-home)::-webkit-scrollbar,
body.cabinet-home::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* Two rows: the radio spans the whole viewport width and is the one thing
   that resizes with the window; the cabinet sits under it and fits the
   remaining height. */
.room {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  justify-items: center;
  align-items: start;
  perspective: 1600px;
  --p: 0;
  --doors: 0;
  --zoom: 0;
  /* Live radio height (full photo → compact bar as the doors open); the
     furniture below sizes itself to the height the radio gives back. Mirrors
     the --radio-h the header computes for itself in site.css. */
  --bar-h: clamp(64px, 6.667vw, 18.75vw);
  --radio-h: calc(var(--bar-h) + (1 - var(--doors)) * (18.75vw - var(--bar-h)));
  background:
    radial-gradient(42% 28% at 50% 14%, rgba(120, 72, 24, 0.28), transparent 70%),
    radial-gradient(80% 70% at 50% 60%, #140c08 0%, #030201 72%);
}

.furniture {
  position: relative;
  grid-row: 2;
  /* Cabinet + plinth: the furniture photo minus the 192px radio (682 - 192).
     --radio-h is the radio's live height (18.75vw closed, the compact bar
     once open); 1.06 is the max scroll zoom so the plinth never leaves the
     viewport. */
  width: min(96vw, calc((100vh - var(--radio-h) - 16px) / 1.06 * 1024 / 490), 1640px);
  aspect-ratio: 1024 / 490;
  height: auto;
  max-width: 96vw;
  transform-style: preserve-3d;
  transform-origin: center top;
  transform: translateZ(calc(var(--zoom) * 32px)) scale(calc(1 + var(--zoom) * 0.06));
  filter: drop-shadow(0 28px 48px rgba(0, 0, 0, 0.72));
}

.cabinet-home .photo-radio {
  position: relative;
  grid-row: 1;
  justify-self: stretch;
  width: 100%;
  z-index: 7;
  height: var(--radio-h);
  min-height: 0;
  padding: 0;
  background-color: transparent;
  background-image: url('/assets/radio-face.jpg');
  background-size: 100% auto;
  background-position: 0 calc(-1 * var(--cy, 0px));
  background-repeat: no-repeat;
}
.cabinet-home .photo-radio .radio-face { z-index: 1; pointer-events: none; }
.cabinet-home .photo-radio .radio-home,
.cabinet-home .photo-radio .radio-sign,
.cabinet-home .photo-radio .menu-button { z-index: 3; }

.cabinet {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 87.76%;
  transform-style: preserve-3d;
  background: linear-gradient(180deg, #2a1a10, #120c08);
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.55);
}

/* Soft wood plug over the door join — no bright amber leak, no hard black bar. */
.seam-mask {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  z-index: 5;
  width: 8px;
  transform: translateX(-50%);
  background:
    linear-gradient(90deg, transparent, rgba(18, 12, 8, 0.55) 35%, rgba(18, 12, 8, 0.55) 65%, transparent),
    linear-gradient(180deg, #1a120c, #120e0a 50%, #100c08);
  opacity: calc(1 - var(--doors, 0));
  pointer-events: none;
  mix-blend-mode: multiply;
}

.doors {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  transform-style: preserve-3d;
  z-index: 3;
  column-gap: 0;
}
.door {
  height: 100%;
  padding: 0;
  border: 0;
  background-color: #140c08;
  background-size: calc(100% + 12px) 100%;
  background-repeat: no-repeat;
  will-change: transform;
}
.door-left {
  background-image: url('/assets/door-left.jpg');
  background-position: left center;
  transform-origin: left center;
  transform: rotateY(calc(var(--doors) * -88deg));
}
.door-right {
  background-image: url('/assets/door-right.jpg');
  background-position: right center;
  transform-origin: right center;
  transform: rotateY(calc(var(--doors) * 88deg));
}
.interior {
  position: absolute;
  inset: 3.5% 8.5% 5.5% 4.8%;
  transform-style: preserve-3d;
  overflow: hidden;
  background: linear-gradient(180deg, #1a110c, #0c0806);
}
.chamber {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.65fr);
  align-items: center;
  gap: 28px;
  padding: 20px 36px 20px 28px;
  transform-style: preserve-3d;
  opacity: 0;
  pointer-events: none;
}
.chamber.is-here { opacity: 1; pointer-events: auto; }
.chamber-copy { display: grid; gap: 12px; }
.chamber-kicker { font-size: 12px; color: var(--marketing-muted); }
.chamber h2 { max-width: 18ch; letter-spacing: -0.02em; }
.chamber p { max-width: 40ch; color: var(--marketing-muted); font-size: 16px; }
.chamber-shot {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--marketing-border);
  border-radius: var(--rounded-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65);
  max-height: 90%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0C0907;
}
.chamber-shot img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 52vh;
  object-fit: contain;
  border-radius: var(--rounded-sm);
}
.facts { display: flex; flex-wrap: wrap; gap: 16px; font-size: 14px; color: var(--marketing-text); }
.price-line { font-size: 14px; color: var(--marketing-muted); }
.price-line a { color: var(--marketing-accent); }

.cabinet-home .depth-dial {
  /* Sit on the cabinet stile where the closed photo dial lives. */
  position: absolute;
  top: 1.5%;
  bottom: 4.5%;
  right: 1.8%;
  z-index: 6;
  width: 6.2%;
  min-width: 46px;
  max-width: 68px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  background: url('/assets/depth-dial.png') center / 100% 100% no-repeat;
  cursor: url('/assets/cursor-hand.png') 14 10, url('/assets/cursor-hand.svg') 13 3, pointer;
  filter: none;
}
.cabinet-home .depth-dial.is-on { opacity: 1; pointer-events: auto; }
.cabinet-home .depth-ticks,
.cabinet-home .depth-track,
.cabinet-home .depth-marks {
  display: none !important;
}
.cabinet-home .depth-needle {
  position: absolute;
  left: 12%;
  width: 28%;
  height: 2px;
  transform: translateY(-50%);
  top: calc(10.7% + var(--section-p, var(--p, 0)) * 82.9%);
  background: var(--marketing-accent);
  box-shadow: var(--shadow-filament);
  border-radius: 1px;
  pointer-events: none;
}

/* In-cabinet section visibility */
.chamber[data-section] { display: none; }
.interior[data-active-section="product"] .chamber[data-section="product"],
.interior[data-active-section="developers"] .chamber[data-section="developers"],
.interior[data-active-section="agents"] .chamber[data-section="agents"],
.interior[data-active-section="pricing"] .chamber[data-section="pricing"] {
  display: flex;
}

.code-block-mini {
  background: #0A0806;
  border: 1px solid rgba(232, 176, 90, 0.28);
  border-radius: var(--rounded-sm);
  padding: 10px 14px;
  font-family: var(--font-code);
  font-size: 12px;
  color: #FFF2D6;
  overflow-x: auto;
  max-width: 100%;
}
.code-block-mini pre { margin: 0; }
.code-block-mini code { font-family: inherit; font-size: inherit; color: inherit; }

.pricing-mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
}
.price-mini-card {
  background: rgba(22, 17, 12, 0.9);
  border: 1px solid rgba(232, 176, 90, 0.22);
  border-radius: var(--rounded-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.price-mini-card.pro {
  border-color: rgba(232, 176, 90, 0.6);
  background: rgba(30, 22, 14, 0.95);
}
.price-mini-card strong {
  font-size: 15px;
  color: #FFF2D6;
}
.price-mini-card p {
  font-size: 12px;
  color: var(--marketing-muted);
  margin: 0;
}

.cabinet-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1.95%;
  padding: 0 4%;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 8.35%;
  font-size: 12px;
  color: var(--marketing-muted);
}
.cabinet-foot .brand {
  font-family: var(--font-marketing);
  font-size: 16px;
  font-weight: 600;
  color: var(--marketing-text);
}
.cabinet-foot .brand sup { font-size: 10px; }
.cabinet-foot nav { margin-left: auto; display: flex; flex-wrap: wrap; gap: 16px; }
.cabinet-foot nav a { min-height: 32px; display: inline-flex; align-items: center; }
.cabinet-foot nav a:hover { color: var(--marketing-accent); }

@media (max-width: 860px) {
  html.cabinet-scroll { scrollbar-width: auto; }
  .scroll-track { height: auto; }
  .room {
    position: static;
    display: block;
    perspective: none;
    min-height: auto;
    background: #0C0907;
    padding-bottom: 32px;
  }
  .furniture {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: auto;
    transform: none;
    filter: none;
  }
  .cabinet-home .photo-radio {
    position: sticky;
    top: 0;
    width: 100%;
    height: var(--radio-h);
    background-color: #140C08;
    background-size: 100% auto;
    border-bottom: 1px solid rgba(232, 176, 90, 0.3);
    z-index: 10;
  }
  .cabinet {
    position: static;
    top: auto;
    height: auto;
    background: transparent;
    box-shadow: none;
  }
  .doors, .seam-mask { display: none; }
  .interior {
    position: static;
    inset: auto;
    overflow: visible;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 16px 12px;
    background: transparent;
  }
  .chamber {
    position: static;
    display: flex;
    flex-direction: column;
    gap: 16px;
    opacity: 1;
    pointer-events: auto;
    transform: none !important;
    min-height: auto;
    padding: 24px 18px;
    background: #16110C;
    border: 1px solid rgba(232, 176, 90, 0.22);
    border-radius: var(--rounded-lg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  }
  .chamber h2 { max-width: none; font-size: 24px; }
  .chamber p { max-width: none; font-size: 14px; }
  .chamber-shot {
    width: 100%;
    max-height: none;
    margin-top: 8px;
  }
  .chamber-shot img {
    max-height: none;
    width: 100%;
    height: auto;
  }
  .cabinet-home .depth-dial { display: none; }
  .pricing-mini-grid { grid-template-columns: 1fr; }
  .cabinet-foot {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    padding: 24px 16px;
    margin-top: 24px;
    border-top: 1px solid rgba(232, 176, 90, 0.2);
  }
}

@media (prefers-reduced-motion: reduce) {
  html.cabinet-scroll { scrollbar-width: auto; }
  .scroll-track { height: auto; }
  .room { position: static; display: block; perspective: none; }
  .furniture { transform: none; width: min(1080px, 94vw); margin: 24px auto; }
  .cabinet-home .photo-radio { position: sticky; top: 0; width: 100%; height: var(--radio-h); }
  .cabinet { position: relative; top: auto; height: auto; }
  .door-left { transform: rotateY(-80deg); }
  .door-right { transform: rotateY(80deg); }
  .interior { position: relative; inset: auto; }
  .chamber { position: relative; opacity: 1; pointer-events: auto; transform: none !important; min-height: 60dvh; }
}
