/* HanGiL(한길) 화면 디자인. 규칙은 DESIGN.md에 있다.
   방향: 검색 중심 유학 서비스. 흰 바탕 + 파랑 하나, 얇은 선으로 나누고 정보는 표·목록으로.
   홈 구성: 머리 → 첫 화면(전공 검색 + 서비스 바로가기) → 추천 대학 표 → 이용 방법 → 후기 → 행동 유도 띠 → 하단. */
:root {
  /* 색 */
  --primary: #1847c2;
  --primary-hover: #12369a;
  --primary-tint: #edf2fd;
  --focus-ring: rgb(24 71 194 / 0.35);
  --ink: #131a2a;
  --ink-soft: #4a5468;
  --muted: #626b7f;
  --line: #e0e4eb;
  --line-strong: #c3c9d4;
  --surface: #f5f7fa;
  --footer: #101828;
  --sun: #f2b632;
  --success: #17784a;
  --error: #c42b2b;
  --sample-bg: #fff3cf;
  --sample-line: #9a6b00;
  /* 모양 */
  --r-sm: 6px;
  --r-md: 10px;
  --shadow-sm: 0 1px 2px rgb(16 24 40 / 0.06);
  --shadow-pop: 0 10px 28px rgb(16 24 40 / 0.14);
}

html { scroll-padding-top: 76px; } /* 위에 붙은 머리 줄에 가려지지 않게 */
body { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

.container {
  max-width: 1160px; margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.section { padding-top: clamp(48px, 7vw, 80px); padding-bottom: clamp(48px, 7vw, 80px); }
.section-head { margin-bottom: clamp(20px, 3vw, 32px); }
.section-head-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; }
.section-title { margin: 0; font-size: clamp(22px, 3.4vw, 28px); line-height: 1.3; letter-spacing: -0.02em; color: var(--ink); text-wrap: balance; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.text-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; color: var(--primary); text-decoration: none; }
.text-link::after { content: "→"; margin-left: 6px; }
.text-link:hover { text-decoration: underline; }

/* ---- 위쪽 줄: 로고, 메뉴, 언어 ---- */
.site-header { position: sticky; top: 0; z-index: 30; background: #fff; border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; margin: 0; color: var(--ink); text-decoration: none; }
.brand-mark { flex: none; width: 32px; height: 32px; --mark-bg: var(--primary); --mark-fg: #fff; }
.brand-name { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.brand-sub { padding-left: 10px; font-size: 15px; font-weight: 600; color: var(--muted); white-space: nowrap; border-left: 1px solid var(--line); }
.site-nav { display: none; gap: 2px; margin-left: 28px; min-width: 0; }
.site-nav a { padding: 8px 12px; font-size: 15px; font-weight: 600; color: var(--ink-soft); text-decoration: none; white-space: nowrap; border-radius: var(--r-sm); }
.site-nav a:hover { color: var(--primary); background: var(--surface); }
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.header-actions .header-cta { display: none; }
.langs { flex: none; margin-left: 0; }
#lang-button { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: var(--r-sm); }
#lang-button:hover, .menu-button:hover { background: var(--surface); }
.lang-short { display: none; }
.menu-button {
  display: grid; place-items: center; width: 42px; height: 42px; margin: 0; padding: 0;
  color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
}
.menu-button .icon { width: 22px; height: 22px; }
.mobile-menu { padding: 8px max(12px, env(safe-area-inset-left, 0px)) 14px; background: #fff; border-top: 1px solid var(--line); box-shadow: var(--shadow-pop); }
.mobile-menu a { display: block; padding: 14px 10px; font-weight: 600; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.mobile-menu a:last-child { border-bottom: 0; }
.mobile-menu a:hover { color: var(--primary); }
@media (min-width: 1200px) {
  .site-nav { display: flex; }
  .header-actions .header-cta { display: inline-flex; }
  .menu-button, .mobile-menu { display: none !important; }
}
@media (max-width: 479px) {
  .lang-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .lang-short { display: inline; }
}
@media (max-width: 359px) {
  .container { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .brand-sub { display: none; }
  .langs button { padding: 0 9px; }
}

/* ---- 버튼 ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 12px 24px;
  font-size: 16px; font-weight: 600; line-height: 1.3; text-align: center; text-decoration: none; border-radius: var(--r-sm); transition: background 0.15s;
}
.btn-sm { min-height: 42px; padding: 8px 16px; font-size: 15px; white-space: nowrap; }
.btn-primary { color: #fff; background: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-inverse { color: var(--primary); background: #fff; }
.btn-inverse:hover { background: var(--primary-tint); }

/* ---- 1. 첫 화면 ---- */
.hero { padding-top: clamp(36px, 6vw, 80px); padding-bottom: clamp(40px, 6vw, 80px); background: var(--surface); border-bottom: 1px solid var(--line); }
/* 첫 화면은 제목과 검색창만 가운데에 둔다 */
.hero-copy { min-width: 0; max-width: 760px; margin: 0 auto; text-align: center; }
.hero h1 { max-width: 16em; margin: 0 auto 28px; font-size: clamp(30px, 5.2vw, 44px); line-height: 1.22; letter-spacing: -0.025em; color: var(--ink); text-wrap: balance; }

/* 전공 검색창: 첫 화면의 주인공 */
.hero-search {
  display: flex; align-items: center; gap: 8px; max-width: 640px; padding: 6px 6px 6px 16px;
  background: #fff; border: 2px solid var(--ink); border-radius: var(--r-md); box-shadow: var(--shadow-sm);
}
.hero-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--focus-ring); }
.hero-search > .icon { flex: none; width: 22px; height: 22px; color: var(--muted); }
.hero-search input { flex: 1; min-width: 0; height: 48px; padding: 0 4px; font-size: 17px; border: 0; background: transparent; }
.hero-search input:focus { outline: none; }
.hero-search button { flex: none; width: auto; height: auto; min-height: 48px; margin: 0; padding: 10px 22px; font-size: 16px; }
@media (max-width: 599px) {
  .hero-search { flex-wrap: wrap; padding: 6px; }
  .hero-search > .icon { margin-left: 10px; }
  .hero-search button { flex-basis: 100%; }
}
.hero-popular { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; max-width: 640px; margin: 16px auto 0; }
.hero-popular > span { margin-right: 4px; font-size: 14px; font-weight: 600; color: var(--muted); }
.chip {
  width: auto; height: auto; min-height: 36px; margin: 0; padding: 5px 12px;
  font-size: 14px; font-weight: 500; line-height: 1.3; color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
}
.chip:hover { color: var(--primary); background: #fff; border-color: var(--primary); }

/* 검색창 아래 짧은 정보 (숫자는 home-data.js의 homeStats. 가짜 숫자는 넣지 않는다) */
.hero-facts { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 28px 0 0; padding: 20px 0 0; list-style: none; border-top: 1px solid var(--line); justify-content: center; }
.stat { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.stat p { margin: 0; }
.stat-value { font-size: 16px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-label { font-size: 15px; color: var(--ink-soft); }


/* ---- 2. 추천 대학: 컴퓨터에서는 표, 휴대폰에서는 목록 ---- */
.sample-note { margin: 0 0 16px; padding: 12px 16px; font-weight: 600; background: var(--sample-bg); border: 1px dashed var(--sample-line); border-radius: var(--r-sm); }
.uni-table { border-top: 2px solid var(--ink); }
.uni-table:has(#home-cards[hidden]) { border-top: 0; }
.uni-head { display: none; }
#home-cards { margin: 0; padding: 0; list-style: none; }
.uni-row { display: grid; gap: 12px; min-width: 0; padding: 20px 0; border-bottom: 1px solid var(--line); }
.uni-main { min-width: 0; }
.uni-main h3 { margin: 0 0 4px; font-size: 19px; line-height: 1.4; }
.uni-main .badge { vertical-align: 2px; }
.uni-region { display: flex; align-items: center; gap: 4px; margin: 0; font-size: 14px; color: var(--muted); }
.uni-region .icon { width: 16px; height: 16px; }
.uni-main .pitch { margin: 8px 0 0; font-size: 15px; color: var(--ink-soft); }
.uni-facts { display: grid; gap: 6px; margin: 0; }
.uni-facts > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; }
.uni-facts dt { font-size: 14px; color: var(--muted); }
.uni-facts dd { margin: 0; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
@media (min-width: 900px) {
  .uni-head, .uni-row { grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 24px; }
  .uni-head { display: grid; padding: 12px 0; font-size: 14px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); }
  .uni-table:has(#home-cards[hidden]) .uni-head { display: none; }
  .uni-row { align-items: start; }
  .uni-facts { grid-column: 2 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
  .uni-facts > div { display: block; }
  .uni-facts dt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .uni-facts dd { padding-top: 2px; }
}
.empty-note { margin: 0; padding: 24px; color: var(--ink-soft); background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r-md); }

/* ---- 3. 이용 방법: 번호 + 위쪽 선 ---- */
.how { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
#home-steps { display: grid; gap: 28px; margin: 0; padding: 0; list-style: none; }
.how-step { min-width: 0; padding-top: 16px; border-top: 2px solid var(--line-strong); }
.how-no { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
.how-step h3 { margin: 0; font-size: 18px; line-height: 1.4; }
@media (min-width: 640px) { #home-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 32px; } }
@media (min-width: 1000px) { #home-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---- 4. 학생 후기 (지금은 예시 표시가 붙는다) ---- */
#home-reviews { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.review { display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 22px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); }
.review .badge { align-self: flex-start; }
.review blockquote { margin: 0; font-size: 16.5px; line-height: 1.7; }
.review-who { display: flex; align-items: center; gap: 10px; margin: auto 0 0; padding-top: 14px; font-size: 14.5px; font-weight: 600; color: var(--ink-soft); border-top: 1px solid var(--line); }
.review-avatar { flex: none; display: grid; place-items: center; width: 32px; height: 32px; font-size: 14px; font-weight: 700; color: var(--ink-soft); background: var(--surface); border: 1px solid var(--line); border-radius: 50%; }

/* ---- 행동 유도 띠 ---- */
.cta-band { padding-top: clamp(40px, 6vw, 64px); padding-bottom: clamp(40px, 6vw, 64px); color: #fff; background: var(--primary); }
.cta-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.cta-band h2 { flex: 1 1 420px; min-width: 0; margin: 0; font-size: clamp(22px, 3.4vw, 28px); line-height: 1.3; letter-spacing: -0.02em; text-wrap: balance; }
@media (max-width: 599px) { .cta-band .btn { width: 100%; } }

/* ---- 하단 ---- */
.site-footer { padding-top: 56px; padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px)); color: #c8cfdb; background: var(--footer); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 32px; }
.footer-grid > * { min-width: 0; }
.footer-brand { grid-column: 1 / -1; }
.footer-brand .brand { color: #fff; }
.footer-brand .brand-sub { color: #98a2b3; border-left-color: rgb(255 255 255 / 0.2); }
.footer-brand .brand-mark { --mark-bg: #fff; --mark-fg: var(--footer); }
.footer-tagline { margin: 12px 0 0; color: #98a2b3; }
.site-footer h2 { margin: 0 0 10px; font-size: 14px; letter-spacing: 0; color: #fff; }
.site-footer p { margin: 0; white-space: pre-line; }
.footer-links { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.footer-links a { color: #c8cfdb; text-decoration: none; }
.footer-links a:hover { color: #fff; text-decoration: underline; }
.footer-copy { margin: 40px 0 0; padding-top: 20px; font-size: 14px; color: #98a2b3; border-top: 1px solid rgb(255 255 255 / 0.12); }
.site-footer a:focus-visible { outline-color: #fff; }
@media (min-width: 900px) {
  /* 숨긴 칸(회사 소개·문의가 비었을 때)만큼 자리가 비지 않게 한 줄로 나눈다 */
  .footer-grid { display: flex; gap: 40px; }
  .footer-grid > * { flex: 1 1 0; }
  .footer-grid > .footer-brand { flex-grow: 1.5; }
}

/* ---- 오른쪽 아래에 떠 있는 Q&A 버튼 ---- */
.float-chat {
  position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 40;
  display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px); min-height: 52px; padding: 12px 20px 12px 16px;
  font-size: 15px; font-weight: 600; line-height: 1.3; color: var(--ink); text-decoration: none;
  background: #fff; border: 1px solid var(--line-strong); border-radius: 999px; box-shadow: var(--shadow-pop);
}
.float-chat:hover { color: var(--primary); border-color: var(--primary); }
.float-chat .icon { flex: none; width: 22px; height: 22px; color: var(--primary); }

/* ---- 대화 화면과 Q&A 화면 ---- */
.intro { padding: 20px 0 48px; min-height: calc(100vh - 64px); min-height: calc(100svh - 64px); }
.guide { min-height: calc(100vh - 64px); min-height: calc(100svh - 64px); }

/* ---- 개인정보처리방침, 비자 점검: 문서 모양 ---- */
.policy { padding-top: 24px; padding-bottom: 72px; background: #fff; }
.policy-inner { max-width: 720px; margin: 0 auto; }
.policy-back { display: inline-flex; align-items: center; min-height: 44px; padding: 4px 0; font-weight: 600; color: var(--primary); text-decoration: none; }
.policy-back:hover { text-decoration: underline; }
.policy-note { margin: 12px 0 0; padding: 12px 16px; font-size: 15px; color: var(--ink-soft); background: var(--surface); border-left: 3px solid var(--primary); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
#privacy-content { line-height: 1.75; }
#privacy-content h1 { margin: 16px 0 6px; font-size: clamp(28px, 5vw, 36px); line-height: 1.25; color: var(--ink); }
#privacy-content h2 { margin: 40px 0 10px; padding-top: 24px; font-size: 20px; letter-spacing: -0.01em; color: var(--ink); border-top: 1px solid var(--line); }
#privacy-content p { margin: 0 0 12px; }
#privacy-content ul { margin: 0 0 12px; padding-left: 1.3em; }
#privacy-content li { margin-bottom: 6px; }
.policy-date { color: var(--muted); }
mark.fill { padding: 0 4px; color: var(--ink); background: var(--sample-bg); border: 1px dashed var(--sample-line); border-radius: 4px; }
.consent-more { display: inline-block; margin: 0 0 12px; font-size: 15px; font-weight: 600; color: var(--primary); }
.footer-policy { color: #c8cfdb; }
.footer-policy:hover { color: #fff; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* 비자 준비 점검 */
.visa h1 { margin: 16px 0 8px; font-size: clamp(28px, 5vw, 36px); color: var(--ink); }
.visa h1 + p { color: var(--ink-soft); }
.visa h2 { margin: 36px 0 8px; font-size: 19px; line-height: 1.4; }
.visa-hint { margin: 0 0 4px; color: var(--muted); }
.visa-list { border-top: 1px solid var(--ink); }
.visa-list label { display: flex; gap: 12px; align-items: flex-start; margin: 0; padding: 14px 4px; border-bottom: 1px solid var(--line); font-weight: 400; cursor: pointer; }
.visa-list label:hover { background: var(--surface); }
.visa-list input { flex: none; width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--primary); }
.visa-result { margin-top: 28px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.visa-result p { margin: 0; }
.visa-progress { font-size: 18px; font-weight: 700; color: var(--primary); }
.visa-tips-title { margin-top: 12px !important; font-weight: 700; }
.visa-result ul { margin: 6px 0 0; padding-left: 20px; }
.visa-result li { margin: 4px 0; }
.visa-consult { display: block; width: 100%; height: auto; min-height: 52px; margin-top: 16px; padding: 14px 18px; font-size: 16px; font-weight: 600; color: #fff; background: var(--primary); border: 0; border-radius: var(--r-sm); cursor: pointer; }
.visa-consult:hover { background: var(--primary-hover); }
