/* hnp_2020 v2 디자인 시스템 - 공통 CSS */

/* ============ Tailwind v4 색상 토큰 ============ */
@theme {
  --color-brand-50:  #eef4ff;
  --color-brand-100: #dbe6ff;
  --color-brand-200: #bcd1ff;
  --color-brand-300: #8eb1ff;
  --color-brand-400: #5b87ff;
  --color-brand-500: #3563eb;
  --color-brand-600: #2148d1;
  --color-brand-700: #1c39a8;
  --color-brand-800: #1b3286;
  --color-brand-900: #0f1d52;
  --color-brand-950: #0a1438;
  --color-accent-400: #22d3ee;
  --color-accent-500: #06b6d4;
  --font-sans: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

html { scroll-behavior: smooth; }
body { font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif; word-break: keep-all; font-size: 14pt; }

/* 클릭 가능한 요소 커서 통일 */
a[href],
button,
select,
summary,
label[for],
[role="button"],
[onclick],
input[type="checkbox"],
input[type="radio"],
input[type="submit"],
input[type="button"],
input[type="file"] { cursor: pointer; }

button:disabled,
button[disabled],
input:disabled,
select:disabled,
[aria-disabled="true"] { cursor: not-allowed; }

/* FOUC 방지: Tailwind 런타임 컴파일 완료 전까지 화면을 숨겨 폰트 점프 방지 (페이드 없이 즉시 표시) */
body { visibility: hidden; }
body.tw-ready { visibility: visible; }

/* 모바일에서 페이지 좌우 패딩 축소 (공용 컨테이너 px-6 → 1rem) */
@media (max-width: 640px) {
  .mx-auto.px-6 { padding-left: 1rem; padding-right: 1rem; }
}

/* ============ 그라데이션 ============ */
.gradient-hero {
  background: linear-gradient(135deg, #0f1d52 0%, #1c39a8 35%, #2148d1 70%, #06b6d4 100%);
  background-size: 200% 200%;
  animation: gradient 12s ease infinite;
}
.gradient-text {
  background: linear-gradient(135deg, #5b87ff 0%, #22d3ee 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gradient-cta {
  background: linear-gradient(135deg, #1c39a8 0%, #06b6d4 100%);
}

@keyframes gradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ============ 글래스모피즘 ============ */
.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}
.glass-dark {
  background: rgba(15, 29, 82, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* ============ 스크롤 페이드인 ============ */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ============ 그리드 패턴 (히어로 배경) ============ */
.grid-pattern {
  background-image:
    linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* ============ 카드 호버 ============ */
.card-hover {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease, border-color 0.4s ease;
}
.card-hover:hover, .card-hover:active {
  transform: translateY(-8px);
  box-shadow: 0 20px 60px -20px rgba(33, 72, 209, 0.35);
  border-color: rgba(91, 135, 255, 0.5);
}

/* ============ 블롭 (배경 장식) ============ */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  pointer-events: none;
}

/* ============ 모바일 메뉴 ============ */
.mobile-menu { transform: translateX(100%); transition: transform 0.3s ease; }
.mobile-menu.open { transform: translateX(0); }

/* ============ 카운터 숫자 ============ */
.stat-num {
  font-feature-settings: 'tnum';
  letter-spacing: -0.04em;
}

/* ============ 공통 컴포넌트 ============ */
.nav-link {
  padding: 0.5rem 1rem;
  font-size: 16px;
  font-weight: 500;
  color: rgb(51, 65, 85);
  border-radius: 0.5rem;
  transition: color 0.2s, background-color 0.2s;
}
.nav-link:hover { color: #2148d1; background-color: #eef4ff; }
.nav-link-active { color: #2148d1; background-color: #eef4ff; font-weight: 600; }

/* ============ 드롭다운(롤오버) 메뉴 ============ */
.nav-item { position: relative; display: inline-flex; }
.nav-link { display: inline-flex; align-items: center; gap: 0.25rem; }
.nav-caret { width: 0.85rem; height: 0.85rem; transition: transform 0.2s; }
.nav-item:hover .nav-caret, .nav-item:active .nav-caret, .nav-item:focus-within .nav-caret, .nav-item.dd-open .nav-caret { transform: rotate(180deg); }
.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 12rem;
  padding: 0.5rem;
  background: #fff;
  border: 1px solid rgb(226, 232, 240);
  border-radius: 0.875rem;
  box-shadow: 0 20px 40px -12px rgba(15, 23, 42, 0.18);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  z-index: 60;
}
/* hover 사이 간격에서 메뉴가 닫히지 않도록 보이지 않는 다리 추가 */
.nav-dropdown::before {
  content: '';
  position: absolute;
  top: -8px; left: 0; right: 0; height: 8px;
}
.nav-item:hover .nav-dropdown, .nav-item:active .nav-dropdown, .nav-item:focus-within .nav-dropdown, .nav-item.dd-open .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(2px);
}
.nav-dropdown-link {
  display: block;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgb(51, 65, 85);
  border-radius: 0.5rem;
  white-space: nowrap;
  transition: color 0.15s, background-color 0.15s;
}
.nav-dropdown-link:hover { color: #2148d1; background-color: #eef4ff; }

/* 우측 정렬 드롭다운 (헤더 오른쪽 끝 버튼용) */
.nav-item-right .nav-dropdown {
  left: auto;
  right: 0;
  transform: translateX(0) translateY(8px);
}
.nav-item-right:hover .nav-dropdown, .nav-item-right:active .nav-dropdown, .nav-item-right:focus-within .nav-dropdown, .nav-item-right.dd-open .nav-dropdown {
  transform: translateX(0) translateY(2px);
}

/* 모바일 하위 메뉴 */
.m-sublink {
  display: block;
  padding: 0.5rem 1rem 0.5rem 2.25rem;
  font-size: 0.9rem;
  color: rgb(100, 116, 139);
  border-radius: 0.5rem;
}
.m-sublink:hover { color: #2148d1; background-color: #eef4ff; }

/* 모바일 아코디언 */
.m-acc-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.m-acc-caret {
  width: 1rem; height: 1rem;
  flex-shrink: 0;
  color: rgb(148, 163, 184);
  transition: transform 0.25s ease;
}
.m-acc.open .m-acc-caret { transform: rotate(180deg); }
.m-acc-panel {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.28s ease;
}
.m-acc.open .m-acc-panel { max-height: 320px; }

/* 페이지 히어로 (서브 페이지 공용) */
.page-hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 360px;
  padding-top: 5.5rem;
  padding-bottom: 2rem;
  background: linear-gradient(135deg, #0f1d52 0%, #1c39a8 60%, #2148d1 100%);
  color: white;
  overflow: hidden;
}
@media (min-width: 768px) {
  .page-hero { min-height: 480px; padding-top: 7rem; padding-bottom: 2.5rem; }
}
/* 각 페이지가 지정한 내부 세로 패딩을 무력화하여 높이를 중앙에서 통일 */
.page-hero > .relative {
  width: 100%;
  padding-top: 0;
  padding-bottom: 0;
}
.page-hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.5;
}
.page-hero-eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.375rem 1rem;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 9999px;
  font-size: 0.875rem; font-weight: 500;
  margin-bottom: 1.5rem;
}
.page-hero-title {
  font-size: 2.25rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 1rem;
}
@media (min-width: 768px) { .page-hero-title { font-size: 3.5rem; } }
.page-hero-desc {
  font-size: 1.125rem;
  color: rgba(255,255,255,0.8);
  line-height: 1.6;
  max-width: 42rem;
}

/* 본문 섹션 공용 */
.section { padding: 4rem 1.5rem; }
@media (min-width: 768px) { .section { padding: 6rem 2rem; } }
.section-inner { max-width: 80rem; margin: 0 auto; }
.section-title {
  font-size: 1.875rem; font-weight: 900;
  color: rgb(15,23,42); margin-bottom: 1rem;
  letter-spacing: -0.02em;
}
@media (min-width: 768px) { .section-title { font-size: 2.5rem; } }
.section-desc { font-size: 1rem; color: rgb(71,85,105); line-height: 1.7; }

.m-link {
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  color: rgb(30, 41, 59);
  border-radius: 0.5rem;
}
.m-link:hover { color: #2148d1; background-color: #eef4ff; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background-color: white;
  color: #1c39a8;
  font-weight: 700;
  border-radius: 0.75rem;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  transition: transform 0.2s;
}
.btn-primary:hover { transform: scale(1.05); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background-color: rgba(255,255,255,0.1);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  font-weight: 600;
  border-radius: 0.75rem;
  transition: background-color 0.2s, transform 0.2s;
}
.btn-ghost:hover { background-color: rgba(255,255,255,0.2); transform: scale(1.05); }

/* 히어로 내부 버튼은 약간 작게 (히어로 높이를 다른 페이지와 통일) */
.page-hero .btn-primary,
.page-hero .btn-ghost { padding: 0.75rem 1.75rem; }

.eyebrow {
  font-size: 0.875rem;
  font-weight: 700;
  color: #2148d1;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 0.75rem;
}

.h-section {
  font-size: 1.875rem;
  font-weight: 900;
  color: rgb(15, 23, 42);
  letter-spacing: -0.02em;
}
@media (min-width: 768px) {
  .h-section { font-size: 3rem; }
}

/* feature 카드 (JS로 생성) */
.feat-card {
  padding: 1.75rem;
  background: linear-gradient(135deg, #eef4ff 0%, #ffffff 100%);
  border: 1px solid #dbe6ff;
  border-radius: 1rem;
  transition: transform 0.4s, box-shadow 0.4s, border-color 0.4s;
}
.feat-card:hover, .feat-card:active {
  transform: translateY(-8px);
  box-shadow: 0 20px 60px -20px rgba(33, 72, 209, 0.35);
  border-color: rgba(91, 135, 255, 0.5);
}
.feat-icon {
  width: 3rem; height: 3rem; border-radius: 0.75rem;
  background: linear-gradient(135deg, #1c39a8 0%, #06b6d4 100%);
  color: white;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 0;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}
.feat-emoji {
  background: #ffffff;
  border: 1px solid #dbe6ff;
  font-size: 1.6rem; line-height: 1;
  box-shadow: 0 4px 12px -4px rgba(33, 72, 209, 0.18);
}
.feat-card:hover .feat-emoji, .feat-card:active .feat-emoji { transform: scale(1.06); transition: transform 0.3s; }
.feat-head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.feat-title { font-size: 1.125rem; font-weight: 700; margin-bottom: 0; color: rgb(15, 23, 42); }
.feat-desc { font-size: 0.875rem; color: rgb(71, 85, 105); line-height: 1.6; }

/* product 카드 (JS로 생성) */
.prod-card {
  position: relative;
  overflow: hidden;
  border-radius: 1.5rem;
  padding: 2rem;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: white;
  transition: transform 0.4s, box-shadow 0.4s;
  width: 100%;
  max-width: 280px;
}
.prod-card:hover { transform: translateY(-8px); box-shadow: 0 20px 60px -20px rgba(0,0,0,0.4); }
.prod-card .blob-deco {
  position: absolute;
  right: -2.5rem; bottom: -2.5rem;
  width: 10rem; height: 10rem;
  border-radius: 50%;
  background-color: rgba(255,255,255,0.1);
  filter: blur(40px);
}
.prod-eyebrow { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.15em; color: rgba(255,255,255,0.6); margin-bottom: 0.5rem; }
.prod-title { font-size: 1.5rem; font-weight: 900; margin-bottom: 0.5rem; }
.prod-desc { font-size: 0.875rem; color: rgba(255,255,255,0.8); line-height: 1.6; }
.prod-arrow { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; font-weight: 600; margin-top: 1.5rem; }
.prod-arrow svg { transition: transform 0.2s; }
.prod-card:hover .prod-arrow svg { transform: translateX(4px); }
