/* ==========================================================================
   BEAR Lab — Battery & Energy Advanced Research Lab · Pukyong National University
   Design tokens, layout, components
   ========================================================================== */

:root {
  /* Ink (deep navy, from the BEAR logo) */
  --ink-950: #06111f;
  --ink-900: #0b1c33;
  --ink-800: #122b4c;
  --ink-700: #1a3a63;

  /* Paper */
  --paper-050: #f7f8fb;
  --paper-100: #eef1f7;
  --paper-200: #dde3ee;

  /* Accent (navy blue) + Amber (from the battery in the logo) */
  --accent: #1f5fa8;
  --accent-dark: #174b86;
  --accent-soft: #3f86d8;
  --amber: #e0a33a;
  --amber-soft: #f3c66b;
  --grad: linear-gradient(135deg, var(--accent-dark) 0%, var(--accent) 55%, var(--accent-soft) 100%);
  --grad-line: linear-gradient(90deg, var(--accent) 0%, var(--accent-soft) 60%, var(--amber) 100%);

  /* Semantic */
  --bg: var(--paper-050);
  --bg-alt: var(--paper-100);
  --surface: #ffffff;
  --text: #13213a;
  --muted: #4b5b75;
  --border: rgba(19, 33, 58, 0.12);
  --border-strong: rgba(19, 33, 58, 0.22);
  --accent-tint: rgba(31, 95, 168, 0.08);
  --amber-tint: rgba(224, 163, 58, 0.14);
  --shadow: 0 1px 2px rgba(6, 17, 31, 0.04), 0 8px 28px -12px rgba(6, 17, 31, 0.18);
  --shadow-lg: 0 2px 6px rgba(6, 17, 31, 0.06), 0 24px 56px -20px rgba(6, 17, 31, 0.28);

  --on-ink: #e8eef8;
  --on-ink-muted: #9fb0c9;

  /* Type */
  --sans: "Pretendard Variable", "Pretendard", "Inter", -apple-system, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --display: "Inter Tight", "Inter", "Pretendard Variable", "Pretendard", -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --max: 1140px;
  --radius: 14px;
  --radius-sm: 8px;
  --header-h: 68px;
}

html[data-theme="dark"] {
  --bg: #08131f;
  --bg-alt: #0c1a2b;
  --surface: #112238;
  --text: #e6edf7;
  --muted: #aebfd6;
  --border: rgba(230, 237, 247, 0.12);
  --border-strong: rgba(230, 237, 247, 0.24);
  --accent: #5b9ae6;
  --accent-dark: #3f86d8;
  --accent-tint: rgba(91, 154, 230, 0.13);
  --amber-tint: rgba(224, 163, 58, 0.18);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.3), 0 28px 60px -20px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

/* Language switching: both texts live in the HTML, CSS shows one */
html[data-lang="en"] .ko { display: none !important; }
html[data-lang="ko"] .en { display: none !important; }
html[data-lang="ko"] body { word-break: keep-all; }

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; font-size: 18px; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01";
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--display); letter-spacing: -0.015em; line-height: 1.2; margin: 0 0 0.5em; color: var(--text); }
h1 { font-size: clamp(2.2rem, 4.4vw, 3.6rem); font-weight: 700; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 700; letter-spacing: -0.025em; }
h3 { font-size: 1.25rem; font-weight: 650; }
p { margin: 0 0 1em; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 62ch; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 0.9em; letter-spacing: 0.02em; }
.wrap { width: min(var(--max), 100% - 2.5rem); margin-inline: auto; }
.section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.section.alt { background: var(--bg-alt); }
.section.tight { padding-top: 0; }
.section-head { margin-bottom: 2.5rem; max-width: 720px; }
.section-head.wide { max-width: none; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--mono); font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--accent); margin-bottom: 0.9rem;
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--grad-line); border-radius: 2px; }
.between { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: #fff; padding: 0.5rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; top: 1rem; }

/* --------------------------------------------------------------------------
   Buttons, tags
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.3rem; border-radius: 999px; font-weight: 600; font-size: 0.95rem;
  border: 1px solid transparent; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  text-decoration: none !important; line-height: 1.2;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 22px -10px rgba(31, 95, 168, 0.7); }
.btn-primary:hover { box-shadow: 0 12px 28px -10px rgba(31, 95, 168, 0.8); }
.btn-ghost { border-color: var(--border-strong); color: var(--text); background: transparent; }
.btn-ghost:hover { background: var(--accent-tint); border-color: var(--accent); }
.btn-amber { background: var(--amber); color: #1a1405; }
.btn-amber:hover { background: var(--amber-soft); }
.btn-light { background: rgba(255, 255, 255, 0.12); color: #fff; border-color: rgba(255, 255, 255, 0.28); backdrop-filter: blur(6px); }
.btn-light:hover { background: rgba(255, 255, 255, 0.2); }
.btn .arrow { transition: transform .15s ease; }
.btn:hover .arrow { transform: translateX(3px); }
.tag {
  display: inline-block; padding: 0.22rem 0.7rem; border-radius: 999px; font-size: 0.9rem; font-weight: 600;
  background: var(--accent-tint); color: var(--accent); letter-spacing: 0.01em;
}
.tag.amber { background: var(--amber-tint); color: #8a5d0f; }
html[data-theme="dark"] .tag.amber { color: var(--amber-soft); }
.tag.ink { background: rgba(255, 255, 255, 0.12); color: var(--on-ink); }

/* --------------------------------------------------------------------------
   Header / nav
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: min(1360px, 100% - 2.5rem); }
.brand { display: flex; align-items: center; gap: 0.7rem; color: var(--text); text-decoration: none !important; }
.brand-mark { width: auto; height: 54px; flex: none; object-fit: contain; background: #fff; border-radius: 6px; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em; line-height: 1.1; }
.brand-sub { display: block; font-size: 0.86rem; color: var(--muted); font-weight: 500; letter-spacing: 0.02em; white-space: nowrap; }
.brand-sub b { color: var(--amber); font-weight: 800; }
html[data-theme="dark"] .brand-sub b { color: var(--amber-soft); }
.brand { flex: none; }
.nav { display: flex; align-items: center; gap: 0.15rem; }
.nav a {
  color: var(--text); font-weight: 500; font-size: 0.95rem; padding: 0.5rem 0.55rem; border-radius: 8px;
  text-decoration: none !important; position: relative; transition: background .15s; white-space: nowrap;
}
.nav a:hover { background: var(--accent-tint); }
.nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0.7rem; right: 0.7rem; bottom: 2px; height: 2px; background: var(--grad-line); border-radius: 2px;
}
.nav-tools { display: flex; align-items: center; gap: 0.35rem; margin-left: 0.35rem; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.3rem;
  height: 36px; min-width: 36px; padding: 0 0.6rem; border-radius: 999px; border: 1px solid var(--border-strong);
  background: transparent; color: var(--text); cursor: pointer; font: inherit; font-size: 0.9rem; font-weight: 600;
  transition: background .15s, border-color .15s;
}
.icon-btn:hover { background: var(--accent-tint); border-color: var(--accent); }
.icon-btn svg { width: 16px; height: 16px; }
.lang-btn .ko, .lang-btn .en { display: inline !important; }
.lang-btn span { opacity: 0.45; }
html[data-lang="en"] .lang-btn .l-en, html[data-lang="ko"] .lang-btn .l-ko { opacity: 1; color: var(--accent); }
.lang-btn .sep { opacity: 0.35; margin: 0 -0.1rem; }
.theme-btn .sun { display: none; }
html[data-theme="dark"] .theme-btn .sun { display: block; }
html[data-theme="dark"] .theme-btn .moon { display: none; }
.menu-btn { display: none; }
@media (max-width: 1360px) { .brand-sub { display: none; } }
@media (max-width: 1080px) {
  .menu-btn { display: inline-flex; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; align-items: stretch; gap: 0.2rem;
    background: var(--surface); border-bottom: 1px solid var(--border); padding: 0.8rem 1.25rem 1.2rem;
    box-shadow: var(--shadow-lg); transform: translateY(-8px); opacity: 0; pointer-events: none; transition: .18s ease;
  }
  .nav.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav a { padding: 0.75rem 0.8rem; font-size: 1.05rem; }
  .nav a[aria-current="page"]::after { display: none; }
  .nav-tools { margin: 0.6rem 0 0; padding-top: 0.8rem; border-top: 1px solid var(--border); justify-content: flex-start; }
  .brand-sub { display: none; }
}

/* --------------------------------------------------------------------------
   Hero (home)
   -------------------------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--bg);
  background-image: radial-gradient(circle at 1px 1px, var(--border-strong) 1px, transparent 0);
  background-size: 26px 26px;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(55% 70% at 85% 20%, var(--accent-tint), transparent 70%),
    radial-gradient(40% 55% at 5% 90%, var(--amber-tint), transparent 70%),
    linear-gradient(180deg, transparent 0%, var(--bg) 100%);
}
.hero .wrap { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; padding: clamp(3.5rem, 8vw, 6.5rem) 0 clamp(3.5rem, 8vw, 6rem); }
.hero h1 { max-width: 16ch; margin-bottom: 1.2rem; }
.hero h1 .thin { font-weight: 400; color: var(--muted); }
.hero .lead { margin-bottom: 2rem; }
.hero-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; }
/* hero eyebrow: keep on one line, scale with the column */
.hero .eyebrow { white-space: nowrap; font-size: clamp(0.72rem, 1.05vw, 0.92rem); letter-spacing: 0.12em; }
@media (max-width: 860px) { .hero .eyebrow { white-space: normal; font-size: 0.88rem; } }
.hero-card {
  background: #fff; border-radius: calc(var(--radius) + 6px); padding: clamp(1.5rem, 3vw, 2.5rem);
  box-shadow: var(--shadow-lg); border: 1px solid var(--border); position: relative; overflow: hidden;
}
.hero-card::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: var(--grad-line); }
.hero-card img { width: 100%; height: auto; }
.hero-card .caption { margin: 1.2rem 0 0.3rem; font-family: var(--mono); font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase; color: #5b6b85; text-align: center; }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: 1fr; } .hero-card { max-width: 440px; } }

/* stat strip */
.stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; position: relative; z-index: 2;
  box-shadow: var(--shadow); margin-top: -2rem;
}
.stat { background: var(--surface); padding: 1.4rem 1.5rem; }
.stat b { display: block; font-family: var(--display); font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; background: var(--grad-line); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { color: var(--muted); font-size: 1rem; }
@media (max-width: 800px) { .stats { grid-template-columns: repeat(2, 1fr); margin-top: 0; } }

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.6rem; box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  display: flex; flex-direction: column; gap: 0.6rem; position: relative;
}
a.card { color: inherit; text-decoration: none !important; }
a.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.card h3 { margin: 0.2rem 0 0.2rem; }
.card p { margin: 0; color: var(--muted); font-size: 1.02rem; }
.card .num { font-family: var(--mono); font-size: 0.92rem; color: var(--accent); letter-spacing: 0.1em; }
.card-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-tint); display: grid; place-items: center; color: var(--accent); }
.card-icon svg { width: 24px; height: 24px; }
.card .more { margin-top: auto; padding-top: 0.6rem; color: var(--accent); font-weight: 600; font-size: 0.97rem; }
.card-img { aspect-ratio: 16/10; object-fit: cover; border-radius: 10px; margin: -0.4rem 0 0.4rem; background: var(--paper-100); }

/* --------------------------------------------------------------------------
   Dark feature panel (approach / join)
   -------------------------------------------------------------------------- */
.panel { background: var(--ink-900); color: var(--on-ink); border-radius: calc(var(--radius) + 6px); padding: clamp(1.6rem, 4vw, 3rem); position: relative; overflow: hidden; }
.panel::before { content: ""; position: absolute; inset: 0; background: radial-gradient(50% 60% at 90% 10%, rgba(224, 163, 58, 0.18), transparent 70%); pointer-events: none; }
.panel .eyebrow { color: var(--amber-soft); }
.panel .eyebrow::before { background: var(--amber-soft); }
.panel h2 { color: #fff; }
.panel p { color: var(--on-ink-muted); }
.panel > * { position: relative; }
.pipe-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: 2rem; position: relative; }
.pipe-steps::before { content: ""; position: absolute; top: 34px; left: 8%; right: 8%; height: 2px; background: var(--grad-line); opacity: 0.8; }
.pipe { text-align: center; padding: 0 0.75rem; position: relative; }
.pipe .dot { width: 68px; height: 68px; border-radius: 50%; margin: 0 auto 1rem; background: var(--ink-800); border: 2px solid rgba(243, 198, 107, 0.5); display: grid; place-items: center; position: relative; }
.pipe .dot svg { width: 34px; height: 34px; color: var(--amber-soft); }
.pipe b { display: block; color: #fff; font-family: var(--display); font-size: 1.02rem; margin-bottom: 0.3rem; }
.pipe span { font-size: 0.95rem; color: var(--on-ink-muted); }
@media (max-width: 760px) { .pipe-steps { grid-template-columns: repeat(2, 1fr); row-gap: 1.6rem; } .pipe-steps::before { display: none; } }

.join { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 2rem; align-items: center; }
.join .actions { display: flex; gap: 0.8rem; flex-wrap: wrap; }
@media (max-width: 800px) { .join { grid-template-columns: 1fr; } }

/* --------------------------------------------------------------------------
   Page hero (sub pages)
   -------------------------------------------------------------------------- */
.page-hero { background: var(--ink-900); color: var(--on-ink); padding: clamp(3.5rem, 7vw, 5.5rem) 0 clamp(2.5rem, 5vw, 4rem); position: relative; overflow: hidden; }
.page-hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(45% 70% at 85% 20%, rgba(63, 134, 216, 0.28), transparent 70%), radial-gradient(30% 50% at 10% 100%, rgba(224, 163, 58, 0.16), transparent 70%); pointer-events: none; }
.page-hero h1 { color: #fff; font-size: clamp(2rem, 4vw, 3rem); }
.page-hero .lead { color: var(--on-ink-muted); }
.page-hero .eyebrow { color: var(--amber-soft); } .page-hero .eyebrow::before { background: var(--amber-soft); }
.page-hero .wrap { position: relative; z-index: 1; }

/* --------------------------------------------------------------------------
   Research topics
   -------------------------------------------------------------------------- */
.topic { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: center; padding: clamp(2.5rem, 6vw, 4.5rem) 0; border-top: 1px solid var(--border); scroll-margin-top: calc(var(--header-h) + 1rem); }
.topic:first-of-type { border-top: 0; }
.topic.flip .topic-media { order: -1; }
.topic.no-media { grid-template-columns: 1fr; }
.topic.no-media > div { max-width: 72ch; }
.topic-media { border-radius: var(--radius); overflow: hidden; background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow); position: relative; }
.topic-media img { width: 100%; height: auto; object-fit: contain; padding: 0.8rem; background: #fff; }
.topic-media figcaption { color: var(--muted); font-size: 0.95rem; font-family: var(--mono); padding: 0.5rem 1rem 0.8rem; border-top: 1px solid var(--border); background: var(--surface); }
.topic h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.topic .themes { display: grid; gap: 0.4rem; margin: 0.6rem 0 1rem; padding: 0; list-style: none; }
.topic .themes li { font-weight: 600; color: var(--accent); padding-left: 1.4rem; position: relative; }
.topic .themes li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 0.8rem; height: 2px; background: var(--grad-line); }
.topic ul.pts { padding-left: 1.1rem; margin: 0.8rem 0 0; color: var(--muted); }
.topic ul.pts li { margin-bottom: 0.35rem; }
.topic ul.pts li::marker { color: var(--amber); }
.topic .keys { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1.2rem; }
.topic .related { margin-top: 1.8rem; padding-top: 1rem; border-top: 1px dashed var(--border); }
.topic .related h4 { font-family: var(--mono); font-size: 0.92rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin: 0 0 0.5rem; font-weight: 600; }
.topic .related ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.topic .related li a, .topic .related li .prep { display: inline-block; font-size: 0.97rem; padding: 0.3rem 0.75rem; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); text-decoration: none !important; }
.topic .related li a:hover { border-color: var(--accent); color: var(--accent); }
.topic .related li .prep { color: var(--muted); border-style: dashed; }
@media (max-width: 800px) { .topic { grid-template-columns: 1fr; } .topic.flip .topic-media { order: 0; } }

/* --------------------------------------------------------------------------
   People
   -------------------------------------------------------------------------- */
.pi { display: grid; grid-template-columns: 220px 1fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.pi-photo { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.pi-photo img { aspect-ratio: 4/5; object-fit: cover; object-position: center top; width: 100%; height: auto; display: block; }
.pi h2 { margin-bottom: 0.2rem; }
.page-tabs { padding-top: 1.6rem; position: relative; z-index: 2; }
.page-tabs .chips { gap: 0.6rem; }
.page-tabs .chip { font-size: 1.1rem; font-weight: 700; padding: 0.75rem 1.5rem; border: 2px solid var(--accent); color: var(--accent); background: var(--accent-tint); }
.page-tabs .chip:hover { background: var(--accent); color: #fff; }
.page-tabs .chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
html[data-theme="dark"] .page-tabs .chip { color: #9cc9ff; border-color: #9cc9ff; background: rgba(156, 201, 255, 0.12); }
html[data-theme="dark"] .page-tabs .chip.active, html[data-theme="dark"] .page-tabs .chip:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-tabs .chip .count { display: inline-block; min-width: 1.6em; padding: 0 0.45em; margin-left: 0.3em; border-radius: 999px; background: var(--amber); color: #1a1405; font-size: 0.85em; line-height: 1.6; text-align: center; }
.tab-panel[hidden] { display: none; }
.pi .role { color: var(--accent); font-weight: 600; margin-bottom: 1rem; }
.pi .links { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1.2rem 0 1.6rem; }
.pi .links a { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.97rem; font-weight: 600; padding: 0.45rem 0.9rem; border: 1px solid var(--border-strong); border-radius: 999px; color: var(--text); text-decoration: none !important; }
.pi .links a:hover { border-color: var(--accent); background: var(--accent-tint); }
.pi .links svg { width: 15px; height: 15px; }
.pi h3 { margin-top: 1.8rem; font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text); font-family: var(--mono); font-weight: 700; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--border-strong); }
.timeline li { position: relative; padding-left: 2rem; margin-bottom: 1rem; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 0.5rem; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent); }
.timeline .when { font-family: var(--mono); font-size: 0.95rem; color: var(--accent); letter-spacing: 0.06em; }
.timeline b { display: block; font-size: 1.1rem; }
.timeline small { color: var(--muted); font-size: 0.95rem; }
.timeline .logo { height: 20px; width: auto; display: inline-block; vertical-align: middle; margin-left: 0.5rem; opacity: 0.9; border-radius: 3px; }
.awards { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.awards li { display: flex; gap: 0.7rem; align-items: baseline; }
.awards li::before { content: "★"; color: var(--amber); font-size: 0.9rem; flex: none; }
.awards .when { font-family: var(--mono); font-size: 0.95rem; color: var(--muted); }
@media (max-width: 800px) { .pi { grid-template-columns: 1fr; } .pi-photo { max-width: 220px; } }

.member { text-align: center; padding: 1.5rem 1.2rem; }
.member .avatar { width: 116px; height: 116px; border-radius: 50%; margin: 0 auto 0.9rem; background: var(--accent-tint); display: grid; place-items: center; color: var(--accent); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--border-strong); overflow: hidden; }
.member .avatar svg { width: 44px; height: 44px; opacity: 0.8; }
.member .avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.member b { display: block; font-family: var(--display); font-size: 1.15rem; }
.member .kr { color: var(--muted); font-size: 0.95rem; margin-left: 0.3rem; font-weight: 500; }
.member span.role { display: block; color: var(--muted); font-size: 0.97rem; }
.member .badge { margin-top: 0.5rem; }
.member .ach { margin: 0.8rem 0 0; padding: 0.7rem 0 0; border-top: 1px dashed var(--border); text-align: left; font-size: 0.97rem; color: var(--muted); list-style: none; display: grid; gap: 0.2rem; }
.member .ach li { padding-left: 1rem; position: relative; }
.member .ach li::before { content: "·"; position: absolute; left: 0.2rem; color: var(--amber); font-weight: 700; }
.member.open { border-style: dashed; background: transparent; box-shadow: none; }
.member.open b { color: var(--accent); }
.member.open .avatar { border: 2px dashed var(--border-strong); box-shadow: none; }
.alumni { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }
.alumni li { display: grid; grid-template-columns: 1fr auto auto; gap: 1rem; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.9rem 1.2rem; }
.alumni b { font-family: var(--display); }
.alumni .when { font-family: var(--mono); font-size: 0.95rem; color: var(--accent); }
.alumni .now { color: var(--muted); font-size: 1rem; }
@media (max-width: 600px) { .alumni li { grid-template-columns: 1fr; gap: 0.2rem; } }

/* --------------------------------------------------------------------------
   Publications
   -------------------------------------------------------------------------- */
.pub-tools { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; margin-bottom: 2rem; }
.pub-search { flex: 1 1 260px; position: relative; }
.pub-search input {
  width: 100%; height: 44px; padding: 0 1rem 0 2.6rem; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-size: 0.95rem;
}
.pub-search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.pub-search svg { position: absolute; left: 0.95rem; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip { padding: 0.45rem 0.9rem; border-radius: 999px; border: 1px solid var(--border-strong); background: transparent; color: var(--text); font: inherit; font-size: 0.97rem; font-weight: 600; cursor: pointer; transition: .15s; }
.chip:hover { border-color: var(--accent); }
.chip.active { background: var(--ink-900); color: var(--on-ink); border-color: var(--ink-900); }
html[data-theme="dark"] .chip.active { background: var(--accent); color: #06111f; border-color: var(--accent); }
.pub-year { display: grid; grid-template-columns: 110px 1fr; gap: 1.5rem; padding: 1.8rem 0; border-top: 1px solid var(--border); }
.pub-year > h3 { font-family: var(--display); font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; color: var(--accent); margin: 0; position: sticky; top: calc(var(--header-h) + 1rem); align-self: start; }
.pub-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.9rem; }
.pub { scroll-margin-top: calc(var(--header-h) + 1.5rem); }
.pub.target { outline: 2px solid var(--amber); outline-offset: 2px; }
.pub { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1.05rem 1.25rem 1.05rem 3.4rem; display: grid; gap: 0.25rem; transition: border-color .15s, box-shadow .15s; position: relative; }
.pub:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.pub .no { position: absolute; left: 1.05rem; top: 1.15rem; font-family: var(--mono); font-size: 0.92rem; color: var(--muted); }
.pub .title { font-weight: 650; font-size: 1.1rem; line-height: 1.45; color: var(--text); }
.pub .title a { color: inherit; }
.pub .authors { color: var(--muted); font-size: 0.97rem; }
.pub .authors b { color: var(--text); font-weight: 650; }
.pub .venue { font-size: 0.97rem; color: var(--text); }
.pub .venue i { font-style: italic; }
.pub .venue .if { color: var(--muted); font-family: var(--mono); font-size: 0.92rem; margin-left: 0.4rem; }
.pub .meta { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.3rem; align-items: center; }
.pub .meta .tag { font-size: 0.88rem; }
.pub a.note { text-decoration: none !important; }
.pub a.note:hover { filter: brightness(0.9); }
.pub .note { font-size: 0.92rem; font-weight: 600; color: #8a5d0f; background: var(--amber-tint); border: 1px solid rgba(224, 163, 58, 0.35); border-radius: 999px; padding: 0.18rem 0.65rem; }
html[data-theme="dark"] .pub .note { color: var(--amber-soft); }
.pub .venue i.hi { color: #b5462a; font-weight: 700; }
html[data-theme="dark"] .pub .venue i.hi { color: #f3c66b; }
.pub-count { color: var(--muted); font-size: 0.97rem; }
.sel-pubs .pub { padding-left: 1.25rem; }
.legend { font-size: 0.95rem; color: var(--muted); margin-top: 0.4rem; }
@media (max-width: 700px) { .pub-year { grid-template-columns: 1fr; gap: 0.6rem; } .pub-year > h3 { position: static; font-size: 1.5rem; } }

/* Home: selected pubs */
.sel-pubs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
@media (max-width: 800px) { .sel-pubs { grid-template-columns: 1fr; } }

/* Covers */
.covers { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.5rem; }
.cover { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin: 0; }
.cover img { aspect-ratio: 3/4; object-fit: cover; width: 100%; }
.cover figcaption { padding: 0.8rem 1rem; font-size: 1rem; }
.cover figcaption b { display: block; font-family: var(--display); }
.cover figcaption span { color: var(--muted); font-size: 0.95rem; }

/* Patents */
.patent-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.patent-group h3 { display: flex; align-items: baseline; gap: 0.6rem; }
.patent-group h3 small { font-family: var(--mono); font-size: 0.9rem; color: var(--muted); font-weight: 500; }
.patents { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.patents li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.7rem 1rem; font-size: 0.97rem; display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 0.8rem; align-items: baseline; }
.patents .no { font-family: var(--mono); font-size: 0.9rem; color: var(--accent); white-space: nowrap; }
.patents .t { color: var(--text); }
.patents .yr { grid-column: 2; font-size: 0.9rem; color: var(--muted); font-family: var(--mono); }
details.more-patents { margin-top: 0.6rem; }
details.more-patents summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 0.97rem; padding: 0.4rem 0; list-style: none; }
details.more-patents summary::-webkit-details-marker { display: none; }
details.more-patents summary::before { content: "+ "; }
details.more-patents[open] summary::before { content: "− "; }
details.more-patents .patents { margin-top: 0.5rem; }
@media (max-width: 800px) { .patent-groups { grid-template-columns: 1fr; } }

/* --------------------------------------------------------------------------
   News
   -------------------------------------------------------------------------- */
.news-year { display: grid; grid-template-columns: 110px 1fr; gap: 1.5rem; padding: 1.8rem 0; border-top: 1px solid var(--border); }
.news-year > h3 { font-family: var(--display); font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; color: var(--accent); margin: 0; position: sticky; top: calc(var(--header-h) + 1rem); align-self: start; }
.news-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.9rem; }
.news { display: grid; grid-template-columns: 96px 1fr; gap: 1.2rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1.1rem 1.3rem; align-items: start; }
.news time { font-family: var(--mono); font-size: 0.95rem; color: var(--accent); letter-spacing: 0.04em; padding-top: 0.25rem; white-space: nowrap; }
.news b { display: block; font-size: 1.1rem; }
.news p { margin: 0.25rem 0 0; color: var(--muted); font-size: 1rem; }
.news .tag { margin-bottom: 0.3rem; }
.news .tag.paper { background: var(--accent-tint); color: var(--accent); }
.news .tag.award { background: var(--amber-tint); color: #8a5d0f; }
html[data-theme="dark"] .news .tag.award { color: var(--amber-soft); }
.news .tag.seminar { background: rgba(120, 90, 200, 0.12); color: #6a49c2; }
html[data-theme="dark"] .news .tag.seminar { color: #b39cf0; }
.news .tag.talk { background: rgba(40, 150, 120, 0.12); color: #1f7a60; }
html[data-theme="dark"] .news .tag.talk { color: #7fd8bd; }
.news .tag.project { background: rgba(200, 90, 60, 0.12); color: #b5462a; }
html[data-theme="dark"] .news .tag.project { color: #f0a08a; }
.news .tag.patent { background: rgba(90, 110, 130, 0.14); color: #4a5d72; }
html[data-theme="dark"] .news .tag.patent { color: #b6c6d8; }
.news .tag.lab { background: rgba(60, 140, 200, 0.12); color: #24699a; }
html[data-theme="dark"] .news .tag.lab { color: #8fc6ee; }
@media (max-width: 700px) { .news-year { grid-template-columns: 1fr; gap: 0.6rem; } .news-year > h3 { position: static; font-size: 1.5rem; } }
@media (max-width: 600px) { .news { grid-template-columns: 1fr; gap: 0.3rem; } }

/* --------------------------------------------------------------------------
   Gallery
   -------------------------------------------------------------------------- */
.g-year { display: grid; grid-template-columns: 110px 1fr; gap: 1.5rem; padding: 1.8rem 0; border-top: 1px solid var(--border); }
.g-year > h3 { font-family: var(--display); font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; color: var(--accent); margin: 0; position: sticky; top: calc(var(--header-h) + 1rem); align-self: start; }
.g-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; }
.g-item { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); cursor: zoom-in; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; display: flex; flex-direction: column; }
.g-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.g-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--paper-100); }
.g-item figcaption { padding: 0.7rem 0.9rem 0.85rem; font-size: 0.95rem; line-height: 1.45; color: var(--text); }
.g-item time { display: block; font-family: var(--mono); font-size: 0.88rem; color: var(--accent); letter-spacing: 0.04em; margin-bottom: 0.2rem; }
@media (max-width: 900px) { .g-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .g-year { grid-template-columns: 1fr; gap: 0.6rem; } .g-year > h3 { position: static; font-size: 1.5rem; } }
@media (max-width: 520px) { .g-grid { grid-template-columns: 1fr; } }
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(6, 17, 31, 0.92); display: grid; place-items: center; padding: 3rem 4rem; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: min(1200px, 100%); max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 0.8rem; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 8rem); object-fit: contain; border-radius: 8px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.8); }
.lightbox figcaption { color: var(--on-ink); font-size: 1.05rem; text-align: center; max-width: 70ch; }
.lightbox button { position: absolute; background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.25); width: 44px; height: 44px; border-radius: 50%; font-size: 1.6rem; line-height: 1; cursor: pointer; display: grid; place-items: center; transition: background .15s; }
.lightbox button:hover { background: rgba(255,255,255,.22); }
.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 1rem; top: 50%; transform: translateY(-50%); }
@media (max-width: 600px) { .lightbox { padding: 3.5rem 0.75rem; } .lb-prev, .lb-next { top: auto; bottom: 0.75rem; transform: none; } }

/* --------------------------------------------------------------------------
   Facility
   -------------------------------------------------------------------------- */
.equip { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.equip li { display: flex; gap: 0.8rem; align-items: flex-start; font-size: 1.02rem; }
/* facility photo grid */
.equip-group + .equip-group { margin-top: 3rem; padding-top: 2.5rem; border-top: 1px solid var(--border); }
.equip-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.equip-item { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.equip-item img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; background: #fff; padding: 0.6rem; display: block; }
.equip-item figcaption { padding: 0.75rem 0.9rem 0.9rem; font-size: 1rem; font-weight: 600; line-height: 1.4; color: var(--text); border-top: 1px solid var(--border); }
.equip-extra { list-style: none; margin: 1rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.equip-extra li { font-size: 0.97rem; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: 999px; padding: 0.35rem 0.9rem; }
@media (max-width: 1000px) { .equip-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .equip-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.equip li::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 2px; background: var(--grad-line); margin-top: 0.6rem; }
.equip small { color: var(--muted); }

/* --------------------------------------------------------------------------
   Resources (must-read essays)
   -------------------------------------------------------------------------- */
.essays { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.8rem; counter-reset: essay; }
.essays li { counter-increment: essay; }
.essays a { display: grid; grid-template-columns: 2.4rem 1fr auto; gap: 0.8rem; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem 1.2rem; color: var(--text); text-decoration: none !important; transition: .15s; }
.essays a:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-1px); }
.essays a::before { content: counter(essay, decimal-leading-zero); font-family: var(--mono); color: var(--accent); font-size: 0.92rem; }
.essays b { display: block; font-weight: 650; }
.essays span { color: var(--muted); font-size: 0.95rem; }
.essays .ext { color: var(--muted); font-size: 0.9rem; font-family: var(--mono); }
@media (max-width: 600px) { .essays a { grid-template-columns: 2.4rem 1fr; } .essays .ext { display: none; } }

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.contact-item { display: flex; gap: 1rem; align-items: flex-start; }
.contact-item .card-icon { flex: none; }
.contact-item b { display: block; font-family: var(--display); }
.contact-item span, .contact-item a { color: var(--muted); }
.map-wrap { aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); }
.map-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }
@media (max-width: 800px) { .contact-grid { grid-template-columns: 1fr; } }

.positions { display: grid; gap: 1rem; }
.position { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1.2rem 1.4rem; display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; }
.position b { font-family: var(--display); font-size: 1.05rem; display: block; }
.position span { color: var(--muted); font-size: 1rem; }
@media (max-width: 600px) { .position { grid-template-columns: 1fr; } }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer { background: var(--ink-950); color: var(--on-ink-muted); padding: 3rem 0 2rem; margin-top: 2rem; font-size: 0.95rem; }
.site-footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 0.7rem; }
.site-footer a { color: var(--on-ink); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.site-footer .brand { color: #fff; margin-bottom: 0.8rem; }
.site-footer .brand-mark { height: 64px; padding: 4px; border-radius: 8px; }
.site-footer .brand-sub { color: var(--on-ink-muted); }
.site-footer .copy { grid-column: 1 / -1; border-top: 1px solid rgba(255, 255, 255, 0.1); padding-top: 1.2rem; margin-top: 1rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; font-size: 0.9rem; }
@media (max-width: 700px) { .site-footer .wrap { grid-template-columns: 1fr; } }

/* --------------------------------------------------------------------------
   Reveal on scroll
   -------------------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }
