/* HCEE Lab — 연구 소개 사이트 스타일 */
:root {
  --navy: #1F3A5F;
  --navy-soft: #E8EDF4;
  --ink: #1A1F29;
  --muted: #5B6472;
  --cite: #8A929E;
  --line: #DCE1E8;
  --bg: #FFFFFF;
  --bg-alt: #F6F8FB;
  --radius: 8px;
  --nav-h: 60px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); }
body {
  font-family: "Pretendard", "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Malgun Gothic", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  font-size: 16px;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy); }
.container { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .container { padding: 0 32px; } }

/* 출처 표시 (Citation tag) */
.cite {
  font-size: 0.75em;
  color: var(--cite);
  white-space: nowrap;
  font-weight: 400;
}

/* 1. 내비게이션 바 */
.navbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: rgba(255,255,255,0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(160%) blur(6px);
}
.nav-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.logo { font-weight: 800; font-size: 1.15rem; color: var(--navy); text-decoration: none; letter-spacing: -0.01em; }
.nav-links { display: flex; gap: 22px; }
.nav-links a { color: var(--ink); text-decoration: none; font-size: 0.93rem; font-weight: 500; }
.nav-links a:hover { color: var(--navy); }
.nav-links .nav-chat { color: #fff; background: var(--navy); padding: 4px 12px; border-radius: 999px; }
.hamburger { display: none; background: none; border: 0; width: 40px; height: 40px; cursor: pointer; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 5px auto; transition: transform .2s, opacity .2s; }

@media (max-width: 900px) {
  .hamburger { display: block; }
  .nav-links {
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 14px 16px; border-top: 1px solid var(--line); }
  .nav-links .nav-chat { border-radius: 0; padding: 14px 16px; }
  .hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* 2. 히어로 영역 */
.hero { padding: 88px 0 72px; background: linear-gradient(180deg, var(--navy-soft) 0%, #fff 100%); }
.eyebrow { color: var(--navy); font-size: 0.85rem; font-weight: 600; letter-spacing: 0.02em; margin-bottom: 16px; }
.hero h1 { font-size: clamp(1.75rem, 4.6vw, 3rem); line-height: 1.3; letter-spacing: -0.02em; color: var(--ink); }
.hero-sub { margin-top: 20px; max-width: 760px; color: var(--muted); font-size: 1.05rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-note { margin-top: 20px; color: var(--muted); font-size: 0.85rem; }
.br-desk { display: none; }
@media (min-width: 768px) { .br-desk { display: inline; } }

.btn { display: inline-block; padding: 12px 22px; border-radius: var(--radius); font-weight: 600; text-decoration: none; font-size: 0.97rem; border: 1px solid var(--navy); transition: background .15s, color .15s; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: #16304F; }
.btn-secondary { background: #fff; color: var(--navy); }
.btn-secondary:hover { background: var(--navy-soft); }
.btn-doi { margin-top: auto; align-self: flex-start; padding: 7px 14px; font-size: 0.82rem; background: #fff; color: var(--navy); }
.btn-doi:hover { background: var(--navy-soft); }

/* 섹션 공통 */
.section { padding: 80px 0; }
.section-alt { background: var(--bg-alt); }
.section-tag { color: var(--navy); font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.section h2 { font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.35; margin: 6px 0 24px; letter-spacing: -0.01em; }
.prose p { max-width: 820px; margin-bottom: 14px; }
.lead { max-width: 820px; font-size: 1.05rem; margin-bottom: 32px; }
.sub-h { font-size: 1.1rem; margin: 40px 0 16px; }
.sub-h .en, h3 .en { color: var(--muted); font-weight: 500; font-size: 0.85em; }
.small-note { color: var(--muted); font-size: 0.85rem; margin-top: 12px; }

/* 카드·그리드 */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } }
.grid-3 { margin-top: 24px; }
.card h3 { font-size: 1.05rem; margin-bottom: 6px; }

.icon-card .icon { width: 44px; height: 44px; border-radius: var(--radius); background: var(--navy-soft); display: grid; place-items: center; margin-bottom: 14px; }
.icon svg { width: 24px; height: 24px; fill: none; stroke: var(--navy); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* HCEE 4계층 다이어그램 */
.arch-wrap { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .arch-wrap { grid-template-columns: 1.6fr 1fr; align-items: start; } }
.layers { display: flex; flex-direction: column; align-items: stretch; }
.layer { background: #fff; border: 1px solid var(--navy); border-radius: var(--radius); padding: 14px 18px; display: flex; flex-direction: column; gap: 2px; }
.layer-name { font-weight: 700; color: var(--navy); }
.layer-name em { font-style: normal; font-weight: 500; color: var(--muted); font-size: 0.85em; margin-left: 4px; }
.layer-desc { font-size: 0.93rem; }
.layer-base { background: var(--navy); }
.layer-base .layer-name, .layer-base .layer-name em, .layer-base .layer-desc { color: #fff; }
.layer-base .cite { color: #C7D1DE; }
.arrow { text-align: center; color: var(--navy); font-size: 1.3rem; line-height: 1.6; }
.loop-note { margin-top: 10px; font-size: 0.85rem; color: var(--muted); text-align: center; }
.arch-side { display: grid; gap: 16px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--navy); border-radius: var(--radius); padding: 20px; }
.stat-label { font-size: 1.6rem; font-weight: 800; color: var(--navy); line-height: 1.2; }
.stat-title { font-size: 0.85rem; color: var(--muted); margin-bottom: 8px; }

.rule-id { font-size: 0.8rem; font-weight: 700; color: var(--muted); letter-spacing: 0.05em; }
.rule-cond { font-size: 1.35rem; font-weight: 800; color: var(--navy); margin: 2px 0 6px; font-variant-numeric: tabular-nums; }

/* 칩 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-block; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; font-size: 0.88rem; }
.chip b { color: var(--navy); margin-right: 4px; }
.chips.sm .chip { font-size: 0.78rem; padding: 3px 10px; background: var(--bg-alt); }

/* 5. 타임라인 */
.timeline { list-style: none; display: grid; gap: 16px; grid-template-columns: 1fr; position: relative; }
.step { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 20px 20px 64px; }
.step-num { position: absolute; left: 18px; top: 22px; width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 0.95rem; }
.step h3 { font-size: 1.05rem; margin-bottom: 6px; }
.step .q { color: var(--navy); font-weight: 600; font-size: 0.95rem; margin-bottom: 8px; }
.step p { font-size: 0.9rem; margin-bottom: 4px; }
.step b { color: var(--muted); font-weight: 600; margin-right: 4px; }
/* 모바일: 세로 연결선 */
.timeline::before { content: ""; position: absolute; left: 33px; top: 30px; bottom: 30px; width: 2px; background: var(--line); }
@media (min-width: 1000px) {
  .timeline { grid-template-columns: repeat(4, 1fr); }
  .timeline::before { left: 30px; right: 30px; top: 37px; bottom: auto; width: auto; height: 2px; }
  .step { padding: 70px 20px 20px; }
  .step-num { left: 20px; top: 22px; }
}
.journey-note { margin-top: 24px; max-width: 820px; color: var(--muted); }

/* 6. 논문 카드 */
.paper-card { display: flex; flex-direction: column; gap: 10px; }
.badge { align-self: flex-start; background: var(--navy); color: #fff; font-size: 0.78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.journal { color: var(--muted); font-size: 0.85rem; }
.paper-card h3 { font-size: 1.02rem; line-height: 1.45; }
.authors { color: var(--muted); font-size: 0.85rem; margin-top: -6px; }
.paper-card > p { font-size: 0.93rem; }

/* 7. 숫자 타일 */
.num-tile { border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 20px; background: #fff; }
.num { font-size: clamp(1.6rem, 3.2vw, 2.2rem); font-weight: 800; color: var(--navy); line-height: 1.2; margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.num small { font-size: 0.6em; color: var(--muted); font-weight: 500; }
.num-tile > p:last-child { font-size: 0.9rem; }
.fixed-note { margin-top: 16px; padding: 14px 16px; background: var(--bg-alt); border-radius: var(--radius); font-size: 0.88rem; color: var(--muted); }
.factors { list-style: none; counter-reset: f; display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .factors { grid-template-columns: repeat(2, 1fr); } }
.factors li { counter-increment: f; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 14px 52px; position: relative; display: flex; flex-direction: column; }
.factors li::before { content: counter(f); position: absolute; left: 16px; top: 14px; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--navy); color: var(--navy); font-size: 0.8rem; font-weight: 700; display: grid; place-items: center; }
.factors span { color: var(--muted); font-size: 0.85rem; }

/* 8. 연구자 */
.about-card { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.avatar { width: 72px; height: 72px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 1.3rem; flex-shrink: 0; }
.about-card h3 { font-size: 1.25rem; margin-bottom: 10px; }
.about-card dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 0.95rem; }
.about-card dt { color: var(--muted); font-weight: 600; }
.about-card > div:not(.avatar) { flex: 1; min-width: 240px; }
@media (max-width: 480px) { .about-card dl { grid-template-columns: 1fr; gap: 0; } .about-card dd { margin-bottom: 8px; } }

/* 9. 챗봇 안내 */
.chat-teaser > p:first-child { margin-bottom: 16px; }
.chip-q { background: var(--navy-soft); border-color: transparent; color: var(--navy); }

/* 10. 푸터 */
.footer { background: var(--navy); color: #D5DDE8; padding: 40px 0; font-size: 0.88rem; }
.footer p { margin-bottom: 6px; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; }
.footer a { color: #fff; }
