/* 이훈 교수 홈페이지 — ZIGULAB 디자인 시스템 적용 (DESIGN_NOTES.md 참조)
 * 팔레트: 라임 #A3FF5E · 로열블루 #2965FF · 블랙 · 화이트 · 그레이 #F6F6F6
 * 문법: 컬러 밴드 교차, 초대형 볼드 타이포, 알약 버튼, 파선(항로) 모티프 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700;800;900&display=swap');
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');

:root {
  --c-blue-light: #3b4ec1;  /* 한양블루 밝은 톤 (그라데이션 끝) */
  --c-blue-tint: #e8ebf8;   /* 옅은 블루 (카드 배경) */
  --c-blue: #1d2475;        /* 한양블루 (Pantone 541C) */
  --c-navy-deep: #141a54;   /* 한양블루 심화 톤 */
  --c-black: #000000;
  --c-bg: #ffffff;
  --c-surface: #f6f6f6;
  --c-text: #000000;
  --c-muted: #555f6a;
  --c-line: #e8e8e8;
  --c-accent: #1d2475;
  --c-accent-soft: #e7e9f6;
  --pillar-happiness: #ff7a1a;
  --pillar-festival: #e0355f;
  --pillar-inclusive: #12a150;
  --pillar-ai: #1d2475;
  --pillar-region: #8a6a1f;
  --radius: 14px;
  --wrap: 1080px;
  --font-head: 'Pretendard Variable', Pretendard, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  font-size: 16px;
}

/* 큰 제목은 Pretendard — 본문은 Inter 유지 */
h1, h2, h3, .brand-name, .stat .num, .footer-msg, .q-card .q, .project-feature .problem {
  font-family: var(--font-head);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
/* 앵커 이동 시 고정 헤더가 제목을 가리지 않도록 여유 확보 */
[id] { scroll-margin-top: 96px; }
/* 리빌 대기 요소(translateX)나 돌발 요소가 가로 스크롤을 만들지 않도록 차단 */
html, body { overflow-x: clip; }
@supports not (overflow-x: clip) { html, body { overflow-x: hidden; } }
body {
  margin: 0;
  font-family: "Inter", "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.65;
  word-break: keep-all;
}
.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: 20px; padding-right: 20px; }
a { color: var(--c-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ── 헤더 (한양블루) ── */
.site-header { position: sticky; top: 0; background: var(--c-blue); z-index: 50; }
.header-inner { display: flex; align-items: center; gap: 24px; height: 88px; }
.brand { display: flex; flex-direction: row; align-items: center; gap: 11px; color: #fff; flex: none; }
.brand:hover { text-decoration: none; }
.brand-logo { flex: none; display: flex; align-items: center; justify-content: center; }
.brand-logo img { width: 46px; height: 46px; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-size: 1.55rem; font-weight: 900; letter-spacing: -.02em; }
.brand-sub { font-size: .7rem; font-weight: 600; color: rgba(255 255 255 / 68%); }
.site-nav { margin-left: auto; display: flex; gap: 8px; flex-wrap: nowrap; }
.site-nav a {
  padding: 7px 17px; border-radius: 999px; background: rgba(255 255 255 / 14%); color: #fff;
  font-weight: 700; font-size: .86rem; white-space: nowrap;
}
.site-nav a:hover { text-decoration: none; transform: translateY(-1px); }
.site-nav a.active { background: #fff; color: var(--c-blue); }
.nav-toggle { display: none; margin-left: auto; font-size: 1.5rem; background: none; border: none; cursor: pointer; color: #fff; }

/* ── 히어로 (블루 그라데이션 밴드 — 전 페이지 공통, 헤더와 같은 색에서 시작해 흰 배경으로 자연스럽게 페이드) ──
 * 페이드 구간을 퍼센트로 지정 — 히어로 총 높이에 비례해 늘어나므로 화면 크기가 바뀌어도
 * 본문·버튼을 침범하지 않는다. 넉넉한 하단 패딩으로 페이드가 앉을 자리를 확보. */
.hero {
  padding: 76px 0 96px; color: #fff;
  background: linear-gradient(180deg,
    var(--c-blue) 0%, var(--c-blue-light) 55%, var(--c-bg) 100%);
}
.hero a:not(.btn) { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.hero h1 {
  font-size: clamp(2rem, 5.2vw, 3.4rem); font-weight: 800; line-height: 1.18;
  letter-spacing: -.02em; margin: 0 0 18px;
}
.hero .sub { font-size: 1.06rem; font-weight: 500; max-width: 44em; margin: 0 0 8px; }
.hero .sub-en { font-size: .9rem; color: rgba(255 255 255 / 72%); font-weight: 500; margin: 0 0 26px; }
.hero-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 36px; align-items: center; }

/* 홈 전용 센터 히어로 — 일러스트가 하단까지 이어지므로 페이드 시작점을 조금 더 일찍 잡음 */
.hero.hero-home {
  padding: 96px 0 0; text-align: center; overflow: hidden;
  background: linear-gradient(180deg,
    var(--c-blue) 0%, var(--c-blue-light) 50%, var(--c-bg) 100%);
}
.hero.hero-home h1 { font-size: clamp(2.3rem, 6vw, 4rem); }
.hero.hero-home .sub, .hero.hero-home .sub-en { margin-left: auto; margin-right: auto; }
.hero.hero-home .btn-row { justify-content: center; }
/* 히어로 인물 사진 — 사진은 사각형 그대로 두고, 가로·세로 선형 그라데이션 마스크를
   교차(intersect)시켜 네 변 둘레만 얇게 페이드되도록 함 (타원 마스크는 모서리를
   큰 타원으로 잘라내 버려서 사용하지 않음) */
.hero-photo-frame { margin: 34px auto -4px; max-width: 720px; }
.hero-photo-home {
  display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover;
  -webkit-mask-image:
    linear-gradient(to right, transparent 0%, #000 3%, #000 97%, transparent 100%),
    linear-gradient(to bottom, transparent 0%, #000 4%, #000 96%, transparent 100%);
  -webkit-mask-composite: source-over, source-in;
  mask-image:
    linear-gradient(to right, transparent 0%, #000 3%, #000 97%, transparent 100%),
    linear-gradient(to bottom, transparent 0%, #000 4%, #000 96%, transparent 100%);
  mask-composite: intersect;
}
.hero-img-placeholder {
  border: 2px dashed rgba(255 255 255 / 50%); border-radius: var(--radius);
  padding: 28px; color: rgba(255 255 255 / 88%); font-size: .9rem; background: rgba(255 255 255 / 12%);
}
.hero-photo {
  display: block; width: 100%; border-radius: var(--radius);
  box-shadow: 0 14px 36px rgba(0 0 0 / 28%); object-fit: cover;
  -webkit-mask-image:
    linear-gradient(to right, transparent 0%, #000 3%, #000 97%, transparent 100%),
    linear-gradient(to bottom, transparent 0%, #000 4%, #000 96%, transparent 100%);
  -webkit-mask-composite: source-over, source-in;
  mask-image:
    linear-gradient(to right, transparent 0%, #000 3%, #000 97%, transparent 100%),
    linear-gradient(to bottom, transparent 0%, #000 4%, #000 96%, transparent 100%);
  mask-composite: intersect;
}
.story-photo {
  display: block; width: calc(100% + 48px); margin: -24px -24px 16px;
  border-radius: var(--radius) var(--radius) 0 0;
  aspect-ratio: 3 / 2; object-fit: cover;
}
.yt-thumb {
  display: block; width: calc(100% + 48px); margin: -24px -24px 12px;
  border-radius: var(--radius) var(--radius) 0 0;
  aspect-ratio: 16 / 9; object-fit: cover;
}

/* ── 버튼 (알약·볼드 — ZIGULAB 문법) ── */
.btn {
  display: inline-block; padding: 13px 28px; border-radius: 999px; border: 2px solid var(--c-blue);
  background: var(--c-blue); color: #fff; font-weight: 700; font-size: .95rem; cursor: pointer;
  font-family: inherit; transition: transform .12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn.ghost { background: #fff; color: var(--c-blue); border-color: #fff; }
.hero .btn { background: #fff; color: var(--c-blue); border-color: #fff; }
.hero .btn.ghost { background: transparent; color: #fff; border-color: #fff; }
.btn.outline-white { background: transparent; color: #fff; border: 2px solid #fff; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-more {
  margin: 22px auto 0; display: block; background: #fff; color: var(--c-blue);
  border: 2px solid var(--c-blue); padding: 10px 24px;
}
.btn-more:hover { background: var(--c-blue); color: #fff; }

/* ── 섹션 ── */
section.block { padding: 72px 0; }
section.block.alt { background: var(--c-surface); }
.block h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800; letter-spacing: -.02em; margin: 0 0 6px; }
.block .lead { color: var(--c-muted); margin: 0 0 32px; max-width: 46em; }
.block .lead-en { color: var(--c-muted); font-size: .85rem; font-style: italic; margin: -22px 0 32px; max-width: 46em; }
.section-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.section-head .more-link {
  margin-left: auto; font-size: .84rem; font-weight: 700; color: var(--c-blue);
  padding: 6px 16px; border: 2px solid var(--c-blue); border-radius: 999px;
}
.section-head .more-link:hover { background: var(--c-blue); color: #fff; text-decoration: none; }

/* ── 블루 CTA 밴드 ── */
.cta-band { color: #fff; padding: 76px 0; text-align: center;
  background: linear-gradient(180deg, var(--c-blue-light) 0%, var(--c-blue) 100%); }
.cta-band h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; letter-spacing: -.02em; margin: 0 0 12px; }
.cta-band p { margin: 0 auto 28px; max-width: 40em; opacity: .92; }
.cta-band .btn-row { justify-content: center; }

/* ── 카드 ── */
.cards { display: grid; gap: 18px; align-items: stretch; }
/* 같은 그리드의 모든 행을 동일 높이로 — 카드 규격 통일 */
.cards.c3 { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; }
.cards.c2 { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 1fr; }
.card {
  background: var(--c-bg); border: 1px solid var(--c-line); border-radius: var(--radius);
  padding: 24px; display: flex; flex-direction: column; gap: 8px;
  transition: background .12s ease, border-color .12s ease, box-shadow .12s ease;
}
section.block.alt .card { background: #fff; }
.card h3 { margin: 0; font-size: 1.05rem; font-weight: 700; line-height: 1.45; }
.card .meta { font-size: .8rem; color: var(--c-muted); }
.card .desc { font-size: .92rem; color: var(--c-text); margin: 0; }
.card-link { color: inherit; display: flex; }
.card-link .card { flex: 1 1 auto; width: 100%; }
.card-link:hover { text-decoration: none; }
/* 카드 마지막 줄(태그·분야·공식정보)은 항상 하단에 정렬 — 행 안에서 기준선 통일 */
.card > .meta:last-child, .card > .field:last-child, .card > .official:last-child { margin-top: auto; }
.card-link:hover .card, .card.hover:hover {
  background: #fafafa; border-color: #d9d9d9; box-shadow: 0 2px 10px rgb(0 0 0 / 5%);
}

/* 질문 카드 — 노션풍: 컬러 바 없이 타이포와 여백으로 구분 */
.q-card .q { font-weight: 800; font-size: 1.05rem; line-height: 1.5; }
.q-card .q-en { font-size: .82rem; font-weight: 500; color: var(--c-muted); font-style: italic; line-height: 1.4; margin-top: 2px; }
.q-card .field { font-size: .78rem; font-weight: 600; color: var(--c-muted); }

/* ── 배지·태그 — 노션풍 파스텔 태그 (연한 배경 + 진한 같은 계열 글자) ── */
.badge { display: inline-block; font-size: .72rem; padding: 3px 11px; border-radius: 6px;
  font-weight: 700; vertical-align: middle; }
.badge-happiness { background: #fdeadc; color: #b35410; }
.badge-festival { background: #fbe3ea; color: #b02a4c; }
.badge-inclusive { background: #ddf3e5; color: #0e7a3d; }
.badge-ai { background: #e4e6f5; color: #1d2475; }
.badge-region { background: #f1ead9; color: #77591a; }
.tag { display: inline-block; font-size: .72rem; font-weight: 600; padding: 2px 10px; border-radius: 6px;
  background: var(--c-surface); border: 1px solid var(--c-line); color: var(--c-muted); }
.tag-intl { background: var(--c-accent-soft); color: var(--c-accent); border-color: transparent; }

/* ── 목록 ── */
.pub-list { list-style: none; margin: 0; padding: 0; }
.pub-item { padding: 15px 4px; border-bottom: 1px solid var(--c-line); }
.pub-title { font-weight: 600; }
.pub-meta { font-size: .85rem; color: var(--c-muted); margin-top: 3px; }
.doi { font-size: .8rem; white-space: nowrap; font-weight: 700; }
.doi-search { color: var(--c-muted); font-weight: 600; }
.empty { color: var(--c-muted); padding: 24px 0; }

/* ── 필터 바 ── */
.filterbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  padding: 18px; background: var(--c-surface); border-radius: var(--radius); margin-bottom: 24px; }
.filterbar input[type="search"], .filterbar select {
  padding: 10px 16px; border: 1.5px solid var(--c-line); border-radius: 999px; font-size: .92rem;
  background: #fff; min-width: 130px; font-family: inherit; }
.filterbar input[type="search"] { flex: 1 1 220px; }
.filterbar .count { font-size: .85rem; color: var(--c-muted); margin-left: auto; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 7px 16px; border-radius: 999px; border: 1.5px solid var(--c-line);
  background: #fff; font-size: .85rem; font-weight: 600; cursor: pointer; font-family: inherit; }
.chip.on { background: var(--c-blue); border-color: var(--c-blue); color: #fff; }

/* ── 통계 카드 (블루/라임 교차 — ZIGULAB 통계 문법) ── */
.stats-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px; text-align: center; }
.stat { border-radius: var(--radius); padding: 26px 10px 20px; background: var(--c-surface); }
.stat:nth-child(odd) { background: var(--c-blue); }
.stat:nth-child(odd) .num, .stat:nth-child(odd) .label { color: #fff; }
.stat:nth-child(even) { background: var(--c-blue-tint); }
.stat:nth-child(even) .num, .stat:nth-child(even) .label { color: var(--c-blue); }
.stat .num { font-size: 2.4rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.stat .label { font-size: .8rem; font-weight: 600; margin-top: 4px; }

/* ── 탭 ── */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; border-bottom: none; margin-bottom: 26px; }
.tabs button { padding: 9px 18px; background: #fff; border: 1.5px solid var(--c-line); border-radius: 999px;
  font-size: .9rem; cursor: pointer; color: var(--c-text); font-weight: 700; font-family: inherit; }
.tabs button.on { background: var(--c-blue); border-color: var(--c-blue); color: #fff; }

/* ── 스토리 구조(HOOK→STORY→...) ── */
.grammar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; counter-reset: step; }
.grammar .step { background: #fff; border: 1.5px solid var(--c-line); border-radius: var(--radius); padding: 18px; }
.grammar .step b { display: block; color: var(--c-blue); font-size: .78rem; font-weight: 800; letter-spacing: .08em; }
.grammar .step p { font-size: .84rem; margin: 6px 0 0; color: var(--c-muted); }

/* ── 프로젝트 표현(문제 중심) — 노션풍 플레인 카드 ── */
.project-feature .problem { font-size: 1.05rem; font-weight: 800; line-height: 1.45; }
.project-feature .official { font-size: .8rem; color: var(--c-muted); border-top: 1.5px dashed var(--c-line);
  padding-top: 10px; margin-top: 6px; }

/* ── 타임라인/CV ── */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: grid; grid-template-columns: 110px 1fr; gap: 14px; padding: 11px 0;
  border-bottom: 1.5px dashed var(--c-line); }
.timeline .when { color: var(--c-muted); font-size: .88rem; font-weight: 600; }

/* ── 안내 배너(플레이스홀더) ── */
.placeholder-note { background: #eef1fb; border: 1.5px dashed #8890c9; border-radius: var(--radius);
  padding: 14px 18px; font-size: .88rem; color: #2c3577; margin: 20px 0; }

/* ── 푸터 (라임 밴드 + 블랙 바) ── */
.site-footer { margin-top: 0; }
.footer-band { color: #fff;
  background: linear-gradient(180deg, var(--c-blue) 0%, var(--c-navy-deep) 100%); }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr .7fr; gap: 32px; padding: 56px 20px 48px; align-items: start; }
.footer-msg { font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; line-height: 1.5; margin: 0 0 8px; }
.footer-msg-en { font-size: .82rem; font-weight: 500; color: rgba(255 255 255 / 70%); margin: 0 0 18px; }
.footer-links, .footer-sns { display: flex; flex-direction: column; gap: 9px; font-size: .9rem; }
.footer-links a, .footer-sns a { color: #fff; font-weight: 700; }
.footer-soon { color: rgba(255 255 255 / 45%); font-weight: 600; }
.footer-black { background: var(--c-navy-deep); color: rgba(255 255 255 / 70%); }
.footer-copy { padding: 16px 20px; font-size: .78rem; margin: 0 auto; max-width: var(--wrap); }

/* ── 스크롤 리빌 (오른쪽 → 왼쪽 등장) — 홈 전용
 * 트랜지션은 .in(등장) 상태에만: .reveal 부착 시 즉시 숨김(역방향 애니메이션 방지) ── */
.reveal { opacity: 0; transform: translateX(48px); will-change: opacity, transform; }
.reveal.in { opacity: 1; transform: none;
  transition: opacity .6s ease, transform .6s cubic-bezier(.22, .61, .36, 1); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ── 반응형 ──
 * 1080px: 본문 폭과 같아지는 지점 — 3열을 2열로
 * 950px : 태블릿 세로/큰 폰 — 내비 햄버거 전환(잘림·꺾임 방지), 2열·히어로·푸터 1열
 * 640px : 폰 — 전부 1열, 여백·타이포 축소
 * 420px : 소형 폰 — 미세 조정 */
@media (max-width: 1080px) {
  .cards.c3 { grid-template-columns: repeat(2, 1fr); }
  .grammar { grid-template-columns: repeat(3, 1fr); }
  .footer-inner { grid-template-columns: 1.4fr 1fr; }
  .footer-sns { grid-column: span 2; flex-direction: row; flex-wrap: wrap; gap: 14px; }
}
/* 950px: 로고+메뉴 7개가 실제로 한 줄에 들어가는 최소 폭(실측 927~930px)보다 여유 있게 잡아
   그 아래에서는 항상 햄버거로 전환 — 잘림(overflow)도 2줄 꺾임도 없도록 함.
   로고 크기를 키우면 이 최소 폭도 늘어나므로, 로고를 다시 조정할 경우 재측정 필요. */
@media (max-width: 950px) {
  .hero-grid, .cards.c2, .footer-inner { grid-template-columns: 1fr; }
  .footer-sns { grid-column: auto; }
  .grammar { grid-template-columns: repeat(2, 1fr); }
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; top: 88px; left: 0; right: 0;
    background: var(--c-blue); border-bottom: 3px solid var(--c-navy-deep);
    flex-direction: column; padding: 12px 16px; gap: 8px; }
  .site-nav a { text-align: center; }
  .site-nav.open { display: flex; }
  section.block { padding: 52px 0; }
  .hero { padding: 56px 0 64px; }
  .hero.hero-home { padding: 72px 0 0; }
  .stats-strip { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
}
@media (max-width: 640px) {
  .cards.c3, .grammar { grid-template-columns: 1fr; }
  section.block { padding: 44px 0; }
  .hero { padding: 48px 0 56px; }
  .hero.hero-home { padding: 60px 0 0; }
  .cta-band { padding: 56px 0; }
  .hero-photo-frame { max-width: 92%; }
  .timeline li { grid-template-columns: 1fr; gap: 2px; padding: 12px 0; }
  .timeline .when { font-size: .8rem; }
  .stat .num { font-size: 1.9rem; }
  .footer-inner { padding: 72px 20px 38px; gap: 24px; }
  .filterbar { padding: 14px; }
  .filterbar input[type="search"] { flex-basis: 100%; }
  .filterbar select { flex: 1 1 40%; min-width: 0; }
  .block h2 { font-size: 1.45rem; }
  .brand-name { font-size: 1.3rem; }
  .brand-logo img { width: 36px; height: 36px; }
}
@media (max-width: 420px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .hero.hero-home h1 { font-size: 2rem; }
  .btn { padding: 12px 22px; font-size: .9rem; }
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .site-nav { top: 72px; }
  .header-inner { height: 72px; }
}
