.observatory-atlas {
  --ivory: #fbefdb;
  --copper: #f0be85;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: clip;
  isolation: isolate;
  background: radial-gradient(ellipse at 48% 44%, #162743 0, #080e20 66%, #050816);
  color: var(--ivory);
}
.observatory-atlas::backdrop { background: transparent; }
.atlas-map, .atlas-constellations { position: absolute; inset: 0; }
.atlas-map { overflow: clip; }
.atlas-map::before {
  content: '';
  position: absolute;
  inset: -8%;
  background: url('../galaxie-graphite-v46.webp') center / cover no-repeat;
  filter: sepia(.32) hue-rotate(178deg) saturate(1.7) brightness(.82);
  opacity: .24;
}
.observatory-atlas:not(.atlas-still) .atlas-map::before {
  animation: atlas-drift 26s ease-in-out infinite alternate;
}
@keyframes atlas-drift {
  from { transform: translate(-5px, 5px); opacity: .23; }
  to { transform: translate(9px, -7px); opacity: .28; }
}
.atlas-map::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 48%, transparent 32%, #03061575 100%);
  pointer-events: none;
}
.atlas-sky { position: relative; display: block; width: 100%; height: 100%; }
.atlas-constellations { z-index: 1; pointer-events: none; }
.atlas-constellations button {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  display: grid;
  align-content: end;
  width: var(--target-width);
  height: var(--target-height);
  min-height: 44px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--ivory);
  font: 500 clamp(.92rem, 2vw, 1.36rem)/1.2 Georgia, serif;
  cursor: pointer;
  pointer-events: auto;
}
.atlas-constellations button span {
  justify-self: center;
  padding: 6px 8px;
  border-radius: 5px;
  background: #080d21bc;
  text-shadow: 0 1px 5px #000;
  white-space: nowrap;
}
.atlas-constellations button:hover span,
.atlas-constellations button[aria-expanded="true"] span {
  color: #ffdbad;
  box-shadow: 0 1px #e4b17b;
}
.atlas-caption {
  position: absolute;
  z-index: 2;
  width: min(225px, 65vw);
  padding: 9px 12px;
  border-inline-start: 1px solid #f2c58e;
  border-radius: 2px;
  background: linear-gradient(90deg,#101a31ee,#101a31b8);
  color: #ffebcf;
  font: 400 clamp(.9rem, 1.45vw, 1.12rem)/1.36 Georgia, serif;
  pointer-events: none;
}
.atlas-caption::before {
  content: '';
  position: absolute;
  right: 100%;
  top: 50%;
  width: 15px;
  height: 1px;
  background: linear-gradient(90deg, #e6b98020, #f2c58e);
}
.atlas-caption small {
  display: block;
  margin-top: .4rem;
  color: #e4cdb1;
  font: 500 .73rem/1.45 'Space Grotesk', sans-serif;
}
.atlas-caption.is-left { border-inline: 0 solid #f2c58e; border-inline-end-width: 1px; }
.atlas-caption.is-left::before { left: 100%; right: auto; transform: scaleX(-1); }
.atlas-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: clamp(16px, 3.8vw, 46px);
  background: linear-gradient(#050817a8, transparent);
  pointer-events: none;
}
.atlas-heading h2 {
  margin: 0;
  font: 400 clamp(2.1rem, 4.6vw, 4.7rem)/1.04 Georgia, serif;
  letter-spacing: -.05em;
}
.atlas-heading p { margin: .55rem 0 0; color: #d7dce7; font-size: clamp(.78rem, 1.3vw, 1rem); }
.atlas-control {
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid #a08261;
  border-radius: 5px;
  background: #10182ce8;
  color: var(--ivory);
  font: 600 .85rem/1.35 'Space Grotesk', sans-serif;
  cursor: pointer;
  pointer-events: auto;
}
.atlas-control:hover { background: #30364b; }
.observatory-atlas :focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; }
.atlas-actions {
  position: absolute;
  z-index: 2;
  inset: auto auto max(16px, 4vh) 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100% - 20px);
}
.atlas-short-label, .atlas-scroll-track { display: none; }
.atlas-read[hidden] { display: none; }
.atlas-read {
  position: absolute;
  z-index: 3;
  inset: clamp(12px, 2.7vh, 32px) clamp(12px, 2.7vw, 36px) clamp(12px, 2.7vh, 32px) auto;
  width: min(520px, 46vw);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(20px, 3vw, 42px);
  border: 1px solid #b28b65;
  border-radius: 8px;
  background: linear-gradient(150deg, #242e46, #151b30 43%);
  box-shadow: 0 12px 45px #030611b0, inset 0 0 0 3px #a17a4f1f;
  scrollbar-width: thin;
  scrollbar-color: #a7835b #131e30;
}
.observatory-atlas:not(.atlas-still) .atlas-read { animation: atlas-read-in 190ms ease-out both; }
@keyframes atlas-read-in { from { opacity: 0; translate: 12px 0; } to { opacity: 1; translate: 0 0; } }
.atlas-read-close { margin-bottom: 1.3rem; }
.atlas-read h3 { margin: 0 0 1rem; font: 400 clamp(1.9rem, 3.3vw, 3.1rem)/1.07 Georgia, serif; letter-spacing: -.04em; }
.atlas-read h4 { margin: 1.4rem 0 .35rem; color: #ffdcaf; font-size: 1.04rem; line-height: 1.4; }
.atlas-read p, .atlas-read dd { color: #ece5db; font-size: clamp(.96rem, 1.22vw, 1.04rem); line-height: 1.65; }
.atlas-read dl { margin: 1.2rem 0; }
.atlas-read dt { color: #ffdcaf; font-weight: 650; margin-top: 1.05rem; }
.atlas-read dd { margin: .25rem 0 0; }
.atlas-read .atlas-note { padding-left: 1rem; border-left: 2px solid #b78760; color: #ffe0b8; }
.atlas-read .atlas-takeaway {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: .65rem;
  margin: 1.25rem 0 0;
  padding: .65rem .8rem;
  border: 1px solid #a7835b;
  border-radius: 6px;
  background: #312c38;
}
.atlas-takeaway strong { display: block; color: #ffdcaf; }
.atlas-takeaway-icon {
  display: grid;
  place-items: center;
  width: 1.2rem;
  height: 1.2rem;
  margin-top: .15rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: #ffdcaf;
  font: 700 .78rem/1 Georgia, serif;
}
.atlas-read .atlas-agent {
  margin-top: 1.5rem;
  padding: .8rem 1rem;
  border: 1px solid #8499c9;
  border-radius: 6px;
  background: #263451;
}
.atlas-read .atlas-agent h4 { margin: 0 0 .35rem; color: #d9e5ff; }
.atlas-read .atlas-agent p { margin: 0; }
.atlas-takeaway + .atlas-agent { margin-top: .75rem; }
.atlas-read .atlas-example {
  padding: .65rem 1rem;
  border: 1px solid #d5ad824d;
  border-radius: 5px;
  background: #242d46;
}
.atlas-example strong { display: block; color: #ffdcaf; }
.atlas-read.is-continuous { inset-inline: 0; margin-inline: auto; width: min(740px, 80%); }
.observatory-atlas:has(.atlas-read.is-continuous:not([hidden])) :is(.atlas-header, .atlas-constellations, .atlas-actions) {
  visibility: hidden;
}
.atlas-read.is-continuous .atlas-read-close { position: sticky; top: 0; z-index: 1; background: #151e34; }
.atlas-reader-index nav { display: flex; flex-wrap: wrap; gap: 8px; }
.atlas-read.is-continuous [data-atlas-panel] {
  margin-top: 2.6rem;
  padding-top: 2rem;
  border-top: 1px solid #a384645c;
  scroll-margin-top: 60px;
}
.atlas-opening-star {
  position: fixed;
  left: calc(50% - 3px);
  top: calc(50% - 3px);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff1cf;
  box-shadow: 0 0 12px 4px #f9c98b;
  opacity: 0;
  pointer-events: none;
}
.observatory-signal { opacity: 0; }
.observatory-signal.is-lit { animation: observatory-signal 450ms ease-out both; }
@keyframes observatory-signal { 0%,100% { opacity: 0; } 28% { opacity: 1; } 58% { opacity: .75; } }
.observatory-atlas-in-flight, .observatory-atlas-in-flight body { overflow: hidden; }
.observatory-atlas-in-flight .room-header { visibility: hidden; }
.observatory-atlas:not(.atlas-still) :is(.atlas-header, .atlas-constellations, .atlas-actions) { transition: opacity 160ms ease-out; }
.observatory-atlas.is-revealing :is(.atlas-header, .atlas-constellations, .atlas-actions) { opacity: 0; pointer-events: none; }
.observatory-atlas.is-revealing button { pointer-events: none; }

@media (min-width: 681px) {
  .observatory-atlas.read-left .atlas-read { left: clamp(12px, 2.7vw, 36px); right: auto; }
}

@media (max-width: 680px) {
  .atlas-header { display: grid; padding: 15px 16px; gap: 12px; }
  .atlas-return { grid-row: 1; justify-self: start; }
  .atlas-heading p { margin-top: .3rem; }
  .atlas-constellations button { font-size: .95rem; }
  .atlas-caption { text-align: center; border-inline: 0; border-top: 1px solid #f2c58e; }
  .atlas-caption::before { display: none; }
  .atlas-read, .atlas-read.is-continuous { inset: 8px; width: auto; padding: 18px 21px 18px 18px; }
  .observatory-atlas:has(.atlas-read:not([hidden])) :is(.atlas-header, .atlas-constellations, .atlas-actions) {
    visibility: hidden;
  }
  .atlas-read .atlas-read-close { position: sticky; top: 0; z-index: 1; background: #151e34; }
  .atlas-actions .atlas-control { padding-inline: 8px; font-size: .78rem; }
  .atlas-actions .atlas-long-label { display: none; }
  .atlas-short-label { display: inline; }
  .atlas-read [data-atlas-panel] > h3 + .atlas-takeaway { margin: .65rem 0 1.15rem; }
  .atlas-scroll-track:not([hidden]) {
    display: block; position: absolute; z-index: 4; inset: 23px 14px 23px auto;
    width: 3px; border-radius: 3px; background: #414b62; pointer-events: none;
  }
  .atlas-scroll-track span { position: absolute; inset-inline: 0; border-radius: inherit; background: #d7ad82; }
}
@media (max-height: 490px) and (min-width: 681px) {
  .atlas-header { padding: 12px 22px; }
  .atlas-heading h2 { font-size: 2.2rem; }
  .atlas-actions { bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .observatory-signal.is-lit, .observatory-atlas .atlas-read,
  .observatory-atlas:not(.atlas-still) .atlas-map::before { animation: none; }
}
