/* Shared case-page return journey. The homepage owns the outbound journey. */
:root {
  --journey-paper: #f7f4ef;
  --journey-ink: #11110f;
  --journey-ease: cubic-bezier(.76, 0, .24, 1);
  --journey-out: cubic-bezier(.16, 1, .3, 1);
}

html.case-journey-locked,
html.case-journey-locked body { overflow: hidden !important; }

html.case-journey-boot::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2147483639;
  background: #f7f4ef;
}
html.case-journey-boot[data-case-journey-theme="dark"]::before { background: #080909; }

/* The exported case pages may still render former transition nodes. They must
   never compete with the shared journey overlay. */
#page-transition-loader,
.page-transition-loader,
[data-page-transition-loader],
#loader-scanline,
.loader-scanline,
.loader-text-group,
#loader-text-wrapper,
.loader-text-wrapper,
.loader-status-wrapper,
[data-legacy-loader],
[data-loader-legacy] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  animation: none !important;
  transition: none !important;
}

.floating-back-orb {
  position: fixed !important;
  left: clamp(18px, 3vw, 42px) !important;
  bottom: clamp(18px, 3vw, 38px) !important;
  z-index: 2147483000 !important;
  width: 48px !important;
  height: 48px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 1px solid color-mix(in srgb, currentColor 24%, transparent) !important;
  border-radius: 999px !important;
  background: color-mix(in srgb, Canvas 78%, transparent) !important;
  color: CanvasText !important;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .12) !important;
  -webkit-backdrop-filter: blur(14px) saturate(1.08) !important;
  backdrop-filter: blur(14px) saturate(1.08) !important;
  text-decoration: none !important;
  transition: width 440ms var(--journey-out), background-color 220ms ease, border-color 220ms ease, box-shadow 440ms var(--journey-out) !important;
}
.floating-back-orb svg {
  width: 18px !important;
  height: 18px !important;
  flex: 0 0 auto !important;
  transform: translateX(0) !important;
  transition: transform 440ms var(--journey-out) !important;
}
.floating-back-orb .orb-text {
  position: absolute !important;
  left: 43px !important;
  opacity: 0 !important;
  color: inherit !important;
  font: 700 10px/1 Arial, sans-serif !important;
  letter-spacing: .13em !important;
  transform: translateX(7px) !important;
  transition: opacity 220ms ease, transform 440ms var(--journey-out) !important;
}
.floating-back-orb:hover,
.floating-back-orb:focus-visible {
  width: 108px !important;
  border-color: currentColor !important;
  background: color-mix(in srgb, Canvas 94%, transparent) !important;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .17) !important;
  outline: none !important;
}
.floating-back-orb:hover svg,
.floating-back-orb:focus-visible svg { transform: translateX(-25px) !important; }
.floating-back-orb:hover .orb-text,
.floating-back-orb:focus-visible .orb-text { opacity: 1 !important; transform: translateX(0) !important; }

.case-journey {
  --axis-y: 76vh;
  --surface: #f7f4ef;
  --ink: #11110f;
  --journey-progress-duration: 920ms;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  min-height: 100vh;
  z-index: 2147483640;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
  background: var(--surface);
  color: var(--ink);
  isolation: isolate;
  contain: paint;
}
.case-journey[data-theme="dark"] {
  --surface: #080909;
  --ink: #f5f4ef;
}
.case-journey.is-active { visibility: visible; }
.case-journey.is-covering .case-journey-axis,
.case-journey.is-covering .case-journey-scene,
.case-journey.is-covering .case-journey-identity { opacity: 0; }
.case-journey-panel {
  display: none !important;
}

.case-journey-axis {
  position: absolute;
  z-index: 3;
  top: calc(var(--axis-y) - 1px);
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: right;
}
.case-journey.is-returning .case-journey-axis {
  animation: case-axis-return var(--journey-progress-duration) cubic-bezier(.45, 0, .55, 1) both;
}
.case-journey.is-arriving .case-journey-axis { transform: scaleX(1); }
.case-journey.is-arriving.is-open .case-journey-axis {
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 520ms var(--journey-ease), opacity 220ms ease 260ms;
}
.case-journey-scene {
  --journey-travel: 43vw;
  --journey-handoff: 10vw;
  position: absolute;
  z-index: 4;
  left: 50%;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}
.case-journey-scene--walk {
  bottom: calc(24vh - 10px);
  width: 160px;
  transform: translate3d(calc(-50% + var(--journey-travel)), 0, 0);
}
.case-journey-scene--fly {
  bottom: calc(24vh + 8px);
  width: 180px;
  transform: translate3d(calc(-50% + var(--journey-travel)), -3px, 0);
}
.case-journey-scene--fall {
  bottom: calc(24vh - 15px);
  width: 86px;
  transform: translate3d(-50%, 8px, 0);
}
.case-journey-media {
  display: block;
  width: 100%;
  height: auto;
}
.case-journey-scene--walk .case-journey-media,
.case-journey-scene--fly .case-journey-media { transform: scaleX(-1); }
.case-journey.is-returning .case-journey-scene--walk {
  animation: case-character-walk-return var(--journey-progress-duration) cubic-bezier(.45, 0, .55, 1) both;
}
.case-journey.is-returning .case-journey-scene--fly {
  animation: case-character-fly-return var(--journey-progress-duration) cubic-bezier(.45, 0, .55, 1) both;
}
.case-journey.is-returning .case-journey-scene--fall {
  animation: case-character-fall-return var(--journey-progress-duration) cubic-bezier(.45, 0, .55, 1) both;
}
.case-journey-axis::before,
.case-journey-axis::after {
  content: "";
  position: absolute;
  top: 50%;
  border-radius: 50%;
  transform: translateY(-50%);
}
.case-journey-axis::before {
  left: clamp(24px, 6vw, 88px);
  width: 7px;
  height: 7px;
  border: 1px solid var(--ink);
  background: var(--surface);
}
.case-journey-axis::after {
  right: clamp(24px, 6vw, 88px);
  width: 6px;
  height: 6px;
  background: var(--ink);
  box-shadow: 0 0 0 3px var(--surface);
}
.case-journey-identity {
  position: absolute;
  z-index: 4;
  top: calc(var(--axis-y) + 18px);
  left: 50%;
  opacity: 0;
  font: 700 10px/1 Arial, sans-serif;
  letter-spacing: .1em;
  transform: translate(-50%, 7px);
}
.case-journey.is-returning .case-journey-identity {
  animation: case-label-return 420ms var(--journey-out) 90ms both;
}
@keyframes case-axis-return { from { transform: scaleX(0); } to { transform: scaleX(.38); } }
@keyframes case-label-return {
  from { opacity: 0; transform: translate(-50%, 7px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes case-character-walk-return {
  0% { opacity: 1; transform: translate3d(calc(-50% + var(--journey-travel)), 0, 0); }
  100% { opacity: 1; transform: translate3d(calc(-50% + var(--journey-handoff)), 0, 0); }
}
@keyframes case-character-fly-return {
  0% { opacity: 1; transform: translate3d(calc(-50% + var(--journey-travel)), -3px, 0); }
  56% { transform: translate3d(calc(-50% + 26vw), 3px, 0); }
  100% { opacity: 1; transform: translate3d(calc(-50% + var(--journey-handoff)), -2px, 0); }
}
@keyframes case-character-fall-return {
  0% { opacity: 1; transform: translate3d(-50%, 8px, 0); }
  38% { transform: translate3d(-50%, -8px, 0); }
  52% { transform: translate3d(-50%, 0, 0); }
  100% { opacity: 1; transform: translate3d(-50%, -18vh, 0); }
}
@media (max-width: 820px) {
  .case-journey { --axis-y: 76.5vh; }
  .case-journey-scene--walk { width: 150px; }
  .case-journey-scene--fly { width: 164px; }
  .case-journey-scene--fall { width: 74px; }
}

@media (prefers-reduced-motion: reduce) {
  .case-journey.is-returning .case-journey-panel { transition-duration: 160ms; }
  .case-journey.is-returning .case-journey-axis,
  .case-journey.is-returning .case-journey-identity,
  .case-journey.is-returning .case-journey-scene { animation-duration: 160ms; }
}
