/*
  Hyunjae (Jay) Kang — minimal academic website
  Plain HTML/CSS. No build step. Text-first, single column.
*/

:root {
  --ink: #1a1a1a;
  --muted: #707070;
  --line: #e4e4e4;
  --link: #1a1a1a;
  --accent: #3d5a99;        /* refined slate indigo */
  --accent-deep: #2c4373;   /* darker, for hover/contrast */
  --accent-soft: #aebbdd;   /* light tint for underlines */
  --max-width: 680px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  border-top: 3px solid var(--accent);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--accent-soft);
}

a:hover,
a:focus {
  color: var(--accent-deep);
  text-decoration-color: var(--accent);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 22px;
}

/* ---------- Header / nav ---------- */

.site-header {
  padding: 40px 0 0;
}

.nav-wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.brand {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0;
}

.brand:hover,
.brand:focus {
  color: var(--accent);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 15px;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0;
}

.nav a:hover,
.nav a:focus,
.nav a.active {
  color: var(--accent);
}

.nav a.active {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--accent);
}

/* ---------- Layout ---------- */

main {
  padding: 36px 0 56px;
}

.hero,
.two-column {
  display: block;
}

/* ---------- Intro (text + profile photo) ---------- */

.intro {
  display: flex;
  align-items: flex-start;
  gap: 30px;
}

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

.profile-photo {
  flex: none;
  width: 240px;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--line);
  box-shadow: 0 6px 22px rgba(44, 67, 115, 0.12);
}

/* ---------- Typography ---------- */

.kicker {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 10px;
}

h1,
h2,
h3 {
  line-height: 1.3;
  margin: 0 0 12px;
  font-weight: 600;
}

h1 {
  font-size: 30px;
  letter-spacing: -0.01em;
  color: var(--accent-deep); /* fallback if background-clip unsupported */
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  h1 {
    background: linear-gradient(100deg, var(--accent-deep) 0%, var(--accent) 55%, #6b7fb3 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
}

h2 {
  font-size: 17px;
  margin-top: 44px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.container > h2:first-child {
  margin-top: 4px;
}

h3 {
  font-size: 16px;
}

.lead {
  font-size: 19px;
  line-height: 1.5;
  color: var(--ink);
  margin: 0 0 14px;
}

.meta-line {
  color: var(--muted);
  font-size: 15px;
  margin: 0 0 10px;
}

p {
  margin: 0 0 14px;
}

/* ---------- Links row (replaces buttons) ---------- */

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 18px 0 0;
  font-size: 15px;
}

.button {
  display: inline;
  border: 0;
  background: none;
  padding: 0;
  color: var(--link);
  border-radius: 0;
  box-shadow: none;
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: #bdbdbd;
}

.button:hover,
.button:focus {
  text-decoration-color: var(--ink);
}

.button.primary {
  font-weight: 600;
}

/* ---------- Papers / lists ---------- */

.paper-list {
  display: grid;
  gap: 26px;
  margin-top: 18px;
}

.paper,
.tile,
.notice,
.timeline-item,
.schedule-row,
.workshop-hero,
.profile-card {
  background: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.paper-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0;
  margin: 0 0 3px;
}

/* title doubles as the link to the paper — looks like a title, not a link */
a.paper-title,
.paper-title a {
  color: var(--ink);
  text-decoration: none;
}

a.paper-title:hover,
a.paper-title:focus,
.paper-title a:hover,
.paper-title a:focus {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-soft);
  text-underline-offset: 2px;
}

/* a small reference link sitting inline next to the title (e.g., NBER version) */
details.paper > summary .paper-headline {
  display: block;
}

details.paper > summary .paper-headline .paper-title {
  display: inline;
}

.paper-ref {
  margin-left: 8px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--muted);
}

.paper-meta {
  color: var(--muted);
  font-size: 15px;
  margin: 0 0 6px;
}

.paper p {
  color: #333;
  margin: 6px 0 0;
}

/* supplementary lines inside an expanded paper (presented at, recognition, etc.) */
.paper-body .paper-note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  margin: 9px 0 0;
}

.note-label {
  color: var(--accent);
  font-weight: 600;
  margin-right: 4px;
}

.paper-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 8px;
  font-size: 15px;
}

/* ---------- Collapsible papers (details/summary) ---------- */

details.paper > summary {
  list-style: none;
  cursor: pointer;
  position: relative;
  padding-left: 19px;
  outline: none;
}

details.paper > summary::-webkit-details-marker {
  display: none;
}

/* custom chevron in the accent color */
details.paper > summary::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 8px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--accent);
  border-bottom: 1.5px solid var(--accent);
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
}

details.paper[open] > summary::before {
  transform: rotate(45deg);
}

details.paper > summary .paper-title {
  display: block;
  margin: 0;
  transition: color 0.15s ease;
}

details.paper > summary .paper-meta {
  margin: 3px 0 0;
}

details.paper > summary:hover .paper-title,
details.paper[open] > summary .paper-title {
  color: var(--accent);
}

details.paper > summary:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 3px;
  border-radius: 2px;
}

.paper-body {
  padding-left: 19px;
  margin-top: 8px;
}

details.paper[open] > .paper-body {
  animation: paper-reveal 0.22s ease;
}

@keyframes paper-reveal {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* status text, formerly a colored badge */
.badge {
  display: inline;
  border-radius: 0;
  padding: 0;
  background: none;
  color: var(--muted);
  font-size: inherit;
  font-weight: 400;
  font-style: italic;
  margin-right: 10px;
}

/* revise-and-resubmit highlight: mild blue */
.badge-rr {
  color: var(--accent);
}

/* ---------- Section grids -> simple stacked blocks ---------- */

.section-grid {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.tile h3 {
  margin-bottom: 2px;
}

.tile p,
.notice p,
.timeline-item p {
  color: var(--muted);
  margin: 2px 0 0;
}

/* ---------- Page title ---------- */

.page-title {
  margin-bottom: 20px;
}

.page-title h1 {
  font-size: 30px;
}

/* ---------- Sidebars / notices ---------- */

.notice {
  margin-top: 16px;
}

.two-column > .notice,
aside.notice {
  border-left: 2px solid var(--line);
  padding-left: 16px;
  margin-top: 40px;
}

.sidebar-note {
  border-left: 2px solid var(--line);
  padding-left: 16px;
  color: var(--muted);
}

.list-plain {
  margin: 8px 0 0;
  padding-left: 18px;
}

.list-plain li + li {
  margin-top: 6px;
}

/* ---------- Timeline (CV) ---------- */

.timeline {
  display: grid;
  gap: 16px;
  margin-top: 8px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 16px;
}

.timeline-item h3 {
  margin-bottom: 2px;
}

.year {
  color: var(--muted);
  font-weight: 500;
  font-size: 15px;
}

/* ---------- Workshop ---------- */

.workshop-hero {
  margin-bottom: 8px;
}

.schedule {
  display: grid;
  gap: 0;
  margin-top: 14px;
}

.schedule-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 18px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.schedule-time {
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

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

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 26px 0 48px;
  margin-top: 56px;
  font-size: 14px;
}

.footer-wrap {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

/* ---------- Responsive ---------- */

@media (max-width: 560px) {
  .timeline-item,
  .schedule-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  h1,
  .page-title h1 {
    font-size: 26px;
  }

  .intro {
    flex-direction: column-reverse;
    gap: 18px;
  }

  .profile-photo {
    width: 240px;
  }
}

/* ---------- Print ---------- */

@media print {
  .site-header,
  .site-footer,
  .button-row {
    display: none;
  }

  body {
    color: #000;
    font-size: 12pt;
    border-top: 0;
  }

  h1 {
    background: none;
    -webkit-text-fill-color: #000;
    color: #000;
  }

  main {
    padding: 0;
  }

  .container {
    max-width: none;
    padding: 0;
  }
}
