/* The signature has its own travel animation. Reveal only the home content here. */
body.home-revealing .app {
  transition: none;
}

body[data-view=home].home-revealing:not(.paused) :is(
  .intro,
  .professional-worlds > a,
  #personal-world,
  .experience-tools
) {
  animation: home-reveal 260ms ease-out var(--reveal-delay, 80ms) both;
}

.professional-worlds > .library-link { --reveal-delay: 275ms; }
.professional-worlds > .observatory-link, .observatory-voyage-stage { --reveal-delay: 385ms; }
.professional-worlds > .projects-link, .voyage-stage { --reveal-delay: 495ms; }
#personal-world { --reveal-delay: 640ms; }
.experience-tools { --reveal-delay: 780ms; }

/* The two miniature buildings are rendered by the voyage layers outside their links. */
body[data-view=home].home-revealing:not(.paused,.voyage-active,.observatory-voyage-active,.archives-flight-active)
  :is(.observatory-voyage-stage,.voyage-stage) {
  animation: home-reveal-art 260ms ease-out var(--reveal-delay) both;
}

@keyframes home-reveal {
  from { opacity: 0; visibility: hidden; }
  to { opacity: 1; visibility: visible; }
}

@keyframes home-reveal-art {
  from { opacity: 0; }
  to { opacity: 1; }
}

body.observatory-active #wand-trail path {
  stroke-dasharray: 100 100;
  animation: none;
}
body.observatory-active #wand-trail .trail-echo {
  stroke: #82d6ed;
  stroke-width: 9;
  opacity: calc(.30 + var(--magic-thread, .24) * .26);
  transform: none;
  filter: blur(6px);
}
body.observatory-active #wand-trail .trail-pencil { stroke-width: .7; opacity: calc(var(--magic-thread, .24) * .07); }
body.observatory-active #wand-trail .trail-light {
  stroke: #d6f6f8;
  stroke-width: .8;
  opacity: calc(var(--magic-thread, .24) * .18);
  filter: blur(.65px);
}
.wand-magic-head,.wand-magic-mote {
  fill: #e1faff;
  opacity: 0;
  filter: drop-shadow(0 0 3px #9ce5fa) drop-shadow(0 0 6px #73cbe9);
}
.wand-magic-star { fill: #fff0c9; filter: drop-shadow(0 0 3px #bce9ee); }

.experience-tools {
  top: 27px;
  align-items: center;
  gap: 18px;
}

.experience-tools #theme-orbit {
  width: max-content;
  height: 44px;
  flex: 0 0 auto;
}

.experience-tools #theme-orbit .theme-caption {
  position: static;
  transform: none;
  padding: 0 2px;
}

.experience-tools .theme-astro {
  left: -196px;
  top: -122px;
  pointer-events: auto;
}

.experience-tools #motion { margin-top: 0; }

@media (min-width: 741px) {
  body[data-view="home"] #hero-title :is(.title-purpose, .title-dream) { display: block; }
  .experience-tools #motion { min-width: 184px; width: 184px; flex: 0 0 184px; justify-content: flex-end; }
  .experience-tools #motion .motion-word { white-space: nowrap; }
}
@media (min-width: 741px) and (max-height: 760px) {
  body[data-view="home"] #hero-title { font-size: clamp(31px, min(3.55vw, 6.4vh), 52px); margin-bottom: 16px; }
  body[data-view="home"] #hero-title .title-dream { margin-top: 6px; }
}

@media (min-width: 741px) and (max-width: 1050px) {
  .experience-tools .theme-astro { top: -107px; left: -171px; }
}

@media (min-width: 741px) and (max-height: 680px) {
  .experience-tools .theme-astro { top: -139px; }
}

@media (max-width: 740px) {
  .signature-voyage .identity { pointer-events: none; }
  .signature-voyage .identity a { pointer-events: auto; }
  .professional-worlds > .projects-link, .voyage-stage { --reveal-delay: 275ms; }
  .professional-worlds > .library-link { --reveal-delay: 385ms; }
  .professional-worlds > .observatory-link, .observatory-voyage-stage { --reveal-delay: 495ms; }
  .experience-tools {
    top: 26px;
    right: 12px;
    width: auto;
    flex-direction: row;
    gap: 8px;
  }
  .experience-tools #theme-orbit { max-width: 75px; }
  .experience-tools #theme-orbit .theme-caption {
    white-space: normal;
    text-align: center;
  }
  .experience-tools #motion { width: auto; }
  .experience-tools .theme-astro {
    top: 9px;
    left: auto;
    right: -42px;
    clip-path: inset(57px -12px -12px);
  }
}

@media (max-width: 359px) {
  .experience-tools { top: 22px; right: 7px; gap: 5px; }
  .experience-tools .theme-astro { top: 10px; right: -37px; clip-path: inset(50px -12px -12px); }
}

@media (max-width: 480px) {
  .experience-tools { top: 132px; right: 6%; gap: 8px; }
  .experience-tools #theme-orbit { max-width: none; }
  .experience-tools #theme-orbit .theme-caption { white-space: nowrap; }
  .experience-tools #motion { width: 88px; min-width: 88px; }
  .experience-tools .theme-astro { top: -170px; right: -116px; clip-path: none; }
  body[data-view=home] .intro { padding-top: 18px; }
  .professional-worlds { top: 395px; }
}

@media (prefers-reduced-motion: reduce) {
  body[data-view=home].home-revealing:not(.paused) :is(.intro, .professional-worlds > a, #personal-world, .experience-tools),
  body[data-view=home].home-revealing:not(.paused,.voyage-active,.observatory-voyage-active,.archives-flight-active)
    :is(.observatory-voyage-stage,.voyage-stage) {
    animation: none;
  }
}


/* Home UI leaves in place and returns in groups after the traveller lands. */
body :is(.intro,.signature-voyage,.professional-worlds,#personal-world,.experience-tools,#arrival-replay-local) {
  transition: opacity 180ms ease-out var(--travel-return-delay, 30ms);
}
body :is(.professional-worlds,#personal-world,.voyage-stage,.observatory-voyage-stage) {
  --travel-return-delay: 125ms;
}
body :is(.experience-tools,#arrival-replay-local) {
  --travel-return-delay: 215ms;
}
body .voyage-stage { transition: opacity 180ms ease-out var(--travel-return-delay); }
body:not(.observatory-voyage-active) .observatory-voyage-stage {
  transition: translate .26s ease, opacity 180ms ease-out var(--travel-return-delay);
}
body:is(.voyage-active,.observatory-voyage-active,.archives-flight-active)
  :is(.intro,.signature-voyage,.professional-worlds,#personal-world,.experience-tools,#arrival-replay-local),
body.voyage-active .observatory-voyage-stage,
body.observatory-voyage-active .voyage-stage,
body.archives-flight-active :is(.voyage-stage,.observatory-voyage-stage) {
  opacity: 0 !important;
  transition-delay: 0s;
}
body:is(.voyage-active,.observatory-voyage-active,.archives-flight-active) #wand-trail { opacity: 0 !important; }

body.paused :is(.intro,.signature-voyage,.professional-worlds,#personal-world,.experience-tools,#arrival-replay-local,.voyage-stage,.observatory-voyage-stage) {
  transition-duration: 0s;
  transition-delay: 0s;
}
@media (prefers-reduced-motion: reduce) {
  body :is(.intro,.signature-voyage,.professional-worlds,#personal-world,.experience-tools,#arrival-replay-local,.voyage-stage,.observatory-voyage-stage) {
    transition-duration: 0s !important;
    transition-delay: 0s !important;
  }
}


/* Give the two experience controls a shared type scale. */
.experience-tools { --control-label-size: 12px; }
.experience-tools #theme-orbit .theme-action,
.experience-tools #motion .motion-word {
  font: 400 var(--control-label-size)/1.35 'Space Grotesk', sans-serif;
  letter-spacing: 0;
}
.experience-tools #motion > [aria-hidden="true"] {
  display: inline-grid;
  place-items: center;
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
  border: 1px solid #b8d9d27a;
  border-radius: 7px;
  background: #182731b8;
  color: #e5eee9;
  font-size: 13px;
  line-height: 1;
}
.experience-tools #motion:is(:hover,:focus-visible,[aria-pressed="true"]) > [aria-hidden="true"] {
  border-color: #b8d9d2;
  background: #354e57;
}
@media (max-width: 740px) {
  .experience-tools { --control-label-size: 11px; }
  .experience-tools #motion .motion-word { font-size: 0; }
  .experience-tools #motion .motion-word::after { font-size: var(--control-label-size); }
}
