/* Landing page cleanup — envelope layout + remove orange text glows */
.hero-glow {
  background: none !important;
}

.envelope-video-wrap {
  position: relative;
  width: min(88vw, 700px);
  margin: -0.5rem auto 0.75rem;
}

.envelope-quote {
  margin-top: -0.75rem;
}

.envelope-video {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to top, transparent 0%, rgba(0, 0, 0, 0.15) 22%, rgba(0, 0, 0, 0.72) 36%, #000 46%);
  mask-image: linear-gradient(to top, transparent 0%, rgba(0, 0, 0, 0.15) 22%, rgba(0, 0, 0, 0.72) 36%, #000 46%);
}

.thesis-section {
  padding-top: clamp(4rem, 9vw, 8rem);
}

.flower-stage {
  display: flex;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.flower-canvas {
  display: block;
  width: clamp(140px, 22vw, 220px);
  height: auto;
  pointer-events: none;
  opacity: calc((var(--reveal, 1) * 0.92) + 0.08);
  filter: saturate(1.08) contrast(1.04);
  will-change: opacity;
}

.flower-video-src {
  position: absolute;
  left: -9999px;
  top: 0;
  width: 2px;
  height: 2px;
  opacity: 0;
  pointer-events: none;
}

.positioning-card-thumb {
  width: 92px;
  height: 92px;
  border-radius: 10px;
  overflow: hidden;
  flex: none;
  display: block;
}

.positioning-card-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* zoom into the artwork so the element fills the square,
     without enlarging the square itself */
  transform: scale(1.5);
}

/* Source <video> is the decode feed for the canvas — keep it in the render tree
   (NOT display:none / visibility:hidden, which can suspend frame decoding),
   just park it offscreen. drawImage still reads it at full intrinsic resolution. */
.envelope-video-src {
  position: absolute;
  left: -9999px;
  top: 0;
  width: 2px;
  height: 2px;
  opacity: 0;
  pointer-events: none;
}

.hero-play-icon {
  width: 3rem;
  height: 3rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  flex-shrink: 0;
}

.hero-wave-wrap {
  position: relative;
  max-width: 560px;
  margin-inline: auto;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.hero-wave-wrap canvas {
  display: block;
  width: 100%;
  height: 100px;
}

/* Hero entrance — staggered, softer motion */
@media (prefers-reduced-motion: no-preference) {
  .hero-intro [data-reveal] {
    opacity: 0;
    transform: translateY(32px);
    filter: blur(8px);
    transition:
      opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
      transform 0.9s cubic-bezier(0.16, 1, 0.3, 1),
      filter 0.9s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .hero-intro [data-reveal].mz-in {
    opacity: 1;
    transform: none;
    filter: none;
  }

  .hero-intro [data-reveal]:nth-child(1) { transition-delay: 0.05s; }
  .hero-intro [data-reveal]:nth-child(2) { transition-delay: 0.18s; }
  .hero-intro [data-reveal]:nth-child(3) { transition-delay: 0.32s; }
  .hero-intro [data-reveal]:nth-child(4) { transition-delay: 0.46s; }
  .hero-intro [data-reveal]:nth-child(5) { transition-delay: 0.58s; }

  .hero-word {
    display: inline-block;
    will-change: transform, opacity, filter;
    transition:
      opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
      transform 0.55s cubic-bezier(0.16, 1, 0.3, 1),
      filter 0.55s cubic-bezier(0.16, 1, 0.3, 1);
  }
}

/* React Bits "Rotating Text" — per-character staggered roll (vanilla port) */
.hero-rotate {
  position: relative;
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: 0.14em;
  margin-bottom: -0.14em;
}

.hero-rt-word {
  display: inline-flex;
  white-space: nowrap;
}

.hero-rt-word.is-leaving {
  position: absolute;
  left: 0;
  top: 0;
}

.hero-rt-char {
  display: inline-block;
  transform: translateY(0);
  opacity: 1;
  transition:
    transform var(--hero-rt-dur, 520ms) cubic-bezier(0.22, 1, 0.36, 1),
    opacity var(--hero-rt-dur, 520ms) cubic-bezier(0.22, 1, 0.36, 1);
}

/* incoming starts below the mask, then springs to rest */
.hero-rt-word.is-enter .hero-rt-char {
  transform: translateY(110%);
  opacity: 0;
}

/* outgoing rolls up and out */
.hero-rt-word.is-exit .hero-rt-char {
  transform: translateY(-120%);
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .hero-rt-char { transition: none; }
}
