/* ==========================================================================
   공통 스타일: 색·글꼴 기본값, 상단, 하단, 버튼, 섹션 머리말
   다른 사이트로 옮길 때는 맨 위 :root 의 값만 바꾸면 전체 색·폭이 바뀐다.
   ========================================================================== */

:root {
  /* 색 */
  --brand: #294b9b;        /* 연구소 강조색(파랑) */
  --brand-deep: #162a46;   /* 짙은 남색 */
  --brand-soft: #bbd2ff;   /* 어두운 배경 위 강조 */
  --accent: #294b9b;
  --ink: #171c24;          /* 기본 글자 */
  --ink-sub: #556170;
  --line: #dce2ea;
  --bg: #ffffff;
  --bg-soft: #f4f6f9;
  --bg-dark: #0f1c30;
  --on-dark-sub: #a0a0a0;

  /* 크기 */
  --header-h: 80px;
  --wrap: 1440px;
  --gutter: 60px;
  --radius: 22px;

  --font: "Pretendard Variable", Pretendard, "Malgun Gothic", "맑은 고딕", sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

@media (max-width: 1024px) {
  :root { --header-h: 64px; --gutter: 22px; --radius: 16px; }
}

/* ---------- 기본 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--header-h); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -.025em;
  color: var(--ink);
  background: var(--bg);
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; border: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

main { padding-top: var(--header-h); }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  padding: 10px 16px; background: var(--brand); color: #fff; border-radius: 8px;
}
.skip-link:focus { top: 12px; }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 24px; border-radius: 999px;
  font-size: 15px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap;
  transition: background-color .25s, color .25s, border-color .25s;
}
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-deep); }
.btn--ghost { border: 1px solid rgba(255, 255, 255, .7); color: #fff; }
.btn--ghost:hover { background: #fff; color: var(--ink); }

/* 글 상태 표시(예: 모집 종료) */
.badge { display: inline-block; vertical-align: middle; margin-left: 6px; padding: 3px 10px; border-radius: 999px; background: #eceff4; color: var(--ink-sub); font-size: 13px; font-weight: 600; letter-spacing: 0; line-height: 1.5; white-space: nowrap; }

/* ---------- 섹션 머리말 (작은 영문 라벨 + 제목) ---------- */
.eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: 2px; color: var(--brand);
  margin-bottom: 32px;
}
.eyebrow--dot {
  position: relative; padding-left: 26px;
  font-size: 20px; line-height: 20px; letter-spacing: 1px;
}
.eyebrow--dot::before {
  content: ""; position: absolute; left: 0; top: 2px;
  width: 16px; height: 16px; border-radius: 50%; background: currentColor;
}
.heading {
  font-size: clamp(30px, 3.4vw, 52px); font-weight: 500; line-height: 1.4; letter-spacing: -.04em;
}
.heading-2 {
  font-size: clamp(24px, 2.5vw, 36px); font-weight: 500; line-height: 1.5; letter-spacing: -.04em;
  color: var(--ink-sub);
}
.heading-2 strong { font-weight: 500; color: var(--ink); }
.on-dark .eyebrow { color: var(--brand-soft); }
.on-dark .heading-2 { color: var(--on-dark-sub); }
.on-dark .heading-2 strong { color: #fff; }

/* ---------- 상단 ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100; height: var(--header-h);
  background: #fff; border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter);
}
.site-header__logo img { height: calc(var(--header-h) - 38px); width: auto; }

.gnb { display: flex; align-items: center; gap: 28px; height: 100%; }
.gnb__list { display: flex; height: 100%; }
.gnb__item { position: relative; height: 100%; }
.gnb__link {
  display: flex; align-items: center; height: 100%; padding: 0 22px;
  font-size: 18px; font-weight: 500; transition: color .2s;
}
.gnb__item:hover > .gnb__link,
.gnb__item:focus-within > .gnb__link { color: var(--brand); }

/* ---------- 메가메뉴: 헤더 바로 아래에 화면 전체 폭으로 열리는 패널 ---------- */
.gnb { position: static; }
.gnb__link { position: relative; }
.gnb__link::after { content: ""; position: absolute; left: 22px; right: 22px; bottom: 0; height: 3px; background: var(--brand); transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease); }
.gnb__item.is-current > .gnb__link { color: var(--brand); }
.gnb__item.is-active > .gnb__link::after, .gnb__item.is-current > .gnb__link::after { transform: scaleX(1); }
.mega {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 1;
  background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  box-shadow: 0 24px 40px rgba(22, 42, 70, .12);
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: opacity .22s, transform .22s var(--ease), visibility .22s;
}
/* 열릴 때는 곧바로 보이게 해서(visibility 지연 없음) 키보드 초점이 바로 들어갈 수 있게 한다 */
.site-header.is-mega-open .mega { opacity: 1; visibility: visible; transform: none; transition: opacity .22s, transform .22s var(--ease), visibility 0s; }
.mega__inner { display: grid; grid-template-columns: repeat(4, 1fr); max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.mega__col { padding: 36px 28px 44px; border-left: 1px solid var(--line); transition: background-color .2s; }
.mega__col:last-child { border-right: 1px solid var(--line); }
.mega__col.is-active { background: var(--bg-soft); }
.mega__en { font-size: 11px; font-weight: 700; letter-spacing: 1.6px; color: var(--brand); margin-bottom: 8px; }
.mega__title { display: block; margin-bottom: 18px; font-size: 20px; font-weight: 700; letter-spacing: -.03em; }
.mega__col li a { display: block; padding: 8px 0; font-size: 16px; color: var(--ink-sub); transition: color .2s, transform .2s; }
.mega__col li a:hover, .mega__col li a:focus-visible { color: var(--brand); transform: translateX(4px); }
.mega__col li a[aria-current="page"] { color: var(--brand); font-weight: 700; }
.mega-backdrop { position: fixed; inset: var(--header-h) 0 0 0; z-index: -1; background: rgba(15, 28, 48, .35); opacity: 0; visibility: hidden; transition: opacity .22s, visibility .22s; pointer-events: none; }
.site-header.is-mega-open .mega-backdrop { opacity: 1; visibility: visible; }
@media (max-width: 1024px) { .mega, .mega-backdrop { display: none; } }

/* 모바일 메뉴 버튼 */
.nav-toggle { display: none; width: 44px; height: 44px; margin-right: -10px; position: relative; }
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
  position: absolute; left: 10px; width: 24px; height: 2px; background: var(--ink);
  transition: transform .25s, opacity .25s;
}
.nav-toggle__bars { top: 21px; }
.nav-toggle__bars::before { content: ""; left: 0; top: -8px; }
.nav-toggle__bars::after { content: ""; left: 0; top: 8px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-8px) rotate(-45deg); }

.mobile-nav { position: fixed; inset: var(--header-h) 0 0 0; z-index: 99; }
.mobile-nav[hidden] { display: none; }
.mobile-nav__backdrop { position: absolute; inset: 0; background: rgba(6, 6, 6, .5); opacity: 0; transition: opacity .3s; }
.mobile-nav__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(86%, 360px);
  display: flex; flex-direction: column; padding: 12px 22px 28px;
  background: #fff; overflow-y: auto; transform: translateX(100%); transition: transform .3s var(--ease);
}
.mobile-nav.is-open .mobile-nav__backdrop { opacity: 1; }
.mobile-nav.is-open .mobile-nav__panel { transform: none; }
.mobile-nav__list > li { border-bottom: 1px solid var(--line); }
.mobile-nav__list > li > a,
.mobile-nav__list summary {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 56px; font-size: 18px; font-weight: 600; cursor: pointer; list-style: none;
}
.mobile-nav__list summary::-webkit-details-marker { display: none; }
.mobile-nav__list summary::after { content: "+"; font-size: 22px; font-weight: 300; color: var(--ink-sub); }
.mobile-nav__list details[open] summary::after { content: "−"; }
.mobile-nav__list details ul { padding: 0 0 12px; }
.mobile-nav__list details a { display: block; padding: 10px 12px; font-size: 16px; color: var(--ink-sub); }
.mobile-nav__list details a[aria-current="page"] { color: var(--brand); font-weight: 700; }
.mobile-nav__cta { margin-top: 24px; min-height: 52px; font-size: 16px; }

@media (max-width: 1024px) {
  .gnb { display: none; }
  .nav-toggle { display: block; }
}
@media (min-width: 1025px) {
  .mobile-nav { display: none !important; }
}

/* ---------- 하단 ---------- */
.site-footer { padding: 64px 0 48px; background: #f6f8fb; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-sub); }
.site-footer a:hover { color: var(--brand); }
.site-footer__top { display: flex; align-items: center; gap: 24px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.site-footer__logo img { height: 44px; width: auto; }
.site-footer__logo { margin-right: auto; }
.site-footer__brand strong { font-size: 17px; color: var(--ink); }
.site-footer__contact { font-weight: 600; color: var(--brand); }
.site-footer__menu { display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 24px 0 18px; }
.site-footer__menu a { color: var(--ink); }
.site-footer__menu .is-strong { font-weight: 700; }
.site-footer__info { display: flex; flex-wrap: wrap; gap: 6px 28px; }
.site-footer__info div { display: flex; gap: 6px; }
.site-footer__info dt::after { content: " :"; }
.site-footer__bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; margin-top: 36px; }
.site-footer__copy { color: var(--ink); font-size: 13px; }
.site-footer__note { margin-top: 6px; font-size: 12px; }
.family { text-align: right; }
.family__title { display: block; margin-bottom: 10px; font-size: 12px; font-weight: 600; letter-spacing: 1.5px; color: var(--ink); }
.family ul { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.family a { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 13px; color: var(--ink); transition: border-color .2s, color .2s; }
.family a:hover { border-color: var(--brand); }

@media (max-width: 800px) {
  .site-footer { padding: 44px 0 36px; }
  .site-footer__top { flex-wrap: wrap; gap: 14px 18px; }
  .site-footer__logo img { height: 36px; }
  .site-footer__info { flex-direction: column; gap: 4px; }
  .site-footer__bottom { flex-direction: column; align-items: flex-start; }
  .family { text-align: left; }
  .family ul { justify-content: flex-start; }
}

/* ---------- 스크롤 등장 (스크립트가 준비됐을 때만 숨겨 두었다가 나타나게 한다) ---------- */
.js-motion [data-reveal],
.js-motion .rise { opacity: 0; transform: translateY(60px); }

/* 움직임 줄이기 설정을 켠 방문자: 전환·애니메이션을 끈다 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
