/* Section 3: Full-Screen Scroll-Scrubbed History Morph (1951 -> Present Korea)
   Smooth Entry Dissolve From Chung Section Mist -> Vivid 1951 Past -> Crisp Golden Present */
.history-morph {
  position: relative;
  z-index: 8;
  width: 100%;
  height: 250svh;
  margin-top: -1px;
  background: #0E1116;
}

.hm-sticky {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100svh;
  overflow: hidden;
  background: #0E1116;
}

.hm-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.hm-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  will-change: transform, opacity, filter;
}

.hm-past-img {
  filter: contrast(1.06) brightness(0.84) blur(var(--hm-past-blur, 0px));
  transform: scale(var(--hm-past-scale, 1));
}

.hm-present {
  opacity: var(--hm-morph, 0);
  will-change: opacity;
}

.hm-present-img {
  object-position: center 62%;
  transform: scale(var(--hm-present-scale, 1.08));
}

/* Soft natural readability scrim that keeps white cinema titles crisp over both photos */
.hm-scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 68% 42% at 50% 48%, rgba(10, 14, 20, 0.34) 0%, rgba(10, 14, 20, 0.14) 65%, rgba(10, 14, 20, 0.28) 100%),
    linear-gradient(180deg, rgba(10, 14, 20, 0.28) 0%, rgba(10, 14, 20, 0.08) 45%, rgba(10, 14, 20, 0.34) 100%);
}

.hm-copy-wrap {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  pointer-events: none;
}

.hm-phrase {
  position: absolute;
  margin: 0;
  text-align: center;
  font-family: inherit;
  font-size: clamp(36px, 5.2vw, 76px);
  font-weight: 560;
  line-height: 1.24;
  letter-spacing: -0.042em;
  white-space: nowrap;
  color: #FFFFFF;
  text-shadow: 0 6px 32px rgba(0, 0, 0, 0.36);
  will-change: transform, opacity, filter;
}

.hm-phrase-past {
  opacity: var(--hm-past-text-op, 0);
  transform: translate3d(0, var(--hm-past-text-y, 20px), 0) scale(var(--hm-past-text-scale, 0.97));
  filter: blur(var(--hm-past-text-blur, 8px));
}

.hm-phrase-present {
  opacity: var(--hm-present-text-op, 0);
  transform: translate3d(0, var(--hm-present-text-y, 24px), 0) scale(var(--hm-present-text-scale, 0.97));
  filter: blur(var(--hm-present-text-blur, 8px));
}

/* Luminous Mist Dissolve Veil ONLY at Top Entry (Clears Completely Before Sticky Locks) */
.hm-entry-veil {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: linear-gradient(180deg, #F1F3F6 0%, #ECEFF4 56%, #E6EBF2 100%);
  opacity: var(--hm-entry-veil, 0);
  will-change: opacity;
}

.hm-exit-veil {
  display: none;
}

@media (max-width: 640px) {
  .history-morph {
    height: 220svh;
  }

  .hm-phrase {
    font-size: clamp(24px, 7.2vw, 36px);
    letter-spacing: -0.045em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hm-entry-veil {
    display: none;
  }

  .hm-phrase-past {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
}
