/* Hero prototype (hero-prototyp.html): the turning "Erde" globe on a night sky, real exports floating around it;
   the call to action plays the route live, then shows the same trip printed. */
:root { --space: #060d15; --space-mid: #0b1824; --space-glow: #0e1c29; --space-ink: #eef3f1; --space-muted: #9fb1ad; }

header.on-dark { background: var(--space); border-bottom-color: rgba(255, 255, 255, .06); }
header.on-dark nav a { color: rgba(238, 243, 241, .78); }
header.on-dark nav a:hover { color: #fff; }
header.on-dark .brand img { filter: brightness(0) invert(1); opacity: .92; }

.space-hero { position: relative; isolation: isolate; overflow: hidden; min-height: min(92vh, 920px); display: flex; align-items: center; color: var(--space-ink);
  background: radial-gradient(ellipse 60% 70% at 68% 50%, var(--space-glow) 0%, var(--space-mid) 48%, var(--space) 100%); }
.space-sky { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.space-sky canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.space-sky .twinkle { animation: space-twinkle 6s ease-in-out infinite alternate; }
@keyframes space-twinkle { from { opacity: .35; } to { opacity: 1; } }

.space-grid { position: relative; width: 100%; display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: 24px; align-items: center; padding-top: 40px; padding-bottom: 72px;
  transition: grid-template-columns 1.1s cubic-bezier(.65, 0, .25, 1) .25s, gap 1.1s ease .25s; }
.space-copy { max-width: 560px; transition: opacity .6s ease, transform .8s cubic-bezier(.65, 0, .25, 1), visibility 0s linear .8s; }
.space-copy .eyebrow { color: #c9dccf; }
.space-copy h1 { color: #fff; margin: 18px 0 20px; }
.space-copy h1 em { color: var(--lime, #deea88); }
.space-copy .intro { color: var(--space-muted); max-width: 480px; }
.space-copy .text-link { color: #dfe8e4; }
.space-copy .format-tags span { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .12); color: #cfdcd7; }
.space-play { cursor: pointer; border: 0; font: inherit; }
.space-play span { display: inline-grid; place-items: center; }

.space-stage { position: relative; aspect-ratio: 1; width: 100%; max-height: min(78vh, 760px); justify-self: center; transition: max-height 1.1s cubic-bezier(.65, 0, .25, 1) .25s, aspect-ratio 1.1s ease .25s; }
/* Soft edges: the map melts into the sky (the flat map of a close stop would otherwise end in a hard box). */
.space-globe { -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent), linear-gradient(transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent), linear-gradient(transparent, #000 10%, #000 90%, transparent); -webkit-mask-composite: source-in; mask-composite: intersect; }
/* The opening (Florian: the night turning into day, the world rising with it): the globe waits a little low and
   small, and rises into its place while the map's sunrise spreads over it ("maps-express:dawn", hero.js). */
.space-globe { position: absolute; inset: 0; z-index: 2; opacity: 0; transform: translateY(12%) scale(.9);
  transition: opacity .9s ease, transform 4.2s cubic-bezier(.22, .8, .25, 1); }
.space-hero.globe-ready .space-globe { opacity: 1; }
.space-hero.is-dawn .space-globe { transform: none; }
@media (prefers-reduced-motion: reduce) { .space-globe { transform: none; transition: opacity .9s ease; } }
.space-globe iframe { width: 100%; height: 100%; border: 0; background: transparent; color-scheme: normal; }
/* Until the live globe is there: a soft glow where it will be. */
.space-stage::before { content: ""; position: absolute; inset: 14%; border-radius: 50%; background: radial-gradient(circle at 38% 34%, rgba(120, 180, 220, .22), rgba(20, 50, 80, .15) 55%, transparent 72%); transition: opacity 1.2s ease; }
.space-hero.globe-ready .space-stage::before { opacity: 0; }

/* Real exports floating around the globe (gentle drift; the pointer adds a little parallax via --px/--py). */
.float { position: absolute; margin: 0; border-radius: 6px; overflow: hidden; background: #fff; box-shadow: 0 24px 60px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .08);
  --px: 0; --py: 0; translate: calc(var(--px) * var(--depth) * 1px) calc(var(--py) * var(--depth) * 1px);
  transition: opacity .7s ease, translate .4s ease-out, scale .9s cubic-bezier(.65, 0, .25, 1); animation: float-drift var(--drift, 9s) ease-in-out infinite alternate; }
.float img { display: block; width: 100%; height: auto; }
.float figcaption { position: absolute; left: 8px; bottom: 8px; padding: 3px 8px; border-radius: 99px; background: rgba(6, 13, 21, .72); color: #eef3f1; font-size: 11px; letter-spacing: .02em; backdrop-filter: blur(6px); }
/* As if on an orbit around the earth, only hinted: the cards turn a little towards the globe (left ones to the
   right, right ones to the left), the upper two pass behind it (under the globe, dimmer, softer), the lower two
   in front; each sways gently in its own rhythm. */
.float.f1 { width: 42%; left: -6%; bottom: 4%; rotate: -4deg; --depth: 18; --drift: 10s; --ry: 16deg; --rx: 5deg; z-index: 3; }
.float.f2 { width: 23%; right: -2%; top: 3%; rotate: 5deg; --depth: 10; --drift: 12s; --ry: -20deg; --rx: -6deg; z-index: 1; filter: brightness(.82) blur(.3px); }
.float.f3 { width: 34%; right: -5%; bottom: 10%; rotate: 3deg; --depth: 14; --drift: 11s; --ry: -15deg; --rx: 4deg; z-index: 3; }
.float.f4 { width: 18%; left: 4%; top: 6%; rotate: -6deg; --depth: 7; --drift: 13s; --ry: 22deg; --rx: -5deg; z-index: 1; filter: brightness(.78) blur(.4px); }
.float { --ry: 0deg; --rx: 0deg; transform: perspective(1100px) rotateY(var(--ry)) rotateX(var(--rx)); }
@keyframes float-drift {
  from { transform: perspective(1100px) translate3d(0, -7px, 0) rotateY(var(--ry)) rotateX(var(--rx)); }
  to { transform: perspective(1100px) translate3d(0, 9px, 0) rotateY(calc(var(--ry) * .75)) rotateX(calc(var(--rx) * .6)); } }

/* Playing: copy and exports leave, the globe takes the whole stage and the trip flies. */
.space-hero[data-state="playing"] .space-grid, .space-hero[data-state="ended"] .space-grid { grid-template-columns: 0fr 1fr; gap: 0; }
.space-hero[data-state="playing"] .space-copy, .space-hero[data-state="ended"] .space-copy { opacity: 0; transform: translateX(-40px); visibility: hidden; pointer-events: none; }
.space-hero:not([data-state="rest"]) .float { opacity: 0; scale: .85; pointer-events: none; }
.space-hero:not([data-state="rest"]) .space-stage { aspect-ratio: 16 / 9; max-height: min(80vh, 820px); }

.space-live { position: absolute; left: 50%; top: 22px; translate: -50% 0; display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 16px; border-radius: 99px;
  background: rgba(6, 13, 21, .6); border: 1px solid rgba(255, 255, 255, .1); backdrop-filter: blur(10px); font-size: 13px; color: #dfe8e4;
  opacity: 0; pointer-events: none; transition: opacity .6s ease .9s; z-index: 5; }
.space-live b { color: #fff; }
.space-live > span:nth-child(2) { white-space: nowrap; }
.space-live .live-dot { background: #ff6b5a; box-shadow: 0 0 0 4px rgba(255, 107, 90, .2); }
.space-hero:not([data-state="rest"]) .space-live { opacity: 1; pointer-events: auto; }
.space-live button, .space-print button { font: inherit; cursor: pointer; }
.space-back { border: 1px solid rgba(255, 255, 255, .18); background: transparent; color: #eef3f1; padding: 5px 12px; border-radius: 99px; font-size: 12px; }

/* The end: the same trip, printed. */
.space-print { position: absolute; right: max(24px, 5vw); top: 50%; translate: 0 -50%; width: min(440px, 40vw); z-index: 6; opacity: 0; transform: translateX(40px) rotate(2deg); pointer-events: none;
  transition: opacity .8s ease, transform 1s cubic-bezier(.2, .7, .2, 1); }
.space-hero[data-state="ended"] .space-print { opacity: 1; transform: none; pointer-events: auto; }
.space-print figure { margin: 0; border-radius: 6px; overflow: hidden; background: #fff; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.space-print img { display: block; width: 100%; height: auto; }
.space-print { padding: 0 0 18px; }
.space-print::before { content: ""; position: absolute; inset: 40% -28px -24px; z-index: -1; border-radius: 14px; background: radial-gradient(ellipse at 50% 70%, rgba(6, 13, 21, .82), rgba(6, 13, 21, 0) 75%); }
.space-print p { margin: 16px 0 4px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--space-muted); }
.space-print h2 { margin: 0 0 14px; color: #fff; font-size: 28px; line-height: 1.15; }
.space-print .actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.space-print .again { border: 0; background: none; color: #dfe8e4; text-decoration: underline; text-underline-offset: 3px; }

.space-scroll { position: absolute; left: 50%; bottom: 18px; translate: -50% 0; color: rgba(238, 243, 241, .55); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; text-decoration: none; display: grid; justify-items: center; gap: 6px; }
.space-scroll::after { content: ""; width: 1px; height: 28px; background: linear-gradient(rgba(238, 243, 241, .6), transparent); animation: space-cue 2.2s ease-in-out infinite; }
@keyframes space-cue { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* The rest of the page arrives softly out of the dark. */
.space-hero + * { position: relative; }
.space-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 90px; background: linear-gradient(transparent, rgba(6, 13, 21, .35)); pointer-events: none; }

@media (max-width: 860px) {
  .space-hero { min-height: auto; align-items: start; }
  .space-grid { grid-template-columns: 1fr; padding-top: 28px; padding-bottom: 64px; }
  .space-stage { max-height: none; width: min(100%, 520px); }
  .space-hero[data-state="playing"] .space-grid, .space-hero[data-state="ended"] .space-grid { grid-template-columns: 1fr; }
  .space-hero:not([data-state="rest"]) .space-copy { display: none; }
  .space-hero:not([data-state="rest"]) .space-stage { aspect-ratio: 3 / 4; width: 100%; }
  .float.f2, .float.f4 { display: none; }
  .space-live { top: 12px; font-size: 12px; max-width: calc(100% - 32px); }
  .space-live .route { display: none; }
  .float.f1 { width: 46%; left: -2%; bottom: -2%; }
  .float.f3 { width: 38%; right: -2%; bottom: 4%; }
  .space-print { position: relative; right: auto; top: auto; translate: none; width: auto; margin: 0 16px 60px; display: none; }
  .space-hero[data-state="ended"] .space-print { display: block; }
  .space-hero[data-state="ended"] { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  .float, .space-sky .twinkle, .space-scroll::after { animation: none; }
  .space-grid, .space-copy, .space-stage, .space-globe, .space-print, .float { transition-duration: .01s; transition-delay: 0s; }
}

/* Taking over (hero.js): while the trip plays a hint invites to move the globe; once moved, the trip waits and
   the pill offers to go on. */
.space-hint { color: rgba(223, 232, 228, .6); font-size: 12px; white-space: nowrap; }
.space-hint::before { content: "·"; margin-right: 10px; }
.space-resume { display: none; border: 0; border-radius: 99px; padding: 5px 12px; background: #deea88; color: #1b2a20; font-size: 12px; font-weight: 700; }
.space-hero.is-paused .space-resume { display: inline-block; }
.space-hero.is-paused .space-hint, .space-hero[data-state="ended"] .space-hint { display: none; }
.space-hero.is-paused .live-dot { background: #deea88; box-shadow: 0 0 0 4px rgba(222, 234, 136, .2); }
@media (max-width: 860px) { .space-hint { display: none; } }

/* A still of the globe (the same view as the live one's start, from the exploded view's layers) until the live
   globe is drawn; it fades out under it. Sized and placed like the live globe (hero zoom: 0.78 of the side). */
.space-poster { position: absolute; z-index: 1; width: 80%; height: auto; left: 51.33%; top: 51.83%; translate: -50% -50%; pointer-events: none; transition: opacity 1.2s ease .3s; }
.space-hero.globe-ready .space-poster { opacity: 0; }
/* The still waits in the night the live globe opens with (the map's intro: night, then the sunrise). */
.space-poster { filter: brightness(.22) saturate(.5); }
@media (prefers-reduced-motion: reduce) { .space-poster { filter: none; } }
.space-hero.globe-ready .space-stage::before { opacity: 0; }
.space-stage::before { display: none; }
.space-hero:not([data-state="rest"]) .space-poster { opacity: 0; }
