/* The room, worktop, lettering and tilted display use the original exhibition
   composition in style.css. The two near objects sit on the page's worktop. */
.journey {
  position: relative;
  background: #39291f;
  --journey-travel: clamp(540px, 136svh, 1420px);
}
.journey-js:not(.motion-off) .journey::after {
  content: "";
  display: block;
  height: var(--journey-travel);
}
.journey .hero-stage {
  --curtain: 0;
  top: var(--pin-top, var(--mast));
  max-height: 990px;
  container-type: size;
}

/* The screen aligns to the available room, including a narrow browser pane. */
.journey-stage > .hero-exhibit {
  --exhibit-width: 52cqw;
  --exhibit-right: 2cqw;
  --rest-w: calc(.82 * var(--exhibit-width));
  --rest-x: calc(100cqw - var(--exhibit-right) - .55 * var(--exhibit-width));
  --rest-y: calc(21cqh + .28125 * var(--rest-w) + 16px);
  --play-w: min(64cqw, 1240px, calc((100cqh - 108px) * 16 / 9));
  --play-y: clamp(42cqh, calc((100svh + var(--mast)) / 2 - var(--pin-top, var(--mast))), 57cqh);
  --p: var(--curtain);
}
@media (min-width: 1650px) {
  .journey-stage > .hero-exhibit {
    --exhibit-width: min(50cqw, 800px);
    --exhibit-right: max(4cqw, calc((100cqw - 1410px) / 2));
  }
}
.journey .hero-stage::before { opacity: calc(1 - .28 * var(--lift)); }
.journey .hero-room {
  mask-image: linear-gradient(90deg, transparent, black 13%);
}
.journey .hero-table { height: calc(34% - 6% * var(--lift)); }
.journey .hero-copy {
  --rest: calc(1 - var(--lift));
  --text-p: calc(1 - var(--rest) * var(--rest) * var(--rest));
  --copy-margin: max(6cqw, calc((100cqw - 1200px) / 2));
  --rest-column: min(1200px, 88cqw);
  --open-column: clamp(190px, 18cqw, 316px);
  --rest-title: clamp(4rem, 6.2cqw, 6.25rem);
  --open-title: clamp(1.7rem, 2.7cqw, 3.05rem);
  position: absolute;
  z-index: 8;
  left: calc(var(--copy-margin) * (1 - var(--text-p)) + 3.2cqw * var(--text-p));
  top: calc(50% - 7cqh * var(--text-p));
  width: calc(var(--rest-column) * (1 - var(--text-p)) + var(--open-column) * var(--text-p));
  margin: 0;
  transform: translateY(-50%);
  opacity: calc(1 - .15 * var(--lift));
  text-shadow: 0 2px 6px #21160efa, 0 0 18px #241a13bf;
}
.journey .hero-copy h1 {
  max-width: none;
  font-size: calc(var(--rest-title) * (1 - var(--text-p)) + var(--open-title) * var(--text-p));
}
.journey .hero-copy > :is(.eyebrow, .hero-cta) { max-width: 100%; }
.journey .hero-copy .intro {
  max-width: min(100%, calc(min(33.44cqw, 450px) * (1 - var(--text-p)) + var(--open-column) * var(--text-p)));
  font-size: calc(clamp(.98rem, 1.12cqw, 1.13rem) * (1 - var(--lift)) + .95rem * var(--lift));
  line-height: calc(1.65 - .15 * var(--lift));
}
.journey .hero-exhibit {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  z-index: 5;
  perspective: none;
  pointer-events: none;
}
.journey .hero-screen {
  --rest-yaw: -15deg;
  left: calc(var(--rest-x) * (1 - var(--p)) + 50cqw * var(--p));
  top: calc(var(--rest-y) * (1 - var(--p)) + var(--play-y) * var(--p));
  width: calc(var(--rest-w) * (1 - var(--p)) + var(--play-w) * var(--p));
  padding: clamp(4px, .42cqw, 9px) clamp(5px, .5cqw, 10px) 3px;
  border: 1px solid transparent;
  background: transparent;
  box-shadow: none;
  transform: translate(-50%, -50%) perspective(1200px)
    rotateY(calc(var(--rest-yaw) * (1 - var(--p)))) rotateZ(calc(-3deg * (1 - var(--p))));
}
/* The wood moulding gives way to the view through the room. Keep the
   lettering, worktop and props in the same daylight throughout the opening. */
.journey .hero-screen::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -1px;
  border: 1px solid #a38565;
  border-radius: inherit;
  background: linear-gradient(145deg, #b38a58, #634d36 11%, #392d23 50%, #b99058);
  box-shadow: 10px 18px 34px #18110eb3, inset 0 0 0 2px #503d2c;
  opacity: calc(1 - var(--p));
}
.atelier-picture {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  border-radius: 2px;
  background: #251d17;
  --side-blend: calc(13% * var(--p));
  --top-blend: calc(9% * var(--p));
  --floor-blend: calc(13% * var(--p));
  mask-image:
    linear-gradient(90deg, transparent, black var(--side-blend), black calc(100% - var(--side-blend)), transparent),
    linear-gradient(180deg, transparent, black var(--top-blend), black calc(100% - var(--floor-blend)), transparent);
  mask-composite: intersect;
}
.journey .atelier-picture :is(video, img, canvas) {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: 0;
}
.journey-static-poster { z-index: 2; }
.journey-js:not(.motion-off) .journey-static-poster,
.journey .atelier-picture [hidden] { display: none; }
.journey-held-frame { z-index: 1; pointer-events: none; }
.journey-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0 .45rem;
  padding-inline: .5rem;
  background: rgb(63 48 36 / calc(1 - var(--p)));
  border-radius: 0 0 3px 3px;
  pointer-events: auto;
}
.journey-actions :is(a, button) {
  display: inline-flex;
  align-items: center;
  gap: .25em;
  min-height: 31px;
  border: 0;
  background: transparent;
  padding: .25rem .4rem;
  font: 550 clamp(.71rem,.9vw,.84rem)/1.2 var(--sans);
  color: #f1dfca;
  text-shadow: 0 1px 3px #24160c;
}
.journey-actions button[hidden] { display: none; }
.journey-actions button[aria-pressed=true] {
  color: white;
  text-decoration: underline;
  text-underline-offset: .3em;
}
.journey-film::cue { color: #fffaef; background-color: #221914ef; }
.atelier-foreground {
  position: absolute;
  z-index: 6;
  inset: 0;
  pointer-events: none;
  overflow: clip;
}
.atelier-prop {
  position: absolute;
  height: auto;
  transform-origin: center bottom;
  user-select: none;
  pointer-events: none;
}
.atelier-cup {
  --w: clamp(174px, 23.5cqw, 395px);
  --start-right: calc(50cqw + min(9cqw, 152px));
  --end-right: calc(50cqw - min(24.5cqw, 50cqh, 508px));
  --start-foot: min(88cqh, calc(22cqh + min(27cqw, 430px) + 28px));
  --end-foot: min(95cqh, calc(56cqh + min(17cqw, 300px)));
  /* The nearer object crosses the line of sight first. Its glaze and baked
     contact shadow already carry the worktop light. */
  --sweep: calc(var(--lift) * (2 - var(--lift)));
  --arc: calc(4 * var(--sweep) * (1 - var(--sweep)));
  width: var(--w);
  left: calc(var(--start-right) * (1 - var(--sweep)) + var(--end-right) * var(--sweep));
  top: calc(var(--start-foot) * (1 - var(--lift)) + var(--end-foot) * var(--lift) + 2.5cqh * var(--arc));
  transform-origin: right bottom;
  transform: translate(-100%, -100%) rotate(calc(-1deg * var(--arc))) scale(calc(1 + .095 * var(--lift)));
}
.atelier-reel {
  --w: clamp(146px, 20.5cqw, 338px);
  --start-x: calc(50cqw + min(24.2cqw, 395px));
  --end-x: calc(50cqw + min(25.5cqw, 51cqh, 502px));
  --start-foot: min(95cqh, calc(27cqh + min(27cqw, 445px) + 48px));
  --end-foot: min(98cqh, calc(61cqh + min(17cqw, 304px)));
  /* The farther reel swings slightly outward and settles later than the cup. */
  --sweep: calc(var(--lift) * var(--lift));
  --arc: calc(4 * var(--lift) * (1 - var(--lift)));
  left: calc(var(--start-x) * (1 - var(--sweep)) + var(--end-x) * var(--sweep) + 1.4cqw * var(--arc));
  top: calc(var(--start-foot) * (1 - var(--sweep)) + var(--end-foot) * var(--sweep) - 1.6cqh * var(--arc));
  width: var(--w);
  transform-origin: 39% 85%;
  transform: translateY(-100%) rotate(calc(-4deg + 6deg * var(--sweep))) scale(calc(1 + .08 * var(--lift)));
  filter: drop-shadow(2px 3px 2px #24150c66);
}
.journey .hero-foot { z-index: 7; }
.motion-off .journey .hero-stage, html:not(.journey-js) .journey .hero-stage { position: relative; top: auto; }
@media (max-width: 640px) {
  .journey .hero-room { mask-image: linear-gradient(180deg, transparent, black 24%); }
  .journey .hero-stage {
    --sill: max(50cqh, calc(var(--mast) - var(--pin-top, var(--mast)) + var(--copy-clearance, 270px) + 10cqw));
  }
  .journey .hero-table {
    --rest-surface: calc(57cqh + 40cqw);
    --open-surface: calc(var(--sill) + 27cqw - 1rem);
    top: calc(var(--rest-surface) * (1 - var(--lift)) + var(--open-surface) * var(--lift));
    bottom: auto;
    height: 100cqh;
    transform: perspective(750px) rotateX(24deg);
  }
  .journey .hero-stage {
    min-height: 700px;
    max-height: 850px;
  }
  .journey .hero-copy {
    position: relative;
    top: auto;
    left: auto;
    width: 90%;
    margin-inline: auto;
    --rest-title: clamp(3.1rem, 10cqw, 4.3rem);
    --open-title: clamp(2.15rem, 7.6cqw, 3.2rem);
    opacity: calc(1 - var(--lift) * .12);
    transform: translateY(calc((var(--mast) - var(--pin-top, var(--mast)) - 1rem) * var(--lift)));
  }
  .journey .hero-copy .intro {
    max-width: 46ch;
    font-size: calc(.91rem - .045rem * var(--lift));
    line-height: calc(1.5 - .14 * var(--lift));
  }
  .journey-stage > .hero-exhibit {
    --rest-w: 72cqw;
    --rest-x: 46cqw;
    --rest-y: calc(57cqh + .28125 * var(--rest-w) + 15px);
    --play-w: 92cqw;
    --play-y: max(calc((100svh + var(--mast)) / 2 - var(--pin-top, var(--mast))),
                  calc(var(--mast) - var(--pin-top, var(--mast)) + var(--copy-clearance, 270px) + .28125 * var(--play-w)));
  }
  .journey .hero-screen { --rest-yaw: -11deg; }
  .journey-actions {
    gap: .05rem .2rem;
    justify-content: center;
    padding-inline: 1.5%;
  }
  .journey-actions :is(a,button) {
    font-size: .71rem;
    min-height: 31px;
    padding-inline: .15rem;
  }
  .atelier-cup {
    --w: min(40cqw, 210px);
    --start-right: 34cqw;
    --end-right: 20.5cqw;
    --start-foot: min(97cqh, calc(57cqh + 40cqw + 22px));
    --end-foot: min(94cqh, calc(var(--sill) + 27cqw + 14px));
  }
  .atelier-reel {
    --w: min(31.5cqw, 175px);
    --start-x: 65cqw;
    --end-x: 82cqw;
    --start-foot: min(99cqh, calc(57cqh + 43cqw + 34px));
    --end-foot: min(98cqh, calc(var(--sill) + 33cqw + 22px));
  }
}
@media (min-width: 641px) and (max-width: 900px) {
  .journey .hero-copy { --rest-title: clamp(3.2rem,6.6cqw,4.2rem); }
}
@media (max-width: 365px) {
  .journey .hero-stage { --copy-clearance: 304px; }
  .journey .hero-copy {
    --rest-title: clamp(2.15rem, 11cqw, 2.5rem);
    --open-title: 1.8rem;
  }
  .journey-actions { padding-inline: 1.5%; }
}
@media (min-width: 641px) and (max-height: 580px) {
  .journey .hero-stage { height: max(360px,calc(100svh - var(--mast))); min-height: 0; }
  .journey .hero-copy {
    --rest-title: clamp(2.2rem,5.6vh,3.8rem);
    --open-title: 1.6rem;
    --open-column: clamp(220px, 27cqw, 310px);
    top: calc(50% - 2.5cqh * var(--text-p));
  }
  .journey .hero-copy h1 { margin-block: .55rem; }
  .journey .hero-copy .eyebrow { font-size: .6rem; letter-spacing: .08em; gap: .45rem; }
  .journey .hero-copy .eyebrow::before { width: 1.25rem; }
  .journey .hero-copy .intro { font-size: .85rem; line-height: 1.37; }
  .journey .hero-cta { margin-top: .5rem; padding-block: .45rem; }
  .journey-stage > .hero-exhibit {
    --rest-w: min(calc(.82 * var(--exhibit-width)), 112cqh);
    --rest-y: 46cqh;
  }
  .atelier-reel {
    --w: min(21cqw, 46cqh);
    --start-x: calc(69cqw + min(8.5cqw, 20cqh));
    --start-foot: 91cqh;
    --end-foot: 96cqh;
  }
  .atelier-cup {
    --w: min(21cqw, 47cqh);
    --end-right: calc(50cqw - min(6cqw, 14cqh));
    --start-foot: 80cqh;
    --end-foot: 94cqh;
  }
}
@media (prefers-reduced-motion: reduce) {
  .journey-js .journey::after { display: none; }
  .journey .hero-stage { position: relative; top: auto; }
  .journey-js .atelier-picture .journey-static-poster { display: block; }
}
