/* Layout idea: calm editorial lab site; wide hero canvas, then clean single-column sections. */
/* Current palette: W6. White & Charcoal·Gold (light) + W6 Dark: Charcoal·Gold (dark). Other saved palettes: see PALETTES.md */
:root {
  --ink: #1a1a1c; --text: #3a3a3e; --muted: #707075; --bg: #fcfcfb; --surface: #ffffff;
  --line: #e7e5e1; --primary: #26262a; --primary-soft: #f1efea; --accent: #a16207; --accent-soft: #f8efdc;
  --fill: #26262a; --fill-hover: #000000; --on-accent: #ffffff;
  --hero-bg: #f6f4ef; --hero-rgb: 246, 244, 239; --hero-line-rgb: 201, 180, 138; --hero-dot-rgb: 161, 98, 7;
  --hero-eyebrow: #a16207; --hero-lead: #3a3a3e; --hero-title: #1a1a1c; --hero-ghost: #1a1a1c; --hero-ghost-line: #e7e5e1; --hero-ghost-hover: #f1efea;
  --card-top: #ffffff; --card-bot: #f8f6f1; --glow-rgb: 161, 98, 7; --card-accent: #a16207; --card-text: #3a3a3e; --card-sub: #707075; --card-title: #1a1a1c; --card-body: #3a3a3e;
  --card-shadow: 0 1px 2px rgba(0,0,0,.05), 0 10px 30px rgba(161,98,7,.10);
  --hero-ink: #eef4fa;
  --font-display: "Manrope", "Noto Sans KR", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", "Noto Sans KR", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(26, 26, 28, .06), 0 8px 24px rgba(26, 26, 28, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #f3f1ec; --text: #d2cfc8; --muted: #9a968e; --bg: #121214; --surface: #1b1b1e;
    --line: #2e2d2b; --primary: #e8c47e; --primary-soft: #2a261d; --accent: #e0b45a; --accent-soft: #2f2716;
    --fill: #d4a64a; --fill-hover: #e8c47e; --on-accent: #16161a;
    --hero-bg: #161618; --hero-rgb: 22, 22, 24; --hero-line-rgb: 201, 180, 138; --hero-dot-rgb: 224, 180, 90;
    --hero-eyebrow: #e8c47e; --hero-lead: #d2cfc8; --hero-title: #ffffff; --hero-ghost: #ffffff; --hero-ghost-line: rgba(255,255,255,.35); --hero-ghost-hover: rgba(255,255,255,.1);
    --card-top: #232326; --card-bot: #151517; --glow-rgb: 224, 180, 90; --card-accent: #e0b45a; --card-text: #d2cfc8; --card-sub: #9a968e; --card-title: #ffffff; --card-body: #e2dfd8;
    --card-shadow: 0 0 0 1px rgba(224,180,90,.06), 0 14px 40px rgba(224,180,90,.12);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --ink: #f3f1ec; --text: #d2cfc8; --muted: #9a968e; --bg: #121214; --surface: #1b1b1e;
    --line: #2e2d2b; --primary: #e8c47e; --primary-soft: #2a261d; --accent: #e0b45a; --accent-soft: #2f2716;
    --fill: #d4a64a; --fill-hover: #e8c47e; --on-accent: #16161a;
    --hero-bg: #161618; --hero-rgb: 22, 22, 24; --hero-line-rgb: 201, 180, 138; --hero-dot-rgb: 224, 180, 90;
    --hero-eyebrow: #e8c47e; --hero-lead: #d2cfc8; --hero-title: #ffffff; --hero-ghost: #ffffff; --hero-ghost-line: rgba(255,255,255,.35); --hero-ghost-hover: rgba(255,255,255,.1);
    --card-top: #232326; --card-bot: #151517; --glow-rgb: 224, 180, 90; --card-accent: #e0b45a; --card-text: #d2cfc8; --card-sub: #9a968e; --card-title: #ffffff; --card-body: #e2dfd8;
    --card-shadow: 0 0 0 1px rgba(224,180,90,.06), 0 14px 40px rgba(224,180,90,.12);
    color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16.5px/1.65 var(--font-body); }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); line-height: 1.2; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0; }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
.ko { font-family: "Noto Sans KR", var(--font-body); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-header .wrap { width: min(1320px, 100% - 40px); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 38px; height: 38px; flex: none; }
.bm-membrane { fill: var(--primary); }
.bm-pore { fill: var(--surface); }
.bm-small { fill: var(--accent); }
.bm-big { fill: none; stroke: var(--primary); stroke-width: 2; }
.brand-text { display: grid; line-height: 1.15; }
.brand-name { font: 800 1.02rem var(--font-display); letter-spacing: -.01em; white-space: nowrap; }
.brand-sub { font-size: .78rem; color: var(--muted); }
.site-nav { display: flex; gap: 2px; flex-wrap: nowrap; }
.site-nav a { display: block; padding: 8px 9px; border-radius: 8px; text-decoration: none; color: var(--text); font: 600 .9rem var(--font-display); white-space: nowrap; }
.site-nav a:hover { background: var(--primary-soft); color: var(--primary); }
.site-nav a[aria-current="page"] { color: var(--primary); background: var(--primary-soft); }
.site-nav .nav-join { color: var(--accent); }
.site-nav { align-items: center; }
.nav-group { position: relative; }
.nav-group > a::after { content: " ▾"; font-size: .7em; opacity: .7; }
.submenu { display: none; position: absolute; top: 100%; left: 0; min-width: 210px; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px; box-shadow: var(--shadow); z-index: 30; }
.nav-group:hover .submenu, .nav-group:focus-within .submenu { display: flex; }
.submenu a { white-space: nowrap; }
.nav-toggle { display: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px; padding: 8px 12px; font: 600 .9rem var(--font-display); cursor: pointer; }
@media (max-width: 1240px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch; max-height: calc(100vh - 68px); overflow-y: auto; background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 20px 16px; }
  .site-nav.open { display: flex; }
  .nav-group .submenu { position: static; display: flex; box-shadow: none; border: 0; padding: 0 0 0 14px; background: transparent; min-width: 0; }
}

/* Hero */
.hero { position: relative; background: var(--hero-bg); color: var(--hero-ink); overflow: hidden; }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-inner { position: relative; padding: 88px 0 80px; display: grid; gap: 18px; max-width: 680px; }
.hero h1 { color: var(--hero-title); }
.hero .eyebrow { color: var(--hero-eyebrow); }
.hero p.lead { font-size: 1.12rem; color: var(--hero-lead); max-width: 58ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.hero .btn-ghost { color: var(--hero-ghost); border-color: var(--hero-ghost-line); }
.hero .btn-ghost:hover { background: var(--hero-ghost-hover); color: var(--hero-ghost); }

.eyebrow { font: 700 .78rem var(--font-display); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 8px; font: 700 .95rem var(--font-display); text-decoration: none; border: 1px solid transparent; cursor: pointer; background: none; }
.btn-primary { background: var(--fill); color: var(--on-accent); }
.btn-primary:hover { background: var(--fill-hover); color: var(--on-accent); }
.btn-ghost { border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--primary-soft); color: var(--primary); }
.btn-text { color: var(--muted); padding-inline: 8px; }
.btn-text:hover { color: var(--ink); }

/* Sections */
.section { padding: 72px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { display: grid; gap: 10px; margin-bottom: 32px; max-width: 70ch; }
.section-head p { color: var(--muted); }
.page-head { padding: 56px 0 8px; display: grid; gap: 10px; }
.page-head p { color: var(--muted); max-width: 65ch; }

.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; display: grid; gap: 12px; align-content: start; }
.card .ko-sub { color: var(--muted); font-size: .9rem; font-family: "Noto Sans KR", var(--font-body); }
.card ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.card .num { font: 800 .85rem var(--font-display); color: var(--accent); letter-spacing: .08em; }
.link-arrow { font: 700 .92rem var(--font-display); text-decoration: none; }

.split { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 28px; } }

.pi-card { display: grid; grid-template-columns: 200px 1fr; gap: 32px; align-items: start; }
.pi-card img { border-radius: var(--radius); aspect-ratio: 4/5; object-fit: cover; width: 100%; height: auto; background: var(--primary-soft); }
@media (max-width: 640px) { .pi-card { grid-template-columns: 1fr; } .pi-card img { max-width: 200px; } }
.pi-meta { display: grid; gap: 10px; }
.pi-meta .role { color: var(--muted); }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.timeline .when { font: 700 .9rem var(--font-display); color: var(--primary); font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { .timeline li { grid-template-columns: 1fr; gap: 2px; } }

.news-list { list-style: none; margin: 0; padding: 0; display: grid; }
.news-list li { display: grid; grid-template-columns: 80px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.news-list .when { font: 700 .9rem var(--font-display); color: var(--accent); font-variant-numeric: tabular-nums; }

.member-group { margin-bottom: 40px; }
.member-group h3 { margin-bottom: 16px; }
.members { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.member { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: grid; gap: 8px; align-content: start; }
.avatar { width: 72px; height: 72px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font: 800 1.4rem var(--font-display); object-fit: cover; }
.member .name { font: 700 1.08rem var(--font-display); color: var(--ink); }
.member .name span { font: 500 .9rem "Noto Sans KR", var(--font-body); color: var(--muted); margin-left: 6px; }
.member .title { color: var(--accent); font-weight: 600; font-size: .92rem; }
.member .small { font-size: .9rem; color: var(--muted); }
.member.open { border-style: dashed; background: transparent; }

/* Publications */
.pub-tools { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 24px; }
.pub-tools input { flex: 1 1 260px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 6px 13px; font: 600 .85rem var(--font-display); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--fill); border-color: var(--fill); color: var(--on-accent); }
.pub-year { font: 800 1.4rem var(--font-display); color: var(--ink); padding: 22px 0 6px; font-variant-numeric: tabular-nums; }
.pubs { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.pub { padding: 14px 0 14px 18px; border-left: 2px solid var(--line); margin-left: 4px; display: grid; gap: 4px; }
.pub:hover { border-left-color: var(--accent); }
.pub .t { color: var(--ink); font-weight: 600; }
.pub .a { font-size: .93rem; }
.pub .a b { color: var(--ink); }
.pub .v { font-size: .93rem; color: var(--muted); }
.pub .v i { color: var(--text); }
.tag { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font: 700 .74rem var(--font-display); vertical-align: 2px; }
.pub-count { color: var(--muted); font-size: .9rem; }

/* Join / contact */
.join-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; display: grid; gap: 14px; }
.join-box .hook { font: 700 1.15rem var(--font-display); color: var(--primary); }
.role-chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.role-chips li { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 5px 12px; font: 700 .85rem var(--font-display); }
.mail { color: var(--ink); white-space: nowrap; }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.contact-grid dt { font: 700 .8rem var(--font-display); text-transform: uppercase; letter-spacing: .1em; color: var(--accent); margin-bottom: 6px; }
.contact-grid dd { margin: 0; color: var(--ink); }

/* Footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding: 36px 0 20px; margin-top: 40px; font-size: .9rem; color: var(--muted); }
.footer-row { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-row p { margin-bottom: 4px; }
.footer-name { font: 700 1rem var(--font-display); color: var(--ink); }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; align-items: start; }
.footer-copy { margin-top: 24px; font-size: .82rem; }

/* Modal */
.modal-back { position: fixed; inset: 0; background: rgba(8, 18, 30, .55); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal-back[hidden] { display: none; }
.modal { background: var(--surface); color: var(--text); width: min(560px, 100%); max-height: calc(100% - 32px); overflow-y: auto; border-radius: 14px; padding: 26px 28px 22px; display: grid; gap: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.3); border-top: 5px solid var(--accent); }
.modal-top { display: flex; justify-content: space-between; align-items: center; }
.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.lang-switch button { border: 0; background: transparent; color: var(--muted); padding: 6px 12px; font: 700 .82rem var(--font-display); cursor: pointer; }
.lang-switch button[aria-pressed="true"] { background: var(--fill); color: var(--on-accent); }
.modal-x { border: 0; background: none; font-size: 1.6rem; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px 8px; }
.modal-eyebrow { font: 700 .76rem var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-top: 6px; }
.modal h2 { font-size: 1.45rem; }
.modal-hook { font: 700 1.05rem var(--font-display); color: var(--primary); }
.modal-contact { color: var(--ink); }
.modal-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.modal[lang="ko"] h2, .modal[lang="ko"] p { font-family: "Noto Sans KR", var(--font-body); word-break: keep-all; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

/* Resources & Lab life */
.prose { display: grid; gap: 16px; max-width: 72ch; }
.prose h2 { font-size: 1.35rem; margin-top: 12px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 8px 0; }
.fact { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 4px; }
.fact b { font: 700 .78rem var(--font-display); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.ref-list { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: .95rem; }
.source-note { font-size: .9rem; color: var(--muted); border-left: 3px solid var(--accent); padding: 6px 0 6px 14px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.life-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.life-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: grid; align-content: start; }
.life-card img { width: 100%; aspect-ratio: 3/2; object-fit: cover; }
.life-card .body { padding: 18px 20px 20px; display: grid; gap: 6px; }
.life-card .when { font: 700 .82rem var(--font-display); color: var(--accent); }
.empty { border: 1px dashed var(--line); border-radius: var(--radius); padding: 40px 24px; text-align: center; color: var(--muted); display: grid; gap: 8px; justify-items: center; }

.figure { margin: 8px 0; display: grid; gap: 10px; }
.figure img { background: #fff; border-radius: var(--radius); border: 1px solid var(--line); padding: 10px; width: 100%; height: auto; }
.figure figcaption { font-size: .88rem; color: var(--muted); }
.prose .figure { max-width: none; }

.side-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 36px; align-items: start; max-width: none; }
.side-split .prose { max-width: none; }
@media (max-width: 900px) { .side-split { grid-template-columns: 1fr; } }
.prose.wide { max-width: none; }
.prose.wide > p, .prose.wide > h2, .prose.wide > ul { max-width: 72ch; }
.ref-inline { font-size: .92rem; color: var(--muted); }

/* Research page cards */
.res-head { display: grid; grid-template-columns: auto 1px minmax(0, 1fr); gap: 40px; align-items: center; padding: 56px 0 0; }
.res-head h1 { margin-top: 6px; }
.res-divider { align-self: stretch; background: var(--line); }
.res-head p { color: var(--text); font-size: 1.12rem; max-width: 62ch; }
.res-head p strong { color: var(--accent); }
@media (max-width: 760px) { .res-head { grid-template-columns: 1fr; gap: 14px; } .res-divider { display: none; } }
.res-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.res-card { position: relative; display: grid; grid-template-rows: auto 1fr; border-radius: 22px; overflow: hidden;
  background: linear-gradient(180deg, var(--card-top) 0%, var(--card-bot) 100%); border: 1px solid rgba(var(--glow-rgb), .35);
  box-shadow: var(--card-shadow); color: var(--card-text); transition: border-color .2s, box-shadow .2s, transform .2s; }
.res-card:hover { border-color: rgba(var(--glow-rgb), .7); box-shadow: 0 0 0 1px rgba(var(--glow-rgb), .2), 0 18px 48px rgba(var(--glow-rgb), .28); transform: translateY(-2px); }
.res-art { aspect-ratio: 2 / 1; overflow: hidden; }
.res-art img { width: 100%; height: 100%; object-fit: cover; -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%); mask-image: linear-gradient(to bottom, #000 55%, transparent 100%); }
.res-body { position: relative; margin-top: -26px; padding: 0 26px 28px; display: grid; gap: 10px; align-content: start; }
.res-num { font: 800 .95rem var(--font-display); color: var(--card-accent); letter-spacing: .06em; }
.res-card h3 { color: var(--card-title); font-size: 1.28rem; }
.res-ko { font-family: "Noto Sans KR", var(--font-body); font-size: .9rem; color: var(--card-sub); }
.res-card p { color: var(--card-body); }
.res-card ul { margin: 4px 0 0; padding-left: 18px; display: grid; gap: 8px; }
.res-card li { color: var(--card-text); }
.res-card li::marker { color: var(--card-accent); }
@media (prefers-reduced-motion: reduce) { .res-card:hover { transform: none; } }

.res-intro { display: grid; gap: 10px; }
.res-head p.res-ko-lead { font-family: "Noto Sans KR", var(--font-body); font-size: .95rem; color: var(--muted); word-break: keep-all; }
