/* Eunsang Kim — personal site. Plain CSS, no build step. */
:root {
  --bg: #ffffff;
  --surface: #f6f6f2;
  --ink: #161714;
  --ink-2: #565851;
  --ink-3: #7b7d75;
  --line: #e6e6df;
  --accent: #2f6b4f;
  --accent-soft: #e8f0eb;
  /* one colour per research question / theme */
  --q1: #3f7d5a;   /* communities & social infrastructure — forest */
  --q2: #3a6f98;   /* social policy & inequality — water */
  --q3: #b9832f;   /* valuation & markets — earth */
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Apple SD Gothic Neo", sans-serif;
  --serif: "Newsreader", "Iowan Old Style", Georgia, "Apple SD Gothic Neo", serif;
  --sidebar: 240px;
  --content: 700px;
  --radius: 6px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141513; --surface: #1c1d1a; --ink: #eeeee8; --ink-2: #b4b5ad;
    --ink-3: #8a8b83; --line: #2b2c28; --accent: #7fbf9c; --accent-soft: #1f2a24;
    --q1: #7fbf9c; --q2: #82b1d6; --q3: #ddb06a;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.65 var(--sans); -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { color: var(--accent); text-decoration-color: currentColor; }
img { max-width: 100%; display: block; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 40px 28px;
  border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 28px;
}
.brand { text-decoration: none; }
.brand .name { font: 600 19px/1.25 var(--serif); }
.brand .name-ko { font: 400 12.5px/1.4 "Noto Serif KR", var(--serif); color: var(--ink-3); margin-top: 3px; letter-spacing: 0.04em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  text-decoration: none; color: var(--ink-2); font-size: 14px;
  padding: 5px 10px; margin-left: -10px; border-radius: var(--radius);
}
.nav a:hover { color: var(--ink); background: var(--surface); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: inset 2px 0 0 var(--accent); }
.side-links { margin-top: auto; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.side-links a { text-decoration: none; color: var(--ink-2); }
.side-links a:hover { color: var(--accent); }

.main { min-width: 0; padding: 0 48px 80px; }
.block, .page-head, .foot, .hero-text { max-width: var(--content); margin-left: auto; margin-right: auto; }

/* ---------- home hero with flock ---------- */
.hero { position: relative; height: min(400px, 60vh); display: flex; align-items: flex-end; padding-bottom: 44px; }
.stream {
  position: absolute; inset: 0 -48px 0 -48px; width: calc(100% + 96px); height: 100%;
  -webkit-mask-image: linear-gradient(to bottom, #000 45%, transparent 78%);
          mask-image: linear-gradient(to bottom, #000 45%, transparent 78%);
}
.hero-text { position: relative; width: 100%; pointer-events: none; animation: rise 900ms cubic-bezier(.2,.7,.2,1) both 150ms; }
.hero-text a { pointer-events: auto; }
.hero h1 { font: 400 clamp(32px, 4vw, 42px)/1.1 var(--serif); margin: 0 0 8px; letter-spacing: -0.015em; }
.hero .ko-mobile { display: none; font: 400 14px/1.4 "Noto Serif KR", var(--serif); color: var(--ink-3); letter-spacing: 0.04em; margin: -4px 0 10px; }
.hero .role { font-size: 15px; margin: 0 0 4px; color: var(--ink-2); }
.hero .fields { font-size: 13px; color: var(--ink-3); margin: 0; }

@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

/* ---------- sub-page header ---------- */
.page-head { padding: 72px 0 28px; }
.page-head h1 { font: 400 clamp(30px, 3.6vw, 38px)/1.1 var(--serif); margin: 0; letter-spacing: -0.015em; }
.page-head p { color: var(--ink-3); margin: 8px 0 0; font-size: 14px; }
.hero.hero-sub { height: 250px; padding-bottom: 30px; }
.hero.hero-sub h1 { font-size: clamp(30px, 3.6vw, 38px); margin: 0; }

/* ---------- sections ---------- */
.block { padding: 36px 0 8px; border-top: 1px solid var(--line); }
.block > h2 { font: 500 24px/1.2 var(--serif); margin: 0 0 20px; }
.block h3 {
  font: 600 12px/1.4 var(--sans); text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-3); margin: 32px 0 14px;
}
.block h3:first-of-type { margin-top: 8px; }
.prose p { margin: 0 0 14px; }

.about { display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 32px; align-items: start; }
.portrait { width: 170px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 8px; }

/* research questions: numbered rows tied to theme colours */
.rq { margin: 26px 0 8px; padding: 0; list-style: none; }
.rq li {
  display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 4px 14px;
  padding: 18px 0; border-top: 1px solid var(--line);
}
.rq li:last-child { border-bottom: 1px solid var(--line); }
.rq .num { font: 400 30px/1 var(--serif); color: var(--c); padding-top: 2px; }
.rq .num::after { content: ""; display: block; width: 22px; height: 2px; margin-top: 10px; background: var(--c); opacity: .7; }
.rq p { margin: 0; }
.rq .q { font: 400 17.5px/1.5 var(--serif); }
.rq .more { grid-column: 2; font-size: 12.5px; color: var(--ink-3); text-decoration: none; margin-top: 6px; }
.rq .more:hover { color: var(--c); }
.c1 { --c: var(--q1); } .c2 { --c: var(--q2); } .c3 { --c: var(--q3); }

.venue { font-size: 14px; color: var(--ink-2); margin: 18px 0 0; }

/* education / simple lists */
.dl { display: grid; grid-template-columns: 1fr auto; gap: 6px 20px; margin: 0; }
.dl dt { margin: 0; }
.dl dd { margin: 0; color: var(--ink-3); font-size: 14px; font-variant-numeric: tabular-nums; text-align: right; }
.dl .note { color: var(--ink-3); font-style: italic; }
.contact p { margin: 0 0 6px; }

/* ---------- research ---------- */
.topic-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.pill {
  font: 500 13px/1 var(--sans); height: 30px; padding: 0 12px; border: 0; cursor: pointer;
  border-radius: 999px; color: var(--ink-2); background: transparent; box-shadow: inset 0 0 0 1px var(--line);
  display: inline-flex; align-items: center; gap: 7px;
}
.pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.pill:hover { color: var(--ink); background: var(--surface); }
.pill[aria-pressed="true"] { color: var(--bg); background: var(--ink); box-shadow: none; }
.legend { font-size: 12px; color: var(--ink-3); margin: 8px 0 0; }

.theme[hidden] { display: none; }
.theme h3 { display: flex; align-items: center; gap: 8px; }
.theme h3 i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.paper { padding: 16px 0; border-bottom: 1px solid var(--line); }
.paper:last-child { border-bottom: 0; }
.paper .title { font: 500 17px/1.4 var(--serif); margin: 0 0 4px; }
.paper .meta { font-size: 14px; color: var(--ink-2); margin: 0; }
.tag {
  display: inline-block; font: 600 10.5px/1 var(--sans); letter-spacing: 0.06em; text-transform: uppercase;
  padding: 4px 7px; border-radius: 4px; margin-right: 8px; vertical-align: 2px;
  color: var(--ink-2); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
}
.tag.pub { color: var(--accent); background: var(--accent-soft); box-shadow: none; }
.honor { font-size: 13px; color: var(--accent); margin: 4px 0 0; }
.links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: flex-start; }
.lpill {
  display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: var(--radius);
  font-size: 12.5px; text-decoration: none; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line);
}
.lpill:hover { color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
details { width: auto; }
details[open] { width: 100%; }
details > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; height: 26px; padding: 0 10px;
  border-radius: var(--radius); font-size: 12.5px; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line);
}
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: "+"; margin-left: 6px; color: var(--ink-3); }
details[open] > summary::after { content: "–"; }
details > summary:hover { color: var(--accent); }
.abstract { font-size: 14px; color: var(--ink-2); margin: 12px 0 4px; padding-left: 14px; border-left: 2px solid var(--line); }
.abstract p { margin: 0 0 10px; }

.awards { list-style: none; margin: 0; padding: 0; }
.awards li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.awards li:last-child { border-bottom: 0; }
.awards .aw { font-weight: 600; }
.awards .org { color: var(--ink-2); font-size: 14px; }
.awards .paper-t { font: italic 15px/1.45 var(--serif); color: var(--ink-2); margin-top: 2px; }
.awards .date { float: right; color: var(--ink-3); font-size: 13px; margin-left: 12px; }
.awards .links { margin-top: 6px; }

.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 8px; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; height: 220px; object-fit: contain; border-radius: var(--radius); background: var(--surface); padding: 8px; }
.gallery figcaption { font-size: 12px; color: var(--ink-3); margin-top: 6px; line-height: 1.4; }

/* ---------- cards (engagement / outside) ---------- */
.item { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 26px; padding: 26px 0; border-bottom: 1px solid var(--line); align-items: start; }
.item:last-child { border-bottom: 0; }
.item.noimg { grid-template-columns: 1fr; }
.item .pic { display: flex; flex-direction: column; gap: 8px; }
.item .pic img { width: 100%; height: auto; max-height: 300px; object-fit: cover; border-radius: var(--radius); }
.item .pic img.full { max-height: none; }
.item .pic .thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.item .pic .thumbs img { aspect-ratio: 1; object-fit: cover; max-height: none; }
.item .pic img.logo { object-fit: contain; background: #fff; padding: 18px; }
.item h4 { font: 500 18px/1.35 var(--serif); margin: 0 0 2px; }
.item .sub { font-size: 13px; color: var(--ink-3); margin: 0 0 10px; }
.item ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 14px; }
.item li { margin-bottom: 4px; }
.item p { margin: 0 0 8px; color: var(--ink-2); font-size: 14px; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); margin-top: 48px; padding-top: 24px; color: var(--ink-3); font-size: 13px; }
.foot blockquote { font: italic 16px/1.5 var(--serif); color: var(--ink-2); margin: 0 0 12px; }
.foot p { margin: 0; }

/* ---------- mobile ---------- */
.topbar { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar {
    display: flex; position: sticky; top: 0; z-index: 5; gap: 4px; overflow-x: auto; align-items: center;
    padding: 10px 16px; background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
  }
  .topbar a { white-space: nowrap; text-decoration: none; font-size: 13px; color: var(--ink-2); padding: 4px 10px; border-radius: 999px; }
  .topbar a[aria-current="page"] { color: var(--bg); background: var(--ink); }
  html { scroll-padding-top: 60px; }
  .main { padding: 0 20px 60px; }
  .hero { height: 300px; padding-bottom: 28px; }
  .hero .ko-mobile { display: block; }
  .stream { inset: 0 -20px; width: calc(100% + 40px); }

  .page-head { padding-top: 36px; }
  .hero.hero-sub { height: 190px; padding-bottom: 22px; }
  .about { grid-template-columns: 1fr; gap: 20px; }
  .portrait { width: 140px; order: -1; }
  .rq li { grid-template-columns: 40px minmax(0, 1fr); }
  .rq .num { font-size: 24px; }
  .item { grid-template-columns: 1fr; gap: 14px; }
  .item .pic img { max-height: 340px; }
  .gallery { grid-template-columns: 1fr; }
  .awards .date { float: none; display: block; margin: 0; }
}
/* ---------- laptop / desktop: larger, easier-to-read type ---------- */
@media (min-width: 861px) {
  :root { --sidebar: 264px; --content: 780px; }
  body { font-size: 17px; }
  .brand .name { font-size: 22px; }
  .brand .name-ko { font-size: 14px; }
  .nav a { font-size: 16px; }
  .side-links { font-size: 14.5px; }
  .hero { height: min(440px, 62vh); }
  .hero h1 { font-size: clamp(38px, 4.4vw, 50px); }
  .hero .role { font-size: 17px; }
  .hero .fields { font-size: 15px; }
  .page-head h1 { font-size: clamp(36px, 4vw, 44px); }
  .hero.hero-sub { height: 280px; }
  .hero.hero-sub h1 { font-size: clamp(36px, 4vw, 44px); }
  .page-head p { font-size: 16px; }
  .block > h2 { font-size: 27px; }
  .block h3 { font-size: 13.5px; }
  .about { grid-template-columns: minmax(0, 1fr) 190px; }
  .portrait { width: 190px; }
  .rq li { grid-template-columns: 60px minmax(0, 1fr); }
  .rq .num { font-size: 34px; }
  .rq .q { font-size: 19.5px; }
  .rq .more { font-size: 14px; }
  .venue { font-size: 16px; }
  .dl dd { font-size: 16px; }
  .pill { font-size: 14.5px; height: 34px; padding: 0 14px; }
  .legend { font-size: 13.5px; }
  .paper .title { font-size: 19px; }
  .paper .meta { font-size: 16px; }
  .tag { font-size: 11.5px; }
  .honor { font-size: 14.5px; }
  .lpill, details > summary { font-size: 14px; height: 30px; padding: 0 12px; }
  .abstract { font-size: 16px; }
  .awards .org { font-size: 16px; }
  .awards .paper-t { font-size: 17px; }
  .awards .date { font-size: 14.5px; }
  .gallery img { height: 250px; }
  .gallery figcaption { font-size: 13.5px; }
  .item { grid-template-columns: 240px minmax(0, 1fr); gap: 30px; }
  .item h4 { font-size: 20.5px; }
  .item .sub { font-size: 14.5px; }
  .item ul, .item p { font-size: 16px; }
  .foot { font-size: 14.5px; }
  .foot blockquote { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { .hero-text { animation: none; } }
