/* The camera and floor share a frame, so changing the finish cannot move the furniture. */
#studio {
  --edge: clamp(28px, 5.2vw, 104px);
  --intro-opacity: 1;
  --intro-shift: 0px;
  --room-scale: 1;
  --room-progress: 0;
  --shade-opacity: 1;
  --panel-shift: 118px;
  --panel-opacity: 0;
  position: relative;
  min-height: 215svh;
  color: #273125;
  background: #312d26;
}
.studio-stage {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: clip;
  isolation: isolate;
}
.camera-dock, .scene, .room-camera, .room-camera img, .scene-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.dock-marker { display: none; }
.scene { overflow: hidden; background: #6a6458; }
.room-camera {
  transform: scale(var(--room-scale));
  transform-origin: 49% 68%;
}
.room-camera img { display: block; object-fit: cover; object-position: 50% 68%; }
.room-frame { position: absolute; inset: 0; pointer-events: none; }
.room-frame img[hidden] { display: none; }
.hero-photo { opacity: calc(1 - var(--room-progress)); pointer-events: none; }
.scene-shade {
  pointer-events: none;
  opacity: var(--shade-opacity);
  background: linear-gradient(90deg, rgba(15,21,18,.79) 0%, rgba(20,24,19,.61) 27%, rgba(20,23,18,.20) 57%, transparent 81%),
              linear-gradient(0deg, rgba(16,20,16,.30), transparent 32%);
}
.nav {
  position: absolute;
  top: 0;
  width: 100%;
  z-index: 5;
  color: white;
  background: linear-gradient(to bottom, rgba(18,22,19,.82), rgba(18,22,19,.69));
}
.nav::after {
  content: "";
  position: absolute;
  inset: 100% 0 auto;
  height: 24px;
  background: linear-gradient(to bottom, rgba(18,22,19,.69), transparent);
  pointer-events: none;
}
.nav .navrow {
  width: calc(100% - 2 * clamp(28px, 5.2vw, 104px));
  max-width: none;
  height: 84px;
  border-bottom: 1px solid rgba(255,255,255,.36);
}
.nav .brand img { width: 39px; height: 39px; }
.nav .brand { font-size: 34px; }
.nav .quote-nav {
  gap: 12px;
  min-height: 42px;
  padding: 7px 13px 7px 17px;
  color: white;
  background: rgba(27,32,25,.44);
  border: 1px solid rgba(255,255,255,.7);
  white-space: nowrap;
}
.quote-nav [data-quote-count] {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding-inline: 5px;
  border-radius: 50%;
  background: #f3f1e8;
  color: #30382c;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.intro-copy {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: flex;
  align-items: end;
  padding: 94px var(--edge) clamp(64px, 13svh, 150px);
  color: #fffdf7;
  opacity: var(--intro-opacity);
  transform: translateY(var(--intro-shift));
  pointer-events: none;
}
.intro-copy a { pointer-events: auto; }
.intro-copy .location-line {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 0 0 clamp(15px, 2.3vh, 26px);
  color: inherit;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .19em;
  text-transform: uppercase;
}
.location-line::before { content: ""; width: 34px; height: 1px; background: currentColor; }
#studio-heading {
  margin: 0 0 clamp(18px, 2.6vh, 34px);
  font: 400 clamp(82px, min(8.2vw, 14svh), 152px)/.88 Georgia, "Times New Roman", serif;
  letter-spacing: -.025em;
}
.intro-description {
  max-width: 38ch;
  margin: 0;
  color: #f5f3ed;
  font-size: clamp(17px, 1.35vw, 23px);
  line-height: 1.52;
}
.studio-enter {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 10px 22px 10px 18px;
  margin-top: clamp(22px, 3.7svh, 41px);
  border: 1px solid #faf6e8;
  border-radius: 100px;
  background: #f6f2e7;
  color: #30362c;
  font-size: 15px;
  font-weight: 550;
  line-height: 1.2;
  transition: background-color 180ms ease, transform 180ms ease;
}
.studio-enter:hover { text-decoration: none; }
.studio-enter:focus-visible { outline: 2px solid white; outline-offset: 5px; }
.sample-stack { position: relative; width: 24px; height: 24px; flex: none; }
.sample-stack i {
  position: absolute;
  top: 5px;
  left: 4px;
  width: 16px;
  height: 12px;
  border: 1.4px solid currentColor;
  border-radius: 1.5px;
  background: #f6f2e7;
  transform: translateY(var(--rise)) rotate(-28deg) skewX(26deg) scaleY(.76);
  transition: transform 220ms ease, background-color 180ms ease;
}
.sample-stack i:nth-child(1) { --rise: 6px; }
.sample-stack i:nth-child(2) { --rise: 3px; }
.sample-stack i:nth-child(3) { --rise: 0px; }
@media (hover: hover) and (pointer: fine) {
  .studio-enter:hover { transform: translateY(-2px); }
  .studio-enter:hover, .studio-enter:hover .sample-stack i { background-color: #fffdf6; }
  .studio-enter:hover i:first-child { --rise: 8px; }
  .studio-enter:hover i:last-child { --rise: -2px; }
}
.studio-enter:active { transform: scale(.98); }
@media (prefers-reduced-motion: reduce) {
  .studio-enter:hover, .studio-enter:active { transform: none; }
  .studio-enter:hover i:first-child { --rise: 6px; }
  .studio-enter:hover i:last-child { --rise: 0px; }
}
.scene-key {
  position: absolute;
  left: var(--edge);
  bottom: clamp(22px, 5vh, 66px);
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
  opacity: var(--panel-opacity);
  pointer-events: none;
}
.scene-key::before {
  content: "";
  position: absolute;
  inset: -12px -21px -12px -12px;
  border-radius: 80px;
  background: rgba(28,33,26,.80);
}
#texture-detail {
  position: relative;
  width: clamp(52px, 5vw, 78px);
  height: auto;
  aspect-ratio: 1;
  border: 2px solid #fffdf3;
  border-radius: 50%;
  object-fit: cover;
}
.scene-tag { position: relative; display: grid; line-height: 1.2; }
.scene-tag span { font-size: 12px; color: #e4e5d9; }
.scene-tag strong { font-weight: 500; font-size: clamp(16px, 1.3vw, 21px); }
.finish-panel {
  position: absolute;
  right: clamp(20px, 3.2vw, 70px);
  top: 50%;
  width: clamp(350px, 30vw, 440px);
  max-height: calc(100svh - 52px);
  overflow: auto;
  padding: clamp(19px, 1.9vw, 32px);
  background: #faf8ef;
  color: #2b3228;
  border: 1px solid #f8f5eb;
  border-radius: 5px;
  box-shadow: 0 6px 42px #191b1833;
  opacity: var(--panel-opacity);
  transform: translate(var(--panel-shift), -50%);
  scrollbar-width: thin;
  scrollbar-color: #aaad9c transparent;
}
.finish-panel:focus-visible { outline: 2px solid #855d36; outline-offset: -3px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel-head h2 { margin: 0; font: 400 clamp(27px, 2.65vw, 38px)/1.08 Georgia, serif; letter-spacing: -.055em; }
.by-type, .textlink, .catalog-shortcuts a { display: inline-flex; align-items: center; gap: 5px; min-height: 40px; font-size: 14px; text-decoration: underline; text-underline-offset: 4px; }
.by-type { font-size: 13px; white-space: nowrap; }
.room-switch { display: flex; border-bottom: 1px solid #c6c9b9; margin-top: 12px; }
.room-switch button {
  position: relative;
  border: 0;
  flex: 1;
  padding: 7px 4px;
  min-height: 44px;
  background: transparent;
  color: #5b6254;
  font-size: 15px;
}
.room-switch button[aria-pressed="true"] { color: #23331e; font-weight: 600; }
.room-switch button[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  bottom: -1px;
  inset-inline: 0;
  height: 2px;
  background: currentColor;
}
.wall-tone { margin: 8px 0 16px; font-size: 13px; color: #5b6255; }
.swatches-heading { margin: 0 0 8px; font: 500 16px/1.3 'Funnel Sans',sans-serif; }
#studio-finishes { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
.finish-choice {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 4px;
  border: 1px solid transparent;
  background: none;
  color: inherit;
  border-radius: 3px;
  text-align: left;
  line-height: 1.16;
}
.finish-choice img { display: block; width: 100%; height: clamp(32px, 4.9svh, 53px); object-fit: cover; border-radius: 1px; }
.finish-choice strong { margin: 6px 0 2px; font-size: 13px; font-weight: 550; }
.finish-choice small { font-size: 11px; color: #565c50; }
.finish-choice[aria-pressed="true"] { border-color: #40523a; box-shadow: inset 0 0 0 1px #40523a; }
#finish-details { border-top: 1px solid #c6c9b9; margin: 14px 0 6px; }
#finish-details summary { padding-block: 9px; cursor: pointer; font-size: 14px; min-height: 40px; }
#finish-details h4 { margin: 4px 0; font-size: 18px; }
#finish-details p { margin: 4px 0; font-size: 14px; }
.specs { display: grid; grid-template-columns: 1fr 1fr; margin: 10px 0 15px; }
.specs dt { border: 0; padding: 0; color: #4f584a; }
.specs dd { margin: 2px 0; font-size: 14px; }
.finish-actions .button { width: 100%; padding: 10px 14px; min-height: 43px; font-size: 15px; }
.finish-actions .textlink { font-size: 13px; min-height: 36px; }
.studio-note { font-size: 11px; margin: 3px 0 0; color: #596151; }
#studio-status:not(.sr-only) { display: block; margin-top: 8px; font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Stacked fallback: a still introduction followed by the room and its controls. */
@media (prefers-reduced-motion: reduce), (max-height: 580px) {
  #studio { min-height: 0; --panel-opacity: 1; --panel-shift: 0px; }
  .studio-stage {
    position: relative;
    height: auto;
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(315px,38%);
    background: #faf8ef;
  }
  .intro-copy {
    position: relative;
    inset: auto;
    grid-column: 1/-1;
    grid-row: 1;
    min-height: 100svh;
    padding-block: 115px 38px;
    background: linear-gradient(90deg,rgba(17,22,18,.82),rgba(17,22,18,.45) 48%,transparent 84%),url(media/studio/living-hero.webp) center 68%/cover;
  }
  .camera-dock { position: relative; grid-column: 1; grid-row: 2; }
  .hero-photo, .scene-shade { visibility: hidden; }
  .finish-panel { position: relative; inset: auto; grid-column: 2; grid-row: 2; width: auto; max-height: none; overflow: visible; transform: none; box-shadow: none; border: 0; border-radius: 0; }
}

/* The full-height picture scrolls up naturally. Its bottom edge stops at the
   preview height. Both camera frames keep fixed dimensions throughout the gesture. */
@media (max-width: 760px) and (min-height: 480.01px) {
  #studio {
    --edge: var(--page-gutter);
    --dock: clamp(150px,31svh,270px);
    min-height: 0;
  }
  .studio-stage { position: relative; display: block; height: auto; overflow: clip; background: #faf8ef; }
  .camera-dock {
    position: sticky;
    z-index: 2;
    inset: auto;
    top: calc(var(--dock) - 100svh);
    height: 100svh;
  }
  .scene {
    height: 100%;
    background: #6a6458 url(media/studio/mobile/living-hero.webp) 50% 64% / cover no-repeat;
  }
  .dock-marker {
    display: block;
    position: absolute;
    top: calc(100svh - var(--dock) - 3px);
    width: 1px;
    height: 1px;
    pointer-events: none;
  }
  .room-camera { transform: none; }
  .room-frame { top: auto; height: var(--dock); }
  .room-frame img { object-position: 50% 64%; }
  .hero-photo, .scene-shade { visibility: visible; opacity: 1; transition: opacity 240ms ease-out; }
  .room-camera .hero-photo { object-position: 50% 64%; }
  .scene-shade { background: linear-gradient(90deg,rgba(16,21,17,.43),rgba(16,21,17,.05)),linear-gradient(0deg,rgba(14,20,16,.76),rgba(16,21,17,.29) 62%,rgba(16,21,17,.05)); }
  #studio[data-studio-phase="preview"] :is(.scene-shade,.intro-inner),
  #studio[data-docked="true"] .hero-photo { opacity: 0; }
  .intro-copy {
    position: absolute;
    top: 0;
    bottom: auto;
    min-height: 0;
    height: 100svh;
    padding: 94px var(--edge) clamp(48px,9svh,88px);
    background: transparent;
    transform: none;
    z-index: 3;
  }
  .intro-inner { transition: opacity 210ms ease-out; }
  #studio-heading { font-size: clamp(74px,15.8vw,106px); }
  .intro-description { font-size: clamp(16px,3.8vw,20px); }
  .studio-enter { margin-top: 22px; }
  .scene-key { left: 18px; bottom: 15px; gap: 8px; opacity: 0; transition: opacity 240ms ease-out; }
  #studio[data-docked="true"] .scene-key { opacity: 1; }
  .scene-key::before { inset: -5px -12px -5px -5px; }
  #texture-detail { width: 36px; }
  .scene-tag span { font-size: 10px; }
  .scene-tag strong { font-size: 13px; }
  .finish-panel {
    position: relative;
    inset: auto;
    width: 100%;
    max-height: none;
    padding: 22px var(--edge) 26px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    opacity: 1;
    transform: none;
    scroll-margin-top: var(--dock);
  }
  .finish-choice img { height: clamp(32px,6svh,50px); }
  .finish-panel :is(a, button, summary) { scroll-margin-top: calc(var(--dock) + 8px); }
}
@media (max-height: 580px) {
  #studio-heading { font-size: clamp(54px,13vh,78px); }
  .intro-copy .location-line { margin-bottom: 8px; }
  .intro-copy .intro-description { font-size: 16px; }
  .studio-enter { margin-top: 12px; }
  .nav .navrow { height: 62px; }
}
@media (min-width: 761px) and (max-height: 580px) {
  .camera-dock { position: sticky; top: 0; align-self: start; height: 100svh; }
}
@media (max-width: 760px) {
  .nav .navrow {
    display: grid;
    grid-template-columns: 1fr auto;
    width: calc(100% - 36px);
    height: auto;
    padding-top: 10px;
    gap: 0;
  }
  .nav .brand { font-size: 29px; }
  .nav .brand img { width: 32px; height: 32px; }
  .navrow > .button { grid-area: 1/2; justify-self: end; font-size: 13px; min-height: 38px; }
  .navrow nav { grid-column: 1/-1; display: flex; width: 100%; justify-content: space-between; margin: 0; gap: 8px; }
  .navrow nav a { font-size: 13px; min-height: 39px; }
}
@media (max-width: 760px) and (max-height: 480px) {
  .studio-stage { display: flex; flex-direction: column; }
  .intro-copy { order: 0; padding: 105px 22px 24px; }
  .camera-dock { order: 1; position: sticky; top: 0; z-index: 2; height: 34svh; }
  .finish-panel { order: 2; padding: 20px; scroll-margin-top: 34svh; }
  .scene-key { left: 12px; bottom: 8px; gap: 6px; }
  .scene-key::before { inset: -3px -9px -3px -3px; }
  #texture-detail { width: 30px; }
}
@media (min-width: 761px) and (max-width: 940px) {
  .nav .navrow { gap: 18px; }
  .navrow nav { gap: 14px; }
}
