/* ATLAS's startup cover. The visual trace is illustrative; only the runtime
   changes channel states. The cover does not request any map data itself. */
#loading-screen[data-atlas-boot] {
  --boot-ink: #eefaff;
  --boot-muted: #9cb4c6;
  --boot-cyan: #95e4ed;
  --boot-amber: #ffc785;
  --boot-edge: #8cb8d447;
  --boot-mono: 'JetBrains Mono', ui-monospace, monospace;
  --boot-gutter: clamp(18px, 5vw, 84px);
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  box-sizing: border-box;
  padding: var(--boot-gutter);
  overflow: auto;
  isolation: isolate;
  color: var(--boot-ink);
  background:
    radial-gradient(ellipse at 74% 45%, #123146 0, #091925 36%, transparent 68%),
    linear-gradient(155deg, #0a1621, #040910 76%);
  transition: opacity .54s ease, visibility .54s;
}

#loading-screen[data-atlas-boot]::before,
.atlas-boot-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

#loading-screen[data-atlas-boot]::before {
  content: '';
  background:
    radial-gradient(circle, #9ae4ff42 .65px, transparent 1.1px) center / 24px 24px,
    repeating-linear-gradient(0deg, #94c3d20a 0 1px, transparent 1px 5px);
  mask-image: radial-gradient(ellipse at 76% 48%, #000 22%, transparent 79%);
}

.atlas-boot-frame {
  inset: clamp(9px, 2vw, 30px);
  border: 1px solid #79b7d222;
  background:
    linear-gradient(90deg, #98e6f6, transparent) 0 0 / 80px 1px no-repeat,
    linear-gradient(#98e6f6, transparent) 0 0 / 1px 42px no-repeat,
    linear-gradient(270deg, #ffc785bc, transparent) 100% 100% / 82px 1px no-repeat,
    linear-gradient(0deg, #ffc785bc, transparent) 100% 100% / 1px 42px no-repeat,
    repeating-linear-gradient(90deg, #8ccccb79 0 1px, transparent 1px 9px) center top / 126px 5px no-repeat,
    repeating-linear-gradient(0deg, #8ccccb4e 0 1px, transparent 1px 9px) left center / 5px 90px no-repeat;
  animation: atlas-boot-etch .82s cubic-bezier(.14,.64,.2,1) both;
}

.atlas-boot-layout {
  display: grid;
  grid-template-columns: minmax(282px, 350px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(14px, 3vw, 60px);
  width: min(calc(100vw - 2 * var(--boot-gutter)), 1260px);
  margin: auto;
}

.atlas-boot-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
  animation: atlas-boot-copy .62s .09s cubic-bezier(.2,.65,.25,1) both;
}

.atlas-boot-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--boot-cyan);
  font: 600 11px/1.4 var(--boot-mono);
  letter-spacing: .21em;
  text-transform: uppercase;
}

.atlas-boot-brand img { display: block; }

#loading-screen[data-atlas-boot] #atlas-boot-title {
  margin: .18em 0 .12em -.04em;
  color: var(--boot-ink);
  font: 650 clamp(62px, 7.6vw, 112px)/.92 Inter, system-ui, sans-serif;
  letter-spacing: .045em;
  text-shadow: 0 0 46px #8dd7ff34;
}

#loading-screen[data-atlas-boot] .loader-status {
  position: relative;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  min-height: 47px;
  margin: 18px 0 17px;
  padding: 7px 10px 7px 14px;
  border-left: 2px solid var(--boot-amber);
  background: linear-gradient(90deg, #ffc7851d, transparent 92%);
  color: var(--boot-ink);
  font: 500 13px/1.5 var(--boot-mono);
  letter-spacing: 0;
  overflow-wrap: anywhere;
  animation: none;
}

.atlas-boot-channels {
  margin: 0;
  border-bottom: 1px solid var(--boot-edge);
  font: 500 11px/1.35 var(--boot-mono);
}

.atlas-boot-channels > div {
  --channel-signal: #8da6ba;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  border-top: 1px solid var(--boot-edge);
  background: linear-gradient(100deg, #0f23358c, transparent);
}

.atlas-boot-channels > [data-state='working'] {
  --channel-signal: var(--boot-amber);
  background: linear-gradient(100deg, #ffc7851c, #1026364d 72%, transparent);
}

.atlas-boot-channels > [data-state='ready'] { --channel-signal: var(--boot-cyan); }
.atlas-boot-channels > [data-state='error'] { --channel-signal: #ff9eaa; }

.atlas-boot-channels dt {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-left: 8px;
  color: #d0e0ec;
}

.atlas-boot-channels dt::before {
  content: '';
  width: 5px;
  height: 5px;
  transform: rotate(45deg);
  border: 1px solid var(--channel-signal);
}

.atlas-boot-channels :is([data-state='working'], [data-state='ready']) dt::before {
  background: var(--channel-signal);
  box-shadow: 0 0 9px var(--channel-signal);
}

.atlas-boot-channels dd {
  margin: 0;
  padding-right: 7px;
  color: var(--channel-signal);
  text-align: right;
}

.atlas-boot-clock {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  font: 500 10px/1.4 var(--boot-mono);
  color: var(--boot-muted);
  font-variant-numeric: tabular-nums;
}

.atlas-boot-clock :is(time, [data-boot-elapsed]) { color: var(--boot-ink); }

.atlas-boot-scope {
  position: relative;
  width: 100%;
  max-width: min(76svh, 790px);
  aspect-ratio: 1;
  justify-self: center;
  user-select: none;
}

.atlas-boot-earth {
  position: absolute;
  inset: 12.5%;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(circle at 31% 24%, #1b4b63, #0a2336 45%, #06101c 87%);
  box-shadow: 0 0 56px #30bffd33, 0 0 0 1px #9edcef7d;
  animation: atlas-boot-world .78s .08s cubic-bezier(.2,.65,.2,1) both;
}

.atlas-boot-wire,
.atlas-boot-relief,
.atlas-boot-trace {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.atlas-boot-wire {
  background:
    repeating-radial-gradient(ellipse at 50% 50%, transparent 0 10%, #68c0db55 10.2% 10.45%, transparent 10.65% 15%),
    repeating-linear-gradient(0deg, #68c0db50 0 1px, transparent 1px 12%),
    linear-gradient(90deg, transparent 49.85%, #a0dbf170 50%, transparent 50.15%);
}

.atlas-boot-relief {
  background: center / contain no-repeat url('/assets/atlas-boot-earth-c8de1ce89cde.webp');
  animation: atlas-boot-resolve 1.13s .29s cubic-bezier(.39,.04,.25,1) both;
}

.atlas-boot-relief canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.atlas-boot-trace {
  inset: 0 auto 0 -16%;
  width: 16%;
  border-radius: 0;
  background: linear-gradient(90deg, transparent, #56d5f42e 70%, #e3feffe0);
  box-shadow: 3px 0 16px #68e9ff63;
  animation: atlas-boot-trace 1.13s .29s cubic-bezier(.39,.04,.25,1) both;
}

.atlas-boot-reticle {
  position: absolute;
  inset: 5.5%;
  border: 1px solid #7bd3ed42;
  border-radius: 50%;
  background: repeating-conic-gradient(from .5deg, #a8e8fb6b 0 .36deg, transparent .36deg 5deg);
  mask-image: radial-gradient(circle, #000 0 66%, transparent 66% 68.1%, #000 68.2% 71%);
  animation: atlas-boot-world .84s cubic-bezier(.2,.65,.2,1) both;
}

.atlas-boot-reticle::before {
  position: absolute;
  content: '';
  inset: 2.1%;
  border: 1px dashed #7dd6ec35;
  border-radius: 50%;
  background: #0b1e2b;
}

.atlas-boot-reticle-axes {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent, #82ddff85 45%, transparent) left center / 14% 1px no-repeat,
    linear-gradient(90deg, transparent, #82ddff85 45%, transparent) right center / 14% 1px no-repeat,
    linear-gradient(transparent, #82ddff9a, transparent) center top / 1px 12.5% no-repeat,
    linear-gradient(transparent, #82ddff9a, transparent) center bottom / 1px 12.5% no-repeat;
  animation: atlas-boot-etch .82s .15s cubic-bezier(.14,.64,.2,1) both;
}

.atlas-boot-bearing {
  position: absolute;
  inset: 5%;
  border-radius: 50%;
  background: conic-gradient(from 25deg, transparent 0 14deg, #ffc785 14deg 18deg, #ffc78536 18deg 47deg, transparent 49deg 360deg);
  mask-image: radial-gradient(circle, transparent 69.1%, #000 69.4% 70.8%, transparent 71%);
  animation: atlas-boot-bearing 11s linear infinite;
}

.atlas-boot-calipers {
  position: absolute;
  inset: 2%;
  background:
    linear-gradient(var(--boot-cyan), var(--boot-cyan)) left top / 21px 1px no-repeat,
    linear-gradient(var(--boot-cyan), var(--boot-cyan)) left top / 1px 16px no-repeat,
    linear-gradient(var(--boot-amber), var(--boot-amber)) right bottom / 21px 1px no-repeat,
    linear-gradient(var(--boot-amber), var(--boot-amber)) right bottom / 1px 16px no-repeat;
  opacity: .7;
  animation: atlas-boot-etch .8s .34s cubic-bezier(.14,.64,.2,1) both;
}

#loading-screen[data-atlas-boot][data-phase='ready'] .atlas-boot-scope {
  animation: atlas-boot-handoff .54s ease-in both;
}

#loading-screen[data-atlas-boot].hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#loading-screen[data-atlas-boot].hidden .atlas-boot-bearing,
#loading-screen[data-atlas-boot][data-phase='error'] .atlas-boot-bearing {
  animation-play-state: paused;
}

#loading-screen[data-atlas-boot][data-phase='error'] .loader-status {
  border-color: #ff9eaa;
  background: linear-gradient(90deg, #ee657f25, transparent 92%);
}

.atlas-boot-retry:not([hidden]) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: 0 0 16px;
  padding: 0 14px;
  border: 1px solid var(--boot-cyan);
  border-radius: 3px;
  color: var(--boot-ink);
  background: #10293a;
  font: 600 12px/1 var(--boot-mono);
  cursor: pointer;
}

.atlas-boot-retry:focus-visible { outline: 2px solid var(--boot-amber); outline-offset: 3px; }

@keyframes atlas-boot-etch {
  from { clip-path: inset(48% 42% 48% 42%); opacity: .25; }
  to { clip-path: inset(0); }
}
@keyframes atlas-boot-copy {
  from { opacity: 0; translate: -9px 0; }
}
@keyframes atlas-boot-world {
  from { opacity: 0; scale: .86; }
}
@keyframes atlas-boot-resolve {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0); }
}
@keyframes atlas-boot-trace {
  0% { translate: 0 0; opacity: 0; }
  15%, 83% { opacity: 1; }
  100% { translate: 725% 0; opacity: 0; }
}
@keyframes atlas-boot-bearing { to { rotate: 1turn; } }
@keyframes atlas-boot-handoff { to { opacity: 0; scale: 1.075; } }

/* The existing chrome draws in once as the cover dissolves. Individual
   panels retain their own transitions, focus and disclosure state. */
body.atlas-boot-handoff:where(html:not([data-ui-theme='cyber']) > body:not(.cockpit-mode))
  :is(#terrantir-menu, #top-center-actions, #camera-hud-toggle) {
  animation: atlas-hud-trace .48s .19s cubic-bezier(.2,.65,.2,1) both;
}

@keyframes atlas-hud-trace {
  from { clip-path: inset(0 47% 0 47%); opacity: 0; }
  to { clip-path: inset(0); }
}

@media (max-width: 680px) {
  #loading-screen[data-atlas-boot] {
    --boot-gutter: clamp(16px, 6vw, 32px);
    background:
      radial-gradient(ellipse at 50% 25%, #12324a, transparent 57%),
      linear-gradient(155deg, #0a1621, #050b13 82%);
  }

  .atlas-boot-layout {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: clamp(8px, 2.8svh, 26px);
  }
  .atlas-boot-copy { width: min(100%, 390px); }
  .atlas-boot-scope {
    grid-row: 1;
    width: min(88%, 37svh, 410px);
  }
  #loading-screen[data-atlas-boot] #atlas-boot-title { font-size: clamp(48px, 12vw, 70px); }
  #loading-screen[data-atlas-boot] .loader-status { margin-block: 10px 12px; min-height: 38px; }
  .atlas-boot-brand img { width: 30px; height: 30px; }
  .atlas-boot-channels > div { min-height: 29px; }
}

@media (max-height: 610px) and (max-width: 680px) {
  .atlas-boot-scope { width: min(76%, 29svh); }
}

@media (prefers-reduced-motion: reduce) {
  #loading-screen[data-atlas-boot],
  #loading-screen[data-atlas-boot] *,
  body.atlas-boot-handoff :is(#terrantir-menu, #top-center-actions, #camera-hud-toggle) {
    animation: none;
    transition: none;
  }
  .atlas-boot-trace { display: none; }
}

/* Slow imagery must not block the workspace. Keep the base surface dim
   behind the active controls until Cesium draws data or the visitor acts. */
#cesiumContainer.atlas-map-awaiting-imagery {
  background:
    radial-gradient(ellipse at 50% 47%, #132a3e 0, #081521 42%, transparent 70%),
    #050b13;
}

#cesiumContainer.atlas-map-awaiting-imagery canvas { opacity: 0; }

.atlas-map-streaming {
  position: absolute;
  inset: 50% auto auto 50%;
  max-width: calc(100% - 36px);
  padding: .65em 1em;
  translate: -50% -50%;
  border-left: 1px solid #ffca87;
  color: #d8ecf4;
  background: #0b1d2de6;
  font: 500 12px/1.4 'JetBrains Mono', ui-monospace, monospace;
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  #cesiumContainer.atlas-map-settling:not(.atlas-map-awaiting-imagery) canvas {
    transition: opacity .22s ease;
  }
}
