.slides {
  height: 100vh;
  height: 100dvh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  touch-action: pan-y;
  overscroll-behavior-y: contain;
}

@media (prefers-reduced-motion: reduce) {
  .slides {
    scroll-behavior: auto;
    scroll-snap-type: y proximity;
  }
}

.slide {
  position: relative;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 5vw, 64px) clamp(24px, 6vw, 96px);
  padding-inline-start: max(clamp(24px, 6vw, 96px), calc(var(--rail-width) + 24px));
  overflow: hidden;
}

.slide__inner {
  width: 100%;
  max-width: 1100px;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
  padding-block: 4px;
}

.slide__next {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--rose);
  color: var(--rose);
  box-shadow: 0 0 16px rgba(217, 160, 168, 0.35);
  transition: box-shadow 0.2s var(--ease), color 0.2s var(--ease);
}

.slide__next:hover {
  color: var(--maroon);
  box-shadow: 0 0 22px rgba(217, 160, 168, 0.55);
}

.slide__next svg {
  width: 18px;
  height: 18px;
  animation: bob 1.8s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

/* Theme toggle */
.theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 50;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.theme-toggle:hover {
  background: var(--elevated);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* Left dot-nav rail */
.rail {
  position: fixed;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
}

.rail__dots {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rail__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--border);
  padding: 0;
  transition: background-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.rail__dot::before {
  content: "";
  display: block;
  width: 22px;
  height: 22px;
  margin: -7px;
}

.rail__dot:hover {
  background: var(--text-secondary);
}

.rail__dot[aria-current="true"] {
  background: var(--maroon);
  transform: scale(1.35);
}

.rail__label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}

.rail__index {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--maroon);
  letter-spacing: 0.05em;
}

.rail__title {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

@media (max-width: 640px) {
  :root {
    --rail-width: 32px;
  }

  .rail {
    left: 12px;
    gap: 8px;
  }

  .rail__dots {
    gap: 9px;
  }

  .rail__dot {
    width: 6px;
    height: 6px;
  }

  .rail__title {
    display: none;
  }
}
