/* The photographic frames on the opening reel become scenery behind each cutaway. */
[data-sector="automotive"] {
  --scenic-image: url("/assets/images/journey/scenery/automotive.webp");
  --scenic-outline: ellipse(53% 46% at 57% 47%);
  --scenic-angle: 138deg;
}
[data-sector="residential-landscaping"] {
  --scenic-image: url("/assets/images/journey/scenery/residential-landscaping.webp");
  --scenic-outline: ellipse(60% 51% at 40% 59%);
  --scenic-angle: 31deg;
}
[data-sector="commercial-landscaping"] {
  --scenic-image: url("/assets/images/journey/scenery/commercial-landscaping.webp");
  --scenic-outline: polygon(
    0 20%,
    26% 20%,
    26% 11%,
    62% 11%,
    62% 3%,
    100% 3%,
    100% 78%,
    81% 78%,
    81% 88%,
    45% 88%,
    45% 96%,
    0 96%
  );
  --scenic-angle: 12deg;
}
[data-sector="construction"] {
  --scenic-image: url("/assets/images/journey/scenery/construction.webp");
  --scenic-outline: polygon(10% 28%, 100% 0, 91% 74%, 0% 99%);
  --scenic-angle: 135deg;
}
[data-sector="software"] {
  --scenic-image: url("/assets/images/journey/scenery/software.webp");
  --scenic-outline: polygon(
    0 18%,
    59% 18%,
    59% 7%,
    100% 7%,
    100% 81%,
    86% 81%,
    86% 94%,
    0% 94%
  );
  --scenic-angle: 21deg;
}
[data-sector="rentals"] {
  --scenic-image: url("/assets/images/journey/scenery/rentals.webp");
  --scenic-outline: inset(1% 1% 2% 0 round 47% 47% 0 0);
  --scenic-angle: 159deg;
}
[data-sector="real-estate"] {
  --scenic-image: url("/assets/images/journey/scenery/real-estate.webp");
  --scenic-outline: polygon(
    0 19%,
    41% 19%,
    41% 0,
    100% 0,
    100% 92%,
    78% 92%,
    78% 100%,
    0 100%
  );
  --scenic-angle: 148deg;
}
[data-atlas-view="gallery"] .directory-art.has-scenery .journey-scenery {
  position: absolute;
  z-index: -2;
  inset: 0 -9% 1% -7%;
  background: center / cover no-repeat var(--scenic-image);
  clip-path: var(--scenic-outline);
  -webkit-mask-image: linear-gradient(
    var(--scenic-angle),
    #000 8%,
    #000e 34%,
    #0005 84%,
    transparent
  );
  mask-image: linear-gradient(
    var(--scenic-angle),
    #000 8%,
    #000e 34%,
    #0005 84%,
    transparent
  );
  transform: translate3d(
      calc(var(--subject-x, 0%) * -0.38),
      calc(var(--subject-y, 0%) * -0.34),
      0
    )
    scale(var(--back-scale, 1)) rotate(calc(var(--camera-roll, 0deg) * -0.32));
}
[data-atlas-view="gallery"] .directory-art.has-scenery::before {
  background: radial-gradient(ellipse at center, var(--paper), transparent 65%);
  width: 100%;
  height: 83%;
}
[data-atlas-view="gallery"] .directory-art.has-scenery::after {
  opacity: 0.56;
  outline-offset: 6px;
}
[data-journey="pinned"] .directory-art img {
  transform: perspective(900px)
    translate3d(var(--subject-x, 0%), var(--subject-y, 0%), 0)
    rotateY(var(--camera-bank, 0deg)) rotate(var(--camera-roll, 0deg))
    scale(var(--subject-scale, 1));
}
[data-journey="pinned"] .directory-list {
  --flight-x: calc(var(--flight-base-x, 71%) + var(--flight-dx, 0%));
  --flight-y: calc(var(--flight-base-y, 50%) + var(--flight-dy, 0%));
}
.journey-leg {
  position: absolute;
  left: 50%;
  bottom: calc(max(17px, env(safe-area-inset-bottom)) + 51px);
  transform: translateX(-50%) translateY(calc((1 - var(--pass-light, 0)) * 6px));
  opacity: var(--pass-light, 0);
  display: flex;
  gap: 0.7em;
  width: max-content;
  max-width: calc(100% - 26px);
  align-items: center;
  padding: 7px 12px;
  border-radius: 3px;
  background-color: #21152bf2;
  color: #fff1ec;
  text-align: center;
  font: 500 clamp(10px, 0.86vw, 13px)/1.18 var(--body);
}
.journey-leg span {
  color: #d6bed5;
}
.journey-leg strong {
  font-weight: 650;
}
.journey-leg i {
  display: inline-block;
  flex: 0 0 20px;
  height: 1px;
  background: #ffb98a;
  position: relative;
}
.journey-leg i::after {
  content: "";
  position: absolute;
  right: 0;
  top: -2px;
  width: 5px;
  height: 5px;
  border-top: 1px solid #ffb98a;
  border-right: 1px solid #ffb98a;
  transform: rotate(45deg);
}
@media (max-width: 700px) {
  [data-journey="pinned"] .directory-list {
    --flight-base-x: 50%;
    --flight-base-y: 31.5%;
  }
  [data-atlas-view="gallery"] .directory-art.has-scenery .journey-scenery {
    inset: -1% -9% -3%;
  }
}
@media (max-width: 700px) and (max-height: 735px) {
  [data-journey="pinned"] .directory-list {
    --flight-base-y: 28%;
  }
  .journey-leg {
    bottom: calc(max(10px, env(safe-area-inset-bottom)) + 45px);
  }
}
@media (max-width: 700px) and (max-height: 625px) {
  [data-journey="pinned"] .directory-list {
    --flight-base-y: 26%;
  }
}
/* The final property opens like a glazed facade. The company record is the
   actual page underneath. Two reflections move with its opening edges. */
[data-flight-route][data-connected][data-company-flight="crossing"]
  .directory-sector[data-sector="real-estate"][data-pose="under"] {
  --facade-opening: linear-gradient(
    to right,
    black calc(var(--flight-x) - var(--company-radius) - 1px),
    transparent calc(var(--flight-x) - var(--company-radius)),
    transparent calc(var(--flight-x) + var(--company-radius)),
    black calc(var(--flight-x) + var(--company-radius) + 1px)
  );
  -webkit-mask-image: var(--facade-opening);
  mask-image: var(--facade-opening);
}
.journey-passage[data-passage="elevation"] .pass-fin:nth-child(n + 3) {
  display: none;
}
.journey-passage[data-passage="elevation"] .pass-mechanism {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: var(--pass-light);
}
.journey-passage[data-passage="elevation"] .pass-fin {
  position: absolute;
  top: -10%;
  height: 120%;
  width: clamp(51px, 13vw, 175px);
  background:
    linear-gradient(
      to right,
      transparent 10%,
      #8c445c5f 70%,
      #fbe4c86e 90%,
      #69465a 94%,
      #ffe7b9 96%,
      #aa7568 98%,
      #392739
    ),
    repeating-linear-gradient(
      166deg,
      transparent 0 15%,
      #ffe8cc7d 15.2%,
      #693a527d 15.5%,
      transparent 16.2%
    );
  border-right: 2px solid #f9dda7;
}
.journey-passage[data-passage="elevation"] .pass-fin:first-child {
  right: calc(100% - var(--flight-x) + var(--pass-radius));
}
.journey-passage[data-passage="elevation"] .pass-fin:nth-child(2) {
  left: calc(var(--flight-x) + var(--pass-radius));
  transform: scaleX(-1);
}
