/* yuvisu.github.io — one stylesheet, no build step. */

:root {
  --bg: #ffffff;
  --bg-soft: #f7f6f3;
  --bg-raised: #ffffff;
  --text: #17171a;
  --text-2: #4d4d55;
  --text-3: #7a7a82;
  --border: #e7e5e0;
  --border-strong: #d4d1ca;
  --accent: #990000;          /* IU crimson */
  --accent-hover: #7a0000;
  --accent-soft: #f8ecea;
  --accent-ink: #8a0f0f;
  --on-accent: #ffffff;
  --header-bg: rgba(255, 255, 255, 0.82);
  --shadow: 0 1px 2px rgba(20, 20, 30, 0.04), 0 8px 24px rgba(20, 20, 30, 0.06);
  --radius: 14px;
  --radius-sm: 8px;
  --max: 1120px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111114;
    --bg-soft: #18181c;
    --bg-raised: #1c1c21;
    --text: #ececef;
    --text-2: #b4b4bc;
    --text-3: #85858f;
    --border: #2a2a31;
    --border-strong: #3a3a42;
    --accent: #e0605e;
    --accent-hover: #f07a77;
    --accent-soft: #2b1819;
    --accent-ink: #f29a97;
    --on-accent: #16090a;
    --header-bg: rgba(17, 17, 20, 0.82);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111114;
  --bg-soft: #18181c;
  --bg-raised: #1c1c21;
  --text: #ececef;
  --text-2: #b4b4bc;
  --text-3: #85858f;
  --border: #2a2a31;
  --border-strong: #3a3a42;
  --accent: #e0605e;
  --accent-hover: #f07a77;
  --accent-soft: #2b1819;
  --accent-ink: #f29a97;
  --on-accent: #16090a;
  --header-bg: rgba(17, 17, 20, 0.82);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
p { margin: 0 0 1em; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; margin: 0; font-weight: 650; }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.1rem); }
h3 { font-size: 1.15rem; letter-spacing: -0.01em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--text-3); }
.small { font-size: 0.875rem; }
.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--on-accent); padding: 8px 12px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-ink);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.lead { font-size: 1.2rem; line-height: 1.6; color: var(--text-2); max-width: 760px; }
.lead-sm { font-size: 1.05rem; color: var(--text-2); }

/* ---------- Buttons, tags, links ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-raised); color: var(--text);
  font: 500 0.95rem/1.2 var(--font); text-decoration: none;
  transition: border-color .15s, background .15s, color .15s, transform .15s;
}
.btn:hover { border-color: var(--text-3); color: var(--text); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.text-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; font-size: 0.95rem; color: var(--accent-ink); text-decoration: none;
}
.text-link .icon { transition: transform .15s; }
.text-link:hover .icon, a:hover > .text-link .icon { transform: translateX(3px); }
.tag {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 600; font-style: normal; letter-spacing: 0.02em;
  background: var(--bg-soft); color: var(--text-3); border: 1px solid var(--border);
  vertical-align: 1px; white-space: nowrap;
}
.tag-note { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; white-space: normal; }
.tag-role { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.chips li { font-size: 0.78rem; padding: 3px 10px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--border); color: var(--text-2); }
.social { display: flex; gap: 6px; flex-wrap: wrap; }
.social a {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  color: var(--text-2); border: 1px solid var(--border); background: var(--bg-raised);
  transition: color .15s, border-color .15s;
}
.social a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(180%) blur(12px); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-row { display: flex; align-items: center; gap: 24px; height: 64px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
.wordmark:hover { color: var(--text); }
.mark { width: 12px; height: 12px; border-radius: 3px; background: var(--accent); transform: rotate(45deg); }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { padding: 8px 12px; border-radius: 8px; color: var(--text-2); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.nav a:hover { color: var(--text); background: var(--bg-soft); }
.nav a[aria-current="page"] { color: var(--accent-ink); background: var(--accent-soft); }
.header-tools { display: flex; gap: 4px; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid transparent; background: none; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { color: var(--text); background: var(--bg-soft); }
.when-dark { display: none; }
:root[data-theme="dark"] .when-dark { display: contents; }
:root[data-theme="dark"] .when-light { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .when-dark { display: contents; }
  :root:not([data-theme="light"]) .when-light { display: none; }
}
.menu-btn { display: none; }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 56px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 72px; align-items: center; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 22px;
  padding: 6px 14px; border-radius: 999px; font-size: 0.85rem; font-weight: 500;
  background: var(--accent-soft); color: var(--accent-ink); text-decoration: none;
}
.pill:hover { color: var(--accent); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.hero h1 { font-size: clamp(2.6rem, 1.6rem + 3.6vw, 4rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1.02; }
.hero-role { margin: 14px 0 24px; color: var(--text-3); font-size: 1rem; }
.hero-mission {
  font-size: clamp(1.3rem, 1.05rem + 0.9vw, 1.7rem); line-height: 1.35; font-weight: 600; letter-spacing: -0.02em;
  padding-left: 18px; border-left: 3px solid var(--accent); margin-bottom: 24px;
}
.hero-bio { color: var(--text-2); font-size: 1.04rem; }
.hero-bio.small { font-size: 0.95rem; color: var(--text-3); }
.hero-bio a { color: inherit; text-decoration-color: var(--border-strong); }
.hero-bio a:hover { color: var(--accent); text-decoration-color: currentColor; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 28px 0 20px; }
.hero-photo { margin: 0; position: relative; }
.hero-photo::before {
  content: ""; position: absolute; inset: 18px -18px -18px 18px; border-radius: 22px;
  background: var(--accent-soft); z-index: -1;
}
.hero-photo img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 22px; box-shadow: var(--shadow); }

/* ---------- Sections ---------- */
.section { padding: 80px 0; }
.section-tight { padding: 40px 0; }
.section-soft { background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { margin-bottom: 32px; max-width: 720px; }
.section-head p.muted { margin: 10px 0 0; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 64px; }

.themes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.theme {
  position: relative; display: flex; flex-direction: column; padding: 24px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg-raised); color: inherit; text-decoration: none;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.theme:hover { color: inherit; border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow); }
.theme h3 { margin: 18px 0 8px; }
.theme p { color: var(--text-2); font-size: 0.95rem; flex: 1; }
.theme-icon { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); }
.theme-icon .icon { width: 24px; height: 24px; }
.theme-num { position: absolute; top: 22px; right: 24px; color: var(--text-3); font-size: 0.85rem; font-variant-numeric: tabular-nums; }

/* ---------- Projects ---------- */
.projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.project { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); border-radius: var(--radius); overflow: hidden; background: var(--bg-raised); border: 1px solid var(--border); }
.project-media { background: #161a26; min-height: 260px; position: relative; }
.project-media img { position: absolute; inset: 0; width: 100%; height: 100%; padding: 16px 12px 0; object-fit: contain; object-position: top center; }
.project-media-art { background: var(--accent-soft); display: grid; place-items: center; }
.dag { width: 88%; height: auto; }
.dag path { stroke: var(--accent); stroke-width: 1.6; fill: none; opacity: 0.55; }
.dag circle { fill: var(--bg-raised); stroke: var(--accent); stroke-width: 2; }
.dag circle.hub { fill: var(--accent); }
.project-body { padding: 24px; display: flex; flex-direction: column; }
.project-head { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.project-head h3 { font-size: 1.3rem; }
.project-tagline { color: var(--accent-ink); font-weight: 500; margin: 4px 0 12px; font-size: 0.95rem; }
.project-body > p { color: var(--text-2); font-size: 0.95rem; }
.project-papers-label { font-size: 0.8rem; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; margin: 4px 0 6px; }
.mini-pubs { margin-bottom: 16px; font-size: 0.9rem; }
.mini-pubs li { margin-bottom: 6px; line-height: 1.45; }
.project .text-link { margin-top: auto; }

/* ---------- News ---------- */
.news li { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 16px; padding: 14px 0; border-top: 1px solid var(--border); }
.news li:first-child { border-top: 0; padding-top: 0; }
.news-date { color: var(--text-3); font-size: 0.85rem; font-weight: 500; padding-top: 2px; font-variant-numeric: tabular-nums; }
.news-text { color: var(--text-2); font-size: 0.97rem; }
.more { margin-top: 12px; }
.more summary { cursor: pointer; color: var(--accent-ink); font-weight: 600; font-size: 0.95rem; padding: 8px 0; }
.more[open] summary { margin-bottom: 12px; }

/* ---------- Publications ---------- */
.pubs { margin-bottom: 20px; }
.pub { padding: 16px 0; border-top: 1px solid var(--border); }
.pubs > .pub:first-child { border-top: 0; padding-top: 0; }
.pub p { margin: 0; }
.pub-title { font-weight: 600; line-height: 1.4; letter-spacing: -0.005em; }
.pub-title a { color: var(--text); text-decoration: none; background-image: linear-gradient(var(--accent), var(--accent)); background-size: 0 1px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size .25s, color .15s; }
.pub-title a:hover { color: var(--accent-ink); background-size: 100% 1px; }
.pub-authors { color: var(--text-2); font-size: 0.9rem; margin-top: 4px !important; line-height: 1.5; }
.pub-authors strong { color: var(--text); font-weight: 650; }
.pub-authors .gap { color: var(--text-3); }
.pub-venue { color: var(--text-3); font-size: 0.88rem; margin-top: 2px !important; }

.pub-controls { position: sticky; top: 64px; z-index: 10; background: var(--bg); padding: 16px 0 6px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.chips-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip-btn {
  font: 500 0.9rem/1 var(--font); padding: 8px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--bg-raised); color: var(--text-2);
}
.chip-btn span { color: var(--text-3); margin-left: 4px; font-variant-numeric: tabular-nums; }
.chip-btn:hover { border-color: var(--text-3); color: var(--text); }
.chip-btn[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip-btn[aria-pressed="true"] span { color: inherit; opacity: 0.7; }
.pub-controls-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 8px; }
.search { display: flex; align-items: center; gap: 8px; flex: 1 1 320px; max-width: 460px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--bg-raised); color: var(--text-3); }
.search:focus-within { border-color: var(--accent); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font: 400 0.95rem var(--font); padding: 10px 0; }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 0.92rem; cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
.pub-controls .small { margin: 0; }
.year-group { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 24px; padding: 28px 0 8px; border-top: 1px solid var(--border); }
.year-group:first-of-type { border-top: 0; }
.year { font-size: 1.5rem; color: var(--text-3); font-weight: 600; font-variant-numeric: tabular-nums; position: sticky; top: 210px; align-self: start; }
.year-group .pubs { margin: 0; }
.empty { padding: 40px 0; }

/* ---------- Research page ---------- */
.page-head { padding: 64px 0 28px; }
.page-head h1 { font-size: clamp(2.2rem, 1.6rem + 2.4vw, 3.2rem); font-weight: 700; letter-spacing: -0.03em; margin-bottom: 16px; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 8px; align-items: center; }
.toc a:not(.btn) { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-2); text-decoration: none; font-size: 0.88rem; font-weight: 500; }
.toc a:not(.btn):hover { border-color: var(--accent); color: var(--accent-ink); }
.theme-section { padding: 56px 0; border-top: 1px solid var(--border); }
.theme-section:first-of-type { border-top: 0; }
.theme-row { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr); gap: 56px; }
.theme-aside { position: sticky; top: 96px; align-self: start; }
.theme-aside h2 { margin-top: 18px; font-size: 1.7rem; }
.theme-aside .theme-num { position: static; display: block; margin-top: 16px; }
.list-label { font-size: 0.8rem; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; margin: 28px 0 8px; }
.grants { border-top: 1px solid var(--border); }
.grant { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 24px; align-items: start; padding: 18px 0; border-bottom: 1px solid var(--border); }
.grant p { margin: 0; }
.grant-period { color: var(--text-3); font-size: 0.88rem; font-variant-numeric: tabular-nums; padding-top: 2px; }
.grant-title { font-weight: 600; line-height: 1.4; }
.grant .muted { font-size: 0.88rem; margin-top: 2px; }

/* ---------- People ---------- */
.sub { font-size: 1.5rem; margin-bottom: 20px; }
.sub-sm { font-size: 1.05rem; margin: 28px 0 10px; color: var(--text-2); }
.people { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.person { display: flex; gap: 16px; align-items: center; padding: 20px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-raised); }
.person p { margin: 0; line-height: 1.4; }
.person-name { font-weight: 600; }
.avatar { width: 56px; height: 56px; border-radius: 50%; flex: none; display: grid; place-items: center; object-fit: cover; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; letter-spacing: 0.02em; }
.rows { border-top: 1px solid var(--border); }
.row { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--border); line-height: 1.5; }
.row-when { color: var(--text-3); font-size: 0.88rem; font-variant-numeric: tabular-nums; padding-top: 1px; }
.plain li { padding: 6px 0 6px 18px; position: relative; color: var(--text-2); }
.plain li::before { content: ""; position: absolute; left: 0; top: 0.95em; width: 6px; height: 6px; border-radius: 2px; background: var(--accent); transform: rotate(45deg); }

/* ---------- Join ---------- */
.join { padding: 64px 0; }
.join-box { display: flex; gap: 40px; align-items: center; justify-content: space-between; }
.join-box > div:first-child { max-width: 680px; }
.join-box h2 { margin-bottom: 12px; }
.join-box p:not(.eyebrow) { color: var(--text-2); margin: 0; }
.join .container {
  padding: 40px 44px; border-radius: 22px; background: var(--accent-soft);
  max-width: calc(var(--max) - 48px);
}
.join-actions { display: flex; flex-direction: column; gap: 10px; flex: none; }

/* ---------- CV ---------- */
.cv .toc { margin-bottom: 8px; }
.cv-section { padding: 36px 0 8px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 44px 0 28px; margin-top: 40px; background: var(--bg-soft); }
.footer-row { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.footer-row p { margin: 0; }
.footer-name { font-weight: 700; margin-bottom: 4px !important; }
.footer-links { display: flex; flex-direction: column; gap: 14px; align-items: flex-end; }
.footer-links > a { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); text-decoration: none; }
.footer-links > a:hover { color: var(--accent); }
.footer-meta { margin-top: 28px; font-size: 0.85rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .themes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .projects { grid-template-columns: minmax(0, 1fr); }
  .people { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); gap: 56px; }
}
@media (max-width: 820px) {
  .container { padding: 0 16px; }
  .menu-btn { display: inline-grid; }
  .nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; gap: 2px;
    padding: 8px 16px 16px; background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px; }
  .header-tools { margin-left: auto; }
  .hero { padding: 40px 0 40px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .hero-photo { order: -1; max-width: 168px; }
  .hero-photo img { aspect-ratio: 1 / 1; object-position: 50% 26%; border-radius: 18px; }
  .hero-photo::before { inset: 10px -10px -10px 10px; border-radius: 18px; }
  .section { padding: 56px 0; }
  .theme-row { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .theme-aside { position: static; }
  .theme-aside h2 { margin-top: 12px; }
  .year-group { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .year { position: static; font-size: 1.3rem; }
  .pub-controls { position: static; }
  .grant { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .grant .tag-role { justify-self: start; }
  .join .container { padding: 28px 20px; border-radius: 18px; max-width: calc(100% - 32px); }
  .join-box { flex-direction: column; align-items: flex-start; gap: 24px; }
  .footer-links { align-items: flex-start; }
}
@media (max-width: 560px) {
  .themes { grid-template-columns: minmax(0, 1fr); }
  .people { grid-template-columns: minmax(0, 1fr); }
  .project { grid-template-columns: minmax(0, 1fr); }
  .project-media { min-height: 200px; }
  .news li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
