
/* ========================= */
/* SECTION RAIL NAV (RIGHT)  */
/* ========================= */

.section-rail {
  position: fixed;
  top: 50%;
  right: 2rem;
  transform: translateY(-50%);
  z-index: 50;
  pointer-events: none; /* links enabled inside */
}

/* Hide on smaller screens */
/*@media (max-width: 991px) {
  .section-rail {
    display: none;
  }
}*/

/* Vertical glass capsule just for the dots */
.section-rail ul {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  position: relative;
  pointer-events: auto;

  width: 30px;
  border-radius: 999px;
  background: rgba(10, 16, 14, 0.35);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
}

.section-rail-item {
  pointer-events: auto;
}

/* Each item: dot centered inside capsule */
.section-rail-item a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 24px;
  text-decoration: none;
  color: #f5f5f5;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1;
  opacity: 0.55;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

/* Slight lift on hover */
.section-rail-item a:hover {
  opacity: 0.9;
  transform: translateX(-1px);
}

/* The dot itself */
.section-rail-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background-color: rgba(245, 245, 245, 0.9);
  transition:
    width 0.2s ease,
    height 0.2s ease,
    background-color 0.2s ease,
    transform 0.2s ease;
}

/* Floating label chip to the left */
.section-rail-label {
  position: absolute;
  right: 34px;  /* sits just left of the capsule */
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;

  background: rgba(10, 16, 14, 0.9);
  color: #f5f5f5;
  white-space: nowrap;
  font-size: 0.75rem;

  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

/* Show label when hovered OR active */
.section-rail-item:hover .section-rail-label,
.section-rail-item.is-active .section-rail-label {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* Active state: brighter + larger dot */
.section-rail-item.is-active a {
  opacity: 1;
}

.section-rail-item.is-active .section-rail-dot {
  width: 11px;
  height: 11px;
  background-color: #ffffff;
  transform: scale(1.05);

  /* soft teal halo behind the dot */
  box-shadow: 0 0 0 6px rgba(25, 130, 112, 0.45);
}

/* DRIP / SQUISH ANIMATION ON ACTIVE CHANGE */
@keyframes sectionRailDotDrip {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.1, 1.9) translateY(2px);   /* stretch downward */
  }
  65% {
    transform: scale(1.05, 0.7) translateY(-1px); /* bounce back up */
  }
  100% {
    transform: scale(1);
  }
}

/* Applied via JS when a dot becomes active */
.section-rail-dot.dot-drip {
  animation: sectionRailDotDrip 0.45s ease-out;
}
.section-rail-trail {
  position: absolute;
  right: 11px; /* aligns with dot center inside capsule; tweak if needed */
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(
    to bottom,
    rgba(25, 130, 112, 0.0),
    rgba(25, 130, 112, 0.9),
    rgba(25, 130, 112, 0.0)
  );
  opacity: 0;
  pointer-events: none;
  transition:
    top 0.25s ease,
    height 0.25s ease,
    opacity 0.25s ease;
}

.section-rail-trail.is-visible {
  opacity: 0.9;
}

/* ========================= */
/* MOBILE: HORIZONTAL RAIL   */
/* ========================= */

@media (max-width: 767px) {
  .section-rail {
    position: fixed;
    top: env(safe-area-inset-top, 0px);  /* sit just under the URL bar / notch */
    left: 0;
    right: 0;
    bottom: auto;
    transform: none;
    display: block;
    opacity: 0;                 /* hidden until hero is off-screen */
    pointer-events: none;
    z-index: 40;
    transition: opacity 0.2s ease;
  }

  .section-rail.section-rail--show-mobile {
    opacity: 1;
    pointer-events: auto;
  }
  /* Top glass bar, horizontal layout */
  .section-rail ul {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;  /* no extra safe-area padding here */
    width: 100%;
    border-radius: 0 0 999px 999px;
    background: rgba(10, 16, 14, 0.78);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
    overflow-x: auto;
    scrollbar-width: none;     /* Firefox hide scrollbar */
  }

  .section-rail ul::-webkit-scrollbar {
    display: none;             /* WebKit hide scrollbar */
  }

  /* Pills: dot + label inline, centered vertically */
  .section-rail-item a {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    padding: 0.25rem 0.6rem;
    gap: 0.35rem;
    border-radius: 999px;
    background: transparent;
    opacity: 0.7;
    transform: none;
  }

  .section-rail-item a:hover {
    opacity: 0.9;
    transform: none;
  }

  .section-rail-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    box-shadow: none; /* glow is too much at this size */
  }

  .section-rail-label {
    position: static;
    right: auto;
    top: auto;
    transform: none !important;
    padding: 0;
    background: none;
    white-space: nowrap;
    font-size: 0.78rem;
    line-height: 1.2;
    opacity: 1;                /* always visible in the bar */
  }

  /* Active pill */
  .section-rail-item.is-active a {
    background: rgba(25, 130, 112, 0.35);
    opacity: 1;
  }

  .section-rail-item.is-active .section-rail-dot {
    width: 9px;
    height: 9px;
    background-color: #ffffff;
    box-shadow: none;
    transform: scale(1);
  }

  /* Trail only makes sense on vertical rail (desktop) */
  .section-rail-trail {
    display: none !important;
  }
}