/* =========================================================
   실험실 홈페이지 스타일시트
   색상 테마는 아래 :root 변수만 바꾸면 전체가 바뀝니다.
   ========================================================= */

:root {
  --color-primary: #1a5c8a;      /* 메인 색 (강원대 블루 계열) */
  --color-primary-dark: #123f5f;
  --color-accent: #2e9e8f;       /* 강조 색 (틸) */
  --color-bg: #ffffff;
  --color-bg-alt: #f5f8fa;
  --color-text: #22303c;
  --color-text-soft: #5a6b78;
  --color-border: #e2e8ee;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(18, 63, 95, 0.08);
  --shadow-lg: 0 12px 40px rgba(18, 63, 95, 0.14);
  --max-width: 1120px;
  --font: "Pretendard", "Noto Sans KR", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 76px; }

body {
  font-family: var(--font);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- 헤더 / 내비게이션 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--color-border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.nav__brand {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  color: var(--color-primary-dark);
}
.nav__brand:hover { text-decoration: none; }
.nav__brand strong { font-size: 1.15rem; font-weight: 800; }
.nav__logo { height: 30px; width: auto; margin-bottom: 3px; }
.nav__brand span { font-size: 0.72rem; color: var(--color-text-soft); letter-spacing: 0.02em; }

.nav__links {
  display: flex;
  gap: 4px;
  list-style: none;
  align-items: center;
}
.nav__links a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--color-text);
  font-size: 0.92rem;
  font-weight: 500;
}
.nav__links a:hover { background: var(--color-bg-alt); text-decoration: none; color: var(--color-primary); }
.nav__links a.active {
  color: var(--color-primary);
  font-weight: 700;
  background: var(--color-bg-alt);
}

.nav__toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--color-primary-dark);
}

/* ---------- 히어로 ---------- */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary) 55%, var(--color-accent));
  color: #fff;
  padding: 96px 0 104px;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  right: -120px; top: -120px;
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(255,255,255,0.16), transparent 70%);
  border-radius: 50%;
}
/* 배경사진 레이어 — 글자는 그대로 두고 이 레이어만 스크롤에 따라 움직입니다.
   가장자리가 드러나지 않도록 상하좌우로 넉넉히 키워 두었습니다. */
.hero-bg {
  position: absolute;
  /* 위아래는 기울어질 여유가 필요하지만, 좌우는 조금만 있으면 됩니다.
     좌우 여백이 크면 사진의 양 끝이 화면 밖으로 잘려 나갑니다. */
  inset: -22% -5% -11%;
  z-index: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform: scale(1.04);
  transform-origin: center 40%;
  will-change: transform;
  backface-visibility: hidden;
}

/* 첫 화면에 배경사진이 깔린 경우 — 사진 위에 어두운 막을 덮어 글자를 살립니다 */
.hero--photo {
  /* 배경사진이 시원하게 보이도록 화면 높이의 약 80%를 차지하게 합니다 */
  min-height: 80vh;
  display: flex;
  align-items: center;
  padding: 140px 0 150px;
  background-color: var(--color-primary-dark);
  perspective: 1200px;
}
.hero--photo > .hero__inner { width: 100%; }
.hero--photo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    100deg,
    rgba(8, 28, 46, 0.88) 0%,
    rgba(8, 28, 46, 0.72) 42%,
    rgba(8, 28, 46, 0.42) 100%
  );
}
.hero--photo::after { display: none; }
.hero--photo h1 { text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45); }
.hero--photo p { text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5); }

.hero__inner { position: relative; z-index: 2; max-width: 760px; }
.hero__eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.15);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
}
.hero h1 { font-size: 2.6rem; font-weight: 800; line-height: 1.25; margin-bottom: 18px; }
.hero p { font-size: 1.12rem; opacity: 0.94; margin-bottom: 30px; }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn--primary { background: #fff; color: var(--color-primary-dark); }
.btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,0.6); }

/* ---------- 하위 페이지 상단 배너 ---------- */
.page-hero {
  position: relative;
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary) 70%, var(--color-accent));
  background-size: cover;
  background-position: center;
  color: #fff;
  padding: 62px 0;
  text-align: center;
  overflow: hidden;
}

/* 배경사진이 깔린 배너 — 사진 위에 어두운 막을 덮어 글자가 잘 보이게 합니다 */
.page-hero--photo {
  padding: 104px 0;
  background-color: var(--color-primary-dark);
  perspective: 1200px;
}
.page-hero--photo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(10, 32, 50, 0.72) 0%,
    rgba(10, 32, 50, 0.55) 45%,
    rgba(10, 32, 50, 0.75) 100%
  );
}
.page-hero > .container { position: relative; z-index: 2; }

/* 시스템에서 "동작 줄이기"를 켠 분에게는 움직임을 적용하지 않습니다 */
@media (prefers-reduced-motion: reduce) {
  .hero-bg { transform: scale(1.02) !important; transition: none !important; }
}

.page-hero__eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.85;
  font-weight: 600;
}
.page-hero__title {
  font-size: 2.1rem;
  font-weight: 800;
  margin: 8px 0 10px;
}
.page-hero__desc { opacity: 0.92; max-width: 640px; margin: 0 auto; }

/* 사진 배너에서는 글자에 옅은 그림자를 넣어 가독성을 더 높입니다 */
.page-hero--photo .page-hero__title { text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5); }
.page-hero--photo .page-hero__eyebrow,
.page-hero--photo .page-hero__desc { text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55); }

/* ---------- 홈: 페이지 안내 카드 ---------- */
.home-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px;
}
.home-card {
  display: block;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  color: var(--color-text);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.home-card:hover {
  text-decoration: none;
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-accent);
}
.home-card__thumb {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--color-bg-alt);
}
.home-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.home-card:hover .home-card__img { transform: scale(1.07); }
.home-card__body { padding: 16px 18px 18px; }
.home-card__title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-primary-dark);
  margin-bottom: 3px;
}
.home-card__desc { font-size: 0.86rem; color: var(--color-text-soft); }

.section__more { text-align: center; margin-top: 34px; }
.btn--outline {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: transparent;
}
.btn--outline:hover { background: var(--color-primary); color: #fff; }

/* ---------- 섹션 공통 ---------- */
.section { padding: 84px 0; }
.section--alt { background: var(--color-bg-alt); }
.section__head { max-width: 720px; margin: 0 auto 48px; text-align: center; }
.section__eyebrow {
  color: var(--color-accent);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.section__title { font-size: 2rem; font-weight: 800; margin: 10px 0 14px; color: var(--color-primary-dark); }
.section__desc { color: var(--color-text-soft); font-size: 1.05rem; }

/* ---------- 랩 소개 ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 40px;
  align-items: center;
}
.about-text p { margin-bottom: 16px; color: var(--color-text-soft); }
.about-text p strong { color: var(--color-text); }
.about-highlights {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.highlight-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.highlight-card .num { font-size: 2rem; font-weight: 800; color: var(--color-accent); }
.highlight-card .label { color: var(--color-text-soft); font-size: 0.92rem; }

/* ---------- PI 소개 ---------- */
.pi-card {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 36px;
  box-shadow: var(--shadow);
  align-items: start;
}
.pi-photo {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--color-bg-alt);
}
.pi-info h3 { font-size: 1.5rem; color: var(--color-primary-dark); }
.pi-name-en { font-size: 0.95rem; color: var(--color-text-soft); font-weight: 400; }
.pi-intro { color: var(--color-text-soft); }
.pi-info .pi-role { color: var(--color-accent); font-weight: 600; margin-bottom: 16px; }
.pi-info h4 {
  margin: 22px 0 8px;
  font-size: 0.95rem;
  color: var(--color-primary-dark);
  border-left: 3px solid var(--color-accent);
  padding-left: 10px;
}
.pi-info ul { list-style: none; }
.pi-info ul li { padding: 3px 0; color: var(--color-text-soft); }
.pi-contact { margin-top: 20px; display: flex; gap: 18px; flex-wrap: wrap; font-size: 0.9rem; }

/* ---------- 랩 인원 ---------- */
.member-group-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin: 36px 0 20px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-border);
}
.member-group-title:first-of-type { margin-top: 0; }
.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 22px;
}
.member-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.member-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.member-photo {
  width: 96px; height: 96px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 28%; /* 세로로 긴 사진에서 얼굴이 잘리지 않도록 위쪽 기준 */
  margin: 0 auto 14px;
  background: var(--color-bg-alt);
  border: 3px solid var(--color-bg-alt);
}
.member-card h4 { font-size: 1.05rem; color: var(--color-primary-dark); }
.member-card .member-role { color: var(--color-accent); font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
.member-card .member-desc { color: var(--color-text-soft); font-size: 0.82rem; }
.member-card .member-email { font-size: 0.78rem; margin-top: 8px; word-break: break-all; }

/* ---------- 논문 목록 ---------- */
.pub-filters { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 18px; }
.pub-legend {
  text-align: center;
  font-size: 0.84rem;
  color: var(--color-text-soft);
  margin-bottom: 30px;
}
.pub-legend b { color: var(--color-primary-dark); }
.pub-legend sup { color: var(--color-accent); font-weight: 700; }
.pub-filter {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text-soft);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.15s ease;
}
.pub-filter.active, .pub-filter:hover { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.pub-list { list-style: none; max-width: 900px; margin: 0 auto; }
.pub-item {
  display: flex;
  gap: 18px;
  padding: 20px 0;
  border-bottom: 1px solid var(--color-border);
}
.pub-year {
  flex-shrink: 0;
  font-weight: 800;
  color: var(--color-accent);
  width: 52px;
}
.pub-body .pub-title { font-weight: 600; color: var(--color-text); margin-bottom: 4px; }
.pub-body .pub-authors { color: var(--color-text-soft); font-size: 0.9rem; }
/* 제1저자(1) · 교신저자(*) 위첨자 표시 */
.pub-mark { color: var(--color-accent); font-weight: 700; margin-left: 1px; }
/* 제목 안의 학명은 기울임으로 */
.pub-body .pub-title em { font-style: italic; }
.pub-body .pub-journal { color: var(--color-primary); font-size: 0.9rem; font-style: italic; }
.pub-links { margin-top: 6px; font-size: 0.85rem; display: flex; gap: 12px; }

/* ---------- 뉴스 ---------- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 26px;
}
.news-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.news-card__img { width: 100%; aspect-ratio: 16/10; object-fit: cover; background: var(--color-bg-alt); }
.news-card__body { padding: 20px; }
.news-card__date { color: var(--color-accent); font-size: 0.82rem; font-weight: 600; }
.news-card__title { font-size: 1.1rem; font-weight: 700; margin: 6px 0 8px; color: var(--color-primary-dark); }
.news-card__text { color: var(--color-text-soft); font-size: 0.9rem; }
.news-card__link {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--color-accent);
}

/* ---------- 갤러리 ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4/3;
  background: var(--color-bg-alt);
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.gallery-item:hover img { transform: scale(1.06); }
.gallery-item__caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 14px 12px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,0.65));
  color: #fff;
  font-size: 0.82rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.gallery-item:hover .gallery-item__caption { opacity: 1; }

/* 라이트박스 */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 30px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 90vw; max-height: 82vh; border-radius: 8px; }
.lightbox__close {
  position: absolute; top: 24px; right: 30px;
  background: none; border: none; color: #fff; font-size: 2.4rem; cursor: pointer;
}
.lightbox__caption { position: absolute; bottom: 30px; color: #fff; font-size: 0.95rem; text-align: center; width: 100%; }

/* ---------- 자료실 ---------- */
.resource-list { display: grid; gap: 12px; max-width: 820px; margin: 0 auto; }
.resource-item {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 22px 16px 16px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.resource-item:hover {
  transform: translateY(-2px);
  text-decoration: none;
  box-shadow: var(--shadow-lg);
  border-color: var(--color-accent);
}
.resource-thumb {
  flex-shrink: 0;
  width: 148px;
  aspect-ratio: 16/10;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--color-border);
}
/* 웹사이트 화면 캡처라 가로세로 비율이 제각각이므로,
   잘라내지 않고 전체가 보이도록 맞춰 넣습니다. */
.resource-thumb__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.resource-info { flex: 1; min-width: 0; }
.resource-info .r-title { font-weight: 600; color: var(--color-text); }
.resource-info .r-meta { color: var(--color-text-soft); font-size: 0.82rem; }
.resource-arrow { color: var(--color-accent); font-weight: 700; }

/* ---------- 연락처 / 방문 ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.contact-info h4 {
  font-size: 0.95rem; color: var(--color-primary-dark);
  border-left: 3px solid var(--color-accent); padding-left: 10px; margin: 20px 0 6px;
}
.contact-info h4:first-child { margin-top: 0; }
.contact-info p { color: var(--color-text-soft); }
.contact-info .addr-en { font-size: 0.88rem; }
.map-embed {
  width: 100%; min-height: 320px; height: 100%;
  border: 0; border-radius: var(--radius); box-shadow: var(--shadow);
  background: var(--color-bg-alt);
}
.map-placeholder {
  display: flex; align-items: center; justify-content: center;
  min-height: 320px; border-radius: var(--radius);
  background: var(--color-bg-alt); color: var(--color-text-soft);
  text-align: center; padding: 20px; border: 1px dashed var(--color-border);
}

/* ---------- 푸터 ---------- */
.site-footer {
  background: var(--color-primary-dark);
  color: rgba(255,255,255,0.82);
  padding: 40px 0;
  font-size: 0.9rem;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.footer-inner strong { color: #fff; font-size: 1.05rem; }
.footer-addr { font-size: 0.84rem; opacity: 0.8; line-height: 1.9; }
.site-footer a { color: rgba(255,255,255,0.9); }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  max-width: 380px;
}
.footer-links a { font-size: 0.88rem; }
.footer-copy {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.16);
  font-size: 0.82rem;
  opacity: 0.7;
}

/* ---------- 404 안내 페이지 ---------- */
.notfound { text-align: center; padding: 40px 0 20px; }
.notfound__code {
  font-size: 4.5rem;
  font-weight: 800;
  color: var(--color-primary);
  opacity: 0.25;
  line-height: 1;
}
.notfound__title {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--color-primary-dark);
  margin: 14px 0 12px;
}
.notfound__text { color: var(--color-text-soft); margin-bottom: 30px; }
.notfound__links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
/* 첫 화면용 흰 버튼은 흰 배경에서 안 보이므로 파란 버튼으로 */
.notfound .btn--primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.notfound .btn--primary:hover { background: var(--color-primary-dark); }

/* ---------- 반응형 ---------- */
@media (max-width: 860px) {
  .nav__toggle { display: block; }
  .nav__links {
    position: absolute;
    top: 68px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    padding: 8px 16px 16px;
    gap: 2px;
    display: none;
    box-shadow: var(--shadow);
  }
  .nav__links.open { display: flex; }
  .about-grid, .pi-card, .contact-grid { grid-template-columns: 1fr; }
  .pi-photo { max-width: 240px; }
  .hero h1 { font-size: 2rem; }
  .hero--photo { min-height: 74vh; padding: 90px 0 100px; }
  .page-hero { padding: 44px 0; }
  .page-hero--photo { padding: 68px 0; }
  .page-hero__title { font-size: 1.7rem; }
  .section { padding: 60px 0; }
  .footer-links { max-width: none; }
  .resource-item { align-items: flex-start; gap: 14px; padding: 14px; }
  .resource-thumb { width: 96px; }
  .resource-arrow { align-self: center; }
}
