/* ==========================================================================
   junwoop0.github.io — hand-rolled stylesheet, no framework.
   Light/dark follows the visitor's OS preference automatically.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f8;
  --text: #1f2428;
  --muted: #667079;
  --hairline: #e4e7ea;
  --accent: #0064a4;        /* UCI blue */
  --accent-strong: #00507f;
  --thumb-bg: #ffffff;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161a;
    --bg-soft: #1a2026;
    --text: #e3e7ea;
    --muted: #98a3ac;
    --hairline: #2b333b;
    --accent: #6cb2dd;
    --accent-strong: #93c8e8;
    --thumb-bg: #f3f4f6;
  }
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, .site-name {
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-weight: 600;
  line-height: 1.25;
}

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

::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }

.container {
  max-width: 56rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.muted { color: var(--muted); font-weight: 400; }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
}

.site-name {
  color: var(--text);
  font-size: 1.05rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.site-header.scrolled .site-name {
  opacity: 1;
  pointer-events: auto;
}
.site-name:hover { color: var(--text); text-decoration: none; }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.1rem;
  font-size: 0.875rem;
}
.site-nav a { color: var(--muted); font-weight: 500; }
.site-nav a:hover { color: var(--accent); text-decoration: none; }
.site-nav a.active { color: var(--accent); }

/* ----- hero ----- */

.hero { padding-top: 3.5rem; }

.hero-top {
  display: flex;
  align-items: center;
  gap: 3rem;
}

.hero-text { flex: 1 1 auto; min-width: 0; }

.hero h1 {
  font-size: 2.4rem;
  margin: 0 0 0.35rem;
}

.hero-role {
  margin: 0 0 0.25rem;
  font-weight: 500;
}

.hero-email {
  margin: 0 0 1.1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.hero-photo {
  flex: 0 0 auto;
  width: 215px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: 58% 20%;
  border-radius: 18px;
  border: 1px solid var(--hairline);
}

.interests {
  margin: 0 0 1.4rem;
  padding-left: 1.2rem;
}
.interests li { margin-bottom: 0.3rem; }

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.4rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
}
.pill svg { width: 15px; height: 15px; color: var(--muted); }
.pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
.pill:hover svg { color: var(--accent); }

/* ----- sections ----- */

section { scroll-margin-top: 4.5rem; }

main > section { margin-bottom: 0.5rem; }

h2 {
  font-size: 1.45rem;
  margin: 3.2rem 0 0.4rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--hairline);
}

h3 {
  font-size: 1.05rem;
  margin: 0;
}

/* ----- news ----- */

.news-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}

.news-list li {
  display: grid;
  grid-template-columns: 5.6rem 1fr;
  gap: 1rem;
  margin-bottom: 0.65rem;
}

.news-date {
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  padding-top: 0.15rem;
  white-space: nowrap;
}

/* ----- media items (publications / projects) ----- */

.item-list > * {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--hairline);
}
.item-list > *:last-child { border-bottom: none; }

.media-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.6rem;
  padding: 1.5rem 0;
}
section > .media-item { border: none; }  /* single publication: no divider needed */

.media-thumb {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--hairline);
  margin-top: 0.3rem;
}

/* figures (paper diagrams) shouldn't be cropped */
.media-thumb.figure {
  object-fit: contain;
  background: var(--thumb-bg);
  padding: 0.4rem;
}

.media-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.media-date {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.media-body p { margin: 0.55rem 0 0; font-size: 0.95rem; }

.media-meta {
  color: var(--muted);
  font-size: 0.9rem !important;
  margin-top: 0.25rem !important;
}

.media-links { font-size: 0.9rem; font-weight: 500; }
.media-links a { margin-right: 1rem; }
.media-links a:last-child { margin-right: 0; }

/* ----- footer ----- */

.site-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--hairline);
}

.footer-inner {
  padding-top: 1.4rem;
  padding-bottom: 2.2rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ----- responsive ----- */

@media (max-width: 640px) {
  .hero { padding-top: 2.25rem; }
  .hero-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.75rem;
  }
  .hero-photo {
    order: -1;
    width: 140px;
  }
  .hero h1 { font-size: 2rem; }

  .media-item { grid-template-columns: 1fr; gap: 1rem; }
  .media-thumb { max-width: 400px; }

  .news-list li { grid-template-columns: 1fr; gap: 0.1rem; margin-bottom: 0.9rem; }
}
