/* =========================================================
   Junsol Kim — personal website
   Design benchmarked on byungkyulee.com (Quarto "Trestles" about
   layout): purple fixed navbar, white body, Roboto type, slate-blue
   links, two-column profile (photo + links | bio + news).
   ========================================================= */
:root {
  /* palette */
  --bg:            #ffffff;
  --surface:       #ffffff;
  --ink:           #111111;
  --ink-soft:      #2b2b2b;
  --muted:         #6c757d;
  --muted-light:   #868e96;
  --border:        #dee2e6;
  --border-strong: #ced4da;

  --navbar:        #800000;   /* UChicago maroon */
  --navbar-active: #a83232;
  --link:          #325d88;   /* slate blue */
  --link-hover:    #284a6d;

  /* type */
  --sans: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;

  --fs-xs:   0.8125rem;
  --fs-sm:   0.9rem;
  --fs-base: 1rem;
  --fs-md:   1.1rem;
  --fs-lg:   1.3rem;
  --fs-xl:   1.6rem;
  --fs-2xl:  2.1rem;

  --lh-body: 1.6;

  /* spacing */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 88px;

  --max-w: 1000px;
  --radius: 6px;
  --ease: ease;
  --dur: 200ms;
}

/* =========================================================
   Base
   ========================================================= */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  color: var(--ink);
  background: var(--bg);
  font-weight: 400;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

h1, h2, h3, h4 {
  font-family: var(--sans);
  line-height: 1.2;
  margin: 0;
  color: var(--ink);
  font-weight: 600;
}
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }

p { margin: 0 0 var(--s-4) 0; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--link);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}
a:hover { color: var(--link-hover); text-decoration: underline; }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--s-5);
}

/* =========================================================
   Skip link
   ========================================================= */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: var(--s-3) var(--s-4);
  z-index: 100;
}
.skip:focus { left: var(--s-4); top: var(--s-4); }

/* =========================================================
   Site header / nav  (BK purple fixed bar, centered brand)
   ========================================================= */
.site-header {
  background: var(--navbar);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 0 rgba(0,0,0,.08);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 56px;
  gap: var(--s-7);
}
.brand {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #fff;
}
.brand:hover { color: #fff; text-decoration: none; opacity: .88; }

.nav {
  display: flex;
  gap: var(--s-6);
  font-size: 1rem;
}
.nav a {
  color: rgba(255,255,255,.85);
  font-weight: 600;
  padding: 2px 0;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: #fff; text-decoration: none; }
.nav a.current { color: #fff; border-bottom-color: rgba(255,255,255,.9); }

@media (max-width: 640px) {
  .site-header .container {
    flex-wrap: wrap;
    gap: var(--s-3) var(--s-5);
    min-height: 0;
    padding-top: var(--s-3);
    padding-bottom: var(--s-3);
  }
  .nav { gap: var(--s-5); }
}

/* =========================================================
   Homepage — Trestles two-column profile
   ========================================================= */
.about-trestles {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: var(--s-8);
  padding: var(--s-9) 0 var(--s-8);
}

/* Left column: photo + name + links */
.about-entity {
  flex: 0 0 33%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: sticky;
  top: 86px;
}
.about-image {
  width: 100%;
  max-width: 15em;
  height: auto;
  display: block;
  border-radius: 10px;
  margin: 0 auto var(--s-5);
  background: #f3f3f3;
  box-shadow: 0 2px 16px rgba(17,17,17,.10);
}
.about-name {
  font-size: 1.7rem;
  font-weight: 600;
  margin: 0 0 var(--s-2) 0;
}
.about-tagline {
  font-size: var(--fs-sm);
  color: var(--muted);
  margin: 0 0 var(--s-5) 0;
  line-height: 1.45;
}
.about-links {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  width: 100%;
}
.about-link {
  display: inline-flex;
  align-items: center;
  gap: .35em;
  font-size: 0.78rem;
  line-height: 1.2;
  padding: .28em .55em;
  color: #444;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  white-space: nowrap;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.about-link:hover {
  color: var(--link);
  border-color: var(--link);
  background: #f6f9fc;
  text-decoration: none;
}
.about-link i { font-size: 1em; }

/* Right column: bio + news */
.about-contents {
  flex: 1 1 0;
  min-width: 0;
  border-left: 1px solid var(--border);
  padding-left: var(--s-8);
}
.about-block { margin-bottom: var(--s-8); }
.about-block:last-child { margin-bottom: 0; }
.about-block > h2 {
  font-size: var(--fs-xl);
  margin: 0 0 var(--s-5) 0;
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--border);
}
.about-block p { color: var(--ink-soft); }

@media (max-width: 820px) {
  .about-trestles { flex-direction: column; gap: var(--s-7); padding: var(--s-7) 0; }
  .about-entity { flex: none; width: 100%; position: static; top: auto; }
  .about-image { max-width: 14em; }
  .about-links { max-width: 17em; }
  .about-contents {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--border);
    padding-top: var(--s-7);
    width: 100%;
  }
}

/* =========================================================
   News list
   ========================================================= */
.news {
  list-style: none;
  padding: 0;
  margin: 0;
}
.news li {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: var(--s-5);
  padding: var(--s-4) 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}
.news li:last-child { border-bottom: none; }
.news-date {
  font-size: var(--fs-sm);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@media (max-width: 540px) {
  .news li { grid-template-columns: minmax(0, 1fr); gap: var(--s-1); }
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  border-top: 1px solid var(--border);
  background: #fff;
  margin-top: var(--s-8);
  padding: var(--s-6) 0;
}
.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-4);
  flex-wrap: wrap;
  font-size: var(--fs-sm);
  color: #757575;
}
.site-footer a { color: #757575; }
.site-footer a:hover { color: var(--link); }
.social {
  display: flex;
  gap: var(--s-5);
  list-style: none;
  padding: 0;
  margin: 0;
}

/* =========================================================
   Inner pages — page header / sections
   ========================================================= */
.page-header {
  padding: var(--s-9) 0 var(--s-6);
  border-bottom: 1px solid var(--border);
}
.eyebrow {
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--link);
  margin-bottom: var(--s-3);
  display: inline-block;
  font-weight: 500;
}
.page-header h1 { margin-bottom: var(--s-4); font-size: var(--fs-2xl); }
.lead {
  font-size: var(--fs-md);
  color: var(--ink-soft);
  max-width: 46rem;
}

.section { padding: var(--s-7) 0; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-4);
  margin-bottom: var(--s-5);
  flex-wrap: wrap;
}
.section-head h2 { margin: 0; }
.link-arrow { font-size: var(--fs-sm); color: var(--link); }
.link-arrow::after { content: " \2192"; }

/* =========================================================
   Research page — projects with representative papers
   ========================================================= */
.project {
  padding: var(--s-8) 0;
  border-bottom: 1px solid var(--border);
}
.project:last-child { border-bottom: none; }
.project-head {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: var(--s-4);
  align-items: baseline;
  margin-bottom: var(--s-4);
}
.project-num {
  font-size: var(--fs-sm);
  color: var(--link);
  font-weight: 600;
  letter-spacing: 0.06em;
}
.project-title {
  font-size: var(--fs-xl);
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
}
.project-body {
  max-width: 48rem;
  margin-left: calc(56px + var(--s-4));
  color: var(--ink-soft);
}
.project-figure {
  margin: var(--s-5) 0 0 calc(56px + var(--s-4));
  max-width: 30rem;
}
.project-figure img {
  width: 100%;
  height: auto;
  display: block;
}

.project-papers {
  margin-left: calc(56px + var(--s-4));
  margin-top: var(--s-5);
  padding-top: var(--s-4);
  border-top: 1px dashed var(--border-strong);
}
.project-papers h4 {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 var(--s-4) 0;
  font-weight: 600;
}
@media (max-width: 640px) {
  .project-head { grid-template-columns: minmax(0, 1fr); gap: var(--s-1); }
  .project-body, .project-papers { margin-left: 0; }
  .project-figure { margin-left: 0; }
}

/* =========================================================
   Publication list (used on the research page)
   ========================================================= */
.pub-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--s-5);
}
.pub {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: var(--s-4);
  align-items: baseline;
}
.pub-year {
  font-size: var(--fs-sm);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.pub-body h3 {
  font-size: var(--fs-md);
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 var(--s-1) 0;
}
.pub-body h3 a { color: var(--ink); }
.pub-body h3 a:hover { color: var(--link); }
.pub-authors {
  font-size: var(--fs-sm);
  color: var(--muted);
  margin-bottom: var(--s-1);
}
.pub-authors em { font-style: italic; color: var(--ink-soft); }
.pub-venue {
  font-style: italic;
  font-size: var(--fs-sm);
  color: var(--ink-soft);
}
.pub-badge {
  display: inline-block;
  margin-left: var(--s-2);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--link);
  border: 1px solid var(--link);
  padding: 1px var(--s-2);
  border-radius: 4px;
  vertical-align: middle;
  font-style: normal;
}
@media (max-width: 540px) {
  .pub { grid-template-columns: minmax(0, 1fr); gap: var(--s-1); }
}
