/* ============================================================
   Clover Trade — Premium Light Glassmorphism Design System
   ============================================================
   브랜드 컬러: 네이비 쉴드 (#0D1B3E) + 그린 클로버 (#22A555 / #10B981)
   테마: 밝은 유리질감(Glassmorphism) 기반 프리미엄 UI
   타이포: Outfit (헤딩/숫자) + Noto Sans KR (한국어 본문)
   ============================================================ */

/* ────────────────────────────────────────────────────────────
   0. Google Fonts Import
   ──────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Noto+Sans+KR:wght@300;400;500;600;700&display=swap');

/* ────────────────────────────────────────────────────────────
   1. CSS Custom Properties (:root)
   모든 색상, 간격, 타이포그래피, 그림자, 전환 효과를 변수로 정의
   ──────────────────────────────────────────────────────────── */
:root {
  /* ── 브랜드 컬러 ── */
  --clv-navy:          hsl(220, 65%, 15%);       /* #0D1B3E */
  --clv-navy-light:    hsl(220, 50%, 25%);
  --clv-navy-dark:     hsl(220, 70%, 10%);
  --clv-green:         hsl(150, 65%, 39%);       /* #22A555 */
  --clv-green-bright:  hsl(160, 84%, 39%);       /* #10B981 */
  --clv-green-light:   hsl(152, 76%, 80%);
  --clv-green-dark:    hsl(152, 68%, 28%);

  /* ── 배경 & 서피스 ── */
  --bg-white:          hsl(0, 0%, 100%);
  --bg-slate:          hsl(210, 40%, 96%);       /* #F1F5F9 */
  --bg-gradient:       linear-gradient(180deg, var(--bg-white) 0%, var(--bg-slate) 100%);
  --surface-glass:     rgba(255, 255, 255, 0.70);
  --surface-glass-hover: rgba(255, 255, 255, 0.85);
  --surface-glass-border: hsl(214, 32%, 91%);    /* #E2E8F0 */

  /* ── 텍스트 컬러 ── */
  --text-primary:      hsl(222, 47%, 11%);       /* #0F172A */
  --text-secondary:    hsl(215, 16%, 47%);       /* #475569 */
  --text-tertiary:     hsl(215, 20%, 65%);       /* #94A3B8 */
  --text-inverse:      hsl(0, 0%, 100%);

  /* ── 알림 / 상태 컬러 ── */
  --alert-red-text:    hsl(0, 73%, 41%);         /* #B91C1C */
  --alert-red-bg:      hsl(0, 93%, 94%);         /* #FEE2E2 */
  --alert-red-border:  hsl(0, 80%, 82%);
  --alert-amber-text:  hsl(32, 95%, 26%);        /* #B45309 */
  --alert-amber-bg:    hsl(48, 96%, 89%);        /* #FEF3C7 */
  --alert-amber-border:hsl(45, 90%, 76%);
  --alert-green-text:  hsl(162, 93%, 17%);       /* #047857 */
  --alert-green-bg:    hsl(152, 81%, 90%);       /* #D1FAE5 */
  --alert-green-border:hsl(152, 70%, 78%);

  /* ── 타이포그래피 ── */
  --font-heading:      'Outfit', sans-serif;
  --font-body:         'Noto Sans KR', 'Outfit', sans-serif;
  --font-mono:         'JetBrains Mono', 'Fira Code', monospace;

  --text-base:         1rem;                      /* 16px */
  --text-scale:        1.25;
  --text-xs:           0.75rem;
  --text-sm:           0.875rem;
  --text-md:           1rem;
  --text-lg:           calc(var(--text-md) * var(--text-scale));         /* 1.25rem */
  --text-xl:           calc(var(--text-lg) * var(--text-scale));         /* 1.5625rem */
  --text-2xl:          calc(var(--text-xl) * var(--text-scale));         /* ~1.953rem */
  --text-3xl:          calc(var(--text-2xl) * var(--text-scale));        /* ~2.441rem */
  --text-4xl:          calc(var(--text-3xl) * var(--text-scale));        /* ~3.052rem */
  --text-5xl:          calc(var(--text-4xl) * var(--text-scale));        /* ~3.815rem */

  --leading-tight:     1.25;
  --leading-normal:    1.6;
  --leading-relaxed:   1.8;

  /* ── 간격 (4px 베이스 스케일) ── */
  --space-1:           0.25rem;
  --space-2:           0.5rem;
  --space-3:           0.75rem;
  --space-4:           1rem;
  --space-5:           1.25rem;
  --space-6:           1.5rem;
  --space-8:           2rem;
  --space-10:          2.5rem;
  --space-12:          3rem;
  --space-16:          4rem;
  --space-20:          5rem;
  --space-24:          6rem;

  /* ── 둥글기 ── */
  --radius-sm:         0.375rem;
  --radius-md:         0.5rem;
  --radius-lg:         0.75rem;
  --radius-xl:         1rem;
  --radius-2xl:        1.5rem;
  --radius-full:       9999px;

  /* ── 그림자 ── */
  --shadow-sm:         0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md:         0 4px 6px -1px rgba(15, 23, 42, 0.07),
                       0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg:         0 10px 15px -3px rgba(15, 23, 42, 0.08),
                       0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-xl:         0 20px 25px -5px rgba(15, 23, 42, 0.10),
                       0 8px 10px -6px rgba(15, 23, 42, 0.06);
  --shadow-glass:      0 8px 32px rgba(15, 23, 42, 0.06);
  --shadow-glow-green: 0 0 20px rgba(16, 185, 129, 0.35);
  --shadow-glow-navy:  0 0 20px rgba(13, 27, 62, 0.25);

  /* ── 전환 효과 ── */
  --transition-fast:   0.15s ease;
  --transition-base:   0.3s ease;
  --transition-slow:   0.5s ease;
  --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* ── 레이아웃 ── */
  --container-max:     1200px;
  --navbar-height:     72px;

  /* ── Z-인덱스 스케일 ── */
  --z-base:            1;
  --z-dropdown:        100;
  --z-sticky:          200;
  --z-navbar:          500;
  --z-modal:           1000;
}


/* ────────────────────────────────────────────────────────────
   2. Reset & Base Styles
   브라우저 기본 스타일 초기화 및 전역 기본값 설정
   ──────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background: var(--bg-gradient);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: var(--leading-tight);
  color: var(--text-primary);
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p {
  margin-bottom: var(--space-4);
  color: var(--text-secondary);
}

a {
  color: var(--clv-green);
  text-decoration: none;
  transition: color var(--transition-base);
}

a:hover {
  color: var(--clv-green-bright);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  list-style: none;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
  background: none;
}

button {
  cursor: pointer;
}

section {
  padding: var(--space-24) 0;
  position: relative;
}


/* ────────────────────────────────────────────────────────────
   3. Navigation Bar (.navbar)
   고정 상단 바, 유리 질감 효과, 로고 + 네비 링크
   ──────────────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-8);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--surface-glass-border);
  z-index: var(--z-navbar);
  transition: background var(--transition-base),
              box-shadow var(--transition-base);
}

/* 스크롤 시 그림자 추가 (JS로 .scrolled 클래스 토글) */
.navbar.scrolled {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-md);
}

.navbar__logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.navbar__logo img {
  height: 48px;
  width: auto;
}

.navbar__logo-text {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--clv-navy);
}

.navbar__links {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.navbar__link {
  position: relative;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--space-2) 0;
  transition: color var(--transition-base);
}

.navbar__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--clv-green);
  border-radius: var(--radius-full);
  transition: width var(--transition-base), left var(--transition-base);
}

.navbar__link:hover,
.navbar__link.active {
  color: var(--clv-navy);
}

.navbar__link:hover::after,
.navbar__link.active::after {
  width: 100%;
  left: 0;
}

/* 모바일 햄버거 (기본 숨김) */
.navbar__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-2);
}

.navbar__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--clv-navy);
  border-radius: var(--radius-full);
  transition: transform var(--transition-base), opacity var(--transition-base);
}


/* ────────────────────────────────────────────────────────────
   4. Hero Section (.hero)
   전체 뷰포트, 중앙 정렬 콘텐츠, 그라디언트 헤드라인,
   CSS 전용 배경 오브(pseudo-elements + radial-gradient)
   ──────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--navbar-height) var(--space-8) var(--space-16);
  overflow: hidden;
}

/* 배경 장식 오브 — CSS 전용 (JS 불필요) */
.hero::before,
.hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  z-index: 0;
  animation: float 8s ease-in-out infinite;
  pointer-events: none;
}

.hero::before {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, hsla(160, 84%, 39%, 0.4) 0%, transparent 70%);
  top: -10%;
  right: -8%;
  animation-delay: 0s;
}

.hero::after {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, hsla(220, 65%, 15%, 0.25) 0%, transparent 70%);
  bottom: -5%;
  left: -6%;
  animation-delay: -4s;
}

/* 추가 오브를 위한 별도 요소 (HTML에서 .hero__orb 사용) */
.hero__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.25;
  pointer-events: none;
  animation: float 10s ease-in-out infinite;
}

.hero__orb--green {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, hsla(152, 76%, 80%, 0.5) 0%, transparent 70%);
  top: 30%;
  left: 15%;
  animation-delay: -2s;
}

.hero__orb--navy {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, hsla(220, 50%, 25%, 0.2) 0%, transparent 70%);
  bottom: 20%;
  right: 10%;
  animation-delay: -6s;
}

.hero__content {
  position: relative;
  z-index: var(--z-base);
  max-width: 800px;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--clv-green);
  margin-bottom: var(--space-6);
}

.hero__title {
  font-size: var(--text-5xl);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: var(--space-6);
  background: linear-gradient(135deg, var(--clv-navy) 0%, var(--clv-green-bright) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero__subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto var(--space-10);
  line-height: var(--leading-relaxed);
}

.hero__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}


/* ────────────────────────────────────────────────────────────
   5. Problem Section (.problem)
   2컬럼 그리드: 왼쪽 타임라인 카드, 오른쪽 통계 카드
   ──────────────────────────────────────────────────────────── */
.problem {
  background: var(--bg-slate);
}

.problem__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: start;
}

/* 타임라인 카드 (좌측) */
.problem__timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.timeline-card {
  position: relative;
  padding: var(--space-6);
  padding-left: var(--space-8);
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--alert-red-border);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.timeline-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.timeline-card--amber {
  border-left-color: var(--alert-amber-border);
}

.timeline-card--red {
  border-left-color: var(--alert-red-border);
}

.timeline-card--green {
  border-left-color: var(--alert-green-border);
}

.timeline-card__step {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: var(--space-2);
}

.timeline-card__title {
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}

.timeline-card__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* 통계 카드 (우측) */
.problem__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}

.stat-card {
  padding: var(--space-6);
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.stat-card__number {
  font-family: var(--font-heading);
  font-size: var(--text-4xl);
  font-weight: 800;
  color: var(--clv-navy);
  line-height: 1;
  margin-bottom: var(--space-2);
}

.stat-card__number--green {
  color: var(--clv-green);
}

.stat-card__label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: 0;
}


/* ────────────────────────────────────────────────────────────
   6. Features Section (.features)
   탭 기반 레이아웃: Risk Scanner, Regulation Alerts, HS Code Chat
   ──────────────────────────────────────────────────────────── */
.features__tabs {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-10);
  flex-wrap: wrap;
}

.features__tab {
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-base);
}

.features__tab:hover {
  color: var(--clv-navy);
  background: var(--surface-glass-hover);
  box-shadow: var(--shadow-sm);
}

.features__tab.active {
  color: var(--text-inverse);
  background: linear-gradient(135deg, var(--clv-navy), var(--clv-green));
  border-color: transparent;
  box-shadow: var(--shadow-md);
}

/* 탭 패널 */
.features__panel {
  display: none;
  animation: fadeInUp 0.4s ease forwards;
}

.features__panel.active {
  display: block;
}

/* ── 6a. Risk Scanner ── */
.risk-scanner {
  max-width: 700px;
  margin: 0 auto;
}

.risk-scanner__form {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.risk-scanner__input {
  flex: 1;
  padding: var(--space-3) var(--space-5);
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-lg);
  font-size: var(--text-md);
  color: var(--text-primary);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.risk-scanner__input::placeholder {
  color: var(--text-tertiary);
}

.risk-scanner__input:focus {
  border-color: var(--clv-green);
  box-shadow: 0 0 0 3px hsla(160, 84%, 39%, 0.15);
}

.risk-scanner__btn {
  padding: var(--space-3) var(--space-6);
  background: linear-gradient(135deg, var(--clv-navy), var(--clv-green));
  color: var(--text-inverse);
  font-family: var(--font-heading);
  font-weight: 600;
  border-radius: var(--radius-lg);
  transition: opacity var(--transition-base), box-shadow var(--transition-base);
}

.risk-scanner__btn:hover {
  opacity: 0.9;
  box-shadow: var(--shadow-glow-green);
}

/* 결과 카드 */
.risk-scanner__result {
  padding: var(--space-8);
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-glass);
  position: relative;
  overflow: hidden;
}

/* 스캔 라인 효과 */
.risk-scanner__result::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--clv-green), transparent);
  animation: scanLine 3s ease-in-out infinite;
}

/* 점수 게이지 */
.score-gauge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}

.score-gauge__circle {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: conic-gradient(
    var(--clv-green) 0deg,
    var(--clv-green-bright) 252deg,
    hsl(214, 32%, 91%) 252deg
  );
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse 2s ease-in-out infinite;
}

.score-gauge__circle::before {
  content: '';
  position: absolute;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--bg-white);
}

.score-gauge__value {
  position: relative;
  z-index: 1;
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--clv-green);
}

.score-gauge__label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.score-gauge__details {
  text-align: left;
}

.score-gauge__detail-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* ── 6b. Regulation Alerts ── */
.regulation-alerts {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.alert-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-5);
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.alert-card:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

.alert-card__badge {
  flex-shrink: 0;
  padding: var(--space-1) var(--space-3);
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: var(--radius-full);
}

.alert-card__badge--red {
  color: var(--alert-red-text);
  background: var(--alert-red-bg);
}

.alert-card__badge--amber {
  color: var(--alert-amber-text);
  background: var(--alert-amber-bg);
}

.alert-card__badge--green {
  color: var(--alert-green-text);
  background: var(--alert-green-bg);
}

.alert-card__content {
  flex: 1;
}

.alert-card__title {
  font-size: var(--text-md);
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.alert-card__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-1);
}

.alert-card__date {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* ── 6c. HS Code Chat ── */
.hs-chat {
  max-width: 600px;
  margin: 0 auto;
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-glass);
  overflow: hidden;
}

.hs-chat__header {
  padding: var(--space-4) var(--space-6);
  background: linear-gradient(135deg, var(--clv-navy), hsl(220, 50%, 25%));
  color: var(--text-inverse);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--text-md);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.hs-chat__status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--clv-green-bright);
  animation: pulse 1.5s ease-in-out infinite;
}

.hs-chat__messages {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-height: 300px;
}

.chat-bubble {
  max-width: 80%;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-xl);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  position: relative;
}

/* 사용자 말풍선 (우측 파란색) */
.chat-bubble--user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--clv-navy), hsl(220, 50%, 30%));
  color: var(--text-inverse);
  border-bottom-right-radius: var(--radius-sm);
}

/* AI 말풍선 (좌측 흰색) */
.chat-bubble--ai {
  align-self: flex-start;
  background: var(--bg-white);
  color: var(--text-primary);
  border: 1px solid var(--surface-glass-border);
  border-bottom-left-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

/* 타이핑 표시기 */
.chat-bubble--typing::after {
  content: '|';
  animation: typing 1s step-end infinite;
  color: var(--text-tertiary);
  margin-left: 2px;
}

.hs-chat__input-area {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--surface-glass-border);
  background: rgba(241, 245, 249, 0.5);
}

.hs-chat__input {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-white);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  color: var(--text-primary);
  transition: border-color var(--transition-base);
}

.hs-chat__input:focus {
  border-color: var(--clv-green);
}

.hs-chat__send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--clv-green);
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
  transition: background var(--transition-base), transform var(--transition-fast);
}

.hs-chat__send:hover {
  background: var(--clv-green-bright);
  transform: scale(1.05);
}


/* ────────────────────────────────────────────────────────────
   7. Data Sources Section (.data-sources)
   소스 카드 그리드, 유리 질감 + 호버 리프트, 장식 연결선
   ──────────────────────────────────────────────────────────── */
.data-sources {
  background: var(--bg-slate);
}

.data-sources__grid {
  display: grid;
  grid-template-columns: 1fr 1fr; /* 가로세로 2x2 격자 구조 고정 */
  gap: var(--space-8);
  position: relative;
  max-width: 960px; /* 대화면에서 가로로 너무 벌어지는 현상 차단 */
  margin: 0 auto;
}

/* 카드 사이 장식 연결선 - 2x2 격자 정렬에는 미적으로 맞지 않으므로 비활성화 */
.data-sources__grid::before {
  display: none;
}

.source-card {
  position: relative;
  z-index: var(--z-base);
  padding: var(--space-8);
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: transform var(--transition-base),
              box-shadow var(--transition-base),
              border-color var(--transition-base);
}

.source-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: var(--clv-green-light);
}

.source-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, hsla(160, 84%, 39%, 0.1), hsla(220, 65%, 15%, 0.08));
  margin-bottom: var(--space-5);
  font-size: var(--text-2xl);
}

.source-card__title {
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}

.source-card__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: 0;
}


/* ────────────────────────────────────────────────────────────
   8. Before/After Comparison (.comparison)
   2컬럼: Before (회색), After (그린 글로우)
   ──────────────────────────────────────────────────────────── */
.comparison__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
}

.comparison__column {
  padding: var(--space-8);
  border-radius: var(--radius-xl);
  border: 1px solid var(--surface-glass-border);
  transition: box-shadow var(--transition-base);
}

/* Before — 무채색 톤 */
.comparison__column--before {
  background: hsl(210, 20%, 96%);
  border-color: hsl(214, 20%, 85%);
}

.comparison__column--before .comparison__label {
  color: var(--text-tertiary);
  background: hsl(210, 20%, 90%);
}

.comparison__column--before .comparison__item {
  color: var(--text-tertiary);
}

.comparison__column--before .comparison__item::before {
  content: '✕';
  color: var(--alert-red-text);
  margin-right: var(--space-3);
  font-weight: 700;
}

/* After — 그린 글로우 */
.comparison__column--after {
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-color: var(--clv-green-light);
  box-shadow: var(--shadow-glow-green);
}

.comparison__column--after .comparison__label {
  color: var(--clv-green);
  background: var(--alert-green-bg);
}

.comparison__column--after .comparison__item {
  color: var(--text-primary);
}

.comparison__column--after .comparison__item::before {
  content: '✓';
  color: var(--clv-green);
  margin-right: var(--space-3);
  font-weight: 700;
}

.comparison__label {
  display: inline-block;
  padding: var(--space-1) var(--space-4);
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-6);
}

.comparison__title {
  font-size: var(--text-xl);
  margin-bottom: var(--space-6);
}

.comparison__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.comparison__item {
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  display: flex;
  align-items: flex-start;
}


/* ────────────────────────────────────────────────────────────
   9. CTA Section (.cta)
   전체 너비 그라디언트 배경, 큰 흰색 텍스트, 글로우 버튼
   ──────────────────────────────────────────────────────────── */
.cta {
  background: linear-gradient(135deg, var(--clv-navy) 0%, hsl(220, 50%, 20%) 40%, var(--clv-green) 100%);
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* 배경 장식 */
.cta::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, hsla(160, 84%, 39%, 0.2) 0%, transparent 70%);
  top: -200px;
  right: -100px;
  pointer-events: none;
}

.cta__content {
  position: relative;
  z-index: var(--z-base);
}

.cta__title {
  font-size: var(--text-4xl);
  color: var(--text-inverse);
  margin-bottom: var(--space-4);
}

.cta__subtitle {
  font-size: var(--text-lg);
  color: hsla(0, 0%, 100%, 0.8);
  max-width: 600px;
  margin: 0 auto var(--space-10);
}

.cta__actions {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}


/* ────────────────────────────────────────────────────────────
   10. Footer (.footer)
   짙은 네이비 배경, 흰색 텍스트, 링크
   ──────────────────────────────────────────────────────────── */
.footer {
  background: var(--clv-navy-dark);
  padding: var(--space-16) 0 var(--space-8);
  color: hsla(0, 0%, 100%, 0.7);
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-10);
  margin-bottom: var(--space-12);
}

.footer__brand-desc {
  font-size: var(--text-sm);
  color: hsla(0, 0%, 100%, 0.5);
  margin-top: var(--space-4);
  line-height: var(--leading-relaxed);
}

.footer__heading {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-inverse);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-4);
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer__link {
  font-size: var(--text-sm);
  color: hsla(0, 0%, 100%, 0.5);
  transition: color var(--transition-base);
}

.footer__link:hover {
  color: var(--clv-green-bright);
}

.footer__bottom {
  padding-top: var(--space-8);
  border-top: 1px solid hsla(0, 0%, 100%, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer__copyright {
  font-size: var(--text-xs);
  color: hsla(0, 0%, 100%, 0.4);
}

.footer__bottom-links {
  display: flex;
  gap: var(--space-6);
}


/* ────────────────────────────────────────────────────────────
   11. Animations & Keyframes
   ──────────────────────────────────────────────────────────── */

/* 스크롤 시 아래→위 등장 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 히어로 배경 오브 부유 효과 */
@keyframes float {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-30px) scale(1.05);
  }
}

/* 리스크 스캐너 수평 스캔 라인 */
@keyframes scanLine {
  0% {
    left: -100%;
  }
  50% {
    left: 100%;
  }
  100% {
    left: 100%;
  }
}

/* 채팅 타이핑 커서 깜빡임 */
@keyframes typing {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

/* 점수 게이지 맥박 효과 */
@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 hsla(160, 84%, 39%, 0.25);
  }
  50% {
    box-shadow: 0 0 0 12px hsla(160, 84%, 39%, 0);
  }
}

/* JS 카운트업용 예약 (JS에서 제어) */
@keyframes countUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 스크롤 기반 등장 애니메이션 클래스 */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* 딜레이 유틸리티 */
.animate-on-scroll.delay-1 { transition-delay: 0.1s; }
.animate-on-scroll.delay-2 { transition-delay: 0.2s; }
.animate-on-scroll.delay-3 { transition-delay: 0.3s; }
.animate-on-scroll.delay-4 { transition-delay: 0.4s; }


/* ────────────────────────────────────────────────────────────
   12. Responsive Media Queries
   모바일, 태블릿, 데스크톱 적응형 레이아웃
   ──────────────────────────────────────────────────────────── */

/* ── 태블릿 (1024px 이하) ── */
@media (max-width: 1024px) {
  :root {
    --text-5xl: 2.8rem;
    --text-4xl: 2.2rem;
  }

  .problem__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }

  .data-sources__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
  }

  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }
}

/* ── 모바일 (768px 이하) ── */
@media (max-width: 768px) {
  :root {
    --text-5xl: 2rem;
    --text-4xl: 1.75rem;
    --text-3xl: 1.5rem;
    --text-2xl: 1.25rem;
  }

  section {
    padding: var(--space-16) 0;
  }

  /* 네비게이션 모바일 처리 */
  .navbar {
    padding: 0 var(--space-4);
  }

  .navbar__links {
    display: none;
    position: absolute;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    flex-direction: column;
    padding: var(--space-6);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--surface-glass-border);
    box-shadow: var(--shadow-lg);
    gap: var(--space-4);
  }

  .navbar__links.open {
    display: flex;
  }

  .navbar__toggle {
    display: flex;
  }

  /* 히어로 */
  .hero {
    min-height: 90vh;
    padding-top: calc(var(--navbar-height) + var(--space-8));
  }

  .hero__title {
    font-size: var(--text-4xl);
  }

  .hero__actions {
    flex-direction: column;
    align-items: stretch;
  }

  /* 문제 섹션 → 단일 컬럼 */
  .problem__grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .problem__stats {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
  }

  .stat-card {
    padding: var(--space-4) !important;
  }

  .stat-card__number {
    font-size: var(--text-3xl) !important;
  }

  .stat-card__label {
    font-size: var(--text-xs) !important;
  }

  /* 기능 탭 */
  .features__tabs {
    gap: var(--space-2);
  }

  .features__tab {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-xs);
  }

  /* 리스크 스캐너 폼 */
  .risk-scanner__form {
    flex-direction: column;
  }

  /* 점수 게이지 */
  .score-gauge {
    flex-direction: column;
    text-align: center;
  }

  /* 채팅 버블 */
  .chat-bubble {
    max-width: 90%;
  }

  /* 데이터 소스 → 단일 컬럼 */
  .data-sources__grid {
    grid-template-columns: 1fr;
  }

  .data-sources__grid::before {
    display: none;
  }

  /* 비교 섹션 → 스택 */
  .comparison__grid {
    grid-template-columns: 1fr;
  }

  /* CTA */
  .cta__title {
    font-size: var(--text-3xl);
  }

  .cta__actions {
    flex-direction: column;
    align-items: stretch;
    max-width: 320px;
    margin: 0 auto;
  }

  /* 푸터 → 단일 컬럼 */
  .footer__grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .footer__bottom {
    flex-direction: column;
    text-align: center;
  }
}


/* ────────────────────────────────────────────────────────────
   13. Utility Classes
   범용 재사용 가능 클래스
   ──────────────────────────────────────────────────────────── */

/* 컨테이너 */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* 섹션 제목 */
.section-title {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-4);
  color: var(--text-primary);
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  text-align: center;
  max-width: 600px;
  margin: 0 auto var(--space-12);
  line-height: var(--leading-relaxed);
}

/* 유리 질감 카드 */
.glass-card {
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-glass);
  padding: var(--space-6);
  transition: transform var(--transition-base),
              box-shadow var(--transition-base),
              border-color var(--transition-base);
}

.glass-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

/* 상태 뱃지 */
.badge-red {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--alert-red-text);
  background: var(--alert-red-bg);
  border-radius: var(--radius-full);
}

.badge-amber {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--alert-amber-text);
  background: var(--alert-amber-bg);
  border-radius: var(--radius-full);
}

.badge-green {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--alert-green-text);
  background: var(--alert-green-bg);
  border-radius: var(--radius-full);
}

/* 기본 버튼 */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-8);
  font-family: var(--font-heading);
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text-inverse);
  background: linear-gradient(135deg, var(--clv-navy), var(--clv-green));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-fast),
              box-shadow var(--transition-base),
              opacity var(--transition-base);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-green), var(--shadow-lg);
  opacity: 0.95;
  color: var(--text-inverse);
}

.btn-primary:active {
  transform: translateY(0);
}

/* 보조 버튼 */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-8);
  font-family: var(--font-heading);
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--clv-navy);
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-lg);
  transition: transform var(--transition-fast),
              box-shadow var(--transition-base),
              background var(--transition-base),
              color var(--transition-base);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  background: var(--surface-glass-hover);
  box-shadow: var(--shadow-md);
  color: var(--clv-green);
}

.btn-secondary:active {
  transform: translateY(0);
}

/* CTA 전용 흰색 버튼 (어두운 배경 위) */
.btn-primary--white {
  background: var(--text-inverse);
  color: var(--clv-navy);
}

.btn-primary--white:hover {
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.3), var(--shadow-lg);
  color: var(--clv-green);
}

.btn-secondary--white {
  color: var(--text-inverse);
  background: transparent;
  border-color: hsla(0, 0%, 100%, 0.3);
}

.btn-secondary--white:hover {
  background: hsla(0, 0%, 100%, 0.1);
  border-color: hsla(0, 0%, 100%, 0.5);
  color: var(--text-inverse);
}

/* 텍스트 정렬 유틸리티 */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

/* 플렉스 유틸리티 */
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col     { flex-direction: column; }
.gap-4        { gap: var(--space-4); }
.gap-8        { gap: var(--space-8); }

/* 여백 유틸리티 */
.mt-4  { margin-top: var(--space-4); }
.mt-8  { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-8  { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }


/* ────────────────────────────────────────────────────────────
   14. Special Effects
   폴백, 접근성, 호버 전환 처리
   ──────────────────────────────────────────────────────────── */

/* backdrop-filter 미지원 브라우저 폴백 */
@supports not (backdrop-filter: blur(1px)) {
  .navbar {
    background: rgba(255, 255, 255, 0.95);
  }

  .glass-card,
  .source-card,
  .risk-scanner__result,
  .hs-chat,
  .alert-card,
  .timeline-card,
  .stat-card,
  .comparison__column--after,
  .hero__eyebrow,
  .btn-secondary {
    background: rgba(255, 255, 255, 0.92);
  }

  .risk-scanner__input {
    background: rgba(255, 255, 255, 0.95);
  }
}

/* 모션 감소 선호 사용자를 위한 접근성 처리 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .animate-on-scroll {
    opacity: 1;
    transform: none;
  }

  .hero::before,
  .hero::after,
  .hero__orb {
    animation: none;
  }
}

/* 전역 호버 전환: 모든 인터랙티브 요소 */
a,
button,
input,
textarea,
select,
.glass-card,
.source-card,
.timeline-card,
.stat-card,
.alert-card {
  transition-duration: var(--transition-base);
  transition-timing-function: ease;
}

/* 포커스 링 (접근성) */
:focus-visible {
  outline: 2px solid var(--clv-green);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* 선택 영역 스타일링 */
::selection {
  background: hsla(160, 84%, 39%, 0.2);
  color: var(--text-primary);
}

/* 스크롤바 스타일링 (WebKit) */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-slate);
}

::-webkit-scrollbar-thumb {
  background: hsl(214, 32%, 80%);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* ────────────────────────────────────────────────────────────
   10. Research Brief Card Wide-Symmetry Custom Responsive
   ──────────────────────────────────────────────────────────── */
.research-brief-card {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.research-brief-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md) !important;
}

@media (max-width: 768px) {
  .research-brief-card {
    padding: var(--space-5) !important;
  }
  
  /* 모바일 1열 전환 시 보더 및 패딩 정렬 */
  .research-brief-card div[style*="display: grid"] {
    grid-template-columns: 1fr !important;
    gap: var(--space-3) !important;
  }
  
  .research-brief-card div[style*="border-left"] {
    border-left: none !important;
    border-top: 1px solid rgba(226, 232, 240, 0.5) !important;
    padding-left: 0 !important;
    padding-top: var(--space-3) !important;
  }
}
