/* The scene module controls the lens and aircraft on a shared clock. */
.opening {
  --journey-duration: 14.2s;
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: clip;
  outline: none;
  opacity: 1;
  color: var(--blue);
  touch-action: manipulation;
  background: #f7f5f0;
  transition: opacity 1.4s ease, visibility 1.4s;
}
.opening.is-leaving { opacity: 0; visibility: hidden; pointer-events: none; }
.journey-atmosphere {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 48%, #eef2f4 0%, #f5f5f1 47%, #f7f5f0 74%);
}
.journey-map {
  position: absolute;
  left: 50%;
  top: 49%;
  width: min(82vw, 780px, calc((100svh - 55px) * .9474));
  aspect-ratio: 720 / 760;
  transform: translate(-50%, -50%);
}
.journey-camera {
  width: 100%;
  height: 100%;
  overflow: visible;
}
#journey-world { will-change: transform; }
.europe-coast { opacity: .85; mask-image: radial-gradient(ellipse 50% 50% at 51% 48%, #000 60%, transparent 100%); }
.flight-routes { opacity: .65; }
.flight-routes path { fill: none; stroke: #56769a; stroke-width: 1; stroke-dasharray: 2 6; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.route-trace { stroke-dasharray: 1; stroke-dashoffset: 1; }
.flight-rider { opacity: 0; will-change: transform; }
.flight-shadow { fill: #56769a; opacity: 0; filter: blur(3px); }
.flight-wake { opacity: 0; }
.flight-wake path { fill: none; stroke: #36577e; stroke-width: .8; stroke-linecap: round; stroke-dasharray: 12 7; animation: slipstream .7s linear infinite; }
.origin { fill: #8293a5; opacity: 0; }
.origin-city { font-family: var(--sans); font-size: 11px; font-weight: 400; letter-spacing: .3px; }
.destination-dot, .destination-label text { fill: var(--blue); }
.destination-label path { fill: none; stroke: #7a91ab; stroke-width: .85; }
.journey-destination { opacity: 1; }
.destination-villa { opacity: 0; }
.destination-label { opacity: 0; }
.destination-label text { font-family: var(--narrow); font-size: 20px; letter-spacing: 2.2px; }
.destination-label tspan { font-family: var(--serif); font-size: 23px; letter-spacing: 0; }
.destination-halo {
  fill: none;
  stroke: #718caa;
  stroke-width: 1;
  opacity: 0;
  transform-origin: 369.79px 550.78px;
  animation: journey-arrival 2.8s 10.6s ease-out forwards;
}
.cloud-passage { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.passage-cloud { position: absolute; width: 130%; height: auto; max-width: none; will-change: transform, opacity; }
.cloud-far { width: 115%; left: -7.5%; top: -12%; animation: cloud-through-far 3.2s cubic-bezier(.3,.1,.2,1) both; }
.cloud-left { width: 145%; left: -50%; top: 10%; animation: cloud-through-left 2.8s cubic-bezier(.3,.1,.2,1) both; }
.cloud-right { width: 150%; right: -53%; top: 25%; animation: cloud-through-right 3.6s cubic-bezier(.3,.1,.2,1) both; }
.cloud-veil { position: absolute; inset: 0; background: #f9faf7; animation: cloud-veil 1.7s ease-out both; }
.cloud-skim { width: 130%; left: -135%; top: 30%; animation: cloud-skim 4.5s 4.4s cubic-bezier(.4,0,.6,1) both; }
.cloud-outro { width: 145%; left: -22.5%; bottom: -30%; animation: cloud-outro 2.8s 13.2s cubic-bezier(.4,0,.6,1) both; }
#skip-intro { position: absolute; z-index: 5; right: 27px; bottom: max(23px, env(safe-area-inset-bottom)); min-height: 44px; padding: 10px; display: flex; align-items: center; gap: 18px; border: 0; background: transparent; color: var(--blue); font-size: 10px; }
#skip-intro span { font-size: 18px; }
.opening-progress { position: absolute; z-index: 5; bottom: 0; left: 0; height: 1px; width: 0; animation: loading-progress var(--journey-duration) linear forwards; background: #7a93ac; }

@keyframes slipstream { to { stroke-dashoffset: -38; } }
@keyframes journey-arrival { 0% { opacity: .8; transform: scale(.55); } 100% { opacity: 0; transform: scale(2); } }
@keyframes cloud-through-far {
  0% { opacity: .95; transform: translateY(12%) scale(1); }
  55% { opacity: .6; }
  100% { opacity: 0; transform: translateY(-65%) scale(1.8); }
}
@keyframes cloud-through-left {
  0% { opacity: 1; transform: translate(12%, -12%) rotate(-12deg) scale(1); }
  45% { opacity: .95; }
  100% { opacity: 0; transform: translate(-60%, 35%) rotate(-20deg) scale(1.7); }
}
@keyframes cloud-through-right {
  0% { opacity: 1; transform: translate(-12%, -12%) rotate(15deg) scale(1.1); }
  45% { opacity: .95; }
  100% { opacity: 0; transform: translate(65%, 40%) rotate(24deg) scale(1.9); }
}
@keyframes cloud-veil { 0% { opacity: 1; } 25% { opacity: .5; } 100% { opacity: 0; } }
@keyframes cloud-skim {
  0% { opacity: 0; transform: translateX(0) scale(1.1); }
  30% { opacity: .3; }
  70% { opacity: .22; }
  100% { opacity: 0; transform: translateX(185%) scale(1.4); }
}
@keyframes cloud-outro {
  from { opacity: 0; transform: translateY(60%) scale(1); }
  to { opacity: .9; transform: translateY(-35%) scale(1.35); }
}

@media (max-width: 760px) {
  .journey-map { width: min(135vw, calc((100svh - 100px) * .9474)); top: 49%; }
  .cloud-far { width: 215%; left: -58%; top: 3%; }
  .cloud-left { width: 240%; left: -137%; top: 27%; }
  .cloud-right { width: 250%; right: -140%; top: 41%; }
  .cloud-skim { width: 220%; left: -225%; top: 33%; }
  .cloud-outro { width: 240%; left: -70%; bottom: -10%; }
  #skip-intro { right: 18px; bottom: max(20px, env(safe-area-inset-bottom)); font-size: 10px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .journey-map { width: min(70vw, calc(100svh * 1.15)); }
}
@media (prefers-reduced-motion: reduce) { .opening { display: none !important; } }
