.arrival, .solar-nav {
  --paper: #fff4e3;
  --foil: #e8c48d;
  --serif: Georgia, "Times New Roman", serif;
  color: var(--paper);
}
.arrival {
  position: relative;
  display: grid;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  overflow: clip;
  background: radial-gradient(ellipse at 22% 44%, #080d1c8c, transparent 70%);
}
.arrival-layout {
  width: min(1140px, 88%);
  margin: auto;
  padding: clamp(4.8rem,12svh,7rem) 0;
  display: grid;
  align-items: center;
  grid-template-columns: 1.12fr 1fr;
  gap: 5%;
}
.identity {position: relative; z-index: 1}
.identity h1, .map-heading h2 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -.058em;
  margin: 0;
}
.identity h1 {font-size: clamp(4.3rem, 8.2vw, 8.4rem); line-height: .97}
.identity h1 em {display: block; color: #d4cbfc; font-weight: 400}
.identity p {max-width: 32ch; color: #e2dfeb; font-size: clamp(1rem, 1.5vw, 1.25rem); margin: 1.7rem 0 0}
.identity p::before {content: ""; display: block; width: 4rem; height: 1px; margin-bottom: 1.2rem; background: linear-gradient(90deg,var(--foil),transparent)}
.portrait-frame {
  position: relative;
  justify-self: center;
  width: min(35vw, 49svh, 416px);
  aspect-ratio: 958 / 1112;
  border-radius: 4px;
  box-shadow: 0 15px 70px #05091470, 0 0 80px #aaa0ff19;
}
.portrait-frame::before, .portrait-frame::after {
  content: ""; position: absolute; pointer-events: none;
}
.portrait-frame::before {
  inset: -8px; border: 1px solid #ded3b84f; border-radius: 7px;
}
.portrait-frame::after {
  inset: -11px; background:
    linear-gradient(90deg,#e3c997,transparent) top left / 38px 1px,
    linear-gradient(270deg,#c9c4ef,transparent) bottom right / 38px 1px;
  background-repeat: no-repeat;
}
.portrait {width: 100%; height: auto; display: block; border-radius: 3px}
.identity h1 > span {display: block}
.identity .name-ink {
  display: inline-block; vertical-align: top; white-space: nowrap;
  padding: .28em .15em; margin: -.28em -.15em;
}
@media (prefers-reduced-motion: no-preference) {
  .awaiting-portrait .portrait, .awaiting-portrait .identity h1 > * {opacity: 0}
  .identity p {animation: arrive-name 1s ease-out 1.25s both}
  .portrait-frame::before, .portrait-frame::after {animation: trace-frame 1.2s ease-out 1.5s both}
}
@keyframes arrive-name {
  from {opacity: 0; transform: translate(-.2em,.22em); filter: blur(8px)}
  55% {opacity: .84}
  to {opacity: 1; transform: translate(0); filter: blur(0)}
}
@keyframes trace-frame {from {opacity: 0; scale: 1.05} to {opacity: 1; scale: 1}}
.gathering {position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none}
.resting-dragon {position: absolute; right: 6%; top: 8%; width: clamp(90px,19vw,270px); pointer-events: none}
body:has(#flight:not([hidden]) #creature:not([hidden])) .resting-dragon {display: none}
.scroll-cue {
  position: absolute; left: 6%; bottom: max(2rem,7svh); z-index: 11;
  display: inline-flex; align-items: center; gap: 12px; min-height: 44px;
  color: var(--paper); text-decoration: none; font-size: 1rem;
}
.scroll-cue::before {content: ""; width: 9px; height: 9px; border: solid var(--foil); border-width: 0 1px 1px 0; transform: rotate(45deg)}
.solar-nav {
  position: relative;
  padding: clamp(2.2rem,6vw,5.6rem) max(4%,calc((100% - 1200px)/2)) 3rem;
  background: radial-gradient(ellipse at 50% 53%, #16192b38, transparent 72%);
}
.map-heading {display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-inline: 2%}
.map-heading h2 {font-size: clamp(2.35rem,5.2vw,4.8rem); line-height: 1.15}
.map-heading em {font-weight: 400; color: #d4cbfc}
.orbit-map {
  --pad-x: 66px; --pad-y: 69px;
  position: relative; margin: 1rem auto 0; max-width: 1150px; height: clamp(530px,47vw,590px);
}
.track {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: calc((100% - 2 * var(--pad-x)) * var(--radius));
  height: calc((100% - 2 * var(--pad-y)) * var(--radius));
  border: 1px solid #c7c2e126; border-radius: 50%; pointer-events: none;
}
.sun, .globe {position: relative; aspect-ratio: 1; border-radius: 50%}
.sun {
  position: absolute; width: clamp(42px,6vw,74px); left: 50%; top: 50%;
  transform: translate(-50%,-50%); box-shadow: 0 0 20px #ffa94477,0 0 65px #e88d414d;
}
.world {
  --body-size: var(--diameter); --start: var(--angle);
  position: absolute;
  left: calc(50% + (50% - var(--pad-x)) * var(--radius) * cos(var(--start)));
  top: calc(50% + (50% - var(--pad-y)) * var(--radius) * sin(var(--start)));
  translate: -50% -50%; width: max(44px,var(--body-size)); height: max(44px,var(--body-size));
  display: grid; place-items: center; color: #f5edf7; text-decoration: none;
  z-index: 11; border-radius: 50%;
}
.globe {display: block; width: var(--body-size); pointer-events: none}
.planet-canvas {position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none}
.globe canvas, .sun canvas {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: var(--extent,100%); height: var(--extent,100%); pointer-events: none;
}
.world[href="#certificates"] .globe {--extent: 225%}

.world-name {
  position: absolute; top: calc(50% + var(--body-size) / 2 + 4px);
  left: 50%; transform: translateX(-50%); font: 400 clamp(.94rem,1.6vw,1.27rem)/1.2 var(--serif);
  white-space: nowrap; text-shadow: 0 1px 6px #070b17,0 0 10px #070b17;
}
.world:hover, .world:focus-visible {color: #ffdd99; text-decoration: underline; text-underline-offset: .24em}
.world:hover .globe, .world:focus-visible .globe {filter: drop-shadow(0 0 8px #ffe2b588)}
@media (prefers-reduced-motion: no-preference) {
  html {scroll-behavior: smooth}
  .world, .globe {transition: color .22s, filter .28s}
  .profile h2:target {animation: section-arrival 1.7s ease-out}
  .cert-viewer {
    opacity: 0; scale: .975;
    transition: opacity .22s ease-out, scale .26s ease-out, overlay .26s allow-discrete, display .26s allow-discrete;
  }
  .cert-viewer[open] {opacity: 1; scale: 1}
  .cert-viewer::backdrop {
    opacity: 0;
    transition: opacity .22s ease-out, overlay .22s allow-discrete, display .22s allow-discrete;
  }
  .cert-viewer[open]::backdrop {opacity: 1}
  @starting-style {
    .cert-viewer[open] {opacity: 0; scale: .975}
    .cert-viewer[open]::backdrop {opacity: 0}
  }
  #creature :is(#texture,.flight-preview,#rig) {transition: opacity .24s ease-in-out}
  #creature .flight-preview, #creature #rig {display: block; opacity: 0}
  #creature.atlas-ready .flight-preview, #creature.rigged #rig {opacity: 1}
  #creature.atlas-ready #texture, #creature.rigged #texture, #creature.rigged .flight-preview {
    display: block; opacity: 0;
  }
}
@keyframes section-arrival {from {text-shadow: 0 0 14px #ddd0ffb0} to {text-shadow: 0 0 14px transparent}}
#flight {position: absolute; inset: 0; height: 100vh; height: 100dvh; z-index: auto}
#effects {position: fixed; z-index: 9}
#creature {position: fixed; z-index: 10}
#creature :is(#texture,.flight-preview) {
  filter: hue-rotate(-13deg) saturate(1.16) contrast(1.08) drop-shadow(0 0 2px #9bb4f44d);
}
.controls {position: fixed; z-index: 14}
@media (max-width: 650px) {
  .arrival-layout {width: 88%; padding: 5.5rem 0 7.3rem; grid-template-columns: 1fr; justify-items: center; gap: 2.3rem}
  .portrait-frame {grid-row: 1; width: clamp(166px,min(61vw,32svh),275px)}
  .identity {text-align: center}
  .identity h1 {font-size: clamp(3.1rem,10.4vw,4.8rem)}
  .identity p {font-size: 1rem; margin: 1rem auto 0}
  .identity p::before {margin: 0 auto .8rem}
  .scroll-cue {bottom: 4.3rem}
  .solar-nav {padding-inline: 0}
  .map-heading {padding-inline: 6%}
  .orbit-viewport {width: 100%; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none}
  .orbit-viewport::-webkit-scrollbar {display: none}
  .orbit-map {--pad-x: 70px; --pad-y: 80px; width: 800px; max-width: none; height: 560px; margin-inline: 0}
  .world {--body-size: calc(var(--diameter) * .86)}
  .world-name {font-size: .94rem}
}
@media (min-width: 651px) and (max-height: 540px) {
  .arrival-layout {padding-block: 4rem}
  .portrait-frame {width: min(29vw,53svh)}
}
#perch {
  position: fixed; right: max(22px,env(safe-area-inset-right)); bottom: max(63px,calc(env(safe-area-inset-bottom) + 49px));
  width: clamp(108px,12vw,152px); height: 31px; pointer-events: none; z-index: 12;
  filter: drop-shadow(0 7px 12px #0008);
}
#perch::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(170deg,#a5a5be 0%,#666b89 17%,#30364c 23%,#1b2034 56%,#111529 100%);
  clip-path: polygon(0 19%,15% 6%,42% 0,78% 4%,100% 19%,86% 39%,80% 69%,63% 61%,51% 100%,35% 66%,18% 73%,11% 42%);
}
#perch::after {
  content: ""; position: absolute; inset: 2px 10px auto; height: 7px;
  border-radius: 50%; border-top: 1px solid #d1c1f6b3;
  background: radial-gradient(ellipse,#a6a0d852,transparent 70%);
  box-shadow: 0 -2px 13px #9386d94a;
}
#flight[data-state="perched"] .controls .launch-help {display: inline}
.controls .launch-help {display: none}
.controls:has(#guide:not([hidden])) #guide {position: absolute; right: 0; bottom: 90px; width: max-content}
#flight[data-state="perched"] #creature {cursor: pointer}
#flight[data-state="perched"] #help {border-color: #dfc394; color: #ffe4b3}
@media (min-width: 651px) and (max-width: 1100px) {
  .world {--body-size: calc(var(--diameter) * .8)}
}
#guide {pointer-events: auto}
#guide-launch {color: #ffe2af; text-decoration: underline; text-underline-offset: 3px}
#flight[data-state="perched"] .steer-help {display: none}
#flight[data-state="perched"] #creature {z-index: 12}
#flight[data-state="perched"] #help {width: auto; padding-inline: 12px}
.controls #fire:disabled {cursor: default; opacity: .75}
@media (max-width: 820px) {
  #deep-sky::before, #deep-sky::after {animation: none}
}
