:root {
  --close-header-offset: 126px;
  --close-side-padding: clamp(20px, 4vw, 48px);
  --close-text-dark: #273142;
  --close-text-mid: #425066;
  --close-line: rgba(39, 49, 66, 0.12);
  --close-line-active: #2d8cff;
}

.close-scene {
  position: relative;
  height: 380vh;
  background: #edf3fb;
  isolation: isolate;
  z-index: 10;
}

.close-scene__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  height: var(--app-height, 100svh);
  overflow: hidden;
  background:
    linear-gradient(
      90deg,
      #d9e8f8 0%,
      #edf3fb 18%,
      #dceaf9 50%,
      #edf3fb 82%,
      #d9e8f8 100%
    );
}

/* 배경 레이어들만 absolute inset — content는 별도 처리 (구조 분리) */
.close-scene__bg,
.close-scene__gradient,
.close-scene__shade,
.close-scene__glow,
.close-scene__noise {
  position: absolute;
  inset: 0;
}

.close-scene__bg {
  z-index: 1;
  overflow: hidden;
  background: #edf3fb;
}

.close-scene__gradient--base {
  background:
    linear-gradient(
      90deg,
      rgba(140, 185, 235, 0.22) 0%,
      rgba(255, 255, 255, 0.72) 20%,
      rgba(164, 205, 247, 0.28) 50%,
      rgba(255, 255, 255, 0.72) 80%,
      rgba(140, 185, 235, 0.22) 100%
    );
  z-index: 1;
}

.close-scene__gradient--left {
  background:
    radial-gradient(
      circle at 28% 50%,
      rgba(255, 255, 255, 0.86) 0%,
      rgba(255, 255, 255, 0.34) 28%,
      rgba(255, 255, 255, 0) 58%
    );
  opacity: 0.85;
  z-index: 2;
}

.close-scene__gradient--right {
  background:
    radial-gradient(
      circle at 72% 50%,
      rgba(189, 225, 255, 0.62) 0%,
      rgba(189, 225, 255, 0.18) 25%,
      rgba(189, 225, 255, 0) 60%
    );
  opacity: 0.76;
  z-index: 3;
}

.close-scene__shade--dynamic {
  z-index: 4;
  background: linear-gradient(
    to bottom,
    rgba(232, 241, 252, 0.04) 0%,
    rgba(227, 237, 249, 0.12) 38%,
    rgba(219, 232, 247, 0.24) 100%
  );
  opacity: 0.06;
  will-change: opacity;
}

.close-scene__glow {
  z-index: 5;
  background:
    radial-gradient(
      circle at 50% 50%,
      rgba(255, 255, 255, 0.98) 0%,
      rgba(244, 249, 255, 0.92) 18%,
      rgba(224, 238, 255, 0.62) 38%,
      rgba(224, 238, 255, 0.18) 58%,
      rgba(255, 255, 255, 0) 76%
    );
  opacity: 0.38;
  transform: scale(0.88);
  filter: blur(24px);
  will-change: transform, opacity, filter;
}

.close-scene__noise {
  z-index: 6;
  opacity: 0.05;
  background-image:
    radial-gradient(rgba(255,255,255,0.9) 0.7px, transparent 0.7px);
  background-size: 10px 10px;
  mix-blend-mode: soft-light;
}

/* PC: content는 stage 밖 sticky로 100vh 핀 + 음수 margin으로 stage와 같은 자리 겹침 */
.close-scene__content {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  height: var(--app-height, 100svh);
  margin-top: -100vh;
  margin-top: calc(-1 * var(--app-height, 100svh));
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--close-side-padding);
  text-align: center;
  pointer-events: none;
}

.close-scene__copy {
  position: relative;
  width: min(100%, 980px);
  min-height: clamp(260px, 42vh, 500px);
  transform: translateY(calc(var(--close-header-offset) * 0.14));
}

.close-scene__message {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2vh, 18px);
  opacity: 0;
  transform: translate3d(0, 48px, 0) scale(0.985);
  filter: blur(14px);
  will-change: transform, opacity, filter;
  pointer-events: none;
}

.close-scene__message.is-current {
  opacity: 1;
}

.close-scene__eyebrow {
  margin: 0;
  font-family: "Wanted Sans", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: clamp(12px, 1vw, 15px);
  line-height: 1.4;
  letter-spacing: 0.22em;
  color: rgba(39, 49, 66, 0.58);
  text-transform: uppercase;
  font-weight: 700;
}

.close-scene__eyebrow--final {
  color: rgba(39, 49, 66, 0.52);
}

.close-scene__headline {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.02em;
  font-family: "Wanted Sans", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-weight: 900;
  font-size: clamp(2.25rem, 5.4vw, 5.7rem);
  line-height: 0.94;
  letter-spacing: -0.07em;
  color: var(--close-text-dark);
  word-break: keep-all;
}

.close-scene__headline--final {
  font-size: clamp(2.4rem, 6vw, 6.2rem);
  line-height: 0.9;
}

.close-scene__subcopy {
  margin: 0;
  max-width: min(92vw, 760px);
  font-family: "Wanted Sans", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  line-height: 1.72;
  color: var(--close-text-mid);
  font-weight: 500;
  word-break: keep-all;
}

.close-scene__progress {
  position: absolute;
  left: clamp(16px, 2vw, 24px);
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: min(28vh, 220px);
  z-index: 12;
}

.close-scene__progress-track,
.close-scene__progress-bar {
  position: absolute;
  left: 0;
  width: 100%;
  border-radius: 999px;
}

.close-scene__progress-track {
  top: 0;
  bottom: 0;
  background: var(--close-line);
}

.close-scene__progress-bar {
  top: 0;
  height: 0%;
  background: linear-gradient(180deg, #8fd0ff 0%, #2d8cff 100%);
  box-shadow: 0 0 20px rgba(45, 140, 255, 0.22);
}

.close-scene__scroll-indicator {
  position: absolute;
  right: clamp(16px, 2vw, 24px);
  bottom: clamp(18px, 3vw, 32px);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  z-index: 12;
  opacity: 1;
  transition: opacity 0.28s ease;
}

.close-scene__scroll-label {
  font-family: "Wanted Sans", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: rgba(39, 49, 66, 0.6);
  font-weight: 700;
}

.close-scene__scroll-line {
  display: block;
  width: 42px;
  height: 1px;
  background: rgba(39, 49, 66, 0.24);
  position: relative;
  overflow: hidden;
}

.close-scene__scroll-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #2d8cff;
  transform: translateX(-100%);
  animation: closeSceneScrollLine 1.6s ease-in-out infinite;
}

@keyframes closeSceneScrollLine {
  0% { transform: translateX(-100%); opacity: 0; }
  30% { transform: translateX(-15%); opacity: 1; }
  70% { transform: translateX(45%); opacity: 1; }
  100% { transform: translateX(100%); opacity: 0; }
}

@media (min-width: 1024px) {
  .close-scene__headline,
  .close-scene__headline--final {
    line-height: 1.01;
  }
}

@media (max-width: 1024px) {
  :root {
    --close-header-offset: 118px;
  }

  .close-scene__headline,
  .close-scene__headline--final {
    line-height: 0.97;
    letter-spacing: -0.062em;
  }
}

@media (max-width: 767px) {
  :root {
    --close-header-offset: 108px;
    --close-side-padding: 18px;
  }

  /* 모바일: 긴 스크롤 트랙 + sticky 배경 + 자연 흐름 카피.
     배경 그라데이션을 .close-scene(전체 트랙)에 직접 깔아 수평 경계선 제거.
     90deg(가로) 그라데이션이라 세로로 균일 → 어느 스크롤 지점에서도 동일하게 보임. */
  .close-scene {
    position: relative;
    height: auto;
    min-height: 280svh;
    overflow: visible;
    background:
      linear-gradient(
        90deg,
        rgba(140, 185, 235, 0.22) 0%,
        rgba(255, 255, 255, 0.72) 20%,
        rgba(164, 205, 247, 0.28) 50%,
        rgba(255, 255, 255, 0.72) 80%,
        rgba(140, 185, 235, 0.22) 100%
      ),
      #edf3fb;
  }

  html.is-kakao-inapp .close-scene {
    height: auto;
    min-height: 240svh;
  }

  /* stage / bg는 투명 — 아래 .close-scene의 긴 그라데이션이 그대로 비치게.
     (100svh 안에서만 그려지던 레이어가 만들던 경계선 원천 제거) */
  .close-scene__stage,
  .close-scene__bg {
    background: transparent;
  }

  /* 100svh 안에서만 그려지며 경계선을 만들던 가로/세로 그라데이션 레이어 숨김.
     프리미엄 톤은 .close-scene 자체 그라데이션 + radial __glow가 담당. */
  .close-scene__gradient--base,
  .close-scene__gradient--left,
  .close-scene__gradient--right,
  .close-scene__shade--dynamic {
    display: none !important;
  }

  /* 하단 fade-out 오버레이 — 배경이 다음 섹션으로 자연스럽게 전환 */
  .close-scene::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 200px;
    z-index: 5;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(237, 243, 251, 0) 0%, #edf3fb 80%, #edf3fb 100%);
  }

  /* 배경 stage — sticky로 close 섹션 안에서만 viewport에 붙음.
     섹션 진입/이탈은 브라우저 sticky 흐름이 자연스럽게 처리. */
  .close-scene__stage {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100svh;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
    opacity: 1;
    visibility: visible;
    transition: none;
  }

  /* 콘텐츠는 일반 흐름 — sticky stage가 차지한 100svh를 음수 margin으로 끌어올려
     첫 화면부터 메시지가 stage 위에 겹치게 함 */
  .close-scene__content {
    position: relative;
    inset: auto;
    z-index: 10;
    display: block;
    width: 100%;
    height: auto;
    min-height: 280svh;
    margin-top: -100svh;
    padding: 0;
    text-align: center;
    pointer-events: none;
  }

  /* PC absolute copy 컨테이너 무력화 */
  .close-scene__copy {
    position: relative;
    width: 100%;
    min-height: auto;
    transform: none;
  }

  /* 각 문구 = 한 화면, 자연 스크롤 */
  .close-scene__message {
    position: relative;
    inset: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 100svh;
    padding: 0 24px;
    opacity: 1;
    transform: none;
    filter: none;
    will-change: auto;
  }

  .close-scene__message--logo {
    min-height: 100svh;
  }

  .close-scene__copy .close-scene__message.is-current {
    opacity: 1; /* PC의 is-current opacity 단독 규칙 무력화 */
  }

  .close-scene__headline,
  .close-scene__headline--final {
    font-size: clamp(2.05rem, 9vw, 3.4rem);
    line-height: 0.96;
    letter-spacing: -0.056em;
  }

  .close-scene__eyebrow {
    font-size: 12px;
    letter-spacing: 0.16em;
  }

  .close-scene__subcopy {
    font-size: 0.96rem;
    line-height: 1.62;
  }

  /* 모바일에서는 progress/scroll indicator 숨김 */
  .close-scene__progress,
  .close-scene__scroll-indicator {
    display: none !important;
  }

  /* PC 전용 fixed/bottom 클래스가 잔존해도 모바일 fixed 배경으로 강제 통일 */
  .close-scene__stage.is-fixed,
  .close-scene__stage.is-bottom {
    position: fixed;
    inset: 0;
    top: 0;
    bottom: auto;
    width: 100%;
    height: 100svh;
  }
}

.close-scene__stage.is-fixed {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  height: var(--app-height, 100svh);
}

.close-scene__stage.is-bottom {
  position: absolute;
  top: auto;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
}

/* PC: stage와 동일한 핀 상태를 content에도 적용 (구조 분리 후 동기화) */
.close-scene__content.is-fixed {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  height: var(--app-height, 100svh);
  margin-top: 0;
}

.close-scene__content.is-bottom {
  position: absolute;
  top: auto;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  height: var(--app-height, 100svh);
  margin-top: 0;
}

/* 모바일: PC 핀 클래스가 잔존해도 자연 흐름이 깨지지 않도록 무력화 */
@media (max-width: 767px) {
  .close-scene__content.is-fixed,
  .close-scene__content.is-bottom {
    position: relative;
    inset: auto;
    width: 100%;
    height: auto;
    min-height: 280svh;
    margin-top: -100svh;
  }
}

.close-scene__message--logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-scene__logo-wrap {
  transform: scale(0.92);
  opacity: 0;
  transition: all 0.6s ease;
}

.close-scene__logo {
  width: min(110vw, 780px);
  height: auto;
}

/* 활성 */
.close-scene__message--logo.is-current .close-scene__logo-wrap {
  transform: scale(1);
  opacity: 1;
}