/* =========================================================================
   메인 히어로 스크롤 (src/components/Main/HeroScroll/)
   - 모든 규칙은 .hero-scroll 안에서만 적용됩니다 (다른 섹션에 영향 없음).
   - 크기 단위: --hs-s = 1920×1080 프레임 대비 화면 비율 (엔진이 매 프레임 설정).
   - 사이트 헤더(56px, sticky) 아래에서 고정되도록 --hs-header 로 맞춥니다.
   ========================================================================= */
.hero-scroll {
  --hs-header: 56px;
  --hs-blue: #006cff;
  --hs-ink: #333;
  --hs-muted: #6b7588;
  --hs-fade: #f6f9fe;
  position: relative;
  z-index: 2;
  background: #fff;
}
.main-container .section.hero-scroll {
  padding: 0;
}

/* 키 큰 화면: 프레임 아래로 다음 섹션 윗부분 복사본을 보여 줌 */
.hero-scroll .hs-peek {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.hero-scroll .hs-sticky {
  --hs-s: 0.75;
  position: sticky;
  top: var(--hs-header);
  height: calc(100vh - var(--hs-header));
  overflow: hidden;
  background: #fff;
}
/* stage = hero00/hero05 의 둥근 패널 (hero01~04 에서는 화면 가득) */
.hero-scroll .hs-stage {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  will-change: clip-path;
}
.hero-scroll .hs-bgl {
  position: absolute;
  top: -6%;
  right: -6%;
  bottom: -6%;
  left: -6%;
  background: url('../images/main/hero/bg.webp') center/cover no-repeat;
  will-change: transform;
}
.hero-scroll .hs-fade {
  position: absolute;
  left: 0;
  right: 0;
  height: calc(var(--hs-s) * 179px);
  z-index: 5;
  pointer-events: none;
  background: linear-gradient(rgba(246, 249, 254, 0), var(--hs-fade));
}
.hero-scroll .hs-scene {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: hidden;
  pointer-events: none;
  will-change: transform;
}
.hero-scroll .hs-scene-card {
  z-index: 6;
}

/* ---------- 머리글 (Figma: 제목 56px SemiBold/Bold -1%, 부제 20/28, 버튼 60px r30) ---------- */
.hero-scroll .hs-head {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--hs-s) * 8px);
  padding: 0 16px;
}
.hero-scroll .hs-titles {
  display: grid;
  justify-items: center;
}
.hero-scroll .hs-t {
  grid-area: 1 / 1;
  margin: 0;
  font-size: calc(var(--hs-s) * 56px);
  line-height: 1.45;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-align: center;
  white-space: nowrap;
  color: var(--hs-ink);
}
/* 단계별 제목 (스케줄러·키워드·모바일): 48px */
.hero-scroll .hs-t ~ .hs-t {
  opacity: 0;
  visibility: hidden;
  font-size: calc(var(--hs-s) * 48px);
}
.hero-scroll .hs-nw {
  display: inline-block;
}
.hero-scroll .hs-t em {
  font-style: normal;
  font-weight: 700;
  color: var(--hs-blue);
}
.hero-scroll .hs-more {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--hs-s) * 32px);
  will-change: opacity;
}
.hero-scroll .hs-sub {
  margin: 0;
  font-size: calc(var(--hs-s) * 20px);
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--hs-ink);
  text-align: center;
  white-space: nowrap;
}
.hero-scroll .hs-ctas {
  display: flex;
  gap: calc(var(--hs-s) * 16px);
}
.hero-scroll .hs-cta,
.hero-scroll a.hs-cta:link,
.hero-scroll a.hs-cta:visited {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: calc(var(--hs-s) * 60px);
  padding: 0 calc(var(--hs-s) * 57px - 1px);
  border-radius: 999px;
  border: 1px solid var(--hs-blue);
  background: #fff;
  color: var(--hs-blue);
  font-size: calc(var(--hs-s) * 16px);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}
.hero-scroll .hs-cta.hs-cta-primary,
.hero-scroll a.hs-cta.hs-cta-primary:link,
.hero-scroll a.hs-cta.hs-cta-primary:visited {
  background: var(--hs-blue);
  color: #fff;
}
.hero-scroll .hs-cta:focus-visible {
  outline: 3px solid #9cc0ff;
  outline-offset: 2px;
}

/* 스크롤 안내 (Lucide "mouse" 아이콘, ISC) */
.hero-scroll .hs-hint {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  height: 22px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.2px;
  color: var(--hs-muted);
  white-space: nowrap;
  pointer-events: none;
}
.hero-scroll .hs-hint svg {
  width: 22px;
  height: 22px;
  display: block;
}
.hero-scroll .hs-wheel {
  animation: hs-wheel 1.6s ease-in-out infinite;
}
@keyframes hs-wheel {
  0%,
  100% {
    transform: translateY(0);
    opacity: 1;
  }
  50% {
    transform: translateY(2.5px);
    opacity: 0.35;
  }
}

/* ---------- 장면 (world = 1300px 창 기준 px) ---------- */
.hero-scroll .hs-world {
  position: absolute;
  left: 0;
  top: 0;
  width: 1299px;
  height: 960px;
  transform-origin: center;
  transform-style: preserve-3d;
  will-change: transform;
}
.hero-scroll .hs-world img {
  max-width: none;
  user-select: none;
}
.hero-scroll .hs-win {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border-radius: 18px;
  overflow: hidden;
  transform-origin: center;
  will-change: transform, opacity;
  box-shadow: 0 30px 80px -30px rgba(20, 40, 100, 0.35), 0 0 0 1px rgba(20, 40, 100, 0.06);
}
.hero-scroll .hs-win > img,
.hero-scroll .hs-base > img,
.hero-scroll .hs-phone > img {
  display: block;
  width: 100%;
  height: 100%;
}
.hero-scroll .hs-lay {
  position: absolute;
  will-change: transform, opacity;
}
.hero-scroll .hs-sclip {
  position: absolute;
  left: 62px;
  top: 161px;
  width: 285px;
  height: 799px;
  overflow: visible;
}
.hero-scroll .hs-w-dash {
  overflow: visible;
  box-shadow: none;
  transform-style: preserve-3d;
}
.hero-scroll .hs-base {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(20, 40, 100, 0.35), 0 0 0 1px rgba(20, 40, 100, 0.06);
}
.hero-scroll .hs-lyr {
  position: absolute;
  overflow: hidden;
  border-radius: 6px;
  will-change: transform, box-shadow;
}
.hero-scroll .hs-lyr img {
  position: absolute;
  width: 1299px;
  height: 960px;
}
.hero-scroll .hs-phone {
  position: absolute;
  left: 904px;
  top: 0;
  width: 443px;
  height: 907px;
  border-radius: 62px;
  overflow: hidden;
  opacity: 0;
  transform-origin: top left;
  will-change: transform, opacity;
  box-shadow: 0 40px 80px -30px rgba(20, 40, 100, 0.4);
}

/* hero03 상품 페이지 (Figma hero03 시안 75:5562) — 그림자는 이미지에 포함 */
.hero-scroll .hs-w-pp {
  overflow: visible;
  box-shadow: none;
  border-radius: 0;
}

/* 상품 카드 (Figma 리소스 › 상품카드 300×396) */
.hero-scroll .hs-cardlayer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transform-origin: center;
  transform-style: preserve-3d;
  z-index: 4;
}
.hero-scroll .hs-card {
  position: absolute;
  left: 0;
  top: 0;
  width: 300px;
  height: 396px;
  transform-origin: center;
  will-change: transform, opacity;
}
.hero-scroll .hs-face {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border-radius: 24px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0.929px 2.786px 11.143px rgba(0, 108, 255, 0.1);
}
.hero-scroll .hs-face img {
  display: block;
  width: 100%;
  height: 100%;
}
.hero-scroll .hs-cover {
  position: absolute;
  left: 6px;
  right: 6px;
  top: 331px;
  height: 46px;
  background: #fff;
}
.hero-scroll .hs-glint {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(105deg, rgba(255, 255, 255, 0) 36%, rgba(255, 255, 255, 0.6) 50%, rgba(255, 255, 255, 0) 64%);
  transform: translateX(-120%);
  opacity: 0;
  will-change: transform, opacity;
}
.hero-scroll .hs-tags {
  position: absolute;
  left: 40px;
  top: 337.5px;
  display: flex;
  gap: 6px;
}
.hero-scroll .hs-tags span {
  height: 33px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 100px;
  background: #ebf1f9;
  color: #57657a;
  font-size: 18px;
  font-weight: 400;
  line-height: 27px;
  letter-spacing: -0.3px;
  white-space: nowrap;
}
.hero-scroll .hs-tags span:first-child {
  width: 132px;
}
.hero-scroll .hs-tags span:last-child {
  width: 82px;
}
/* 스케줄러 동기화 배지 */
.hero-scroll .hs-badge {
  position: absolute;
  left: 268px;
  top: -19.45px;
  width: 64px;
  height: 64px;
  border-radius: 100px;
  transform-origin: center;
  opacity: 0;
  will-change: transform, opacity;
  box-shadow: 0 6px 14px -6px rgba(0, 108, 255, 0.45);
}
.hero-scroll .hs-badge img {
  display: block;
  width: 100%;
  height: 100%;
  will-change: transform;
}

/* 폰 푸시 알림 (iOS 배너 스타일) */
.hero-scroll .hs-notif {
  position: absolute;
  left: 27px;
  right: 27px;
  top: 24px;
  height: 84px;
  border-radius: 24px;
  padding: 0 14px;
  display: grid;
  grid-template-columns: 38px 1fr 40px;
  gap: 10px;
  align-items: center;
  background: rgba(245, 245, 247, 0.72);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.18), inset 0 0 0 0.5px rgba(255, 255, 255, 0.6);
  opacity: 0;
  will-change: transform, opacity;
  color: #000;
  text-align: left;
  -webkit-font-smoothing: antialiased;
}
.hero-scroll .hs-notif * {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Apple SD Gothic Neo', 'Pretendard Variable', Pretendard, 'Noto Sans KR', sans-serif;
}
.hero-scroll .hs-n-ic {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--hs-blue);
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-scroll .hs-n-ic svg {
  width: 21px;
  height: 21px;
}
.hero-scroll .hs-n-tx {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.hero-scroll .hs-n-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.hero-scroll .hs-n-row b {
  font-size: 15px;
  line-height: 20px;
  font-weight: 600;
  letter-spacing: -0.24px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hero-scroll .hs-n-tm {
  margin-left: auto;
  flex: none;
  font-size: 13px;
  line-height: 20px;
  color: rgba(60, 60, 67, 0.6);
  letter-spacing: -0.08px;
}
.hero-scroll .hs-n-msg {
  font-size: 15px;
  line-height: 20px;
  letter-spacing: -0.24px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-scroll .hs-n-th {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
}
.hero-scroll .hs-n-th img {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------- 1200px 이하 / 동작 줄이기: hero05 정지 화면 ---------- */
.hero-scroll.is-compact .hs-sticky {
  position: relative;
  top: 0;
}
.hero-scroll.is-compact .hs-hint {
  display: none;
}
/* ---------- 767px 이하 모바일 (Figma 모바일 71:3691) ----------
   고정 없음. 제목 30px 한 줄(좁으면 묶음 단위로 줄바꿈), 부제 12px, 버튼 48px 두 개 나란히, 좌우 여백 52/720 */
.hero-scroll.is-mobile .hs-sticky {
  position: relative;
  top: 0;
}
.hero-scroll.is-mobile .hs-hint {
  display: none;
}
.hero-scroll.is-mobile .hs-head {
  gap: 8px;
  padding-left: max(20px, 7.222vw);
  padding-right: max(20px, 7.222vw);
}
.hero-scroll.is-mobile .hs-t {
  font-size: 30px;
  white-space: normal;
}
.hero-scroll.is-mobile .hs-t ~ .hs-t {
  display: none;
}
.hero-scroll.is-mobile .hs-more {
  gap: 16px;
  width: 100%;
}
.hero-scroll.is-mobile .hs-sub {
  font-size: 12px;
  line-height: 1.6;
  white-space: normal;
}
.hero-scroll.is-mobile .hs-ctas {
  width: 100%;
  gap: 8px;
}
.hero-scroll.is-mobile .hs-cta,
.hero-scroll.is-mobile a.hs-cta:link,
.hero-scroll.is-mobile a.hs-cta:visited {
  flex: 1 1 0;
  min-width: 0;
  height: 48px;
  padding: 0 8px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  border-radius: 30px;
}

/* 엔진이 붙기 전(서버 렌더 직후)에는 장면을 숨겨 깜빡임 방지 */
.hero-scroll:not(.is-ready) .hs-stage,
.hero-scroll:not(.is-ready) .hs-hint {
  visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .hero-scroll .hs-wheel {
    animation: none;
  }
}
