/* Woojoo Na — personal site. Plain CSS, no build step. */

:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1d1f23;
  --muted: #5d636e;
  --faint: #8a909a;
  --rule: #e4e1da;
  --accent: #1f4e8c;        /* Oxford-leaning blue */
  --accent-soft: #e8eef7;
  --warm: #b5532a;          /* second figure colour */
  --fig-bg: #f4f2ec;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121418;
    --surface: #1a1d22;
    --text: #e6e7ea;
    --muted: #a4a9b3;
    --faint: #7b818c;
    --rule: #2b2f36;
    --accent: #8fb6ec;
    --accent-soft: #1d2a3d;
    --warm: #e89a72;
    --fig-bg: #181b20;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121418;
  --surface: #1a1d22;
  --text: #e6e7ea;
  --muted: #a4a9b3;
  --faint: #7b818c;
  --rule: #2b2f36;
  --accent: #8fb6ec;
  --accent-soft: #1d2a3d;
  --warm: #e89a72;
  --fig-bg: #181b20;
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px;
}

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } body { font-size: 17px; } }

.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 6px 10px; z-index: 20; }
.skip:focus { left: 8px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 12px; }
.brand { font-family: var(--sans); font-weight: 600; color: var(--text); letter-spacing: -0.01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
nav { display: flex; align-items: center; gap: 22px; font-family: var(--sans); font-size: 15px; }
nav a { color: var(--muted); }
nav a:hover { color: var(--text); text-decoration: none; }
@media (max-width: 600px) {
  nav { gap: 14px; font-size: 14px; }
  nav a[href="#news"] { display: none; }
}

.theme-toggle {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  border: 1px solid var(--rule); border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer;
}
.theme-toggle:hover { color: var(--text); }
.theme-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

/* ---------- intro ---------- */
.intro {
  display: grid; grid-template-columns: 1fr 240px; gap: 56px; align-items: start;
  padding: 72px 0 40px;
}
.intro h1 {
  font-family: var(--serif); font-weight: 600; font-size: 46px; line-height: 1.1; letter-spacing: -0.02em; margin: 0;
}
.tagline {
  font-family: var(--sans); font-size: 13px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); margin: 12px 0 26px;
}
.intro p { margin: 0 0 16px; max-width: 64ch; }
.portrait { margin: 8px 0 0; }
.portrait img {
  width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 10px 30px -12px rgba(0,0,0,.25);
}
.contact { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-wrap: wrap; gap: 10px; font-family: var(--sans); font-size: 14.5px; }
.contact a {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px;
  border: 1px solid var(--rule); border-radius: 999px; color: var(--text); background: var(--surface);
  transition: border-color .15s, color .15s;
}
.contact a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.contact svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 760px) {
  .intro { grid-template-columns: 1fr; gap: 28px; padding: 40px 0 24px; }
  .portrait { order: -1; max-width: 140px; margin: 0; }
  .portrait img { border-radius: 50%; aspect-ratio: 1; object-position: 50% 45%; }
  .intro h1 { font-size: 36px; }
}

/* ---------- sections ---------- */
.block { padding: 40px 0; border-top: 1px solid var(--rule); }
h2 {
  font-family: var(--sans); font-size: 13px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 22px;
}
h2.mt { margin-top: 40px; }
.lede { margin: 0 0 8px; font-size: 20px; line-height: 1.55; max-width: 62ch; color: var(--text); }
.muted { color: var(--muted); margin: 0 0 18px; font-size: 16px; }

/* ---------- research themes ---------- */
.theme {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 44px; align-items: center;
  padding: 36px 0;
}
.theme + .theme { border-top: 1px dashed var(--rule); }
.theme:nth-of-type(even) { grid-template-columns: minmax(0, 420px) minmax(0, 1fr); }
.theme:nth-of-type(even) .fig { order: -1; }
.theme h3 { font-family: var(--serif); font-size: 25px; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; margin: 0 0 14px; }
.theme h3 .num { display: block; font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: .14em; color: var(--accent); margin-bottom: 6px; }
.theme p { margin: 0 0 14px; }
.status { font-family: var(--sans); font-size: 14px; color: var(--faint); }

@media (max-width: 860px) {
  .theme, .theme:nth-of-type(even) { grid-template-columns: 1fr; gap: 22px; }
  .theme:nth-of-type(even) .fig { order: 0; }
}

.fig { margin: 0; background: var(--fig-bg); border: 1px solid var(--rule); border-radius: 14px; padding: 14px; }
.fig canvas { display: block; width: 100%; aspect-ratio: 4 / 3; border-radius: 8px; }
.fig-controls { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-family: var(--sans); font-size: 13px; color: var(--muted); }
.fig-controls label { display: flex; align-items: center; gap: 8px; flex: 1; font-style: italic; font-family: var(--serif); font-size: 16px; }
.fig-controls input[type=range] { flex: 1; accent-color: var(--accent); min-width: 0; }
.fig-controls button {
  font: inherit; font-size: 12.5px; color: var(--text); background: var(--surface); border: 1px solid var(--rule);
  border-radius: 999px; padding: 4px 11px; cursor: pointer; white-space: nowrap;
}
.fig-controls button:hover { border-color: var(--accent); color: var(--accent); }
.fig figcaption { margin-top: 10px; font-family: var(--sans); font-size: 12.5px; line-height: 1.55; color: var(--muted); }
.key { display: inline-block; width: 18px; height: 0; vertical-align: middle; margin: 0 6px 2px 0; border-top: 2px solid var(--accent); }
.key-dash { border-top: 2px dashed var(--warm); margin-left: 4px; }

/* ---------- publications ---------- */
.pubs { list-style: none; margin: 0; padding: 0; }
.pubs li { margin: 0 0 6px; }
.pubs .ptitle { font-weight: 600; color: var(--text); }
.pubs .ptitle:hover { color: var(--accent); }
.pubs .authors, .pubs .venue, .pubs .links { display: block; font-size: 16px; }
.pubs .authors { color: var(--muted); }
.pubs .authors b { color: var(--text); font-weight: 600; }
.pubs .venue { font-family: var(--sans); font-size: 13.5px; font-weight: 500; color: var(--accent); margin-top: 2px; }
.pubs .result { display: block; font-size: 15px; line-height: 1.5; color: var(--muted); margin-top: 6px; }
.pubs.compact .links { margin-top: 10px; }
.pubs.review li { padding: 10px 0; }
.pubs.review .ptitle { font-size: 17px; }
.pubs.compact { margin-top: 6px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--rule); border-left: 3px solid var(--accent); border-radius: 8px; }

.pubs.full .pub { display: grid; grid-template-columns: 168px 1fr; gap: 26px; padding: 22px 0; border-bottom: 1px solid var(--rule); margin: 0; }
.pubs.full .pub:first-child { padding-top: 0; }
.pubs.full .thumb { width: 168px; aspect-ratio: 4 / 3; object-fit: contain; background: #fff; border: 1px solid var(--rule); border-radius: 8px; padding: 6px; }
.pubs.full .ptitle { font-size: 19px; line-height: 1.35; }
.pubs .links { margin-top: 8px; font-family: var(--sans); font-size: 13px; display: flex; gap: 8px; flex-wrap: wrap; }
.pubs .links a { padding: 3px 10px; border: 1px solid var(--rule); border-radius: 999px; color: var(--text); }
.pubs .links a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
details { margin-top: 10px; }
summary { font-family: var(--sans); font-size: 13px; color: var(--muted); cursor: pointer; width: fit-content; }
summary:hover { color: var(--text); }
details p { margin: 8px 0 0; font-size: 16px; color: var(--muted); max-width: 70ch; }

@media (max-width: 600px) {
  .pubs.full .pub { grid-template-columns: 1fr; gap: 12px; }
  .pubs.full .thumb { width: 100%; max-width: 260px; }
}

h3.sub { font-family: var(--serif); font-size: 21px; font-weight: 600; margin: 38px 0 4px; }
.earlier { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.earlier { column-gap: 40px; row-gap: 0; }
.earlier li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 18px; align-items: start; padding: 18px 0; border-top: 1px solid var(--rule); min-width: 0; }
.dia-box { margin: 0; width: 92px; height: 92px; background: var(--fig-bg); border: 1px solid var(--rule); border-radius: 10px; display: grid; place-items: center; }
.dia { width: 80px; height: 80px; overflow: visible; }
.dia * { vector-effect: non-scaling-stroke; }
.d-a, .d-edge, .d-axis, .d-grid line { stroke: var(--muted); stroke-width: 1.1; fill: none; }
.d-grid line { stroke: var(--rule); stroke-width: 1.2; }
.d-b { stroke: var(--muted); stroke-width: 1.1; stroke-dasharray: 3 3; fill: none; }
.d-walk { stroke: var(--warm); stroke-width: 2.4; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.d-node { fill: var(--surface); stroke: var(--text); stroke-width: 1.2; }
.d-start { fill: var(--warm); stroke: none; }
.d-motif { stroke: var(--accent); stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.d-motif2 { stroke: var(--warm); stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.d-rot { fill: var(--text); stroke: none; }
.d-region { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.2; }
.d-region2 { fill: color-mix(in srgb, var(--warm) 14%, transparent); stroke: var(--warm); stroke-width: 1.2; }
.d-dot { fill: var(--accent); }
.d-dot2 { fill: var(--warm); }
.d-out { fill: var(--surface); stroke: var(--muted); stroke-width: 1.2; }
.d-out2 { fill: var(--surface); stroke: var(--warm); stroke-width: 1.4; }
.d-arrow { fill: var(--muted); }
.d-arrow2 { fill: var(--accent); }
.d-missing { stroke: var(--warm); stroke-width: 1.6; stroke-dasharray: 3 3; fill: none; }
.d-q { fill: var(--warm); font: 600 13px var(--sans); }
.d-tok { fill: none; stroke: var(--muted); stroke-width: 1.1; }
.d-span { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.4; }
.d-span2 { fill: color-mix(in srgb, var(--warm) 14%, transparent); stroke: var(--warm); stroke-width: 1.4; }
.d-arc { stroke: var(--accent); stroke-width: 1.6; fill: none; }
.d-lab { fill: var(--muted); font: 9px var(--sans); }
.d-boundary { stroke: var(--text); stroke-width: 1.4; stroke-dasharray: 5 3; fill: none; }
.edesc sub { font-size: 0.72em; }
.edesc sub sub { font-size: 0.8em; }
.etitle { display: block; font-weight: 600; font-size: 16px; line-height: 1.35; }
.emeta { display: block; font-family: var(--sans); font-size: 12.5px; color: var(--faint); margin: 4px 0 6px; line-height: 1.45; }
.edesc { display: block; font-size: 15px; color: var(--muted); line-height: 1.5; }
@media (max-width: 760px) { .earlier { grid-template-columns: 1fr; } }

/* ---------- news / talks ---------- */
.two-col { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 56px; border-top: 1px solid var(--rule); }
.two-col .block { border-top: 0; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; gap: 0; } .two-col .block + .block { border-top: 1px solid var(--rule); } }

.news { list-style: none; margin: 0; padding: 0; }
.news li { display: grid; grid-template-columns: 82px 1fr; gap: 14px; padding: 7px 0; font-size: 16.5px; }
.news time { font-family: var(--sans); font-size: 13px; color: var(--faint); padding-top: 3px; font-variant-numeric: tabular-nums; }

.talks { list-style: none; margin: 0; padding: 0; }
.talks li { padding: 8px 0; }
.ttitle { display: block; font-size: 16.5px; line-height: 1.4; }
.tmeta { display: block; font-family: var(--sans); font-size: 12.5px; color: var(--faint); margin-top: 3px; }

/* ---------- footer ---------- */
.footer {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding-top: 26px; padding-bottom: 46px; border-top: 1px solid var(--rule);
  font-family: var(--sans); font-size: 13px; color: var(--faint);
}
.footer a { color: var(--faint); }
.footer a:hover { color: var(--text); }

/* ---------- research intro with hero figure ---------- */
.bio-lead { font-size: 22px; line-height: 1.4; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 12px !important; }
.research-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px); gap: 44px; align-items: start; padding-bottom: 12px; }
.research-intro .lede { margin: 0; }
.fig-hero { position: relative; }
.fig-hero canvas { aspect-ratio: 5 / 4; }
.chip {
  position: absolute; top: 24px; left: 24px; z-index: 1;
  font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 3px 8px;
}
@media (max-width: 860px) { .research-intro { grid-template-columns: 1fr; gap: 24px; } }

/* ---------- research keywords ---------- */
.research-title { font-family: var(--serif); font-size: 30px; font-weight: 600; line-height: 1.2; letter-spacing: -0.015em; color: var(--accent); margin: 0 0 14px; }
.theme .focus { font-family: var(--sans); font-size: 14px; color: var(--muted); margin: -6px 0 14px; }
.kw-index { list-style: none; padding: 0; margin: 26px 0 0; border-top: 1px solid var(--rule); }
.kw-index li { border-bottom: 1px solid var(--rule); }
.kw-index a { display: flex; align-items: baseline; gap: 14px; padding: 10px 0; font-family: var(--serif); font-size: 18px; font-weight: 600; color: var(--text); text-decoration: none; }
.kw-index a:hover { color: var(--accent); }
.kw-index .num { font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: .14em; color: var(--accent); min-width: 22px; }
@media (max-width: 600px) { .research-title { font-size: 25px; } .kw-index a { font-size: 16.5px; } }

/* ---------- intro without a repeated name (the top bar already shows it) ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.intro .tagline { margin: 6px 0 14px; }
.intro .bio-lead { font-family: var(--serif); font-size: 32px; line-height: 1.22; letter-spacing: -0.02em; margin-bottom: 20px !important; max-width: 20em; text-wrap: balance; }
@media (max-width: 860px) { .intro .bio-lead { font-size: 27px; } }
