/* ==========================================================
   NCDL — Neuromorphic Computing & Device Lab
   색상·글꼴을 바꾸려면 아래 :root 값만 수정하면 됩니다.
   ========================================================== */

:root {
  --paper: #f4f6f5;
  --surface: #ffffff;
  --ink: #17212c;
  --muted: #56626f;
  --rule: #d4dae0;
  --blue: #0062a8;          /* CAU 블루 (#006CB8) 계열 */
  --blue-ink: #053863;      /* NCDL 로고 남색 */
  --tint: #e6ecf5;

  /* 실리콘 웨이퍼 산화막 간섭색 (히어로 그래프에만 사용) */
  --film-1: #b5844a;
  --film-2: #7b4fa6;
  --film-3: #2f63c8;
  --film-4: #2a9a96;
  --film-5: #c9a632;

  --font-display: "Archivo", "Pretendard Variable", Pretendard, system-ui, sans-serif;
  --font-body: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;

  --wrap: 1120px;
  --measure: 68ch;
  --radius-s: 4px;
  --radius-m: 10px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-feature-settings: "tnum" 0;
  text-rendering: optimizeLegibility;
  word-break: keep-all;          /* 한글 단어 단위 줄바꿈 */
  overflow-wrap: break-word;
}

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

a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--blue-ink); }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 0;
  line-height: 1.12;
  font-stretch: 112%;
  font-variation-settings: "wdth" 112;
}
h2 { font-size: clamp(1.6rem, 3vw, 2.05rem); font-weight: 680; letter-spacing: -0.012em; }
h3 { font-size: 1.22rem; font-weight: 620; letter-spacing: -0.005em; font-variation-settings: "wdth" 104; font-stretch: 104%; }

p { margin: 0 0 1em; }

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

.skip {
  position: absolute; left: 12px; top: -48px; z-index: 50;
  background: var(--ink); color: #fff; padding: 8px 14px; border-radius: var(--radius-s);
}
.skip:focus { top: 12px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; min-height: 68px; }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand svg { flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-short {
  font-family: var(--font-display); font-weight: 760; font-size: 1.2rem;
  font-variation-settings: "wdth" 125; font-stretch: 125%; letter-spacing: 0.01em;
}
.brand-uni { font-size: 0.78rem; color: var(--muted); }

.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.nav a {
  display: block; padding: 8px 11px; border-radius: var(--radius-s);
  color: var(--ink); text-decoration: none; font-size: 0.95rem; font-weight: 500;
}
.nav a:hover { background: var(--tint); color: var(--blue-ink); }
.nav a[aria-current="page"] { color: var(--blue); box-shadow: inset 0 -2px 0 var(--blue); border-radius: 0; }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--rule); border-radius: var(--radius-s);
  padding: 8px 12px; font: inherit; font-size: 0.92rem; color: var(--ink); cursor: pointer;
}

@media (max-width: 920px) {
  .nav-toggle { display: inline-flex; align-items: center; gap: 8px; }
  .nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--rule); display: none; }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; padding: 8px 16px 16px; }
  .nav a { padding: 12px 8px; font-size: 1.02rem; }
  .nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--blue); padding-left: 14px; }
}

/* ---------- Home hero ---------- */

.hero {
  position: relative; overflow: hidden; isolation: isolate; color: #fff;
  background:
    radial-gradient(90% 80% at 88% 8%, #0d5a99 0%, rgba(13, 90, 153, 0) 60%),
    linear-gradient(180deg, #053863 0%, #042a4b 100%);
  padding: clamp(56px, 8vw, 112px) 0 clamp(56px, 7vw, 100px);
}
.hero .wrap { position: relative; z-index: 1; }
.hero-text { max-width: 610px; }
.hero-art {
  position: absolute; z-index: 0; top: 0; right: 0; bottom: 0; width: 68%; pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 40%), linear-gradient(180deg, transparent 0, #000 10%);
  mask-image: linear-gradient(90deg, transparent 0, #000 40%), linear-gradient(180deg, transparent 0, #000 10%);
  -webkit-mask-composite: source-in; mask-composite: intersect;
}
.hero-art svg { display: block; width: 100%; height: 100%; }
.hero-art .bl { stroke: #7fa6cc; stroke-opacity: .22; stroke-width: 5; }
.hero-art .wl-shadow { stroke: #021e36; stroke-opacity: .7; stroke-width: 6; }
.hero-art .wl { stroke: #a9c3de; stroke-opacity: .5; stroke-width: 5; }
.hero-art .arr-cells line { stroke-width: 6; stroke-linecap: round; }
.hero-art .arr-glow { opacity: .85; }
.hero-art .arr-glow line { stroke-width: 9; }
.hero-art .pulse { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; stroke-dasharray: .05 1; stroke-dashoffset: .06; opacity: 0; }
.hero-art .arr-note path { fill: none; stroke: rgba(255,255,255,.7); stroke-width: 1.3; }
.hero-art .arr-note circle { fill: none; stroke: #fff; stroke-width: 1.6; }
.hero-art .arr-note text { fill: rgba(255,255,255,.88); font-family: var(--font-body); font-size: 17px; }

@media (prefers-reduced-motion: no-preference) {
  .hero-art .arr-cells line { animation: cell-on .7s ease-out both; animation-delay: var(--d, 0ms); }
  .hero-art .arr-note { animation: cell-on .8s ease-out 1.6s both; }
  .hero-art .pulse { animation: spike 6.8s linear infinite; }
  @keyframes cell-on { from { opacity: 0; } }
  @keyframes spike {
    0% { stroke-dashoffset: .06; opacity: 0; }
    4% { opacity: .9; }
    42% { opacity: .9; }
    48%, 100% { stroke-dashoffset: -1; opacity: 0; }
  }
}

.hero h1 {
  font-size: clamp(2.3rem, 4.7vw, 4.25rem);
  overflow-wrap: normal;
  font-weight: 740;
  line-height: 0.98;
  letter-spacing: -0.025em;
  font-variation-settings: "wdth" 122; font-stretch: 122%;
  margin-bottom: 26px;
}
.hero h1 { color: #fff; }
.hero .lede { font-size: clamp(1.12rem, 1.6vw, 1.3rem); line-height: 1.55; max-width: 34ch; color: #fff; margin-bottom: 14px; }
.hero .sub { color: rgba(255,255,255,.76); max-width: 50ch; margin-bottom: 30px; }
.hero .affil { color: rgba(255,255,255,.76); font-size: 0.95rem; margin-bottom: 18px; }
.hero .btn-primary { background: #fff; color: var(--blue-ink); border-color: #fff; }
.hero .btn-primary:hover { background: #dce9f6; border-color: #dce9f6; color: var(--blue-ink); }
.hero .btn-ghost { color: #fff; border-color: rgba(255,255,255,.55); }
.hero .btn-ghost:hover { background: rgba(255,255,255,.12); }

.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: 0.98rem;
  text-decoration: none; border: 1px solid var(--blue); transition: background .15s, color .15s;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-ink); border-color: var(--blue-ink); color: #fff; }
.btn-ghost { color: var(--blue); background: transparent; }
.btn-ghost:hover { background: var(--tint); }

@media (max-width: 1180px) { .hero-art .arr-note { display: none; } .hero-art { width: 58%; } }
@media (max-width: 820px) {
  .hero { padding-bottom: 0; }
  .hero-art { position: relative; width: auto; height: 240px; margin-top: 24px; overflow: hidden;
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 40%); mask-image: linear-gradient(180deg, transparent 0, #000 40%); }
  .hero-art svg { position: absolute; right: -30px; bottom: 0; width: 690px; height: 442px; }
}

/* ---------- Recruit strip ---------- */

.recruit { background: var(--blue); color: #fff; }
.recruit .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-top: 18px; padding-bottom: 18px; }
.recruit p { margin: 0; font-weight: 500; }
.recruit a { color: #fff; font-weight: 600; white-space: nowrap; }

/* ---------- Sections ---------- */

.section { padding: clamp(48px, 7vw, 88px) 0; }
.section + .section { border-top: 1px solid var(--rule); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 32px; flex-wrap: wrap; }
.section-head a { font-weight: 600; font-size: 0.95rem; }

/* research rows (home) */
.topic-rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.topic-rows li { border-bottom: 1px solid var(--rule); }
.topic-rows a {
  display: grid; grid-template-columns: 76px minmax(0, 1fr) minmax(0, 1.3fr); gap: 24px; align-items: center;
  padding: 26px 4px; color: inherit; text-decoration: none;
}
.topic-rows a:hover h3 { color: var(--blue); }
.topic-rows p { margin: 0; color: var(--muted); }
.glyph { color: var(--blue); }
@media (max-width: 720px) {
  .topic-rows a { grid-template-columns: 56px 1fr; }
  .topic-rows p { grid-column: 2; }
}

/* two column home */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: clamp(32px, 5vw, 64px); }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* ---------- News list ---------- */

.news-list { list-style: none; margin: 0; padding: 0; }
.news-list li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 16px; padding: 16px 0; border-top: 1px solid var(--rule); }
.news-list li:last-child { border-bottom: 1px solid var(--rule); }
.news-date { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.92rem; padding-top: 2px; }
.news-tag { display: inline-block; font-size: 0.78rem; font-weight: 600; color: var(--blue); background: var(--tint); border-radius: var(--radius-s); padding: 1px 7px; margin-right: 8px; vertical-align: 1px; }
.news-list p { margin: 0; }

/* ---------- Publications ---------- */

.pub-list { list-style: none; margin: 0; padding: 0; }
.pub {
  display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px;
  padding: 18px 0; border-top: 1px solid var(--rule);
}
.pub-no { font-family: var(--font-display); font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.95rem; padding-top: 2px; text-align: right; }
.pub-title { font-weight: 600; line-height: 1.42; margin-bottom: 4px; color: var(--ink); }
.pub-title a { color: inherit; text-decoration: none; background-image: linear-gradient(var(--blue), var(--blue)); background-size: 0 1px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size .2s; }
.pub-title a:hover { background-size: 100% 1px; color: var(--blue-ink); }
.pub-authors { color: var(--muted); font-size: 0.95rem; margin-bottom: 2px; }
.pub-authors strong { color: var(--ink); font-weight: 650; }
.pub-venue { font-size: 0.95rem; }
.pub-venue em { font-style: italic; }
.pub-note { color: var(--blue); font-size: 0.85rem; margin-left: 8px; white-space: nowrap; }
.pub-type { font-size: 0.78rem; font-weight: 600; color: var(--muted); border: 1px solid var(--rule); border-radius: var(--radius-s); padding: 0 6px; margin-left: 8px; }

.year-group h3 {
  font-size: 1.6rem; font-weight: 700; color: var(--blue);
  font-variation-settings: "wdth" 120; font-stretch: 120%;
  padding: 28px 0 10px; position: sticky; top: 68px; background: var(--paper); z-index: 2;
}
.year-group:first-child h3 { padding-top: 4px; }

.pub-tools { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--rule); }
.tab {
  background: none; border: 0; font: inherit; font-weight: 600; color: var(--muted);
  padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab[aria-selected="true"] { color: var(--blue); border-bottom-color: var(--blue); }
.tab .count { font-weight: 500; font-size: 0.85rem; margin-left: 4px; color: var(--muted); }
.search {
  font: inherit; font-size: 0.95rem; padding: 9px 14px; min-width: 240px;
  border: 1px solid var(--rule); border-radius: 999px; background: var(--surface); color: var(--ink);
}
.legend { color: var(--muted); font-size: 0.88rem; margin: -12px 0 24px; }

/* ---------- Page header ---------- */

.page-head { padding: clamp(40px, 6vw, 72px) 0 clamp(28px, 4vw, 44px); border-bottom: 1px solid var(--rule); }
.page-head h1 {
  font-size: clamp(2.2rem, 4.6vw, 3.4rem); font-weight: 720; letter-spacing: -0.02em;
  font-variation-settings: "wdth" 120; font-stretch: 120%; margin-bottom: 12px;
}
.page-head p { color: var(--muted); max-width: var(--measure); margin: 0; font-size: 1.08rem; }

/* ---------- People ---------- */

.pi { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: clamp(28px, 5vw, 56px); }
@media (max-width: 760px) { .pi { grid-template-columns: 1fr; } .pi .avatar { max-width: 200px; } }
.avatar {
  aspect-ratio: 1; width: 100%; border-radius: var(--radius-m); overflow: hidden;
  background: var(--tint); display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; color: var(--blue); font-size: 2.6rem;
  font-variation-settings: "wdth" 125; font-stretch: 125%;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.pi-name { font-size: clamp(1.8rem, 3vw, 2.3rem); font-weight: 700; margin-bottom: 2px; }
.pi-name span { font-family: var(--font-body); font-weight: 500; font-size: 0.6em; color: var(--muted); margin-left: 10px; letter-spacing: 0; }
.pi-title { color: var(--muted); margin-bottom: 18px; }
.contact-lines { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 4px; font-size: 0.97rem; }
.contact-lines span { color: var(--muted); display: inline-block; min-width: 64px; }
.bio { max-width: var(--measure); }

.cv { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 32px 48px; margin-top: 36px; }
.cv h3 { margin-bottom: 12px; }
.cv ul { list-style: none; margin: 0; padding: 0; }
.cv li { display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 12px; padding: 8px 0; border-top: 1px solid var(--rule); font-size: 0.97rem; }
.cv .yrs { color: var(--muted); font-variant-numeric: tabular-nums; }

.group { margin-top: 56px; }
.group > h2 { margin-bottom: 22px; }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 28px; }
.person .avatar { font-size: 2rem; margin-bottom: 14px; }
.person h3 { margin-bottom: 2px; }
.person .ko { color: var(--muted); font-size: 0.92rem; margin-bottom: 8px; }
.person dl { margin: 0; font-size: 0.92rem; }
.person dt { color: var(--muted); font-size: 0.82rem; margin-top: 6px; }
.person dd { margin: 0; }

.alumni-list { list-style: none; padding: 0; margin: 0; }
.alumni-list li { display: grid; grid-template-columns: minmax(0, 1fr) 140px minmax(0, 1fr); gap: 16px; padding: 12px 0; border-top: 1px solid var(--rule); }
@media (max-width: 640px) { .alumni-list li { grid-template-columns: 1fr; gap: 2px; } }

.empty {
  border: 1px dashed var(--rule); border-radius: var(--radius-m); padding: 28px; background: var(--surface);
  max-width: 640px;
}
.empty p:last-child { margin-bottom: 0; }

/* ---------- Research ---------- */

.topic { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.topic + .topic { margin-top: 0; }
.topic h2 { margin-bottom: 6px; }
.topic .ko { color: var(--muted); margin-bottom: 20px; }
.topic-desc { max-width: var(--measure); }
.chips { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { background: var(--surface); border: 1px solid var(--rule); border-radius: 999px; padding: 4px 12px; font-size: 0.88rem; }
.topic-art { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-m); aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; }
.topic-art img { width: 100%; height: 100%; object-fit: cover; }
.topic-papers { grid-column: 1 / -1; }
.topic-papers h3 { font-size: 1rem; margin-bottom: 4px; color: var(--muted); font-weight: 600; }
.topic-papers .pub { grid-template-columns: 44px minmax(0, 1fr); padding: 12px 0; }
@media (max-width: 820px) { .topic { grid-template-columns: 1fr; } .topic-art { max-width: 480px; } }

/* ---------- Join ---------- */

.join-lead { font-size: 1.15rem; max-width: var(--measure); }
.join-lead-en { color: var(--muted); max-width: var(--measure); }
.join-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px 64px; }
@media (max-width: 760px) { .join-grid { grid-template-columns: 1fr; } }
.join-grid h2 { font-size: 1.45rem; margin-bottom: 14px; }
.ticks { list-style: none; margin: 0; padding: 0; }
.ticks li { padding: 10px 0 10px 26px; border-top: 1px solid var(--rule); position: relative; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: 19px; width: 12px; height: 2px; background: var(--blue); }
.positions { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.positions li { padding: 14px 0; border-top: 1px solid var(--rule); }
.positions strong { display: block; font-weight: 650; }
.positions span { color: var(--muted); font-size: 0.97rem; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; padding: 12px 0 12px 40px; border-top: 1px solid var(--rule); position: relative; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 11px; width: 26px; height: 26px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 0.85rem; font-weight: 700; display: grid; place-items: center; }
.apply-box { margin-top: 28px; padding: 28px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-m); display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; justify-content: space-between; }
.apply-box p { margin: 0; }
.faq details { border-top: 1px solid var(--rule); padding: 4px 0; }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; padding: 12px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--blue); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--muted); max-width: var(--measure); }

/* ---------- Contact ---------- */

.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: clamp(28px, 5vw, 56px); align-items: start; }
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-grid dl { margin: 0; }
.contact-grid dt { color: var(--muted); font-size: 0.88rem; margin-top: 18px; }
.contact-grid dt:first-child { margin-top: 0; }
.contact-grid dd { margin: 2px 0 0; }
.map { width: 100%; aspect-ratio: 4 / 3; border: 1px solid var(--rule); border-radius: var(--radius-m); background: var(--tint); }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--rule); padding: 40px 0 48px; margin-top: 24px; font-size: 0.92rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 40px; justify-content: space-between; }
.site-footer strong { color: var(--ink); font-weight: 650; }
.site-footer p { margin: 0 0 4px; }

/* ---------- Status ---------- */

.load-error { margin: 48px auto; max-width: 720px; padding: 24px; border: 1px solid #e3b4b4; background: #fff6f6; border-radius: var(--radius-m); color: #6b1f1f; }
.load-error code { background: #fde8e8; padding: 1px 5px; border-radius: 3px; }
.loading { padding: 80px 0; color: var(--muted); text-align: center; }

@media print {
  .site-header, .recruit, .site-footer, .pub-tools { display: none; }
  body { background: #fff; }
}

sub { font-size: 0.72em; line-height: 0; vertical-align: -0.22em; }

/* ---------- Publication status (in progress) ---------- */
.pub-status {
  display: inline-block; font-size: 0.78rem; font-weight: 650; border-radius: 999px;
  padding: 1px 10px; margin-bottom: 6px; background: #eceff3; color: #475260;
}
.pub-status[data-status="submitted"]      { background: #e4ecfa; color: #1d4fa3; }
.pub-status[data-status="under-review"]   { background: #fbf0d9; color: #8a5a00; }
.pub-status[data-status="revision"],
.pub-status[data-status="major-revision"],
.pub-status[data-status="minor-revision"] { background: #efe6f7; color: #6a3d96; }
.pub-status[data-status="accepted"]       { background: #e0f2e9; color: #1f6b45; }
.in-progress .pub-no { visibility: hidden; }

/* ==========================================================
   Themes — data/site.yml 의 design.theme 로 선택
   ========================================================== */



/* white: 흰 바탕, 또렷한 CAU 블루 */
[data-theme="white"] {
  --paper: #ffffff;
  --tint: #edf2fa;
  --rule: #e3e7ec;
}
[data-theme="white"] .section:nth-of-type(even) { background: #f7f9fc; }

/* navy: 남색 첫 화면 + 웨이퍼 다이 격자 */
[data-theme="navy"] {
  --paper: #f5f7fa;
  --navy: #053863;
  --navy-2: #0a4a80;
}
[data-theme="navy"] .site-header { background: color-mix(in srgb, var(--navy) 94%, transparent); border-bottom-color: rgba(255,255,255,.08); }
[data-theme="navy"] .site-header .brand,
[data-theme="navy"] .nav a { color: #fff; }
[data-theme="navy"] .brand-uni { color: rgba(255,255,255,.65); }
[data-theme="navy"] .nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
[data-theme="navy"] .nav a[aria-current="page"] { color: #fff; box-shadow: inset 0 -2px 0 #8fb4ff; }
[data-theme="navy"] .nav-toggle { color: #fff; border-color: rgba(255,255,255,.3); }
[data-theme="navy"] .brand svg rect { fill: #fff; }
[data-theme="navy"] .brand svg path { stroke: var(--navy); }
@media (max-width: 920px) { [data-theme="navy"] .nav { background: var(--navy); } }

[data-theme="navy"] .hero,
[data-theme="navy"] .page-head {
  background-color: var(--navy);
  background-image:
    radial-gradient(1200px 500px at 85% 40%, rgba(80,130,230,.28), transparent 60%),
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: auto, 44px 44px, 44px 44px;
  border-bottom: 0;
}
[data-theme="navy"] .hero h1,
[data-theme="navy"] .hero .lede,
[data-theme="navy"] .page-head h1 { color: #fff; }
[data-theme="navy"] .hero .sub,
[data-theme="navy"] .hero .affil,
[data-theme="navy"] .page-head p,
[data-theme="navy"] .loop-figure figcaption { color: rgba(255,255,255,.72); }
[data-theme="navy"] .loop-axis { stroke: rgba(255,255,255,.7); }
[data-theme="navy"] .loop-tick,
[data-theme="navy"] .loop-legend text { fill: rgba(255,255,255,.7); }
[data-theme="navy"] .hero .btn-primary { background: #fff; color: var(--navy); border-color: #fff; }
[data-theme="navy"] .hero .btn-primary:hover { background: #dfe8fb; }
[data-theme="navy"] .hero .btn-ghost { color: #fff; border-color: rgba(255,255,255,.55); }
[data-theme="navy"] .hero .btn-ghost:hover { background: rgba(255,255,255,.1); }
[data-theme="navy"] .recruit { background: var(--navy-2); border-top: 1px solid rgba(255,255,255,.08); }
[data-theme="navy"] .site-footer { background: var(--navy); color: rgba(255,255,255,.7); border-top: 0; margin-top: 0; }
[data-theme="navy"] .site-footer strong { color: #fff; }
[data-theme="navy"] .site-footer a { color: #b9cffc; }

/* 홈 첫 화면 배경 사진 (design.hero_image) — 모든 테마 공통 */
.hero.has-image {
  background: linear-gradient(90deg, rgba(9,22,46,.9) 0%, rgba(9,22,46,.7) 50%, rgba(9,22,46,.25) 100%), var(--hero-photo) center / cover no-repeat;
  padding: clamp(80px, 12vw, 160px) 0;
}
.hero.has-image .wrap { grid-template-columns: minmax(0, 1fr); }
.hero.has-image .loop-figure { display: none; }
.hero.has-image h1, .hero.has-image .lede { color: #fff; }
.hero.has-image .sub, .hero.has-image .affil { color: rgba(255,255,255,.78); }
.hero.has-image .btn-primary { background: #fff; color: var(--blue-ink); border-color: #fff; }
.hero.has-image .btn-ghost { color: #fff; border-color: rgba(255,255,255,.6); }


/* ---------- Logos ---------- */
.brand { gap: 14px; }
.brand-logo { height: 40px; width: auto; display: block; }
.brand-sep { width: 1px; height: 30px; background: var(--rule); }
.brand-uni-logo { height: 34px; width: auto; display: block; margin-top: -2px; }
[data-theme="navy"] .brand-sep { background: rgba(255,255,255,.25); }
@media (max-width: 480px) { .brand-logo { height: 34px; } .brand-uni-logo { height: 28px; } }

.site-footer .wrap { align-items: flex-start; }
.footer-uni { height: 34px; width: auto; margin-top: 2px; }
.footer-text { margin-right: auto; }

/* ---------- People: portrait ---------- */
.pi .avatar { aspect-ratio: 4 / 5; }
.pi .avatar img { object-position: center 20%; }

/* ---------- Research: methods & figures ---------- */
.topic-jump { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 28px; }
.topic-jump a {
  text-decoration: none; font-weight: 600; font-size: 0.95rem; padding: 8px 16px;
  border: 1px solid var(--rule); border-radius: 999px; background: var(--surface); color: var(--ink);
}
.topic-jump a:hover { border-color: var(--blue); color: var(--blue); }
.methods-title { font-size: 1.05rem; margin: 26px 0 8px; }
.methods li { font-size: 0.98rem; }

.fig { margin: 0; }
.fig-img {
  background: #fff; border: 1px solid var(--rule); border-radius: var(--radius-m);
  padding: 14px; display: grid; place-items: center; overflow: hidden;
}
.fig-img img { max-width: 100%; height: auto; }
.fig figcaption { font-size: 0.9rem; color: var(--muted); margin-top: 10px; line-height: 1.5; max-width: 62ch; }
.fig-cite { display: block; margin-top: 4px; color: var(--ink); font-size: 0.88rem; }
.fig-cite a { color: inherit; }
.fig-hero .fig-img img { width: 100%; }
.fig-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 28px; margin-top: 36px; }
.fig-row .fig-img { min-height: 240px; }
.fig-row .fig-img img { max-height: 300px; width: auto; }
.topic { align-items: start; }

/* 사진 없는 구성원: 작은 원형 이니셜 + 이름 */
.people-grid:has(.person.compact) { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px 28px; }
.person.compact { display: grid; grid-template-columns: 64px minmax(0, 1fr); column-gap: 16px; align-items: center; padding: 14px 0; border-top: 1px solid var(--rule); }
.person.compact .avatar { width: 64px; height: 64px; border-radius: 50%; font-size: 1.15rem; margin: 0; }
.person.compact h3 { margin: 0; font-size: 1.1rem; }
.person.compact .ko { margin: 2px 0 0; }


/* ==========================================================
   Research page (overview, why / what / strategy, diagrams)
   ========================================================== */
.lead { font-size: 1.12rem; line-height: 1.6; max-width: var(--measure); }
.overview .ov-text { margin-bottom: 28px; }
.overview h2 { margin-bottom: 14px; }

.diagram { margin: 0; }
.diagram-art {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-m);
  padding: clamp(12px, 2.5vw, 28px);
}
.diagram-art svg, .diagram-art img { display: block; width: 100%; height: auto; }
.diagram figcaption { font-size: 0.9rem; color: var(--muted); margin-top: 10px; max-width: 72ch; }
.diagram-stack .diagram-art { max-width: 920px; }
.overview .topic-jump { padding-top: 24px; }

.topic-sec .topic-head { margin-bottom: 28px; }
.topic-sec .topic-head h2 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); margin-bottom: 4px; }
.topic-sec .topic-head .ko { color: var(--muted); margin-bottom: 14px; }
.why-what { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 56px; margin-bottom: 32px; }
.why-what h3, .strategy h3, .selected-work h3 { font-size: 1.05rem; margin-bottom: 8px; color: var(--blue-ink); }
.why-what p { max-width: 60ch; }
.why-what .ticks li { font-size: 0.98rem; }
@media (max-width: 820px) { .why-what { grid-template-columns: 1fr; } }

.strategy {
  margin-top: 28px; padding: clamp(20px, 3vw, 36px); border-radius: var(--radius-m);
  background: var(--tint);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px 48px;
}
.strategy p { margin: 0; max-width: 60ch; }
.strategy-points { list-style: none; margin: 0; padding: 0; counter-reset: sp; }
.strategy-points li {
  position: relative; padding: 10px 0 10px 40px; border-top: 1px solid color-mix(in srgb, var(--blue) 18%, transparent);
  font-size: 0.98rem;
}
.strategy-points li:first-child { border-top: 0; padding-top: 2px; }
.strategy-points li::before {
  counter-increment: sp; content: counter(sp);
  position: absolute; left: 0; top: 9px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--blue-ink); color: #fff; font-size: 0.82rem; font-weight: 700; display: grid; place-items: center;
}
.strategy-points li:first-child::before { top: 1px; }
.strategy .diagram-inset { grid-column: 1 / -1; margin-top: 8px; }
@media (max-width: 820px) { .strategy { grid-template-columns: 1fr; } }

.topic-sec .chips { margin-top: 24px; }
.selected-work { margin-top: 36px; }
.work-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.work { margin: 0; }
.work-img {
  background: #fff; border: 1px solid var(--rule); border-radius: var(--radius-m);
  height: 190px; padding: 12px; display: grid; place-items: center; overflow: hidden;
}
.work-img img { width: 100%; height: 100%; object-fit: contain; }
.work figcaption { font-size: 0.88rem; color: var(--muted); margin-top: 8px; line-height: 1.5; }

/* 좁은 화면: 개념도는 글자가 읽히는 크기로 두고 옆으로 밀어서 보기 */
@media (max-width: 700px) {
  .diagram-art { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .diagram-art svg { min-width: 680px; }
  .diagram figcaption::after { content: " Swipe the figure sideways to see all of it."; }
}


/* ---------- Publication tags: lead author, cover, IF / JCR ---------- */
.pub-tags, .work-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.work-tags { margin: 0 0 6px; }
.badge, .metric {
  display: inline-flex; align-items: center; font-size: 0.78rem; font-weight: 650; line-height: 1;
  border-radius: 999px; padding: 5px 10px; white-space: nowrap;
}
.badge-first { background: var(--blue-ink); color: #fff; }
.badge-corr { background: #fff; color: var(--blue-ink); box-shadow: inset 0 0 0 1.5px var(--blue-ink); }
.badge-cover { background: #f3e6b8; color: #6e5300; }
.metrics { display: contents; }
.metric-if { background: var(--tint); color: var(--blue-ink); }
.metric-jcr { background: #eceff3; color: #475260; }
.metric-jcr[data-tier="high"] { background: #dff0ee; color: #1d6b67; }
.metric-jcr[data-tier="top"] { background: #2a9a96; color: #fff; }
.pub-lead .pub-no { color: var(--blue-ink); font-weight: 700; }
.pub-filters { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 0.93rem; cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--blue-ink); }

.topic-lead { margin-bottom: 28px; }
.work-cap { display: block; }

.lab-author { text-decoration: underline; text-decoration-color: var(--blue); text-decoration-thickness: 1.5px; text-underline-offset: 3px; color: var(--ink); }


/* ---------- Footer: navy, bookends the hero ---------- */
.site-footer { background: #042a4b; color: rgba(255,255,255,.72); border-top: 0; margin-top: 0; }
.site-footer strong { color: #fff; }
.site-footer a { color: #cfe1f5; }


/* ---------- Sub-page header: faint crossbar lattice ---------- */
.page-head { position: relative; overflow: hidden; }
.page-head .wrap { position: relative; z-index: 1; }
.page-head::after {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: min(48%, 620px); pointer-events: none;
  background:
    repeating-linear-gradient(26.565deg, transparent 0 21px, rgba(5, 56, 99, .09) 21px 23px),
    repeating-linear-gradient(153.435deg, transparent 0 21px, rgba(5, 56, 99, .09) 21px 23px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000); mask-image: linear-gradient(90deg, transparent, #000);
}
[data-theme="navy"] .page-head::after { display: none; }


/* ==========================================================
   Design B (site.yml design.version: "b", 또는 주소 뒤 ?design=b 로 미리보기)
   홈 첫 화면: 3D 적층 칩 위 메모리 어레이에서 신경망이 자라나는 그림
   ========================================================== */
.hero-art-b { -webkit-mask-image: none; mask-image: none; left: 0; width: auto; }
.hero-art-b > svg, .hero-art-b .hero-notes svg { position: absolute; right: 0; bottom: 0; width: 100%; height: 100%; }
.hero-art .hero-notes { position: absolute; inset: 0; }
.hero-art .chip-top { fill: #9cc4ee; fill-opacity: .05; }
.hero-art .net-edges line { stroke-linecap: round; }
.hero-art .net-node, .hero-art .net-out { fill: #f1f7ff; stroke: #0a3c66; stroke-width: 1.5; }
.hero-art .net-glow { opacity: .5; fill: #bcd9ff; }
.hero-art .net-drops line { stroke: rgba(255,255,255,.45); stroke-width: 1.2; stroke-dasharray: 3 4; }
.hero-art .net-w text { fill: rgba(255,255,255,.8); font-family: var(--font-display); font-style: italic; font-size: 17px; }
.hero-art .strip-a { fill: #fff; fill-opacity: .055; }
.hero-art .strip-b { fill: #fff; fill-opacity: 0; }
.hero-art .signal { fill: none; stroke: #fff; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: .07 1; stroke-dashoffset: .08; opacity: 0; }
.hero-art .note-title { font-weight: 650; fill: #fff; }
@media (prefers-reduced-motion: no-preference) {
  .hero-art .net { animation: cell-on 1s ease-out 1.1s both; }
  .hero-art .hero-notes .arr-note { animation: cell-on .8s ease-out 2s both; }
  .hero-art .signal { animation: climb 7s cubic-bezier(.4, 0, .6, 1) infinite; }
  .hero-art .net-out { animation: breathe 3.5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
  @keyframes climb {
    0% { stroke-dashoffset: .08; opacity: 0; }
    5% { opacity: .95; }
    34% { opacity: .95; }
    40%, 100% { stroke-dashoffset: -1; opacity: 0; }
  }
  @keyframes breathe { 50% { transform: scale(1.18); } }
}
@media (max-width: 1340px) { .hero-art .hero-notes { display: none; } }
@media (max-width: 1100px) { .hero-art-b { top: 20%; } }
@media (max-width: 960px) {
  [data-design="b"] .hero { padding-bottom: 0; }
  .hero-art-b { position: relative; top: auto; height: 330px; margin-top: 12px; overflow: hidden; }
  .hero-art-b > svg { width: 175%; }
  .hero-art .net-w { display: none; }
}

.design-preview {
  position: fixed; left: 16px; bottom: 16px; z-index: 40; padding: 9px 15px; border-radius: 999px;
  background: #fff; color: var(--blue-ink); font-size: .88rem; font-weight: 600; text-decoration: none;
  box-shadow: 0 6px 24px rgba(4, 42, 75, .28), inset 0 0 0 1px var(--rule);
}
