.top_header {
  position: absolute; /* 서브페이지, 메인페이지 상관없이 헤더를 화면 맨 위에 띄움 */
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
}

/* 메인 페이지는 비디오가 맨 위부터 시작해야 하므로 wrapper 여백 제거 */
.is-main #wrapper {
  padding-top: 0 !important;
}

/* 메인 페이지: 메가메뉴 열릴 때 wrapper를 아래로 밀어 영상/타이틀이 가려지지 않게 */
@media (min-width: 769px) {
  body.is-main #wrapper {
    transition: margin-top 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  }

  body.is-main:has(.top_header.mega_open) #wrapper,
  body.is-main:has(.top_menu:hover) #wrapper {
    margin-top: 180px;
  }
}

/* 메인 페이지의 헤더 배경은 '투명'하게 */
.is-main .header_bg {
  background: transparent;
  border-bottom: none;
}

/* --- 1. 메인 부모 영역 (화면을 무조건 꽉 채움) --- */
.hero{
  position: relative;
  width: 100%;
  height: unset;
  min-height: unset;
  background-color: #000;
  overflow: hidden;
}

.vimeo-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* --- 2. 영상 중앙 정렬 및 여백 제거 마법 공식 --- */
.vimeo-wrapper iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%); /* 무조건 영상의 '정중앙'을 보여줌 */
}

/* [PC 영상] 빈틈없이 화면 꽉 채우기 (가로 16:9 기준) */
.vimeo-desktop {
  display: block;
}
.vimeo-desktop iframe {
  width: 100vw;
  height: 56.25vw; /* 16:9 비율 유지 */
  min-height: 100vh; /* 창 높이가 길어져도 까만 여백 안 생김 */
  min-width: 177.77vh; /* 창 너비가 좁아져도 까만 여백 안 생김 */
}

/* [모바일 영상] 빈틈없이 화면 꽉 채우기 (세로 9:16 기준) */
.vimeo-mobile {
  display: none;
}
.vimeo-mobile iframe {
  width: 100vw;
  height: 177.77vw; /* 9:16 비율 유지 */
  min-height: 100vh;
  min-width: 56.25vh;
}


/*main화면 영상 및 main타이틀*/

#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #ffffff; /* 로딩 배경색 (검정을 원하시면 #000000) */
  z-index: 9999; /* 화면 최상단에 배치 */
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease; /* 부드럽게 사라지는 효과 */
}

/* 로딩 화면이 사라질 때 쓸 클래스 */
#preloader.hidden {
  opacity: 0;
  pointer-events: none;
}

/* 간단한 로딩 스피너 디자인 (선택 사항) */
.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #333333;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}


.hero-content {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  text-align: center;
  width: 60%; /* 모바일에서도 잘리지 않게 여유를 줍니다 */
}
.hero-content img{width:100%}
/* PC 버전 래퍼: 가로 100%, 16:9 비율 고정, 비디오가 넘치지 않도록 기준점(relative) 설정 */
.vimeo-desktop {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden; /* 영역 밖으로 삐져나가는 영상 숨김 */
}

/* PC 버전 비디오: 부모 래퍼 영역을 꽉 채우도록 설정 */
#bg_pc_video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* 비율을 유지하면서 여백 없이 꽉 채움 */
  z-index: -1; /* 배경으로 들어가도록 제일 뒤로 배치 */
}

/* 모바일 버전 래퍼 설정 */
.vimeo-mobile {
  position: relative;
  width: 100%;
  overflow: hidden;
  aspect-ratio: 203 / 360;
}

/* 모바일 버전 비디오 설정 */
#bg_mb_video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
}

  #main_title_pc {
      display: inline;
  }
  #main_title_mb {
      display: none;
  }


/* --- 해상도 스위치 --- */
@media (max-width: 768px) {
  .vimeo-desktop {
    display: none;
  }
  .vimeo-mobile {
    display: block;
  }

  #main_title_pc {
      display: none;
  }
  #main_title_mb {
      display: inline;
  }
  .hero-content {
    top: 35%;
    width: 90%;
  }
}


/* ==============================================
   섹션1: AI x SOFTWAVE 소개
   ============================================== */
.section-intro {
  background: #fff;
  padding: 100px 0 120px;
  text-align: center;
}

.intro-title {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800;
  color: #1a2260;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

.intro-desc {
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  color: #333;
  line-height: 1.8;
  margin-bottom: 12px;
}

.feature-cards {
  display: flex;
  gap: 24px;
  margin-top: 56px;
  justify-content: center;
}

.feature-card {
  background: #4caf7d;
  border-radius: 20px;
  padding: 40px 32px;
  flex: 1;
  max-width: 320px;
  color: #fff;
  text-align: center;
}

.feature-icon {
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 2rem;
}

.feature-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.4;
}

.feature-card-desc {
  font-size: 0.9rem;
  line-height: 1.7;
  opacity: 0.9;
}

@media (max-width: 768px) {
  .section-intro {
    padding: 60px 0;
  }
  .feature-cards {
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-top: 40px;
  }
  .feature-card {
    max-width: 100%;
    width: 100%;
    padding: 32px 24px;
  }
}


/* ==============================================
   섹션2: 국내외 AI·SW 기술
   ============================================== */
.section-showcase {
  background: #212a63;
  padding: 100px 0 120px;
  text-align: center;
  color: #fff;
}

.showcase-sub {
  font-size: clamp(0.9rem, 1.5vw, 1rem);
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 0.05em;
  margin-bottom: 20px;
}

.showcase-desc {
  font-size: clamp(1rem, 2vw, 1.35rem);
  line-height: 1.8;
  margin-bottom: 48px;
  color: #fff;
}

.showcase-desc strong {
  color: #a8ff00;
  font-weight: 700;
}

.showcase-cards {
  display: flex;
  gap: 24px;
  justify-content: center;
}

.showcase-card {
  flex: 1;
  max-width: 560px;
  overflow: hidden;
  min-height: 280px;
  position: relative;
  display: flex;
  align-items: flex-end;
}

.showcase-cross,
.showcase-b2b {
  background-size: cover; 
  background-position: center; 
  background-repeat: no-repeat;
}
.showcase-cross {
  background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('/img/main_01.jpg');
}
.showcase-b2b {
  background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('/img/main_02.jpg');
}

/* 부모 컨테이너 설정 */
.showcase-card-inner {
  display: flex;
  flex-direction: column; 
  justify-content: space-between;
  width: 100%;
  height: 280px;
  padding: 20px; 
  box-sizing: border-box;
}

.showcase-card-tag {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
  margin: 0;
}

.showcase-card-text {
  margin: 0;
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
}

@media (max-width: 768px) {
  .section-showcase {
    padding: 60px 0;
  }
  .showcase-cards {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }
  .showcase-card {
    max-width: 100%;
    width: 100%;
    min-height: 200px;
  }
}


/* ==============================================
   섹션3: 홍보영상
   ============================================== */
.section-videos {
  background: #f8f8f8;
  padding: 100px 0 120px;
}

.video-grid {
  display: flex;
  gap: 40px;
  justify-content: center;
}

.video-item {
  flex: 1;
  max-width: 600px;
}

.video-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a2260;
  margin-bottom: 8px;
}

.video-sub {
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 16px;
}

.video-wrap {
  position: relative;
  padding-top: 56.25%;
  overflow: hidden;
  background: #000;
}

.video-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 768px) {
  .section-videos {
    padding: 60px 0;
  }
  .video-grid {
    flex-direction: column;
    gap: 32px;
    align-items: center;
  }
  .video-item {
    max-width: 100%;
    width: 100%;
  }
}


/* 페이드 업(Fade-up) 효과 */
.fade-up {
  opacity: 0;
  transform: translateY(30px); 

  transition: opacity 2s cubic-bezier(0.25, 1, 0.5, 1), 
              transform 3s cubic-bezier(0.25, 1, 0.5, 1);
}

/* 화면에 나타날 때 적용될 상태 (JS가 이 클래스를 추가해줌) */
.fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* 딜레이(지연) 효과 - 카드들이 차례대로 올라오게 할 때 사용 */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.5s; }
.delay-3 { transition-delay: 0.9s; }

/* ===== 중앙 팝업 ===== */
.center-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.center-popup {
  position: relative;
  width: 800px;
  max-width: 90%;
  background: linear-gradient(135deg, #111827 0%, #1C213B 50%, #212a63 100%);
  border-radius: 16px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
  overflow: hidden;
  animation: popupFadeIn 0.4s ease-out;
}

@keyframes popupFadeIn {
  from { opacity: 0; transform: scale(0.9) translateY(-20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.center-popup-header {
  background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 100%);
  padding: 20px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.center-popup-header h2 {
  color: #fff;
  font-size: 28px;
  margin: 0;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  flex: 1;
  text-align: center;
  padding-left: 36px;
}

.center-popup-body {
  padding: 40px 50px;
  text-align: center;
}

.center-popup-body p {
  color: #e0e0e0;
  font-size: 17px;
  line-height: 1.8;
  margin: 0 0 20px 0;
}

.center-popup-body p:last-child {
  margin-bottom: 0;
}

.center-popup-body .highlight {
  color: #B8F400;
  font-weight: 600;
}

.center-popup-close {
  width: 36px;
  height: 36px;
  min-width: 36px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
}

.center-popup-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.center-popup-close svg {
  width: 18px;
  height: 18px;
  stroke: #fff;
  stroke-width: 2.5;
}

.center-popup-footer {
  padding: 20px 30px;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: center;
  gap: 15px;
}

.center-popup-footer label {
  color: #aaa;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.center-popup-footer input[type="checkbox"] {
  appearance: checkbox;
  -webkit-appearance: checkbox;
  width: 16px;
  height: 16px;
  accent-color: #B8F400;
}

@media (max-width: 600px) {
  .center-popup-header h2 { font-size: 22px; }
  .center-popup-body { padding: 30px 25px; }
  .center-popup-body p { font-size: 15px; }
}