/* ==========================================================================
   JOURNEY SCENE — shared mechanics for journey-morning.js / journey-afternoon.js
   Pinned (desktop/tablet, motion allowed) + stepped (mobile OR
   prefers-reduced-motion) variants, see js/behaviors/journey-scroll.js.
   ========================================================================== */

.journey {
  position: relative;
  background: var(--ink);
  /* Testing the bottom scrim color -- was ink (10,10,12). Swap this one
     value to try another color (e.g. var(--accent-rgb) for orange) rather
     than hunting down every rgba() below. */
  --scrim-rgb: 255, 255, 255;
}

/* ---- Pinned / cinematic variant ---- */

.journey-pinned {
  position: relative;
  height: calc(var(--journey-stage-count, 6) * 100vh);
}

.journey-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.journey--stepped .journey-pinned,
.journey--pinned .journey-stepped {
  display: none;
}

/* ---- Scene surface (shared by pinned + each stepped step) ---- */

.journey-scene {
  --progress: 0;
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.journey-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.journey-sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.journey[data-daypart="morning"] .journey-sky {
  background: linear-gradient(180deg, rgba(255, 246, 232, .28) 0%, rgba(255, 246, 232, 0) 32%, rgba(var(--scrim-rgb), .05) 70%, rgba(var(--scrim-rgb), .62) 100%);
}

.journey[data-daypart="afternoon"] .journey-backdrop {
  filter: saturate(.92) brightness(.97);
}

.journey[data-daypart="afternoon"] .journey-sky {
  background: linear-gradient(180deg, var(--sky-afternoon-glow) 0%, rgba(217, 95, 18, 0) 32%, rgba(var(--scrim-rgb), .08) 70%, rgba(var(--scrim-rgb), .64) 100%);
}

.journey-route.route-line-svg { z-index: 1; }

/* ---- Copy (bottom-left narrative text, over the scrim) ---- */

.journey-copy {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 32px;
  z-index: 3;
  max-width: 640px;
  /* Flipped from white to ink to stay legible against the white scrim
     test above (--scrim-rgb) -- revisit together if the scrim color
     changes again. */
  color: var(--ink);
}

.journey-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(10, 10, 12, .65);
  margin: 0 0 10px;
}

.journey-headline {
  font-size: clamp(24px, 3.6vw, 38px);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.16;
  margin: 0;
  color: var(--accent);
}

.journey-sub {
  font-size: 15.5px;
  line-height: 1.55;
  color: rgba(10, 10, 12, .72);
  margin: 12px 0 0;
  max-width: 520px;
}
.journey-sub[hidden] { display: none; }

/* ---- Overlays (parent-notification, school-admin-card) ---- */

.journey-overlay {
  position: absolute;
  top: 100px;
  right: 28px;
  z-index: 4;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity .35s ease, transform .35s ease;
}

.journey-overlay.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

/* ---- Stepped / reduced-motion fallback ---- */

.journey-stepped .journey-step {
  min-height: 78vh;
  display: flex;
  align-items: stretch;
  padding: 28px 0;
}

.journey-stepped .journey-scene {
  /* A definite height (not the base rule's height:100%, which can't
     resolve against .journey-step's min-height-only, otherwise-indefinite
     box) so the absolutely-positioned backdrop/sky/route actually fill the
     step instead of collapsing to the small natural height of the in-flow
     hud/copy/overlay content. */
  height: 78vh;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  /* Anchor content over the darker end of the sky scrim (see the
     data-daypart gradients above) rather than the lighter top, where
     white text would lose contrast against the image. */
  justify-content: flex-end;
}

.journey-stepped .journey-overlay {
  position: static;
  opacity: 1;
  transform: none;
  pointer-events: auto;
  transition: none;
  margin: 14px 28px 0;
  align-self: flex-start;
}

.journey-stepped .journey-copy {
  position: static;
  padding: 20px 28px 16px;
  max-width: none;
}

.journey-stepped .journey-step {
  opacity: 0;
  transition: opacity .5s ease;
}
.journey-stepped .journey-step.in-view {
  opacity: 1;
}

@media (max-width: 640px) {
  .journey-copy { left: 16px; right: 16px; bottom: 20px; }
  .journey-stepped .journey-overlay,
  .journey-stepped .journey-copy { margin-left: 16px; margin-right: 16px; }
}
