/* ===== CSS VARIABLES ===== */
:root {
  --bg: #fdf7f4;
  --bg-alt: #f8f1ed;
  --surface: #ffffff;
  --surface-alt: #fff7f0;
  --text: #2f261f;
  --text-muted: #7a6f66;
  --accent: #e8a08b;
  --accent-strong: #d47b63;
  --accent-soft: rgba(232,160,139,0.18);
  --mint: #b8dccb;
  --mint-soft: rgba(184,220,203,0.25);
  --border: rgba(47,38,31,0.1);
  --shadow-sm: 0 2px 8px rgba(33,26,22,0.06);
  --shadow-md: 0 8px 24px rgba(33,26,22,0.10);
  --shadow-lg: 0 20px 50px rgba(33,26,22,0.13);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --header-h: 72px;
  --bnav-h: 70px;
  --font-body: 'Gowun Dodum', sans-serif;
  --font-display: 'Jua', sans-serif;
}

body.dark {
  --bg: #171313; --bg-alt: #1e1919; --surface: #1f1b1b; --surface-alt: #262121;
  --text: #f5efe9; --text-muted: #c1b5aa; --accent: #f0b39d; --accent-strong: #e28f75;
  --accent-soft: rgba(240,179,157,0.14); --mint: #95c4b2; --mint-soft: rgba(149,196,178,0.15);
  --border: rgba(245,239,233,0.1);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.2); --shadow-md: 0 8px 24px rgba(0,0,0,0.3); --shadow-lg: 0 20px 50px rgba(0,0,0,0.4);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-body); color: var(--text); background: var(--bg); min-height: 100vh; overflow-x: hidden; transition: background 0.3s, color 0.3s; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.25; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

.background-texture {
  position: fixed; inset: -10%;
  background: radial-gradient(circle at 20% 25%, rgba(232,160,139,0.3) 0%, transparent 50%), radial-gradient(circle at 75% 70%, rgba(184,220,203,0.28) 0%, transparent 50%);
  pointer-events: none; z-index: 0; filter: blur(1px);
}

/* ===== 헤더 (더 크게) ===== */
.site-header {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-h);
  display: flex; align-items: center; padding: 0 20px; gap: 12px;
  background: rgba(253,247,244,0.92); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border); z-index: 100; transition: background 0.3s;
}
body.dark .site-header { background: rgba(23,19,19,0.92); }

.header-back {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%; color: var(--text);
  transition: background 0.2s; flex-shrink: 0;
}
.header-back:hover { background: var(--accent-soft); }
.header-back.hidden { display: none !important; }

.brand {
  font-family: var(--font-display);
  font-size: 1.65rem;       /* 로고 크게 */
  color: var(--accent-strong);
  flex: 1; text-align: center;
}

.header-actions { display: flex; gap: 8px; align-items: center; }

.icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;   /* 버튼 크게 */
  border-radius: 50%; color: var(--text);
  font-size: 15px; font-weight: 700;
  transition: background 0.2s;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:hover { background: var(--accent-soft); }

/* ===== 검색 오버레이 ===== */
.search-overlay {
  position: fixed; inset: 0;
  background: rgba(253,247,244,0.97); z-index: 200;
  display: none; flex-direction: column; padding-top: 20px;
}
body.dark .search-overlay { background: rgba(23,19,19,0.97); }
.search-overlay.open { display: flex; }

.search-container {
  width: 100%; max-width: 720px; margin: 0 auto;
  padding: 16px; display: flex; flex-direction: column; gap: 14px;
  height: 100%;
}
.search-input-wrap {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 2px solid var(--accent);
  border-radius: 999px; padding: 12px 20px; box-shadow: var(--shadow-md);
  flex-shrink: 0;
}
.search-input-wrap svg { color: var(--text-muted); flex-shrink: 0; width: 20px; height: 20px; }
#search-input {
  flex: 1; border: none; background: none;
  font-family: var(--font-body); font-size: 16px; color: var(--text); outline: none;
}
#search-input::placeholder { color: var(--text-muted); }
.search-close-btn { font-size: 14px; font-weight: 700; color: var(--text-muted); padding: 4px 10px; border-radius: 6px; transition: color 0.2s; flex-shrink: 0; }
.search-close-btn:hover { color: var(--accent-strong); }

/* 검색 결과 - 카드 고정 높이 */
.search-results {
  overflow-y: auto; flex: 1;
  display: flex; flex-direction: column; gap: 8px;
  padding-bottom: 80px;
  /* 검색결과 없어도 영역 유지 */
  min-height: 0;
}
.search-result-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px 18px;
  cursor: pointer; transition: all 0.2s;
  /* 카드 높이 고정 */
  min-height: 90px; max-height: 90px;
  overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
  flex-shrink: 0;
}
.search-result-item:hover { border-color: var(--accent); transform: translateX(3px); box-shadow: var(--shadow-sm); }
.search-result-tag { font-size: 12px; color: var(--accent-strong); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.search-result-title { font-family: var(--font-display); font-size: 16px; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-summary { font-size: 13px; color: var(--text-muted); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-empty { text-align: center; padding: 48px 16px; color: var(--text-muted); font-size: 16px; }

/* ===== 메인 ===== */
.app-main { position: relative; z-index: 1; padding-top: var(--header-h); padding-bottom: calc(var(--bnav-h) + 16px); min-height: 100vh; }

/* ===== 홈 ===== */
.hero-section { padding: 30px 20px 26px; max-width: 900px; margin: 0 auto; }
.hero-eyebrow { font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-strong); font-weight: 700; margin-bottom: 12px; }
.hero-title { font-size: clamp(1.8rem, 5vw, 2.5rem); line-height: 1.2; margin-bottom: 14px; }
.hero-title span { color: var(--accent-strong); }
.hero-subtitle { font-size: 16px; color: var(--text-muted); line-height: 1.65; margin-bottom: 22px; }
.hero-cta-row { display: flex; gap: 12px; flex-wrap: wrap; }

.btn-primary {
  background: var(--accent-strong); color: white; border-radius: 999px;
  padding: 13px 26px; font-size: 15px; font-weight: 700; font-family: var(--font-body);
  transition: all 0.2s; box-shadow: 0 4px 14px rgba(212,123,99,0.35);
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(212,123,99,0.45); }
.btn-secondary {
  background: var(--surface); color: var(--text); border: 1.5px solid var(--border);
  border-radius: 999px; padding: 13px 26px; font-size: 15px; font-weight: 700;
  font-family: var(--font-body); transition: all 0.2s;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-secondary:hover { border-color: var(--accent); }

.home-sections { padding: 0 16px 16px; max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 32px; }
.home-section-title { font-family: var(--font-display); font-size: 1.25rem; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.home-section-title::after { content: ''; flex: 1; height: 1.5px; background: var(--border); }

/* 그룹 칩 */
.group-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin-bottom: 4px; }
.group-chips::-webkit-scrollbar { display: none; }
.group-chip { flex-shrink: 0; padding: 9px 18px; border-radius: 999px; font-size: 14px; font-weight: 700; border: 1.5px solid var(--border); background: var(--surface); color: var(--text-muted); transition: all 0.2s; font-family: var(--font-body); }
.group-chip:hover { border-color: var(--accent); color: var(--text); }
.group-chip.active { background: var(--accent-strong); border-color: var(--accent-strong); color: white; box-shadow: 0 3px 10px rgba(212,123,99,0.3); }

.sub-chips-hint { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 5px; margin-bottom: 6px; }
.sub-chips-hint svg { color: var(--accent-strong); flex-shrink: 0; }

.sub-chips-wrap { position: relative; }
.stage-sub-chips { margin-top: 0; }
.sub-chips-fade { position: absolute; right: 0; top: 0; bottom: 4px; width: 40px; background: linear-gradient(to right, transparent, var(--bg)); pointer-events: none; }

.stage-sub-chip { flex-shrink: 0; padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; border: 1.5px solid var(--mint); background: var(--surface); color: var(--text-muted); transition: all 0.2s; font-family: var(--font-body); cursor: pointer; }
.stage-sub-chip:hover { background: var(--mint-soft); border-color: var(--mint); color: var(--text); }

/* 스테이지 카드 */
.stage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; }
.stage-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-md); padding: 18px; cursor: pointer; transition: all 0.22s; animation: fadeSlideIn 0.25s ease forwards; scroll-margin-top: calc(var(--header-h) + 16px); }
.stage-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stage-card-group { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-strong); font-weight: 700; margin-bottom: 6px; }
.stage-card-label { font-family: var(--font-display); font-size: 1.1rem; margin-bottom: 5px; }
.stage-card-range { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }
.stage-card-top5 { display: flex; flex-direction: column; gap: 5px; }
.stage-card-top5-item { font-size: 13px; color: var(--text-muted); display: flex; align-items: flex-start; gap: 5px; line-height: 1.4; }
.stage-card-top5-item::before { content: '·'; color: var(--accent-strong); font-weight: 700; flex-shrink: 0; }
.stage-card-cta { margin-top: 14px; font-size: 13px; color: var(--accent-strong); font-weight: 700; }

/* 테마 카드 */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 12px; }
.theme-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-md); padding: 18px; cursor: pointer; transition: all 0.22s; animation: fadeSlideIn 0.25s ease forwards; }
.theme-card:hover { border-color: var(--mint); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.theme-card-title { font-family: var(--font-display); font-size: 1.05rem; margin-bottom: 7px; }
.theme-card-subtitle { font-size: 13px; color: var(--text-muted); line-height: 1.45; margin-bottom: 10px; }
.theme-card-keywords { display: flex; flex-wrap: wrap; gap: 5px; }
.keyword-pill { font-size: 12px; padding: 4px 9px; background: var(--mint-soft); color: var(--text-muted); border-radius: 999px; }

/* ===== 상세 뷰 ===== */
.detail-view { max-width: 800px; margin: 0 auto; padding: 26px 16px; animation: fadeSlideIn 0.3s ease; }
.detail-header { margin-bottom: 24px; }
.detail-eyebrow { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-strong); font-weight: 700; margin-bottom: 7px; }
.detail-title { font-size: clamp(1.5rem, 4vw, 2rem); margin-bottom: 7px; }
.detail-range { font-size: 15px; color: var(--text-muted); }

.top5-box { background: var(--surface-alt); border: 1.5px solid var(--border); border-radius: var(--radius-md); padding: 20px; margin-bottom: 22px; }
.top5-box-title { font-family: var(--font-display); font-size: 1rem; color: var(--accent-strong); margin-bottom: 14px; }
.top5-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.top5-list li { display: flex; align-items: flex-start; gap: 12px; font-size: 15px; line-height: 1.5; }
.top5-num { width: 26px; height: 26px; background: var(--accent-soft); color: var(--accent-strong); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }

.section-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 18px; scrollbar-width: none; }
.section-tabs::-webkit-scrollbar { display: none; }
.section-tab { flex-shrink: 0; padding: 9px 16px; border-radius: 999px; font-size: 14px; font-weight: 700; border: 1.5px solid var(--border); background: var(--surface); color: var(--text-muted); transition: all 0.2s; font-family: var(--font-body); }
.section-tab.active { background: var(--accent-soft); border-color: var(--accent-strong); color: var(--text); }

/* 정보 카드 */
.info-cards { display: flex; flex-direction: column; gap: 10px; }
.info-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-md); overflow: hidden; transition: box-shadow 0.2s; animation: fadeSlideIn 0.25s ease forwards; }
.info-card:hover { box-shadow: var(--shadow-sm); }
.info-card-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; cursor: pointer; gap: 12px; }
.info-card-left { flex: 1; min-width: 0; }
.info-card-cat { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-strong); font-weight: 700; margin-bottom: 4px; }
.info-card-title { font-family: var(--font-display); font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info-card-summary { font-size: 14px; color: var(--text-muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info-card-chevron { color: var(--text-muted); transition: transform 0.25s; flex-shrink: 0; }
.info-card.open .info-card-chevron { transform: rotate(180deg); }
.info-card-body { display: none; padding: 0 18px 18px; border-top: 1px solid var(--border); }
.info-card.open .info-card-body { display: block; }
.info-card-detail { display: grid; gap: 14px; padding-top: 16px; }
.detail-row-label { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-strong); font-weight: 700; margin-bottom: 7px; }
.detail-row-items { display: flex; flex-direction: column; gap: 6px; }
.detail-row-item { font-size: 14px; color: var(--text); display: flex; align-items: flex-start; gap: 7px; line-height: 1.5; }
.detail-row-item::before { content: '•'; color: var(--accent); flex-shrink: 0; margin-top: 1px; }
.checklist-row { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 4px; }
.checklist-chip { font-size: 13px; padding: 5px 12px; background: var(--accent-soft); color: var(--text); border-radius: 999px; }
.friendly-note { background: var(--surface-alt); border: 1px solid var(--border); border-radius: 12px; padding: 12px 13px; }
.friendly-note p { font-size: 14px; line-height: 1.65; color: var(--text); }

.info-card.product-card { border-color: var(--mint); background: linear-gradient(135deg, var(--surface), var(--mint-soft)); }
.info-card.product-card .info-card-cat { color: #3a8c6e; }
.product-focus-list { display: flex; flex-direction: column; gap: 6px; }
.product-focus-item { font-size: 14px; color: var(--text); display: flex; align-items: flex-start; gap: 7px; line-height: 1.5; }
.product-focus-item::before { content: '✓'; color: #3a8c6e; flex-shrink: 0; font-weight: 700; }

/* ===== About / 정책 페이지 ===== */
.about-view { max-width: 720px; margin: 0 auto; padding: 26px 16px; animation: fadeSlideIn 0.3s ease; }
.about-grid { display: grid; gap: 12px; margin-bottom: 4px; }
.about-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-md); padding: 20px; }
.about-card h3 { font-size: 1.05rem; margin-bottom: 10px; color: var(--accent-strong); }
.about-card p { font-size: 15px; line-height: 1.7; color: var(--text-muted); }
.about-section { margin-bottom: 28px; }
.about-section h2 { font-size: 1.2rem; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid var(--accent-soft); }

/* 정책 카드 */
.policy-card { padding: 22px; }
.policy-card h3 { font-size: 1.05rem; color: var(--accent-strong); margin-bottom: 12px; }
.policy-card p { font-size: 15px; color: var(--text-muted); line-height: 1.7; margin-bottom: 10px; }
.policy-card ul { list-style: none; display: flex; flex-direction: column; gap: 8px; padding-left: 4px; }
.policy-card ul li { font-size: 15px; color: var(--text-muted); line-height: 1.6; padding-left: 16px; position: relative; }
.policy-card ul li::before { content: '·'; position: absolute; left: 0; color: var(--accent-strong); font-weight: 700; }
.policy-card a { color: var(--accent-strong); text-decoration: underline; }

.about-page-links { display: flex; flex-direction: column; gap: 10px; }
.about-page-link { display: flex; align-items: center; padding: 14px 18px; background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-md); font-size: 15px; font-weight: 700; transition: all 0.2s; }
.about-page-link:hover { border-color: var(--accent); transform: translateX(4px); }

.sources-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.sources-list a { font-size: 15px; color: var(--accent-strong); display: flex; align-items: center; gap: 6px; transition: opacity 0.2s; }
.sources-list a:hover { opacity: 0.75; }
.sources-list a::before { content: '→'; font-weight: 700; }

.contact-card { background: var(--surface-alt); border: 1.5px solid var(--border); border-radius: var(--radius-md); padding: 20px; font-size: 15px; line-height: 1.8; color: var(--text-muted); }

/* 제휴 폼 */
.partnership-form { display: grid; gap: 16px; }
.form-field { display: flex; flex-direction: column; gap: 7px; }
.form-field span { font-size: 14px; font-weight: 700; color: var(--text-muted); }
.form-field input, .form-field textarea, .form-field select {
  padding: 12px 16px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-family: var(--font-body);
  font-size: 15px; outline: none; transition: border-color 0.2s;
}
.form-field input:focus, .form-field textarea:focus, .form-field select:focus { border-color: var(--accent); }
.form-submit { background: var(--accent-strong); color: white; border-radius: 999px; padding: 14px 28px; font-size: 16px; font-weight: 700; font-family: var(--font-body); transition: all 0.2s; }
.form-submit:hover { opacity: 0.9; transform: translateY(-1px); }

/* ===== 광고 슬롯 ===== */
.ad-slot { background: var(--surface); border: 1.5px dashed var(--border); border-radius: var(--radius-md); padding: 22px; text-align: center; font-size: 13px; color: var(--text-muted); margin: 16px; }

/* ===== 푸터 ===== */
.site-footer { padding: 28px 20px; border-top: 1px solid var(--border); text-align: center; }
.footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 14px; }
.footer-links a { font-size: 14px; color: var(--text-muted); transition: color 0.2s; }
.footer-links a:hover { color: var(--accent-strong); }
.footer-copy { font-size: 13px; color: var(--text-muted); line-height: 1.6; }

/* ===== 하단 탭 ===== */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; height: var(--bnav-h); display: flex; background: rgba(253,247,244,0.95); backdrop-filter: blur(14px); border-top: 1px solid var(--border); z-index: 100; transition: background 0.3s; }
body.dark .bottom-nav { background: rgba(23,19,19,0.95); }
.bnav-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--text-muted); font-size: 11px; font-weight: 700; transition: color 0.2s; padding: 6px 0; }
.bnav-item svg { width: 24px; height: 24px; }
.bnav-item:hover, .bnav-item.active { color: var(--accent-strong); }
.bnav-item.active svg { filter: drop-shadow(0 0 6px rgba(212,123,99,0.5)); }

/* ===== 애니메이션 ===== */
@keyframes fadeSlideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ===== 반응형 ===== */
@media (min-width: 640px) {
  .stage-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
  .theme-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .about-grid { grid-template-columns: repeat(2, 1fr); }
  .about-page-links { flex-direction: row; }
}
@media (min-width: 900px) {
  .brand { text-align: left; }
  .bottom-nav { display: none; }
  .app-main { padding-bottom: 24px; }
  .site-header { padding: 0 36px; }
  .header-actions { margin-left: auto; }
}
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }


/* ===== Bilingual (KO + EN) ===== */
.bi { display: flex; flex-direction: column; gap: 2px; }
.bi-ko { font-weight: 700; }
.bi-en { font-size: 0.88em; color: var(--text-muted); }
.top5-text { flex: 1; }
.top5-text .bi-ko { font-weight: 700; }
.top5-text .bi-en { font-size: 0.88em; }
.stage-card-top5-item .bi-ko { font-weight: 700; }
.stage-card-top5-item .bi-en { font-weight: 600; font-size: 0.85em; color: var(--text-muted); }
