html {
  scroll-snap-type: y proximity; /* only elements w/ scroll-snap-align become stop candidates */
}

#header {
  position: fixed;
  top: 0rem;
  left: 0rem;
  padding: 0.5rem;
  z-index: 2;
  background-color: var(--ink-navy);
  pointer-events: none;
  border-bottom-right-radius: 1rem;
  border-right: 0.1rem solid var(--parchment);
  border-bottom: 0.1rem solid var(--parchment);
}

body.is-ready #header {
  transition: background-color 0.4s ease;
}

#header.is-hero {
  background-color: transparent;
  border-right: none;
  border-bottom: none;
}

#footer {
  position: fixed;
  bottom: 0;
  right: 0;
  z-index: 10;
  background-color: var(--ink-navy);
  padding: 0.75rem 1.25rem 0.5rem 1.25rem;
  border-top-left-radius: 1rem;
  border-top: 0.1rem solid var(--parchment);
  border-left: 0.1rem solid var(--parchment);
}

#footer p {
  margin: 0;
}

#footer a {
  color: var(--bone); /* Clean, legible off-white */
  text-decoration: none;
  opacity: 0.6;
  transition:
    opacity 0.25s ease,
    color 0.25s ease;
}

#footer a:hover {
  opacity: 1;
  color: var(--terracotta); /* Nice pop of amber when hovered */
}

#logo {
  transform-origin: top left;
}

body.is-ready #logo {
  transition: transform 0.4s ease;
}

#logo.is-hero {
  transform: translate(var(--hero-x), var(--hero-y)) scale(var(--hero-scale));
  z-index: 4;
}

#hero-logo-slot {
  height: 160px;
  width: 325px;
  margin-bottom: 1rem;
}

.scrolly {
  position: relative;
}

#scrolly-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#scrolly-graphic {
  position: absolute;
  inset: 0;
  z-index: 1;
}

#scrolly-graphic img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#scrolly-content {
  position: relative;
  width: 90%;
  text-align: center;
  padding: 0 1.5rem;
  z-index: 3;
}

#scrolly-content .content {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

#scrolly-content .content.content-shown {
  opacity: 1;
}

#scrolly-content .content.is-leaving {
  opacity: 0;
  transform: translate(0, 0.5rem);
}

#scrolly-content .content.content-hidden {
  opacity: 0;
}

#steps {
  position: relative;
  z-index: -1;
}

.step {
  height: 100vh;
}

.step.chapter-start {
  scroll-snap-align: start;
  scroll-snap-stop: always; /* stronger pull — set to "normal" for a lighter feel */
}

#scroll-indicator {
  position: fixed;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9; /* Sits just below the footer (10) but above scrolly content (3) */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none; /* Allows users to click "through" it if needed */
  background-color: var(--ink-navy);
  color: var(--bone); /* Uses your existing off-white variable */
  transition:
    opacity 0.4s ease,
    transform 0.4s ease;
  padding: 1rem 1rem 1rem 1rem;
  border-radius: 1rem;
}

/* When this class is added via JS, it fades and slides down out of view */
#scroll-indicator.is-hidden {
  opacity: 0;
  transform: translate(-50%, 1rem);
}

/* Creates a clean, CSS-only down arrow */
#scroll-indicator .arrow {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--bone);
  border-bottom: 2px solid var(--bone);
  transform: rotate(45deg);
  animation: bounce-arrow 2s infinite;
}

/* Gentle keyframe animation for the arrow bounce */
@keyframes bounce-arrow {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0) rotate(45deg);
  }
  40% {
    transform: translateY(-6px) rotate(45deg);
  }
  60% {
    transform: translateY(-3px) rotate(45deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-snap-type: none;
  }
  #scrolly-content .content {
    transition: none;
  }
  body.is-ready #header {
    transition: none;
  }
  body.is-ready #logo {
    transition: none;
  }
}
