/* Course page: the painting is fixed behind; the camera travels across it as you scroll, one scene per month. */

.course-veil {
  background: linear-gradient(to bottom, var(--scene-veil), transparent 35%, transparent 55%, var(--scene-veil));
  opacity: 0.62;
}

.scenes {
  position: relative;
  z-index: 10;
  color: var(--scene-ink);
}

.scene {
  display: flex;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 6rem clamp(1.25rem, 6vw, 5rem);
}

.scene-copy {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 34rem;
  position: relative;
  isolation: isolate;
  text-shadow: 0 1px 3px color-mix(in oklch, var(--scene-veil) 70%, transparent), 0 4px 30px var(--scene-veil);
  will-change: opacity, transform;
}

/* A soft dark glow behind the words keeps them readable on any part of the photo. */
.scene-copy::before {
  content: "";
  position: absolute;
  inset: -3.5rem -5rem;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in oklch, var(--scene-veil) 68%, transparent), transparent);
  filter: blur(10px);
  pointer-events: none;
}

.scene-hero,
.scene-end {
  justify-content: center;
  text-align: center;
}

.scene-hero .scene-copy,
.scene-end .scene-copy {
  align-items: center;
  max-width: 46rem;
}

.scene h1,
.scene-end h2 {
  font-size: clamp(2.5rem, 8vw, 5.5rem);
  line-height: 1;
}

.scene-stage h2 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.05;
}

.scene-stage.is-right {
  justify-content: flex-end;
}

.scene-stage.is-right .scene-copy {
  text-align: right;
  align-items: flex-end;
}

.scene-lead {
  color: var(--scene-ink);
  font-size: 1.1875rem;
  line-height: 1.5;
}

.scene-hint {
  color: var(--scene-ink-muted);
}

.scene-eyebrow {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.scene-number {
  font-size: clamp(5rem, 16vw, 11rem);
  font-weight: 700;
  line-height: 0.85;
  color: transparent;
  -webkit-text-stroke: 2px var(--scene-ink);
  text-shadow: none;
}

.scene-back {
  margin-top: 0.5rem;
  color: var(--scene-ink-muted);
  font-size: 0.9375rem;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.scene-back:hover {
  color: var(--scene-ink);
}

.course-notice {
  position: fixed;
  top: 4.75rem;
  left: 50%;
  z-index: 40;
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--scene-ink);
  border-radius: var(--radius-ui);
  background-color: var(--scene-veil);
  color: var(--scene-ink);
  font-size: 0.9375rem;
  transform: translateX(-50%);
}

@media (max-width: 640px) {
  .scene-stage,
  .scene-stage.is-right {
    justify-content: flex-start;
  }

  .scene-stage.is-right .scene-copy {
    text-align: left;
    align-items: flex-start;
  }
}

/* Display type: month numbers, eyebrows and card titles use the headline font. */
.scene-number,
.scene-eyebrow,
.course-title {
  font-family: var(--font-display);
}

/* Buttons keep their text crisp: the readability shadow is only for text over the photo. */
.scene-copy .btn {
  text-shadow: none;
}

/* First paint of the course page already shows the photo, so arriving from the card's zoom has no gap. */
.journey-stage {
  background: var(--scene-veil) url("../motion/meditation.b58a60a5086a.jpg") center / cover no-repeat;
}

/* Each month: its title and its sessions, mirrored on a diagonal. Without JavaScript they simply
   follow one another inside the month's screen. */
.scene-stage:has(.scene-sessions) {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2rem;
}

/* A dark glass panel: the list stays readable over the brightest part of the photo. */
.scene-sessions {
  width: min(26rem, 100%);
  padding: 1.5rem 1.5rem 1.25rem;
  border-radius: var(--radius-ui);
  background-color: color-mix(in oklab, var(--scene-veil) 76%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.scene-sessions ul {
  margin-top: 0.75rem;
}

.scene-sessions li {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.6rem 0;
  will-change: opacity, transform;
}

/* A gold dot, the color of the buttons here, level with the first line of the title. */
.scene-sessions li::before {
  content: "";
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  margin-top: 0.45em;
  border-radius: 50%;
  background-color: var(--scene-accent);
}

.session-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  line-height: 1.3;
}

/* Pinned (js/course.js): the scroll no longer carries the text across the screen. Every month
   keeps the same two places, one in a top corner and one in the opposite bottom corner, and
   only fades and slides in them. */
.is-pinned .scene-stage:has(.scene-sessions) .scene-copy,
.is-pinned .scene-sessions {
  position: fixed;
  pointer-events: none;
}

.is-pinned .scene-stage:has(.scene-sessions) .scene-copy {
  top: max(5.5rem, 13vh);
  left: clamp(1.25rem, 6vw, 5rem);
  max-width: min(34rem, 46vw);
}

.is-pinned .scene-sessions {
  right: clamp(1.25rem, 6vw, 5rem);
  bottom: max(6rem, 11vh);
  width: min(26rem, 44vw);
}

.is-pinned .scene-stage.is-right:has(.scene-sessions) .scene-copy {
  right: clamp(1.25rem, 6vw, 5rem);
  left: auto;
}

.is-pinned .scene-stage.is-right .scene-sessions {
  right: auto;
  left: clamp(1.25rem, 6vw, 5rem);
}

/* The big month number follows the height of the screen, so both blocks fit on short ones. */
.is-pinned .scene-stage:has(.scene-sessions) .scene-number {
  font-size: clamp(3.5rem, 17vh, 11rem);
}

/* Stopping near a month settles on it, where its composition is complete. */
html:has(.scenes.is-pinned) {
  scroll-snap-type: y proximity;
}

.scenes.is-pinned .scene {
  scroll-snap-align: start;
}

/* Phones and narrow windows: the same diagonal, stacked. Title above on its side, the list
   across the bottom, clear of the sound button. */
@media (max-width: 860px) {
  .is-pinned .scene-stage:has(.scene-sessions) .scene-copy {
    top: 4.75rem;
    left: 1.25rem;
    max-width: calc(100vw - 2.5rem);
    gap: 0.5rem;
  }

  .is-pinned .scene-stage.is-right:has(.scene-sessions) .scene-copy {
    right: 1.25rem;
    left: auto;
    align-items: flex-end;
    text-align: right;
  }

  .is-pinned .scene-sessions,
  .is-pinned .scene-stage.is-right .scene-sessions {
    right: 1rem;
    bottom: 5.75rem;
    left: 1rem;
    width: auto;
    padding: 1rem 1.1rem 0.75rem;
  }

  .is-pinned .scene-stage:has(.scene-sessions) .scene-number {
    font-size: clamp(2.75rem, 10vh, 4.5rem);
  }

  .session-title {
    font-size: 1rem;
  }

  .scene-sessions li {
    padding-block: 0.3rem;
  }
}

/* Phones held sideways: too short to stack, so the two blocks sit side by side, still on the
   diagonal, and the big number gives up its room. */
@media (max-height: 500px) and (orientation: landscape) {
  .is-pinned .scene-stage:has(.scene-sessions) .scene-copy {
    top: 4.25rem;
    left: 1.25rem;
    max-width: 40vw;
  }

  .is-pinned .scene-stage.is-right:has(.scene-sessions) .scene-copy {
    right: 1.25rem;
    left: auto;
  }

  .is-pinned .scene-sessions {
    right: 1rem;
    bottom: 0.75rem;
    left: auto;
    width: 50vw;
    padding: 0.75rem 1rem 0.5rem;
  }

  /* On the left it stays above the sound button. */
  .is-pinned .scene-stage.is-right .scene-sessions {
    right: auto;
    bottom: 5.25rem;
    left: 1rem;
  }

  .is-pinned .scene-stage:has(.scene-sessions) .scene-number {
    display: none;
  }

  .scene-stage:has(.scene-sessions) h2 {
    font-size: 1.75rem;
  }

  .session-title {
    font-size: 0.9375rem;
  }

  .scene-sessions li {
    padding-block: 0.2rem;
  }
}

/* The biography has one block of text per scene: it keeps its place at the side. */
.bio-page .scene-stage {
  flex-direction: row;
  justify-content: flex-start;
}

.bio-page .scene-stage.is-right {
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .bio-page .scene-stage,
  .bio-page .scene-stage.is-right {
    align-items: flex-end;
    justify-content: flex-start;
  }
}

/* Over a bright part of a photo the outline alone cannot be read: a dark glass sits behind it. */
.scheme-dark .btn:not(:hover, :active) {
  background-color: color-mix(in oklab, var(--scene-veil) 76%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
