html {
  scroll-behavior: smooth;
  scroll-padding-top: 86px;
}

#presentation {
  position: relative;
  isolation: isolate;
  min-height: 60vh;
}

.ambient-field {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: #f4f8fc;
}

.ambient-field > div {
  position: absolute;
  inset: -10%;
  transition: opacity 900ms ease, transform 1200ms ease;
  will-change: opacity, transform;
}

.ambient-pearl {
  opacity: 1;
  background:
    radial-gradient(ellipse at 88% 8%, #c3ddff 0, transparent 52%),
    radial-gradient(ellipse at 15% 100%, #e2eaff 0, transparent 55%),
    linear-gradient(135deg, #f6faff, #edf4fb);
}

.ambient-blue {
  opacity: 0;
  background:
    radial-gradient(ellipse at 90% 20%, #9cc9ff 0, transparent 60%),
    radial-gradient(ellipse at 2% 90%, #c3ddff 0, transparent 60%),
    #e7f2ff;
}

.ambient-deep {
  opacity: 0;
  background:
    radial-gradient(ellipse at 80% 20%, #a6c7ec 0, transparent 60%),
    radial-gradient(ellipse at 10% 100%, #b5c7dc 0, transparent 60%),
    #d9e4f1;
}

#presentation[data-theme="blue"] .ambient-blue {
  opacity: 1;
  transform: translate(-1%, 1%);
}

#presentation[data-theme="dark"] .ambient-deep {
  opacity: 1;
  transform: translate(1%, -1%);
}

.chapter-atlas {
  position: fixed;
  z-index: 50;
  top: 50%;
  left: max(8px, calc((100vw - 1440px) / 2 - 32px));
  width: 24px;
  transform: translateY(-50%);
  pointer-events: auto;
}

.atlas-list {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 24px;
  padding: 3px 0;
}

.atlas-track {
  position: absolute;
  z-index: -1;
  top: 12px;
  bottom: 12px;
  left: 11px;
  width: 1px;
  background: linear-gradient(180deg, #96b6d22b, #789bbd75, #96b6d22b);
}

.atlas-glass {
  position: absolute;
  top: 0;
  left: 1px;
  width: 22px;
  height: 22px;
  transform: translateY(var(--marker-y, 3px));
  border: 1px solid #ffffffdd;
  border-radius: 50%;
  background: #ffffff85;
  box-shadow: 0 2px 14px #387cba35, inset 0 0 0 1px #e8f4ffb0;
  backdrop-filter: blur(12px) saturate(155%);
  -webkit-backdrop-filter: blur(12px) saturate(155%);
  transition: transform 500ms cubic-bezier(.22, 1, .36, 1);
  pointer-events: none;
}

.atlas-link {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 25px;
  border: 0;
  border-radius: 50%;
  color: #6b8296;
  text-decoration: none;
  outline-offset: 2px;
}

.atlas-index {
  display: none;
}

.atlas-dot {
  width: 5px;
  height: 5px;
  border: 1px solid #92aabe;
  border-radius: 50%;
  transition: width 200ms ease, height 200ms ease, background 200ms ease, box-shadow 200ms ease;
}

.atlas-link:hover .atlas-dot {
  width: 7px;
  height: 7px;
  border-color: #0877ed;
}

.atlas-link[aria-current="location"] {
  color: #0877ed;
}

.atlas-link[aria-current="location"] .atlas-dot {
  background: #0877ed;
  border-color: #0877ed;
  box-shadow: 0 0 0 4px #0877ed15;
}

.atlas-label {
  position: absolute;
  top: 50%;
  left: 31px;
  z-index: 2;
  width: max-content;
  max-width: min(250px, calc(100vw - 60px));
  padding: 4px 9px;
  transform: translate(5px, -50%);
  border: 1px solid #ffffffb8;
  border-radius: 4px;
  background: #f7fbfff0;
  box-shadow: 0 4px 16px #31516b16;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #274257;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.5;
  opacity: 0;
  visibility: hidden;
  transition: opacity 140ms ease, transform 180ms ease, visibility 140ms;
  pointer-events: none;
}

.atlas-link:hover .atlas-label,
.atlas-link:focus-visible .atlas-label {
  transform: translate(0, -50%);
  opacity: 1;
  visibility: visible;
}

#presentation[data-theme="dark"] .atlas-label {
  border-color: #ffffff30;
  background: #15354be0;
  color: #f4f9fc;
}

.module {
  scroll-margin-top: 12px;
}

.site-footer {
  position: relative;
  z-index: 1;
}

@media (max-width: 1150px) {
  .chapter-atlas {
    left: 2px;
  }
}

@media (max-width: 700px) {
  html {
    scroll-padding-top: 70px;
  }

  .chapter-atlas {
    left: 2px;
    width: 24px;
  }

  .atlas-list {
    width: 24px;
    gap: 4px;
  }

  .atlas-link {
    width: 24px;
    height: 24px;
  }

  .atlas-glass {
    left: 1px;
    width: 22px;
    height: 22px;
  }

  .atlas-track {
    left: 11px;
  }

  .atlas-label {
    left: 28px;
    max-width: calc(100vw - 42px);
    font-size: 10px;
  }

  .module {
    scroll-margin-top: 10px;
  }

  .module-inner {
    padding-left: 30px !important;
  }
}

@media (max-width: 365px) {
  .chapter-atlas {
    left: 0;
    width: 24px;
  }

  .atlas-list,
  .atlas-link {
    width: 24px;
  }

  .atlas-glass {
    left: 1px;
    width: 22px;
  }

  .atlas-track {
    left: 11px;
  }

  .module-inner {
    padding-left: 27px !important;
  }
}

@media (max-height: 540px) {
  .atlas-list {
    gap: 1px;
  }

  .atlas-link {
    height: 24px;
  }
}

@supports not (backdrop-filter: blur(10px)) {
  .atlas-glass {
    background: #ffffffd9;
  }

  .atlas-label {
    background: #ffffffed;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .ambient-field > div,
  .atlas-glass,
  .atlas-dot,
  .atlas-label {
    transition: none !important;
  }
}
