/* ===== 메인 영상 배너 (hv) =====
   기존 .hero 섹션을 대체한다. 클래스는 모두 hv 접두어로 기존 스타일과 겹치지 않게 했다.
   style.css의 :root 변수(--blue, --font-head 등)를 그대로 사용한다. */

.hv {
  --hv-mint: #9BE8D6;
  --hv-slide: 7s;            /* 한 장면 길이. hero-video.js의 SLIDE 값과 맞춘다 */
  --hv-ease: cubic-bezier(.2, .8, .2, 1);
  position: relative;
  display: flex;
  align-items: center;
  min-height: 600px;
  height: calc(100vh - 74px);
  height: calc(100svh - 74px);
  max-height: 1000px;
  color: #fff;
  background: #0F305C;
  overflow: hidden;
  isolation: isolate;
}

/* --- 배경: 포스터 이미지 위로 영상이 페이드인 --- */
.hv__media { position: absolute; inset: 0; z-index: -2; }
.hv__poster,
.hv__video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 50%;
}
.hv__video { opacity: 0; transition: opacity 1.2s ease; }
.hv.is-playing .hv__video { opacity: 1; }

.hv__shade {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(10, 32, 64, .35) 0%, rgba(10, 32, 64, 0) 22%, rgba(10, 32, 64, 0) 62%, rgba(10, 32, 64, .7) 100%),
    linear-gradient(100deg, rgba(12, 40, 78, .93) 0%, rgba(17, 58, 108, .8) 38%, rgba(31, 102, 181, .38) 72%, rgba(46, 158, 143, .22) 100%);
}

/* --- 본문 --- */
.hv__inner { position: relative; width: min(1160px, 100% - 40px); margin-inline: auto; padding: 40px 0 120px; }

/* 슬라이드는 같은 칸에 겹쳐 쌓아, 가장 긴 문구 기준으로 높이가 고정된다(전환 시 흔들림 없음) */
.hv__slides { display: grid; }
.hv__slide {
  grid-area: 1 / 1;
  align-self: end;           /* 문구가 짧은 장면도 버튼 바로 위에 붙도록 */
  opacity: 0; visibility: hidden;
  transform: translateY(-14px);
  transition: opacity .45s ease, transform .45s ease, visibility 0s linear .45s;
}
.hv__slide.is-active {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity .01s, transform .01s, visibility 0s;
}

.hv__eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0 0 22px;
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(14.5px, 1.25vw, 18px); letter-spacing: .01em;
  color: var(--hv-mint);
  opacity: 0; transform: translateX(-16px);
  transition: opacity .5s ease, transform .5s ease;
  transition-delay: .45s;
}
.hv__eyebrow::before { content: ""; width: 28px; height: 3px; border-radius: 3px; background: currentColor; }
.is-active .hv__eyebrow { opacity: 1; transform: none; transition-delay: .1s; }

/* 큰 제목: 줄 단위로 마스크 아래에서 밀려 올라온다 */
.hv__title {
  margin: 0;
  font-family: var(--font-head); font-weight: 500;   /* G마켓 산스 Medium, 강조어만 Bold */
  font-size: clamp(30px, min(5.6vw, 7.6vh), 78px);
  line-height: 1.24; letter-spacing: -.045em;
  color: #fff; word-break: keep-all;
  text-shadow: 0 4px 30px rgba(5, 20, 45, .35);
}
.hv__line { display: block; overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; }
.hv__line > span {
  display: block;
  transform: translateY(112%);
  transition: transform 0s linear .45s;   /* 퇴장 후 조용히 원위치 */
}
.is-active .hv__line > span {
  transform: none;
  transition: transform 1s var(--hv-ease);
  transition-delay: calc(.2s + var(--i, 0) * .13s);
}

/* 강조 단어: 민트색 + 형광펜 밑줄이 그어진다 */
.hv__title em {
  font-style: normal; font-weight: 700; color: var(--hv-mint);
  background: linear-gradient(rgba(155, 232, 214, .22), rgba(155, 232, 214, .22)) no-repeat 0 88% / 0% .3em;
  transition: background-size 0s linear .45s;
}
.is-active .hv__title em {
  background-size: 100% .3em;
  transition: background-size .8s var(--hv-ease) 1s;
}

.hv__lead {
  margin: 26px 0 0; max-width: 36em;
  font-size: clamp(16.5px, 1.45vw, 21px); line-height: 1.6;
  color: rgba(255, 255, 255, .9); word-break: keep-all;
  opacity: 0; transform: translateY(18px);
  transition: opacity .4s ease, transform .4s ease;
}
.is-active .hv__lead { opacity: 1; transform: none; transition: opacity .7s ease .75s, transform .7s var(--hv-ease) .75s; }
.hv__lead strong { color: #fff; font-weight: 700; border-bottom: 2px solid var(--hv-mint); }
.hv__note { display: block; margin-top: 6px; font-size: .8em; color: rgba(255, 255, 255, .62); }

/* 숫자 카운트: 최종 숫자 폭을 미리 잡아 두고 그 위에 올려서 글자가 밀리지 않게 한다 */
.hv__count { position: relative; display: inline-block; font-variant-numeric: tabular-nums; }
.hv__count-ghost { visibility: hidden; }
.hv__count-num { position: absolute; right: 0; top: 0; white-space: nowrap; }

/* --- 버튼 · 칩 (슬라이드와 무관하게 고정) --- */
.hv__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }
.hv__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 18px 32px; border-radius: 999px;
  font-family: var(--font-head); font-weight: 700; font-size: 17.5px; line-height: 1.2;
  border: 1.5px solid transparent;
  transition: transform .2s, box-shadow .2s, background .2s;
}
.hv__btn:hover { transform: translateY(-2px); }
.hv__btn--main { background: #fff; color: var(--blue-deep, #143C6E); box-shadow: 0 12px 30px rgba(8, 30, 60, .3); }
.hv__btn--main svg { animation: hv-nudge 1.4s ease-in-out infinite; }
.hv__btn--ghost { border-color: rgba(255, 255, 255, .7); color: #fff; backdrop-filter: blur(4px); background: rgba(255, 255, 255, .06); }
.hv__btn--ghost:hover { background: rgba(255, 255, 255, .16); }
@keyframes hv-nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(5px); } }

.hv__chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0 0; padding: 0; list-style: none; }
.hv__chips li {
  padding: 8px 16px; border-radius: 999px;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .26);
  backdrop-filter: blur(4px);
  font-size: 14.5px; font-weight: 600;
}
.hv__chips li::before { content: "✓ "; color: var(--hv-mint); }

/* 처음 들어올 때 한 번만 (스크립트가 돌 때만 숨겼다 보여 준다) */
.hv__actions, .hv__chips, .hv__bar { transition: opacity .8s ease, transform .8s var(--hv-ease); }
.hv.is-init .hv__actions, .hv.is-init .hv__chips, .hv.is-init .hv__bar { opacity: 0; transform: translateY(16px); }
.hv.is-ready .hv__actions { opacity: 1; transform: none; transition-delay: 1.05s; }
.hv.is-ready .hv__chips   { opacity: 1; transform: none; transition-delay: 1.2s; }
.hv.is-ready .hv__bar     { opacity: 1; transform: none; transition-delay: 1.4s; }

/* --- 하단: 장면 표시 + 일시정지 + 스크롤 안내 --- */
.hv__bar {
  position: absolute; left: 0; right: 0; bottom: 34px;
  width: min(1160px, 100% - 40px); margin-inline: auto;
  display: flex; align-items: center; gap: 22px;
}
.hv__pager { display: flex; gap: 18px; margin: 0; padding: 0; list-style: none; }
.hv__dot {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0; background: none; border: 0; cursor: pointer;
  font: 800 14px/1 var(--font-head); color: rgba(255, 255, 255, .55);
  transition: color .3s;
}
.hv__dot[aria-current="true"], .hv__dot:hover { color: #fff; }
.hv__track { position: relative; width: 56px; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, .28); overflow: hidden; }
.hv__fill { position: absolute; inset: 0; background: var(--hv-mint); transform-origin: left; transform: scaleX(0); }
.hv__toggle {
  display: grid; place-items: center; width: 34px; height: 34px; flex: none;
  border-radius: 50%; border: 1px solid rgba(255, 255, 255, .45);
  background: rgba(255, 255, 255, .06); color: #fff; cursor: pointer;
  transition: background .2s;
}
.hv__toggle:hover { background: rgba(255, 255, 255, .18); }
.hv__toggle .hv__i-play { display: none; }
.hv.is-paused .hv__toggle .hv__i-play { display: block; }
.hv.is-paused .hv__toggle .hv__i-pause { display: none; }

.hv__scroll {
  margin-left: auto; display: flex; align-items: center; gap: 12px;
  font: 700 12.5px/1 var(--font-body); letter-spacing: .18em; color: rgba(255, 255, 255, .75);
}
.hv__scroll-line { position: relative; width: 2px; height: 46px; border-radius: 2px; background: rgba(255, 255, 255, .25); overflow: hidden; }
.hv__scroll-line::after {
  content: ""; position: absolute; left: 0; top: -40%; width: 100%; height: 40%;
  background: #fff; animation: hv-drop 1.8s ease-in-out infinite;
}
@keyframes hv-drop { 0% { top: -40%; } 100% { top: 100%; } }

.hv button:focus-visible, .hv a:focus-visible { outline: 3px solid var(--hv-mint); outline-offset: 3px; }

/* --- 반응형 --- */
@media (max-width: 860px) {
  .hv { height: calc(100vh - 64px); height: calc(100svh - 64px); min-height: 560px; align-items: flex-start; }
  .hv__inner { padding: 64px 0 150px; }
  .hv__shade {
    background:
      linear-gradient(180deg, rgba(12, 40, 78, .55) 0%, rgba(12, 40, 78, .7) 45%, rgba(10, 32, 64, .92) 100%);
  }
  .hv__poster, .hv__video { object-position: 40% 50%; }
  .hv__eyebrow { margin-bottom: 16px; }
  .hv__lead { margin-top: 18px; }
  .hv__actions { margin-top: 30px; }
  .hv__chips { margin-top: 22px; }
  .hv__chips li { font-size: 13.5px; padding: 7px 13px; }
  .hv__bar { bottom: 92px; }   /* 하단 고정 상담 버튼과 겹치지 않게 */
  .hv__scroll { display: none; }
  .hv__track { width: 36px; }
  .hv__pager { gap: 12px; }
}
@media (max-width: 520px) {
  .hv__actions .hv__btn { flex: 1 1 100%; padding: 17px 20px; }
  .hv__btn--ghost { display: none; }   /* 하단 고정 버튼에 자가진단이 이미 있다 */
  .hv__chips li:nth-child(3) { display: none; }
}
@media (max-height: 700px) and (min-width: 861px) {
  .hv__inner { padding-bottom: 100px; }
  .hv__chips { display: none; }
}

/* 움직임 줄이기 설정 사용자: 영상·자동 넘김·등장 효과 끔 */
@media (prefers-reduced-motion: reduce) {
  .hv:not(.hv--motion) *, .hv:not(.hv--motion) *::before, .hv:not(.hv--motion) *::after { transition-duration: .01s !important; transition-delay: 0s !important; animation: none !important; }
}
