/* ==========================================================================
   Eunwoo Kim — academic site
   Light theme only: light background, dark text.
   ========================================================================== */

:root {
  --bg: #fcfcfb;
  --bg-alt: #f5f5f3;
  --text: #1a1a1a;
  --text-soft: #3d3d3d;
  --muted: #6a6a6a;
  --accent: #1f3f6b;
  --accent-soft: #eaeff6;
  --card-bg: #ffffff;
  --border: #e2e0da;
  --border-strong: #cfccc4;
  --max-width: 780px;
  --wide-width: 880px;
  --serif: "Newsreader", Georgia, "Apple SD Gothic Neo", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --mono: "SFMono-Regular", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

/* --------------------------------------------------------------- Top nav */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(252, 252, 251, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.topbar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.15rem;
}

.topbar nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}

.topbar nav a:hover { color: var(--accent); }

.topbar nav a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ------------------------------------------------------------------ Hero */

.hero {
  padding: 4rem 1.5rem 2.75rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  margin: 0 0 0.5rem;
  font-size: 2.6rem;
  letter-spacing: -0.015em;
  line-height: 1.15;
}

.pronouns {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 1.05rem;
  color: var(--muted);
  letter-spacing: 0;
  white-space: nowrap;
}

.tagline {
  color: var(--text-soft);
  margin: 0 0 0.35rem;
  font-size: 1.08rem;
  font-weight: 500;
}

.tagline-sub {
  color: var(--muted);
  margin: 0 0 1.6rem;
  font-size: 0.92rem;
}

.tagline-sub a { color: var(--muted); text-decoration-color: var(--border-strong); }
.tagline-sub a:hover { color: var(--accent); }

.icon-links {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.9rem;
  padding: 0;
  margin: 0;
}

.icon-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 1px solid var(--border-strong);
  color: var(--text);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.icon-links a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.icon-links svg { width: 18px; height: 18px; }

/* ----------------------------------------------------------- Page header */

.page-header {
  padding: 2.75rem 1.5rem 1.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}

.page-header-inner {
  max-width: var(--wide-width);
  margin: 0 auto;
}

.page-header h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 2.05rem;
  margin: 0;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.page-header .page-sub {
  color: var(--muted);
  margin: 0.6rem 0 0;
  font-size: 0.95rem;
  max-width: 60ch;
}

.breadcrumb {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 0.7rem;
}

.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }
.breadcrumb span { margin: 0 0.4rem; color: var(--border-strong); }

/* ------------------------------------------------------------------ Main */

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.75rem 1.5rem 1rem;
}

main.wide { max-width: var(--wide-width); }

section { margin-bottom: 3.25rem; }

section h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.55rem;
  margin: 0 0 1.3rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

section h2::after {
  content: "";
  display: block;
  width: 38px;
  height: 3px;
  background: var(--accent);
  margin-top: 0.5rem;
}

h3 {
  font-family: var(--serif);
  font-size: 1.22rem;
  font-weight: 600;
  margin: 2rem 0 0.7rem;
  letter-spacing: -0.005em;
}

h4 {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
  color: var(--text);
}

p { margin: 0 0 1.1rem; }

.section-intro {
  color: var(--text);
  margin: 0 0 2rem;
  font-size: 1.02rem;
}

.lead {
  font-size: 1.05rem;
  color: var(--text);
}

/* -------------------------------------------------------------- Timeline */

.timeline {
  border-left: 2px solid var(--border);
  padding-left: 1.35rem;
  margin-left: 0.25rem;
}

.timeline-item {
  position: relative;
  margin-bottom: 1.6rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.8rem;
  top: 0.45rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--bg);
}

.timeline-date {
  display: block;
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.1rem;
}

.timeline-text { display: block; }

.timeline-role {
  font-weight: 600;
  color: var(--text);
}

.timeline-meta {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.1rem;
}

.timeline-thesis {
  display: block;
  font-size: 0.9rem;
  color: var(--text-soft);
  margin-top: 0.35rem;
  padding-left: 0.8rem;
  border-left: 2px solid var(--border);
}

.timeline-text p {
  margin: 0.5rem 0 0;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.timeline-text ul {
  margin: 0.6rem 0 0;
  padding-left: 1.15rem;
}

.timeline-text li {
  margin-bottom: 0.4rem;
  color: var(--text-soft);
  font-size: 0.95rem;
}

/* ---------------------------------------------------------- Project card */

.project-card {
  display: flex;
  gap: 1.4rem;
  align-items: flex-start;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.4rem 1.5rem;
  margin-bottom: 1.1rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.project-card .card-body { flex: 1; min-width: 0; }

.card-thumb {
  flex: 0 0 190px;
  height: 150px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  overflow: hidden;
}

.card-thumb img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.project-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 18px rgba(31, 63, 107, 0.08);
  transform: translateY(-1px);
}

.project-card h3 {
  font-size: 1.14rem;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.project-card p {
  margin: 0 0 0.8rem;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.project-card .card-more {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--accent);
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.75rem;
}

/* ---------------------------------------------------------------- Badges */

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid #d5e0ee;
  white-space: nowrap;
}

.badge.neutral {
  background: var(--bg-alt);
  color: var(--muted);
  border-color: var(--border);
}

.tag {
  display: inline-block;
  font-size: 0.78rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: var(--bg-alt);
  color: var(--text-soft);
  border: 1px solid var(--border);
}

/* -------------------------------------------------------------- Abstract */

.abstract {
  background: var(--card-bg);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 1.4rem 1.6rem;
  margin: 0 0 2rem;
}

.abstract h2 {
  font-family: var(--sans);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.7rem;
}

.abstract h2::after { display: none; }

.abstract p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
}

/* --------------------------------------------------------- Study meta bar */

.study-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.2rem;
  align-items: center;
  padding: 0.9rem 1.1rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 0 0 2rem;
  font-size: 0.88rem;
  color: var(--text-soft);
}

.study-meta .meta-label {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-right: 0.3rem;
}

.study-meta > div { display: flex; align-items: baseline; gap: 0.2rem; }

/* ------------------------------------------------------- Method callouts */

.method-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.4rem;
  border-top: 1px solid var(--border);
}

.method-list li {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  color: var(--text-soft);
}

.method-list .m-label {
  display: block;
  font-weight: 600;
  color: var(--text);
  font-size: 0.92rem;
  margin-bottom: 0.15rem;
}

.callout {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  padding: 1rem 1.2rem;
  margin: 0 0 1.5rem;
  font-size: 0.94rem;
  color: var(--text-soft);
}

.callout strong { color: var(--text); }

/* --------------------------------------------------------------- Figures */

.research-figure {
  margin: 1.5rem 0 1.8rem;
  padding: 1rem;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
}

.research-figure img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  max-height: 380px;
  width: auto;
  height: auto;
  border-radius: 4px;
}

.research-figure figcaption {
  margin-top: 0.8rem;
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.55;
  text-align: left;
}

.research-figure figcaption .fig-label {
  font-weight: 600;
  color: var(--text);
}

.research-figure figcaption .fig-source {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.research-figure figcaption .fig-source a {
  color: var(--muted);
  text-decoration-color: var(--border-strong);
  overflow-wrap: anywhere;
}

.research-figure figcaption .fig-source a:hover { color: var(--accent); }

/* ------------------------------------------------------------ Code blocks */

.code-block {
  background: #1e2530;
  border-radius: 8px;
  padding: 1rem 1.1rem;
  margin: 0 0 1.2rem;
  overflow-x: auto;
}

.code-block pre {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.6;
  color: #e3e8ef;
  white-space: pre;
}

.code-caption {
  font-size: 0.83rem;
  color: var(--muted);
  margin: -0.6rem 0 1.5rem;
}

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--bg-alt);
  padding: 0.1rem 0.32rem;
  border-radius: 3px;
  border: 1px solid var(--border);
}

/* ------------------------------------------------------------ Link lists */

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0 0 1.5rem;
}

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--accent);
  background: var(--card-bg);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 0.4rem 0.85rem;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-link:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-link svg { width: 15px; height: 15px; }

.plain-list { padding-left: 1.2rem; }
.plain-list li { margin-bottom: 0.55rem; }

/* ------------------------------------------------------------- Skill sets */

.skill-group {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.3rem 1.5rem;
  margin-bottom: 1.1rem;
  background: var(--card-bg);
}

.skill-group h3 {
  margin: 0 0 0.3rem;
  font-size: 1.1rem;
}

.skill-group .skill-detail {
  font-size: 0.94rem;
  color: var(--text-soft);
  margin: 0 0 0.9rem;
}

.skill-group .applied {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0.8rem 0 0;
  padding-top: 0.8rem;
  border-top: 1px dashed var(--border);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.3rem;
}

.skill-tags a,
.skill-tags span {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  font-size: 0.83rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid #d5e0ee;
}

.skill-tags a:hover { background: var(--accent); color: #fff; }

/* ------------------------------------------------------------- Next/prev */

.page-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  margin-top: 2.5rem;
  font-size: 0.88rem;
}

.page-nav a { text-decoration: none; font-weight: 500; }
.page-nav a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- Footer */

footer {
  text-align: center;
  padding: 2.25rem 1rem;
  color: var(--muted);
  font-size: 0.83rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

footer a { color: var(--muted); }

/* --------------------------------------------------------------- Mobile */

@media (max-width: 640px) {
  .topbar-inner { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .topbar nav { gap: 0.9rem; }
  .topbar nav a { font-size: 0.82rem; }
  .hero { padding: 3rem 1.25rem 2.25rem; }
  .hero h1 { font-size: 2.05rem; }
  .pronouns { font-size: 0.95rem; }
  .page-header h1 { font-size: 1.7rem; }
  main { padding: 2rem 1.25rem 1rem; }
  .study-meta { flex-direction: column; align-items: flex-start; gap: 0.35rem; }
  .project-card { flex-direction: column; gap: 1rem; }
  .card-thumb { flex: none; width: 100%; height: 130px; }
}
