/* Animate chapter contents while the sticky canvas controls the image wipes. */
.cjgp33 {
  --yh-enter-ease: cubic-bezier(.22, .64, .29, 1);
  --yh-entrance: yh-layer-arrive 820ms var(--yh-enter-ease);
  --yh-hero-brand-delay: 1650ms;
  --yh-hero-title-delay: 1950ms;
  --yh-hero-char-step: 35ms;
  --yh-hero-summary-delay: 2630ms;
}

@keyframes yh-layer-arrive {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes yh-image-settle {
  from { scale: var(--yh-camera-start, 1.055); }
  to   { scale: 1; }
}
@keyframes yh-soft-ink {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes yh-contact-orbit {
  from { transform: rotate(0turn); }
  to   { transform: rotate(1turn); }
}
@keyframes yh-write-name {
  from { mask-position: 100% 0; }
  to   { mask-position: 0 0; }
}
@keyframes yh-brand-arrive {
  from { transform: translateY(7px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
@keyframes yh-hero-fade-in {
  from { opacity: 0; transform: translate3d(0, 24px, 0); clip-path: inset(100% 0 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); clip-path: inset(0); }
}
@keyframes yh-hero-fade-short {
  from { opacity: 0; transform: translate3d(0, 8px, 0); clip-path: inset(100% 0 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); clip-path: inset(0); }
}

/* Server-rendered letters start immediately, including before JavaScript.
   Word wrappers preserve Korean word boundaries and the authored line break. */
.cjgp33 .cjfp-hero-copy h1,
.cjgp33 .cjfp-hero-copy > .cjfp-lead { animation: none; }
.cjgp33 .cjfp-hero .yh-hero-word { display: inline-block; white-space: nowrap; }
.cjgp33 .cjfp-hero .yh-hero-char {
  display: inline-block;
  animation: yh-hero-fade-in 600ms var(--yh-enter-ease)
    calc(var(--yh-hero-title-delay) + var(--yh-char-index, 0) * var(--yh-hero-char-step)) both;
}
.cjgp33 .cjfp-hero :is(.cj-hero-confirmed-logo, .yh-mobile-hero-kicker) {
  animation: yh-hero-fade-in 450ms var(--yh-enter-ease) var(--yh-hero-brand-delay) both;
}
.cjgp33 .cjfp-hero .yh-mobile-hero-summary {
  animation: yh-hero-fade-in 500ms var(--yh-enter-ease) var(--yh-hero-summary-delay) both;
}

/* The SVG carries only the type around the edge. Its sibling is the link label. */
.cjgp33 .gp-contact33 > .gp-contact-ring33 {
  transform-box: view-box;
  transform-origin: center;
  animation: yh-contact-orbit var(--yh-orbit-period, 16s) linear infinite !important;
}

/* Starts at first paint. On a return visit the observer restarts the same
   sequence when the hero comes back into view. */
@media (prefers-reduced-motion: no-preference) {
  .cjgp33 .cjfp-hero-images {
    transform: translateY(var(--yh-hero-drift, 0px)) scale(var(--yh-hero-scale, 1));
  }
  .cjgp33 .cjfp-hero-image {
    animation: yh-image-settle 2300ms var(--yh-enter-ease) backwards;
  }
  .cjgp33 .yh-script-word {
    animation-duration: 1650ms;
    animation-delay: 0s;
  }
  .cjgp33 .cjfp-hero-bottom { animation-delay: var(--yh-hero-summary-delay); }
  .cjgp33.gp-motion33 .cjfp-hero:not(.yh-onstage)
    :is(.cjfp-hero-image, .cjfp-hero-kicker, .yh-script-word, .cj-hero-confirmed-logo,
        .yh-mobile-hero-kicker, .yh-hero-char, .yh-mobile-hero-summary, .cjfp-hero-bottom) {
    animation: none;
    clip-path: none;
  }
}

.cjgp33 .yh-onstage :is(.gp-cover-heading33, .gp-location-heading33) > :first-child {
  animation: var(--yh-entrance) backwards;
}
.cjgp33 .yh-onstage :is(.gp-cover-heading33, .gp-location-heading33) > :not(:first-child) {
  animation: var(--yh-entrance) 90ms backwards;
}

/* The older one-time reveal observers may fire later on a fast wheel scroll.
   An entering chapter owns its visible state immediately. */
.cjgp33.gp-motion33 .yh-onstage .gp-reveal33 {
  opacity: 1;
  transform: none;
  transition: none;
}

@media (min-width: 992px) {
  .cjgp33 .gp-living33.yh-onstage .gp-cover-frame33,
  .cjgp33 .gp-location33.yh-onstage .gp-map33 {
    animation: var(--yh-entrance) 100ms backwards;
  }
  .cjgp33 .gp-location33.yh-onstage .gp-map33:nth-child(2) {
    animation-delay: 180ms;
  }
}
@media (max-width: 991px) {
  .cjgp33 .gp-cover-layer33.yh-inview .gp-cover-mobile-copy33,
  .cjgp33 .gp-map33.yh-inview {
    animation: var(--yh-entrance) backwards;
  }
}

/* The home presentation also runs in the short-motion profile. Only the
   moving artwork, signature and logo opt back into the theme-wide reset. */
@media (prefers-reduced-motion: reduce) {
  .cjgp33 {
    --yh-entrance: yh-soft-ink 500ms ease-out;
    --yh-orbit-period: 20s;
    --yh-camera-start: 1.035;
    --yh-hero-brand-delay: 1050ms;
    --yh-hero-title-delay: 1250ms;
    --yh-hero-char-step: 25ms;
    --yh-hero-summary-delay: 1640ms;
  }
  .cjgp33 .cjfp-hero-image {
    animation: yh-image-settle 1850ms var(--yh-enter-ease) backwards !important;
  }
  .cjgp33 .yh-script-word {
    mask-image: linear-gradient(to right, black 47%, transparent 52%);
    mask-size: 215% 100%;
    mask-repeat: no-repeat;
    mask-position: 0 0;
    animation: yh-write-name 1150ms var(--yh-enter-ease) backwards !important;
  }
  .cjgp33 .cjfp-hero-copy h1,
  .cjgp33 .cjfp-hero-copy > .cjfp-lead { animation: none !important; }
  .cjgp33 .cjfp-hero :is(.cj-hero-confirmed-logo, .yh-mobile-hero-kicker) {
    animation: yh-hero-fade-short 380ms ease var(--yh-hero-brand-delay) both !important;
  }
  .cjgp33 .cjfp-hero .yh-hero-char {
    animation: yh-hero-fade-short 420ms ease
      calc(var(--yh-hero-title-delay) + var(--yh-char-index, 0) * var(--yh-hero-char-step)) both !important;
  }
  .cjgp33 .cjfp-hero .yh-mobile-hero-summary {
    animation: yh-hero-fade-short 380ms ease var(--yh-hero-summary-delay) both !important;
  }
  .cjgp33.gp-motion33 .cjfp-hero:not(.yh-onstage)
    :is(.cjfp-hero-image, .yh-script-word, .cj-hero-confirmed-logo,
        .yh-mobile-hero-kicker, .yh-hero-char, .yh-mobile-hero-summary) {
    animation: none !important;
  }
  .cjgp33 .yh-onstage :is(.gp-cover-heading33, .gp-location-heading33) > *,
  .cjgp33 .gp-cover-caption33.is-active {
    animation: var(--yh-entrance) backwards !important;
  }
}
@media (prefers-reduced-motion: reduce) and (min-width: 992px) {
  .cjgp33 .gp-living33.yh-onstage .gp-cover-frame33,
  .cjgp33 .gp-location33.yh-onstage .gp-map33 {
    animation: var(--yh-entrance) backwards !important;
  }
}
@media (prefers-reduced-motion: reduce) and (max-width: 991px) {
  .cjgp33 .gp-cover-layer33.yh-inview .gp-cover-mobile-copy33,
  .cjgp33 .gp-map33.yh-inview {
    animation: var(--yh-entrance) backwards !important;
  }
}

