.atlas {
  --gutter: clamp(2rem, 7.3vw, 10rem);
  --top: clamp(1.5rem, 4.9vh, 4.25rem);
  --cx: 43%;
  --cy: 59%;
  --diameter: min(63vw, 77vh, 60rem);
  --diameter: min(63vw, 77svh, 60rem);
  --brass: #c8ad80;
  position: relative;
  isolation: isolate;
  overflow: clip;
  max-width: 132rem;
  min-height: max(37rem, 100vh);
  min-height: max(37rem, 100svh);
  margin-inline: auto;
  background: radial-gradient(ellipse at 43% 59%, #191a19 0%, #111315 36%, #0b0c0e 75%);
}

.atlas-nav, .atlas-title, .atlas-stage, .companies, .spin-control { position: absolute; }
.atlas-nav { z-index: 2; top: var(--top); left: var(--gutter); }
.atlas-title {
  z-index: 1;
  left: var(--gutter);
  top: max(6.6rem, 13%);
  margin: 0;
  color: #ece8df;
  font: 400 clamp(3.25rem, 5.8vw, 6.5rem)/0.98 var(--display);
  letter-spacing: -0.035em;
}
.atlas-title em { color: #cebea6; font-weight: 400; }

.atlas-stage {
  top: var(--cy);
  left: var(--cx);
  width: var(--diameter);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.atlas-stage::before {
  content: "";
  position: absolute;
  inset: 23% -4%;
  border: 1px solid #c5aa7e46;
  border-left-color: #c5aa7e0d;
  border-radius: 50%;
  transform: rotate(-28deg);
}
#globe, .globe-fallback { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.globe-fallback { background: url("./assets/globe-still.webp") center / contain no-repeat; }
#globe[data-ready="true"] ~ .globe-fallback { display: none; }

.companies {
  --bend: clamp(1.4rem, 3vw, 3.4rem);
  --lead: clamp(1.7rem, 3.8vw, 4.5rem);
  left: calc(var(--cx) + var(--diameter) * 0.403);
  top: calc(var(--cy) - var(--diameter) * 0.2);
  margin: 0;
  padding: 0;
  color: var(--brass);
  list-style: none;
}
.companies::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  width: 0.35rem;
  height: 0.35rem;
  border: 1px solid #f9e3bb;
  border-radius: 50%;
  background: #d5b78b;
  box-shadow: 0 0 0 4px #cdb79027, 0 0 14px #e7c49040;
  transform: translate(-50%, -50%);
}
.companies::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 100%;
  width: var(--bend);
  height: var(--bend);
  background: linear-gradient(135deg, transparent calc(50% - 0.6px), currentColor 50%, transparent calc(50% + 0.6px));
}
.companies li {
  position: absolute;
  top: calc(0px - var(--bend));
  left: var(--bend);
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 1vw, 1rem);
  transform: translateY(-50%);
}
.companies li::before { content: ""; flex: 0 0 var(--lead); width: var(--lead); height: 1px; background: currentColor; }
.company-label {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #f0e8da;
  font: 400 clamp(2rem, 3.65vw, 4rem)/1 var(--display);
  letter-spacing: -0.025em;
  white-space: nowrap;
  text-decoration: underline;
  text-decoration-color: #85745a;
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
}
.company-label:is(:hover, :focus-visible) { color: #ffdfa4; text-decoration-color: currentColor; }

.spin-control:not([hidden]) {
  left: var(--gutter);
  bottom: var(--top);
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 44px;
  margin: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: #d2cbbb;
  font: 0.94rem/1.3 "Segoe UI", Arial, sans-serif;
  cursor: pointer;
}
.spin-control::before {
  content: "";
  box-sizing: border-box;
  width: 2rem;
  height: 2rem;
  border: 1px solid #827766;
  border-radius: 50%;
  background: #101114;
}
.spin-control::after {
  content: "";
  position: absolute;
  left: calc(1rem - 4px);
  top: calc(50% - 5px);
  width: 8px;
  height: 10px;
  background: linear-gradient(to right, currentColor 31%, transparent 31% 69%, currentColor 69%);
}
.spin-control[data-paused="true"]::after { background: currentColor; clip-path: polygon(12% 0, 100% 50%, 12% 100%); }
.spin-control:focus-visible { outline: 2px solid #ebcca0; outline-offset: 4px; }
.atlas-credit {
  position: absolute;
  right: var(--gutter);
  bottom: var(--top);
  display: flex;
  align-items: center;
  min-height: 44px;
  color: #aaa9a4;
  font: 0.8rem/1.3 "Segoe UI", Arial, sans-serif;
  text-decoration: underline;
  text-decoration-color: #686661;
  text-underline-offset: 0.25em;
}
.atlas-credit:hover { color: #eee6d7; }

@media (max-width: 47.99rem), (max-aspect-ratio: 4/5) {
  .atlas {
    --gutter: clamp(1.45rem, 6.2vw, 3.8rem);
    --top: max(1.35rem, env(safe-area-inset-top));
    --cx: 48%;
    --cy: 52%;
    --diameter: min(98vw, 51svh);
    min-height: max(34rem, 100svh);
  }
  .atlas-title { top: max(6.3rem, 13.5%); font-size: clamp(2.62rem, 12.2vw, 5.5rem); }
  .companies {
    --bend: clamp(1.2rem, 4vw, 2rem);
    --lead: clamp(1.1rem, 3.6vw, 2.75rem);
    left: var(--cx);
    top: calc(var(--cy) + var(--diameter) * 0.45);
  }
  .companies::after {
    top: 0;
    bottom: auto;
    background: linear-gradient(45deg, transparent calc(50% - 0.6px), currentColor 50%, transparent calc(50% + 0.6px));
  }
  .companies li { top: var(--bend); }
  .company-label { font-size: clamp(1.75rem, 6.6vw, 3.3rem); }
  .spin-control:not([hidden]), .atlas-credit { bottom: max(1rem, env(safe-area-inset-bottom)); }
}

@media (forced-colors: active) {
  .companies::after, .companies li::before { forced-color-adjust: none; color: CanvasText; }
  .spin-control::after { forced-color-adjust: none; color: ButtonText; }
}
