/* ==========================================================================
 * 홈피디자인(Grapia) 자체 모션 · 인터랙션 · 캐러셀 · 아코디온 엔진 (hp-motion.css)
 * - 100% 자체 제작 · Elementor 무료 코어 & 5px Ultra-Flat 규격 완벽 호환
 * - JS 미로드/지연 시 영구 투명(opacity:0) 방지: html.hp-motion-ready 스코프 가드
 * ========================================================================== */

html.hp-motion-ready .hp-anim {
  opacity: 0;
  will-change: transform, opacity;
  transition: opacity 0.72s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.72s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--hp-delay, 0ms);
}

html.hp-motion-ready .hp-anim.hp-anim-fade { transform: none; }
html.hp-motion-ready .hp-anim.hp-anim-up { transform: translate3d(0, 26px, 0); }
html.hp-motion-ready .hp-anim.hp-anim-down { transform: translate3d(0, -22px, 0); }
html.hp-motion-ready .hp-anim.hp-anim-left { transform: translate3d(-28px, 0, 0); }
html.hp-motion-ready .hp-anim.hp-anim-right { transform: translate3d(28px, 0, 0); }
html.hp-motion-ready .hp-anim.hp-anim-zoom { transform: scale(0.95); }

.hp-d1 { --hp-delay: 100ms; }
.hp-d2 { --hp-delay: 200ms; }
.hp-d3 { --hp-delay: 300ms; }
.hp-d4 { --hp-delay: 400ms; }
.hp-d5 { --hp-delay: 500ms; }
.hp-d6 { --hp-delay: 600ms; }

html.hp-motion-ready .hp-anim.is-inview {
  opacity: 1 !important;
  transform: translate3d(0, 0, 0) scale(1) !important;
}

/* 세로/가로 헤어라인 신장 모션 */
html.hp-motion-ready .hp-anim-line {
  transform: scaleY(0);
  transform-origin: top center;
  transition: transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--hp-delay, 0ms);
}
html.hp-motion-ready .hp-anim-line.is-inview {
  transform: scaleY(1);
}

/* 타이포 클립 마스크 리빌 */
html.hp-motion-ready .hp-anim-clip {
  opacity: 0;
  clip-path: inset(0 0 100% 0);
  transform: translate3d(0, 16px, 0);
  transition: clip-path 0.8s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.8s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.55s ease;
  transition-delay: var(--hp-delay, 0ms);
}
html.hp-motion-ready .hp-anim-clip.is-inview {
  opacity: 1;
  clip-path: inset(0 0 0 0);
  transform: translate3d(0, 0, 0);
}

@media (prefers-reduced-motion: reduce) {
  html.hp-motion-ready .hp-anim,
  html.hp-motion-ready .hp-anim-line,
  html.hp-motion-ready .hp-anim-clip {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
    transition: none !important;
  }
  .hp-m-hero-bg,
  .hp-m-marquee-track {
    animation: none !important;
  }
  .hp-m-hero-slide {
    transition: none !important;
  }
}

/* 엘리멘터 편집기 모드 영구 가시성 보호 (스크롤 리빌 opacity:0 차단) */
body.elementor-editor-active .hp-anim,
body.elementor-editor-active .hp-anim-line,
body.elementor-editor-active .hp-anim-clip,
html.hp-motion-ready body.elementor-editor-active .hp-anim,
html.hp-motion-ready body.elementor-editor-active .hp-anim-line,
html.hp-motion-ready body.elementor-editor-active .hp-anim-clip {
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  clip-path: none !important;
  transition: none !important;
}

/* ==========================================================================
 * 호버 마이크로 인터랙션 (5px 라운드 · 순수 면 대비)
 * ========================================================================== */
.hp-hover-zoom {
  overflow: hidden;
  border-radius: 5px;
}
.hp-hover-zoom img {
  display: block;
  width: 100%;
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.hp-hover-zoom:hover img,
.hp-hover-card:hover .hp-hover-zoom img {
  transform: scale(1.06);
}

.hp-hover-card {
  transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}
.hp-hover-card:hover {
  transform: translateY(-4px);
}

.hp-arrow-icon {
  display: inline-block;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.hp-hover-card:hover .hp-arrow-icon,
a:hover .hp-arrow-icon,
button:hover .hp-arrow-icon {
  transform: translateX(4px);
}

/* 호버 캡션 리빌 카드 (MW03 등) */
.hp-m-hover-tile {
  position: relative;
  overflow: hidden;
  border-radius: 5px;
  cursor: pointer;
}
.hp-m-hover-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.hp-m-hover-tile .hp-m-hover-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.08) 0%, rgba(15, 23, 42, 0.45) 55%, rgba(15, 23, 42, 0.88) 100%);
  transition: background 0.4s ease;
}
.hp-m-hover-tile:hover img {
  transform: scale(1.07);
}
.hp-m-hover-tile:hover .hp-m-hover-scrim {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.25) 0%, rgba(15, 23, 42, 0.72) 55%, rgba(15, 23, 42, 0.94) 100%);
}
.hp-m-hover-tile .hp-m-hover-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 26px 24px;
  z-index: 2;
  color: #FFFFFF;
}
.hp-m-hover-tile .hp-m-hover-extra {
  max-height: 68px;
  opacity: 0.92;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

/* ==========================================================================
 * 자체 풀폭 히어로 슬라이더 (.hp-m-hero & 14초 켄번즈 줌)
 * ========================================================================== */
.hp-m-hero {
  position: relative;
  width: 100%;
  height: 680px;
  overflow: hidden;
  background: #0F172A;
}
.hp-m-hero.hp-m-hero-light {
  background: #F1F5F9;
}
.hp-m-hero-slides {
  position: relative;
  width: 100%;
  height: 100%;
}
.hp-m-hero-slide {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translate3d(100%, 0, 0);
  transition: none;
  will-change: transform;
  z-index: 1;
}
.hp-m-hero-slide.is-active {
  opacity: 1;
  visibility: visible;
  transform: translate3d(0, 0, 0);
  z-index: 3;
}
.hp-m-hero-slide.is-sliding {
  transition: transform 0.78s cubic-bezier(0.22, 1, 0.36, 1);
}
.hp-m-hero-slide.is-leaving-left {
  opacity: 1;
  visibility: visible;
  transform: translate3d(-100%, 0, 0);
  transition: transform 0.78s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 2;
}
.hp-m-hero-slide.is-leaving-right {
  opacity: 1;
  visibility: visible;
  transform: translate3d(100%, 0, 0);
  transition: transform 0.78s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 2;
}
.hp-m-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1);
}
@keyframes hpKenBurns {
  0% { transform: scale(1); }
  100% { transform: scale(1.09); }
}
.hp-m-hero-kenburns .hp-m-hero-slide.is-active .hp-m-hero-bg {
  animation: hpKenBurns 14s ease-out forwards;
}
.hp-m-hero-scrim-light {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.56) 0%, rgba(15, 23, 42, 0.28) 52%, rgba(15, 23, 42, 0.08) 100%);
}
.hp-m-hero-scrim-dark {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.42) 0%, rgba(15, 23, 42, 0.62) 100%);
}
.hp-m-hero-inner {
  position: relative;
  z-index: 3;
  max-width: 1600px;
  height: 100%;
  margin: 0 auto;
  padding: 0 88px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}
.hp-m-hero-inner.is-center {
  align-items: center;
  text-align: center;
}
.hp-m-hero-kicker {
  font-family: 'Pretendard', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.88);
  margin: 0 0 12px;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease 0.08s, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.08s;
}
.hp-m-hero-title {
  font-family: 'Pretendard', sans-serif;
  font-size: 52px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -1.2px;
  color: #FFFFFF;
  margin: 0 0 16px;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.75s ease 0.2s, transform 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.2s;
}
.hp-m-hero-desc {
  font-family: 'Pretendard', sans-serif;
  font-size: 18px;
  line-height: 1.65;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.92);
  max-width: 580px;
  margin: 0 0 28px;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.75s ease 0.34s, transform 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.34s;
}
.hp-m-hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 5px;
  font-family: 'Pretendard', sans-serif;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  background: #A80632;
  color: #FFFFFF;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.75s ease 0.46s, transform 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.46s, background-color 0.25s ease;
}
.hp-m-hero-cta.is-outline {
  background: rgba(15, 23, 42, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.78);
}
.hp-m-hero-cta:hover {
  background: #0F172A;
  color: #FFFFFF;
}
.hp-m-hero-slide.is-active .hp-m-hero-kicker,
.hp-m-hero-slide.is-active .hp-m-hero-title,
.hp-m-hero-slide.is-active .hp-m-hero-desc,
.hp-m-hero-slide.is-active .hp-m-hero-cta,
.hp-m-hero-slide.is-leaving-left .hp-m-hero-kicker,
.hp-m-hero-slide.is-leaving-left .hp-m-hero-title,
.hp-m-hero-slide.is-leaving-left .hp-m-hero-desc,
.hp-m-hero-slide.is-leaving-left .hp-m-hero-cta,
.hp-m-hero-slide.is-leaving-right .hp-m-hero-kicker,
.hp-m-hero-slide.is-leaving-right .hp-m-hero-title,
.hp-m-hero-slide.is-leaving-right .hp-m-hero-desc,
.hp-m-hero-slide.is-leaving-right .hp-m-hero-cta {
  opacity: 1;
  transform: translateY(0);
}
.hp-m-hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 48px;
  height: 48px;
  border-radius: 5px;
  border: 0;
  background: rgba(15, 23, 42, 0.35);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.25s ease;
}
.hp-m-hero-arrow:hover {
  background: rgba(168, 6, 50, 0.88);
}
.hp-m-hero-arrow.is-prev { left: 20px; }
.hp-m-hero-arrow.is-next { right: 20px; }
.hp-m-hero-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 24px;
  z-index: 5;
  display: flex;
  justify-content: center;
  gap: 8px;
}
.hp-m-hero-dot {
  width: 28px;
  height: 5px;
  border-radius: 5px;
  border: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.42);
  cursor: pointer;
  transition: width 0.3s ease, background-color 0.3s ease;
}
.hp-m-hero-dot.is-active {
  width: 48px;
  background: #FFFFFF;
}
.hp-m-hero-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  z-index: 6;
  background: rgba(255, 255, 255, 0.16);
}
.hp-m-hero-progress > span {
  display: block;
  height: 100%;
  width: 0;
  background: #A80632;
}

/* ==========================================================================
 * 3·4·5열 반응형 캐러셀 (.hp-m-carousel)
 * ========================================================================== */
.hp-m-carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
}
.hp-m-carousel-viewport {
  overflow: hidden;
  width: 100%;
}
.hp-m-carousel-track {
  display: flex;
  gap: 20px;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.hp-m-carousel-slide {
  flex: 0 0 calc((100% - (var(--hp-cols, 3) - 1) * 20px) / var(--hp-cols, 3));
  min-width: 0;
}
.hp-m-carousel-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
}
.hp-m-carousel-btns {
  display: flex;
  gap: 8px;
}
.hp-m-cbtn {
  width: 48px;
  height: 48px;
  border-radius: 5px;
  border: 0;
  background: #F1F5F9;
  color: #0F172A;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease;
}
.hp-m-cbtn:hover {
  background: #0F172A;
  color: #FFFFFF;
}

/* ==========================================================================
 * 무한 키네틱 마키 (.hp-m-marquee)
 * ========================================================================== */
.hp-m-marquee {
  position: relative;
  width: 100%;
  overflow: hidden;
  user-select: none;
}
@keyframes hpMarqueeScroll {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}
.hp-m-marquee-track {
  display: flex;
  width: max-content;
  align-items: center;
  animation: hpMarqueeScroll var(--hp-marquee-dur, 26s) linear infinite;
  will-change: transform;
}
.hp-m-marquee:hover .hp-m-marquee-track {
  animation-play-state: paused;
}
.hp-m-marquee-group {
  display: flex;
  align-items: center;
  gap: 56px;
  padding-right: 56px;
}
.hp-m-marquee-word {
  font-family: 'Pretendard', sans-serif;
  font-size: 64px;
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.05;
  color: #E2E8F0;
  white-space: nowrap;
}
.hp-m-marquee-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #CBD5E1;
  flex-shrink: 0;
}

/* ==========================================================================
 * 가로 4분할 이미지 아코디온 (.hp-m-accordion)
 * ========================================================================== */
.hp-m-accordion {
  display: flex;
  gap: 10px;
  width: 100%;
  height: 460px;
  overflow: hidden;
}
.hp-m-acc-item {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  border-radius: 5px;
  overflow: hidden;
  cursor: pointer;
  transition: flex 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  background: #0F172A;
}
.hp-m-acc-item.is-active,
.hp-m-acc-item:hover {
  flex: 2.8 1 0;
}
.hp-m-acc-item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.hp-m-acc-item.is-active img,
.hp-m-acc-item:hover img {
  transform: scale(1.05);
}
.hp-m-acc-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.15) 0%, rgba(15, 23, 42, 0.78) 100%);
  transition: background 0.35s ease;
}
.hp-m-acc-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px 26px;
  z-index: 2;
  color: #FFFFFF;
}
.hp-m-acc-num {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 6px;
}
.hp-m-acc-title {
  font-size: 16px;
  line-height: 1.3;
  font-weight: 700;
  color: #FFFFFF;
  margin: 0;
  white-space: normal;
  word-break: keep-all;
  transition: font-size 0.3s ease;
}
.hp-m-acc-item.is-active .hp-m-acc-title,
.hp-m-acc-item:hover .hp-m-acc-title {
  font-size: 22px;
}
.hp-m-acc-detail {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(10px);
  transition: max-height 0.4s ease, opacity 0.4s ease 0.08s, transform 0.4s ease 0.08s;
}
.hp-m-acc-item.is-active .hp-m-acc-detail,
.hp-m-acc-item:hover .hp-m-acc-detail {
  max-height: 140px;
  opacity: 1;
  transform: translateY(0);
  margin-top: 10px;
}
.hp-m-acc-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 9px 18px;
  border-radius: 5px;
  background: #A80632;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

/* ==========================================================================
 * 4탭 필터링 갤러리 (.hp-m-filter-gallery)
 * ========================================================================== */
.hp-m-fg-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 28px;
}
.hp-m-fg-tab {
  min-height: 44px;
  padding: 10px 22px;
  border-radius: 5px;
  border: 0;
  background: #F1F5F9;
  color: #334155;
  font-family: 'Pretendard', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease;
}
.hp-m-fg-tab.is-active {
  background: #0F172A;
  color: #FFFFFF;
}
.hp-m-fg-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.hp-m-fg-card {
  position: relative;
  border-radius: 5px;
  overflow: hidden;
  background: #F8FAFC;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.hp-m-fg-card.is-hidden {
  display: none;
}
.hp-m-fg-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.hp-m-fg-card:hover img {
  transform: scale(1.06);
}
.hp-m-fg-meta {
  padding: 16px 18px;
  background: #F8FAFC;
}
.hp-m-fg-cat {
  font-size: 12px;
  font-weight: 700;
  color: #A80632;
  margin-bottom: 4px;
}
.hp-m-fg-name {
  font-size: 16px;
  font-weight: 600;
  color: #0F172A;
  margin: 0;
}

/* ==========================================================================
 * 다중 배경 크로스페이드 (.hp-m-bg-fade) & 파러렉스 클램핑
 * ========================================================================== */
.hp-m-bg-fade {
  position: relative;
  overflow: hidden;
}
.hp-m-bg-fade-layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.3s ease;
  z-index: 0;
}
.hp-m-bg-fade-layer.is-active {
  opacity: 1;
}
.hp-m-scroll-stage {
  overflow-x: clip;
  overflow-x: hidden;
}

/* ==========================================================================
 * 태블릿(<=1024px) & 모바일(<=767px) 반응형 정렬
 * ========================================================================== */
@media (max-width: 1024px) {
  .hp-m-hero { height: 560px; }
  .hp-m-hero-inner { padding: 0 68px; }
  .hp-m-hero-title { font-size: 38px; }
  .hp-m-marquee-word { font-size: 46px; }
  .hp-m-fg-grid { grid-template-columns: repeat(2, 1fr); }
  .hp-m-accordion { height: 380px; }
}

@media (max-width: 767px) {
  .hp-m-hero { height: 480px; }
  .hp-m-hero-inner { padding: 0 24px 36px; }
  .hp-m-hero-title { font-size: 28px; letter-spacing: -0.6px; }
  .hp-m-hero-desc { font-size: 15px; margin-bottom: 20px; }
  .hp-m-hero-arrow {
    top: auto;
    bottom: 14px;
    transform: none;
    width: 40px;
    height: 40px;
  }
  .hp-m-hero-arrow.is-prev { left: auto; right: 64px; }
  .hp-m-hero-arrow.is-next { right: 16px; }
  .hp-m-hero-dots { justify-content: flex-start; left: 24px; bottom: 28px; }
  .hp-m-marquee-word { font-size: 32px; }
  .hp-m-marquee-group { gap: 28px; padding-right: 28px; }
  .hp-m-accordion {
    flex-direction: column;
    height: auto;
    gap: 8px;
  }
  .hp-m-acc-item {
    flex: none !important;
    height: 150px;
    transition: height 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .hp-m-acc-item.is-active {
    height: 270px;
  }
  .hp-m-fg-grid { grid-template-columns: 1fr; }
}
