/* hellobae.in home: the opening and the on-screen motion (home-motion.js).
   `launch` is on <html> only while the opening plays (not for reduced motion,
   not when a link opens a section); `moving` whenever motion is on.
   No blur anywhere (owner, 17 Nov 2026): words slide up from behind their line. */

.intro-mark {
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  /* ---- 1. The opening ---- */

  /* A brand-pink shutter over the first screen: the wordmark writes itself
     in, white, then the shutter rolls up and shows the photo. */
  .launch .intro-mark {
    display: grid;
    place-items: center;
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background: linear-gradient(135deg, #f06aa6 0%, #e8418a 35%, #b5105f 100%);
    box-shadow: 0 24px 48px rgba(58, 15, 36, 0.35);
    animation: shutter-up 1.1s 1.15s cubic-bezier(0.76, 0, 0.24, 1) forwards;
  }

  .launch .intro-mark img {
    width: clamp(180px, 26vw, 340px);
    height: auto;
    filter: brightness(0) invert(1);
    animation: mark-in 0.9s 0.1s cubic-bezier(0.6, 0, 0.2, 1) backwards;
  }

  /* Under the shutter, the photo settles as it is uncovered. */
  .launch .hero-photo img {
    animation: photo-settle 2s 1.15s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
  }

  .launch .top {
    animation: drop-in 0.7s 1.9s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
  }

  /* The headline word by word, sliding up; the button after it. */
  .launch .hero h1:not(.split) {
    animation: fade-in 0.6s 2s ease backwards;
  }

  .launch .hero h1.split {
    animation: none;
  }

  .launch .hero h1 .wi {
    animation: word-up 0.8s calc(2s + var(--i) * 0.07s) cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
  }

  .launch .hero-copy .btn {
    animation: rise-in 0.7s 2.55s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
  }

  @keyframes mark-in {
    from {
      clip-path: inset(0 100% 0 0);
    }
    to {
      clip-path: inset(0 0 0 0);
    }
  }

  @keyframes shutter-up {
    to {
      transform: translateY(-100%);
      box-shadow: none;
    }
  }

  @keyframes photo-settle {
    from {
      transform: scale(1.15);
    }
    to {
      transform: none;
    }
  }

  @keyframes fade-in {
    from {
      opacity: 0;
    }
  }

  @keyframes drop-in {
    from {
      opacity: 0;
      transform: translateY(-14px);
    }
  }

  @keyframes rise-in {
    from {
      opacity: 0;
      transform: translateY(18px);
    }
  }

  @keyframes word-up {
    from {
      transform: translateY(110%);
    }
    to {
      transform: none;
    }
  }

  /* ---- 2. On screen ---- */

  /* Each word sits in a box that hides it until it slides up. A little room
     around the word keeps tails and italics from being cut. */
  .moving .split .w {
    display: inline-block;
    clip-path: inset(-0.3em -0.3em -0.14em -0.3em);
  }

  .moving .split .wi {
    display: inline-block;
  }

  .moving .split:not(h1) .wi {
    transform: translateY(110%);
    transition: transform 0.85s cubic-bezier(0.2, 0.7, 0.2, 1);
    transition-delay: calc(var(--i) * 0.07s);
  }

  .moving .split.on .wi {
    transform: none;
  }

  /* The text under them, softly after. */
  .moving .soft {
    opacity: 0;
    transform: translateY(16px);
    transition:
      opacity 0.8s ease,
      transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
    transition-delay: var(--d, 0.25s);
  }

  .moving .soft.on {
    opacity: 1;
    transform: none;
  }

  /* The app's screens rise one after another. */
  .moving .lift {
    opacity: 0;
    transform: translateY(60px);
    transition:
      opacity 0.8s ease,
      transform 1s cubic-bezier(0.2, 0.7, 0.2, 1);
    transition-delay: var(--d, 0s);
  }

  .moving .lift.on {
    opacity: 1;
    transform: none;
  }

  /* The offer's photo opens from the bottom and settles. */
  .moving .open {
    clip-path: inset(100% 0 0 0);
    transition: clip-path 1.1s cubic-bezier(0.7, 0, 0.2, 1) 0.15s;
  }

  .moving .open img {
    transform: scale(1.16);
    transition: transform 1.8s cubic-bezier(0.2, 0.7, 0.2, 1) 0.15s;
  }

  .moving .open.on {
    clip-path: inset(0 0 0 0);
  }

  .moving .open.on img {
    transform: none;
  }

  /* A hand-drawn pink line under the key words. */
  .scribbled {
    position: relative;
    display: inline-block;
  }

  .scribble {
    position: absolute;
    left: -3%;
    bottom: -0.16em;
    width: 106%;
    height: 0.32em;
    overflow: visible;
    pointer-events: none;
  }

  .scribble path {
    fill: none;
    stroke: var(--brand);
    stroke-width: 5;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    transition: stroke-dashoffset 0.9s cubic-bezier(0.6, 0, 0.2, 1);
    transition-delay: calc(var(--words, 4) * 0.07s + 0.35s);
  }

  /* On the pink offer, the line is gold like the word. */
  .offer .scribble path {
    stroke: var(--gold);
  }

  .split.on .scribble path {
    stroke-dashoffset: 0;
  }
}
