/**
 * NeuroBloom overdrive — the growing stem, and hero depth.
 *
 * The stem replaces a generic reading-progress bar. It encodes something true
 * rather than decorating: the page is a journey, and it grows a leaf at each
 * stage you reach — the Recovery Garden's own metaphor, used structurally.
 *
 * Desktop only (it needs margin), gated behind .nb-js, and off entirely under
 * prefers-reduced-motion. Decorative and aria-hidden throughout.
 */

/* ─── The stem ─────────────────────────────────────────────────────────────── */

.nb-stem {
  display: none;
  position: fixed;
  left: 46px;
  top: 0;
  bottom: 0;
  width: 26px;
  z-index: 40;
  pointer-events: none;
}

/* Needs a wide viewport to sit clear of the content column. */
@media (min-width: 1400px) {
  .nb-js .nb-stem {
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nb-stem {
    display: none !important;
  }
}

.nb-stem-track,
.nb-stem-grow {
  position: absolute;
  left: 12px;
  width: 2px;
  border-radius: 2px;
}

.nb-stem-track {
  top: 14vh;
  bottom: 14vh;
  background: #2e7d32;
  opacity: 0.14;
}

.nb-stem-grow {
  top: 14vh;
  height: calc(72vh * var(--nb-p, 0));
  background: linear-gradient(180deg, #2e7d32 0%, #4caf50 100%);
  will-change: height;
}

/* A seed at the base, so the stem starts from something. */
.nb-stem-seed {
  position: absolute;
  left: 9px;
  top: calc(14vh - 4px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7b4426;
  opacity: 0.55;
}

/* ─── Leaves and the bloom ─────────────────────────────────────────────────── */

/* Each leaf is hinged at its base, on the stem, and swings out as it opens. */
.nb-leaf {
  position: absolute;
  left: 13px;
  width: 26px;
  height: 15px;
  margin-top: -7px;
  transform-origin: 0 50%;
  transform: rotate(0deg) scale(0);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: visible;
}

.nb-leaf-r.is-open {
  transform: rotate(-24deg) scale(1);
}

/* 180 + 24: past horizontal-left, so the tip lifts rather than droops. */
.nb-leaf-l.is-open {
  transform: rotate(204deg) scale(1);
}

/* The last marker is a flower, not a leaf: centred on the stem, no hinge. */
.nb-leaf-bloom {
  left: 5px;
  width: 17px;
  height: 17px;
  margin-top: -8px;
  transform-origin: 50% 50%;
  transform: rotate(-35deg) scale(0);
}

.nb-leaf-bloom.is-open {
  transform: rotate(0deg) scale(1);
}

/* ─── Hero device: scroll-linked depth (transform-only, GPU-friendly) ──────── */

@supports (animation-timeline: scroll(root block)) {
  .nb-od-parallax.nb-od-scroll-native {
    animation-name: nb-hero-device-depth;
    animation-timing-function: cubic-bezier(0.25, 1, 0.5, 1);
    animation-timeline: scroll(root block);
    animation-fill-mode: both;
    will-change: transform;
  }
}

@keyframes nb-hero-device-depth {
  from {
    transform: translateY(12px) scale(1);
  }
  to {
    transform: translateY(-28px) scale(1.03);
  }
}

.nb-od-parallax.nb-od-scroll-js {
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .nb-od-parallax {
    animation: none !important;
    transform: none !important;
    will-change: auto;
  }
}
