/* NASHORN room focus story. One room image, one shared scroll state. */

.room-focus {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #dfe3df;
}

.room-focus__sticky {
  position: relative;
  min-height: clamp(680px, 78vw, 920px);
  overflow: hidden;
}

.room-focus__camera {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.room-focus__camera img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.room-focus__shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(242, 244, 241, 0.92) 0%, rgba(242, 244, 241, 0.58) 24%, transparent 54%);
}

.room-focus__overlay {
  position: relative;
  z-index: 3;
  min-height: inherit;
  pointer-events: none;
}

.room-focus__intro {
  position: absolute;
  top: clamp(72px, 9vw, 128px);
  left: 0;
  max-width: 34rem;
}

.room-focus__intro .h2 {
  max-width: 12ch;
  margin: 0;
  color: var(--navy-900);
}

.room-focus__intro > p:last-child {
  max-width: 49ch;
  margin: 22px 0 0;
  color: var(--text-soft);
  line-height: 1.65;
}

.room-focus__states,
.room-focus__state {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.room-focus__state {
  opacity: 0;
  visibility: hidden;
}

.room-focus__label {
  position: absolute;
  z-index: 2;
  top: calc(var(--header-h-compact) + clamp(34px, 5vh, 64px));
  left: 0;
  display: grid;
  justify-items: start;
  width: min(720px, 56vw);
  color: var(--text-dark);
}

.room-focus__label span {
  font-family: var(--font-display);
  font-size: var(--fs-h2-md);
  font-weight: var(--display-weight, 500);
  color: var(--text-dark);
  letter-spacing: var(--display-tracking, -0.024em);
  line-height: 1.16;
  text-transform: uppercase;
}

.room-focus__label strong {
  margin-top: 14px;
  font-family: var(--font-ui);
  font-size: clamp(0.72rem, 0.85vw, 0.88rem);
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.2;
}

.room-focus__hotspot {
  --hotspot-gap: 26px;
  --hotspot-line: 156px;
  --hotspot-marker: 32px;
  --hotspot-marker-half: 16px;
  position: absolute;
  top: var(--room-hotspot-screen-y, 50%);
  right: auto;
  left: var(--room-hotspot-screen-x, 50%);
  z-index: 3;
  display: grid;
  grid-template-columns: var(--hotspot-marker-half) var(--hotspot-line) var(--hotspot-gap) max-content;
  column-gap: 0;
  align-items: center;
  color: var(--navy-900);
  translate: calc(-1 * var(--hotspot-marker-half)) -50%;
}

.room-focus__anchor {
  position: relative;
  z-index: 1;
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
  display: grid;
  place-items: center;
  width: var(--hotspot-marker);
  height: var(--hotspot-marker);
  border: 0;
  border-radius: 0;
  background: var(--nashorn-blue);
  isolation: isolate;
  translate: 50% 0;
}

.room-focus__anchor::before,
.room-focus__anchor::after {
  content: "";
  position: absolute;
}

.room-focus__anchor::before {
  z-index: 1;
  width: 9px;
  height: 9px;
  background: #fff;
}

.room-focus__anchor::after {
  z-index: -1;
  inset: 0;
  background: var(--nashorn-blue);
  animation: room-focus-marker-pulse 1.8s ease-out infinite;
}

.room-focus__line {
  grid-column: 2;
  grid-row: 1;
  height: 2.5px;
  background: rgba(13, 28, 39, 0.48);
  transform-origin: left center;
}

.room-focus__hotspot-copy,
.room-focus__hotspot p {
  font-family: var(--font-heading);
  font-size: clamp(1.14rem, 1.35vw, 1.36rem);
  font-weight: 600;
  line-height: 1.42;
  color: var(--navy-900);
  letter-spacing: -0.005em;
}

.room-focus__hotspot-copy {
  grid-column: 4;
  grid-row: 1;
  display: grid;
  gap: 0;
  max-width: 360px;
  text-align: left;
}

.room-focus__hotspot p {
  max-width: 38ch;
  margin: 0;
}

.room-focus__state--nightstand .room-focus__label {
  right: 0;
  left: auto;
  justify-items: end;
  text-align: right;
}

.room-focus__state--desk .room-focus__label {
  top: auto;
  bottom: clamp(52px, 7vh, 84px);
}

.room-focus__hotspot--reverse {
  grid-template-columns: max-content var(--hotspot-gap) var(--hotspot-line) var(--hotspot-marker-half);
  translate: calc(-100% + var(--hotspot-marker-half)) -50%;
}

.room-focus__hotspot--reverse .room-focus__anchor {
  grid-column: 4;
  grid-row: 1;
  justify-self: start;
  translate: -50% 0;
}

.room-focus__hotspot--reverse .room-focus__line {
  grid-column: 3;
  grid-row: 1;
  transform-origin: right center;
}

.room-focus__hotspot--reverse .room-focus__hotspot-copy {
  grid-column: 1;
  grid-row: 1;
  text-align: left;
}

.room-focus__hotspot--vertical {
  --hotspot-line: 140px;
  grid-template-columns: max-content;
  grid-template-rows: auto var(--hotspot-gap) var(--hotspot-line) var(--hotspot-marker-half);
  justify-items: start;
  column-gap: 0;
  row-gap: 0;
  text-align: left;
  translate: 0 calc(-100% + var(--hotspot-marker-half));
}

.room-focus__hotspot--vertical .room-focus__anchor {
  grid-column: 1;
  grid-row: 4;
  align-self: start;
  justify-self: start;
  translate: -50% -50%;
}

.room-focus__hotspot--vertical .room-focus__line {
  grid-column: 1;
  grid-row: 3;
  width: 2.5px;
  height: 100%;
  transform-origin: center top;
}

.room-focus__hotspot--vertical .room-focus__hotspot-copy {
  grid-column: 1;
  grid-row: 1;
}

@keyframes room-focus-marker-pulse {
  0% {
    opacity: 0.28;
    transform: scale(1);
  }
  75%,
  100% {
    opacity: 0;
    transform: scale(1.42);
  }
}

@media (min-width: 1200px) and (prefers-reduced-motion: no-preference),
       (min-width: 768px) and (max-width: 1199.98px) and (orientation: landscape) and (min-height: 601px) and (prefers-reduced-motion: no-preference),
       (min-width: 1024px) and (max-width: 1199.98px) and (orientation: portrait) and (prefers-reduced-motion: no-preference) {
  .room-focus.is-cinematic {
    height: 460vh;
    overflow: visible;
  }

  .room-focus.is-cinematic .room-focus__sticky {
    position: sticky;
    top: 0;
    height: 100dvh;
    min-height: 0;
    overflow: clip;
  }

  .room-focus.is-cinematic .room-focus__camera img {
    transform: translate3d(var(--room-x, 0), var(--room-y, 0), 0) scale(var(--room-scale, 1));
    transform-origin: center center;
    will-change: transform;
  }

  .room-focus.is-cinematic .room-focus__overlay {
    height: 100%;
    min-height: 100%;
  }

  .room-focus.is-cinematic .room-focus__intro {
    top: calc(var(--header-h-compact) + clamp(34px, 5vh, 62px));
    opacity: var(--room-intro, 1);
    filter: blur(calc((1 - var(--room-intro, 1)) * 4px));
    transform: translate3d(0, calc((1 - var(--room-intro, 1)) * -14px), 0);
    transition: opacity 160ms linear;
  }

  .room-focus.is-cinematic .room-focus__state {
    visibility: hidden;
    opacity: 1;
  }

  .room-focus.is-cinematic .room-focus__state.is-active {
    visibility: visible;
  }

  .room-focus.is-cinematic .room-focus__label {
    opacity: var(--room-label, 0);
    filter: blur(var(--room-label-blur, 4px));
    transform: translate3d(0, var(--room-label-y, 14px), 0);
  }

  .room-focus.is-cinematic .room-focus__hotspot {
    opacity: var(--room-hotspot, 0);
    transform: translate3d(0, var(--room-hotspot-y, 12px), 0);
  }

  .room-focus.is-cinematic .room-focus__anchor {
    transform: scale(var(--room-hotspot-scale, 0.6));
  }

  .room-focus.is-cinematic .room-focus__line {
    transform: scaleX(var(--room-hotspot, 0));
  }

  .room-focus.is-cinematic .room-focus__hotspot--vertical .room-focus__line {
    transform: scaleY(var(--room-hotspot, 0));
  }

  .room-focus.is-cinematic .room-focus__shade {
    opacity: calc(0.72 + var(--room-intro, 1) * 0.28);
  }
}

@media (max-width: 767.98px),
       (min-width: 768px) and (max-width: 1023.98px) and (orientation: portrait),
       (min-width: 768px) and (max-width: 1199.98px) and (orientation: landscape) and (max-height: 600px) {
  .room-focus__sticky {
    min-height: min(82vh, 820px);
  }

  .room-focus__intro {
    left: var(--gutter);
  }
}

@media (max-width: 767.98px) {
  .room-focus__sticky {
    min-height: 72vh;
  }

  .room-focus__intro {
    top: 54px;
    right: var(--gutter);
    left: var(--gutter);
  }

  .room-focus__intro .h2 {
    font-size: clamp(2rem, 9vw, 3.2rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .room-focus,
  .room-focus.is-cinematic {
    height: auto;
  }

  .room-focus__camera,
  .room-focus__intro,
  .room-focus__state {
    transition: none;
    transform: none;
    filter: none;
  }

  .room-focus__anchor::after {
    animation: none;
  }
}
