/* A dark cinematic layer, independent of the site's light reading surface.
   Layer order: atmosphere, live destination, historical planes, skip control. Native dialog top layer
   isolates focus and interaction from the homepage without changing its layout. */
html.journey-pending::before {
    content: ''; position: fixed; inset: 0; z-index: 100; background: #07090d;
    pointer-events: none;
}
html.journey-open { overflow: hidden; }
.time-journey {
    --journey-ready: 1;
    --journey-ink: #f2f0e9;
    --journey-accent: #edc88d;
    position: fixed; inset: 0; width: 100%; height: 100%; height: 100dvh;
    max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
    overflow: hidden; overflow: clip; color: var(--journey-ink); background: #07090d;
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 16px; line-height: 1.5; isolation: isolate;
}
.time-journey::backdrop { background: transparent; }
.time-journey .journey-header button {
    font: inherit; cursor: pointer; color: var(--journey-ink); background: transparent;
    border: 1px solid transparent; border-radius: 4px; min-height: 44px;
    padding: 10px 16px; white-space: nowrap; touch-action: manipulation;
}
.time-journey .journey-header button:hover { background: rgb(255 255 255 / 8%); }
.time-journey .journey-header button:disabled { opacity: .4; cursor: default; background: transparent; }
.time-journey .journey-header button:focus-visible { outline: 2px solid var(--journey-accent); outline-offset: 5px; }
.time-journey .journey-atmosphere, .time-journey .journey-stars {
    position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
}
.journey-atmosphere { opacity: .9; }
.journey-stars { opacity: .85; }
.journey-shade {
    position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(180deg, rgb(7 9 13 / 62%), transparent 23%, transparent 60%, #07090d 98%);
}
.journey-header {
    position: absolute; z-index: 3; top: max(28px, env(safe-area-inset-top));
    left: 4.5%; right: 4.5%; display: flex; align-items: center; justify-content: space-between;
}
.journey-brand { font-size: 18px; letter-spacing: .12em; font-weight: 500; }
.journey-header .journey-skip { border-color: rgb(242 240 233 / 28%); padding-inline: 20px; background: rgb(7 9 13 / 40%); }
.journey-skip span { margin-left: 16px; color: var(--journey-accent); }
.journey-flight {
    position: absolute; inset: 0; z-index: 2;
    perspective: 1100px; perspective-origin: 50% 50%; pointer-events: none;
}
.journey-frame {
    position: absolute; top: 50%; left: 50%; width: min(58vw, 900px);
    aspect-ratio: 8 / 5; margin: 0; opacity: 0; transform-origin: center; transform: translate(-50%, -50%);
    border: 1px solid rgb(237 200 141 / 38%); border-radius: 4px;
    background: #12151b; box-shadow: 0 0 42px rgb(237 200 141 / 8%), 0 28px 80px rgb(0 0 0 / 50%);
    overflow: hidden; backface-visibility: hidden; will-change: transform, opacity;
}
.time-journey .journey-frame img { width: 100%; height: 100%; max-width: none; object-fit: contain; }
/* The destination contains the existing homepage DOM, including its live maps. */
.homepage-surface { display: contents; }
/* Programmatic arrival focus must not frame the entire reading column. */
.academic-content[tabindex="-1"]:focus { outline: none !important; }
.journey-arrival { position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; }
.homepage-surface.is-travelling {
    display: block; position: absolute; inset: 0; width: 100%; height: 100%;
    overflow: hidden; transform-origin: 50% 50%; will-change: transform;
    box-shadow: 0 0 90px rgb(237 200 141 / 18%);
}
.journey-fallback {
    position: absolute; width: 49vw; aspect-ratio: 1; left: 44%; top: 50%;
    transform: translateY(-50%) rotate(-18deg); border-radius: 50%;
    background: radial-gradient(ellipse, #07090d 28%, #edc88d 29%, #9d75452e 31%, transparent 48%);
}
.journey-fallback::after { content: ''; position: absolute; inset: 43% -20%; border-radius: 50%; border: 3px solid #edc88d; box-shadow: 0 0 24px #bb824a, inset 0 0 15px #bb824a; }
.journey-replay { border: 0; background: transparent; color: inherit; font: inherit; padding: 0; cursor: pointer; text-underline-offset: 3px; }
.journey-replay:hover { text-decoration: underline; }
.journey-replay:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 4px; }
@media (max-width: 700px) {
    .journey-header { top: max(18px, env(safe-area-inset-top)); left: 6%; right: 6%; }
    .journey-brand { font-size: 16px; }
    .journey-header .journey-skip { padding: 8px 12px; font-size: 16px; }
    .journey-flight { inset: 0; perspective: 1100px; }
    .journey-frame { width: 86vw; }
    .journey-fallback { width: 95vw; left: 20%; top: 50%; }
}
@media (max-height: 540px) and (orientation: landscape) {
    .journey-header { top: 10px; }
    .journey-flight { inset: 0; }
    .journey-frame { width: 52vw; }
}
@media (prefers-reduced-motion: reduce) {
    .journey-frame { will-change: auto; }
}
