/* The atlas: hidden journey map at the left edge. */
.archive-header { display: none !important; }

.atlas { --atlas-w: 112px; position: fixed; z-index: 60; inset: 0 auto 0 0; width: 0; pointer-events: none; }
.atlas > * { pointer-events: auto; }

/* Always-present handle: a hair-thin light line that fills with progress. */
.atlas-edge { position: fixed; left: 0; top: 0; bottom: 0; width: 22px; cursor: e-resize; }
.atlas-edge-line {
  --pulse: 0;
  position: absolute; left: 7px; top: 18vh; bottom: 18vh; width: 2px; border-radius: 2px;
  background: linear-gradient(180deg, transparent, rgba(242, 237, 227, .16) 12%, rgba(242, 237, 227, .16) 88%, transparent);
  box-shadow: 0 0 calc(6px + var(--pulse) * 22px) rgba(190, 230, 255, calc(.05 + var(--pulse) * .55));
  transition: opacity .5s ease, left .4s ease;
}
.atlas-progress {
  position: absolute; inset: 0; border-radius: inherit; transform-origin: top; transform: scaleY(0);
  background: linear-gradient(180deg, rgba(160, 225, 255, .1), rgba(220, 245, 255, .75) 92%, #fff);
  transition: transform .25s linear;
}
.atlas-edge:hover .atlas-edge-line { left: 9px; }
.atlas.is-open .atlas-edge-line { opacity: 0; }

/* Glass panel with a little depth on the way in. */
.atlas-panel {
  position: fixed; left: 14px; top: 50%;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 12px;
  width: var(--atlas-w); height: min(84vh, 820px); padding: 12px 10px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, .09);
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(140, 200, 255, .07), transparent 60%),
    linear-gradient(180deg, rgba(14, 17, 24, .78), rgba(5, 6, 10, .86));
  box-shadow: 0 40px 90px -20px rgba(0, 0, 0, .85), 0 0 0 1px rgba(0, 0, 0, .5), inset 0 1px rgba(255, 255, 255, .08), inset 0 0 40px rgba(120, 180, 255, .03);
  -webkit-backdrop-filter: blur(22px) saturate(1.35); backdrop-filter: blur(22px) saturate(1.35);
  transform: translate(calc(-100% - 30px), -50%) perspective(900px) rotateY(18deg);
  transform-origin: left center;
  opacity: 0; visibility: hidden;
  transition: transform .62s cubic-bezier(.2, .85, .2, 1), opacity .4s ease, visibility 0s linear .62s;
}
.atlas.is-open .atlas-panel {
  transform: translate(0, -50%) perspective(900px) rotateY(0deg);
  opacity: 1; visibility: visible;
  transition: transform .62s cubic-bezier(.2, .85, .2, 1), opacity .35s ease, visibility 0s;
}

.atlas-top { display: grid; gap: 10px; justify-items: center; }
.atlas-entrance {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  color: rgba(242, 237, 227, .7); border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .03);
  transition: color .3s, background .3s, border-color .3s;
}
.atlas-entrance:hover, .atlas-entrance:focus-visible { color: #fff; border-color: rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .07); }
.atlas svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* The eight worlds become a compact constellation of orbs. */
.atlas .world-nav { display: grid; grid-template-columns: repeat(4, 26px); gap: 7px; }
.atlas .world-button { width: 26px; height: 26px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 50%; padding: 0; background: #111; overflow: visible; }
.atlas .world-button::after { inset: -4px; }
.atlas .world-name { display: none; }

/* Chapter strip. */
.atlas-strip {
  margin: 0; padding: 30px 0; list-style: none; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none;
  display: flex; flex-direction: column; align-items: center;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 9%, #000 91%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 9%, #000 91%, transparent);
}
.atlas-strip::-webkit-scrollbar { display: none; }
.atlas-strip > li { flex: none; }
.atlas-chapter {
  position: relative; display: block; width: 88px; height: 50px; padding: 0; overflow: hidden; cursor: pointer;
  border: 0; border-radius: 7px; background: var(--card-color, #111);
  box-shadow: 0 10px 22px -10px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .07);
  opacity: .62; filter: saturate(.75);
  transform: translateX(-14px) scale(.96);
  transition: transform .45s cubic-bezier(.2, .85, .2, 1), opacity .35s ease, filter .35s ease, box-shadow .35s ease;
}
.atlas.is-open .atlas-chapter { transform: none; transition-delay: calc(var(--i) * 22ms), calc(var(--i) * 22ms), 0s, 0s; }
.atlas-chapter img { width: 100%; height: 100%; object-fit: cover; display: block; }
.atlas-chapter:hover, .atlas-chapter:focus-visible { opacity: 1; filter: none; transform: scale(1.06); box-shadow: 0 16px 30px -12px rgba(0, 0, 0, .95), 0 0 0 1px rgba(255, 255, 255, .28); z-index: 2; }
.atlas-chapter.is-current { opacity: 1; filter: none; box-shadow: 0 0 0 1.5px rgba(235, 248, 255, .85), 0 0 26px -2px rgba(170, 225, 255, .45), 0 14px 26px -12px #000; }
.atlas-chapter.is-reveal { display: grid; place-items: center; background: radial-gradient(circle, rgba(170, 220, 255, .14), transparent 70%), #05070b; color: rgba(242, 237, 227, .75); }
.atlas-chapter.is-reveal svg { width: 26px; height: 26px; stroke-width: 1; }
.atlas-gap { height: 6px; }
.atlas-passage { position: relative; height: 18px; width: 100%; }
.atlas-passage::before {
  content: ''; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; border-radius: 50%; transform: translate(-50%, -50%);
  background: rgba(242, 237, 227, .7); box-shadow: 0 0 8px rgba(190, 230, 255, .7);
}

/* Soundtrack controls. */
.atlas-sound { display: grid; grid-template-columns: 32px minmax(0, 1fr) 22px; align-items: center; gap: 6px; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, .07); }
.atlas-sound[hidden] { display: none; }
.atlas-play, .atlas-next { display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: rgba(242, 237, 227, .8); cursor: pointer; }
.atlas-play { width: 34px; height: 34px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .04); }
.atlas-next { width: 26px; height: 26px; opacity: .6; }
.atlas-play:hover, .atlas-next:hover { color: #fff; opacity: 1; }
.atlas-track { font-size: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: italic 400 12px/1.2 var(--ex-serif, Georgia); color: rgba(242, 237, 227, .55); }
.atlas.is-playing .atlas-play { box-shadow: 0 0 18px rgba(170, 225, 255, .25); }

/* Touch / keyboard toggle; hidden on hover-capable screens. */
.atlas-toggle {
  position: fixed; left: max(12px, env(safe-area-inset-left)); bottom: max(14px, env(safe-area-inset-bottom));
  display: none; place-items: center; width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .14); background: rgba(6, 8, 11, .8); color: rgba(242, 237, 227, .8);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 12px 30px rgba(0, 0, 0, .55);
}
@media (hover: none), (pointer: coarse) {
  .atlas-toggle { display: grid; }
  .atlas-edge { display: none; }
  .atlas-panel { left: 10px; top: auto; bottom: calc(max(14px, env(safe-area-inset-bottom)) + 58px); height: min(70vh, 640px);
    transform: translate(calc(-100% - 30px), 0) perspective(900px) rotateY(18deg); }
  .atlas.is-open .atlas-panel { transform: translate(0, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .atlas-panel, .atlas-chapter, .atlas-progress { transition: none !important; }
}
/* With the left rail gone, the exhibition reclaims the left margin. */
.archive-main { padding-left: clamp(32px, 6vw, 116px); }
@media (max-width: 980px) { .archive-main { padding-left: 32px; } }
@media (max-width: 620px) { .archive-main { padding-left: 16px; padding-bottom: 90px; } }

/* No top toolbar any more: the welcome sits close to the top. */
.archive-main { padding-top: clamp(20px, 4vh, 56px); }

/* A single soundtrack: no next-track button. */
.atlas-next { display: none !important; }
.atlas-sound { grid-template-columns: 32px minmax(0, 1fr); }
