/* ─── COMVILLAIN Header — Glass Nav (Light Default) ─── */

.alpha-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: 68px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease, color 0.2s ease;
}
.alpha-header.scrolled {
  background: rgba(255, 255, 255, 0.97);
  border-bottom-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
}

/* ── 캐러셀 히어로: 맨 위=투명, 스크롤=어두운 반투명 ── */
.alpha-header.on-hero,
body.cv-hero-page .alpha-header {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom-color: transparent !important;
}
.alpha-header.on-hero.scrolled,
body.cv-hero-page .alpha-header.scrolled {
  background: rgba(9, 9, 11, 0.88) !important;
  backdrop-filter: blur(20px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(160%) !important;
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.4) !important;
}

/* on-hero / cv-hero-page: 텍스트·아이콘 → 화이트 */
.alpha-header.on-hero .logo-text,
.alpha-header.on-hero .nav-link,
.alpha-header.on-hero .header-btn,
body.cv-hero-page .alpha-header .logo-text,
body.cv-hero-page .alpha-header .nav-link,
body.cv-hero-page .alpha-header .header-btn {
  color: rgba(255, 255, 255, 0.92) !important;
}
.alpha-header.on-hero .nav-link:hover,
.alpha-header.on-hero .nav-item.active > .nav-link,
body.cv-hero-page .alpha-header .nav-link:hover,
body.cv-hero-page .alpha-header .nav-item.active > .nav-link {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.1) !important;
}
.alpha-header.on-hero .header-btn,
body.cv-hero-page .alpha-header .header-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
}
.alpha-header.on-hero .header-btn:hover,
body.cv-hero-page .alpha-header .header-btn:hover {
  background: rgba(255, 255, 255, 0.16) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  color: #fff !important;
}
/* 드롭다운 서브메뉴는 항상 어두운 배경 */
.alpha-header.on-hero .sub-menu,
body.cv-hero-page .alpha-header .sub-menu {
  background: rgba(15, 15, 20, 0.95) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}
.alpha-header.on-hero .sub-link,
body.cv-hero-page .alpha-header .sub-link {
  color: rgba(255, 255, 255, 0.75) !important;
}
.alpha-header.on-hero .sub-link:hover,
body.cv-hero-page .alpha-header .sub-link:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

/* scrolled 후: 텍스트 유지 (어두운 배경 위 흰색) */
.alpha-header.on-hero.scrolled .logo-text,
.alpha-header.on-hero.scrolled .nav-link,
.alpha-header.on-hero.scrolled .header-btn,
body.cv-hero-page .alpha-header.scrolled .logo-text,
body.cv-hero-page .alpha-header.scrolled .nav-link,
body.cv-hero-page .alpha-header.scrolled .header-btn {
  color: rgba(255, 255, 255, 0.88) !important;
}
.alpha-header.on-hero.scrolled .nav-link:hover,
body.cv-hero-page .alpha-header.scrolled .nav-link:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.08) !important;
}
.alpha-header.on-hero.scrolled .header-btn,
body.cv-hero-page .alpha-header.scrolled .header-btn {
  border-color: rgba(255, 255, 255, 0.15) !important;
  background: rgba(255, 255, 255, 0.06) !important;
}

.header-content {
  display: flex;
  align-items: center;
  height: 68px;
  gap: 2rem;
}

/* ── Logo ── */
.header-logo a {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
}
.header-logo img { height: 32px; width: auto; }
.logo-text {
  font-family: 'Paperlogy', 'Pretendard', sans-serif;
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--cv-text);
  white-space: nowrap;
}

/* ── Nav ── */
.header-nav { flex: 1; }
.nav-list {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  padding: 0; margin: 0;
}
.nav-item { position: relative; }
.nav-link {
  display: block;
  padding: 0.4375rem 0.875rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--cv-text-2);
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
  text-decoration: none;
}
.nav-link:hover,
.nav-item.active > .nav-link {
  color: var(--cv-text);
  background: var(--cv-card-bg-2);
}
.nav-item.has-submenu > .nav-link::after {
  content: '';
  display: inline-block;
  width: 0; height: 0;
  margin-left: 0.35rem;
  border-left: 3.5px solid transparent;
  border-right: 3.5px solid transparent;
  border-top: 4px solid currentColor;
  opacity: 0.5;
  vertical-align: middle;
}

/* Dropdown */
.sub-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 180px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--cv-card-border);
  border-radius: 12px;
  padding: 0.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  list-style: none;
  z-index: 100;
}
.nav-item.has-submenu:hover .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.sub-link {
  display: block;
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  color: var(--cv-text-2);
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.sub-link:hover {
  color: var(--cv-text);
  background: var(--cv-card-bg-2);
}

/* ── Header right actions ── */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-left: auto;
}
.header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 9px;
  border: 1px solid var(--cv-border);
  color: var(--cv-text-2);
  background: var(--cv-card-bg);
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
  text-decoration: none;
}
.header-btn:hover {
  color: var(--cv-text);
  background: var(--cv-card-bg-2);
  border-color: var(--cv-border-2);
}
.sun-icon, .moon-icon { pointer-events: none; }

/* ── Mobile toggle ── */
.mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px; height: 36px;
  padding: 6px;
  border-radius: 9px;
  background: var(--cv-card-bg);
  border: 1px solid var(--cv-border);
  cursor: pointer;
  margin-left: 0.5rem;
}
.mobile-toggle span {
  display: block;
  height: 1.5px;
  background: var(--cv-text-2);
  border-radius: 2px;
  transition: var(--transition);
}

/* ── Mobile menu overlay ── */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(255, 255, 255, 0.99);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16,1,0.3,1);
}
.mobile-menu.active { transform: translateX(0); }

.mobile-menu-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.5rem;
  overflow-y: auto;
}
.mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}
.mobile-logo { display: flex; align-items: center; gap: 0.625rem; }
.mobile-logo img { height: 28px; width: auto; }
.mobile-logo span {
  font-family: 'Paperlogy', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  color: var(--cv-text);
}
.mobile-close {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: var(--cv-card-bg);
  border: 1px solid var(--cv-border);
  color: var(--cv-text-2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.mobile-nav { flex: 1; }
.mobile-nav-list { list-style: none; padding: 0; margin: 0; }
.mobile-nav-item { border-bottom: 1px solid var(--cv-divider-c); }
.mobile-nav-link {
  display: block;
  padding: 1rem 0;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--cv-text-2);
  text-decoration: none;
  transition: color 0.2s;
}
.mobile-nav-link:hover { color: var(--cv-text); }
.mobile-sub-menu { list-style: none; padding: 0 0 0.5rem 1rem; margin: 0; }
.mobile-sub-link {
  display: block;
  padding: 0.5rem 0;
  font-size: 0.9375rem;
  color: var(--cv-text-3);
  text-decoration: none;
  transition: color 0.2s;
}
.mobile-sub-link:hover { color: var(--cv-text-2); }

.mobile-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 2rem;
}
.mobile-btn {
  display: block;
  text-align: center;
  padding: 0.875rem;
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 600;
  background: #06b6d4;
  color: #09090b;
  text-decoration: none;
  transition: background 0.2s;
}
.mobile-btn:hover { background: #0891b2; }
.mobile-btn-outline {
  background: var(--cv-card-bg);
  color: var(--cv-text-2);
  border: 1px solid var(--cv-border);
}
.mobile-btn-outline:hover { background: var(--cv-card-bg-2); color: var(--cv-text); }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .header-nav  { display: none; }
  .mobile-toggle { display: flex; }
  .mobile-menu   { display: block; }
}
@media (min-width: 1025px) {
  .mobile-toggle { display: none; }
}
