/* ------------------------------------------------------------
   Taewon Hwang — site styles
   Fonts are stored in assets/fonts so the site does not depend
   on Google or any other outside service.
   ------------------------------------------------------------ */

/* Inter (variable weight), stored locally. Licensed under the SIL Open Font License. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin-wght-italic.woff2") format("woff2"); }

/* ---------- Colors ---------- */
:root {
  --paper:  #FFFFFF;
  --wash:   #F2F5F7;   /* light slate band behind the header */
  --ink:    #17212B;   /* body text */
  --muted:  #5B6672;   /* dates, coauthors, small notes */
  --rule:   #DDE3E8;
  --accent: #1D5C7A;   /* links */
  --tag-bg: #E3EEF3;   /* "revise and resubmit" label */

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --serif: var(--font);   /* kept so older rules still work; everything uses Inter */
  --sans:  var(--font);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper:  #141A20;
    --wash:   #1B232B;
    --ink:    #E6EAEE;
    --muted:  #9AA6B2;
    --rule:   #2C3740;
    --accent: #7FBEDB;
    --tag-bg: #1F3644;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;           /* 16px */
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
p { margin: 0 0 1em; }

.wrap { max-width: 44rem; margin: 0 auto; padding: 0 1.25rem; }

/* ---------- Header: photo, name, links, tabs ---------- */
.masthead { padding-top: 2.75rem; border-bottom: 1px solid var(--rule); }
.profile { display: flex; align-items: center; gap: 1.75rem; }
.avatar {
  flex: none; width: 144px; height: 144px; border-radius: 50%;
  object-fit: cover; background: var(--wash);
}
.name {
  font-family: var(--sans); font-weight: 500;
  font-size: clamp(1.75rem, 5vw, 2.25rem); line-height: 1.1; letter-spacing: -0.02em;
  margin: 0 0 0.45rem;
}
.name a { color: var(--ink); text-decoration: none; }
.role { color: var(--muted); font-size: 1.02rem; line-height: 1.45; margin: 0 0 0.75rem; }
.role a { color: var(--muted); }
.quick {
  display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; margin: 0; padding: 0; list-style: none;
  font-family: var(--sans); font-weight: 500; font-size: 0.93rem;
}
.quick a { text-decoration: none; }
.quick a:hover { text-decoration: underline; }
.quick .email { color: var(--muted); }

.tabs {
  display: flex; gap: 1.9rem; margin-top: 2.1rem; overflow-x: auto;
  font-family: var(--sans); font-weight: 500; font-size: 0.98rem;
}
.tabs a {
  color: var(--muted); text-decoration: none; white-space: nowrap;
  padding: 0.55rem 0 0.7rem; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

main { padding: 2.5rem 0 4rem; }

/* ---------- About ---------- */
.about > p { font-size: 1.05rem; }
.fields { margin-top: 1.8rem; padding-top: 1.4rem; border-top: 1px solid var(--rule); }
.fields-label { font-size: 0.85rem; font-weight: 500; color: var(--muted); margin: 0 0 0.7rem; }
.pills { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.pills li {
  font-size: 0.92rem; font-weight: 500; line-height: 1.3;
  padding: 0.42rem 0.95rem; border-radius: 999px;
  border: 1px solid var(--rule); background: var(--paper); color: var(--ink);
}
.pills li.main { background: var(--tag-bg); border-color: color-mix(in srgb, var(--accent) 35%, var(--tag-bg)); color: var(--accent); }
.facts { margin: 1.6rem 0 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.facts li { display: grid; grid-template-columns: 6rem 1fr; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--rule); }
.facts .k { font-family: var(--sans); font-weight: 500; font-size: 0.92rem; color: var(--muted); padding-top: 0.12rem; }

/* ---------- Section headings (Research, Teaching) ---------- */
.page-title {
  font-family: var(--sans); font-weight: 700; font-size: clamp(2rem, 6vw, 2.6rem);
  letter-spacing: -0.03em; line-height: 1.1; margin: 0 0 2.5rem;
}
h2 {
  font-family: var(--sans); font-weight: 700; font-size: 1.3rem; letter-spacing: -0.015em;
  margin: 3rem 0 0.25rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--ink);
}
h2:first-of-type { margin-top: 0; }
.section-note { font-size: 0.93rem; color: var(--muted); margin: 0.6rem 0 0; }
h3.sub { font-family: var(--sans); font-weight: 500; font-size: 1rem; color: var(--muted); margin: 1.8rem 0 0.4rem; }

/* ---------- Papers ---------- */
.paper { padding: 1.6rem 0; border-bottom: 1px solid var(--rule); }
.paper:last-child { border-bottom: 0; }
.paper-title { font-family: var(--font); font-weight: 600; font-size: 1.1rem; letter-spacing: -0.01em; line-height: 1.4; margin: 0 0 0.35rem; }
.paper-title a { color: var(--ink); text-decoration-color: var(--rule); }
.paper-title a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.meta { color: var(--muted); font-size: 0.95rem; margin: 0; }
.meta a { color: var(--muted); }
.status {
  display: inline-block; margin-top: 0.55rem; font-family: var(--sans); font-weight: 500; font-size: 0.85rem;
  padding: 0.15rem 0.6rem; border-radius: 3px; background: var(--tag-bg); color: var(--ink);
}
.status.plain { background: transparent; border: 1px solid var(--rule); color: var(--muted); }
.award { font-size: 0.95rem; margin: 0.7rem 0 0; }
.award::before { content: ""; display: inline-block; width: 0.5rem; height: 0.5rem; margin-right: 0.5rem; background: #C8A24A; border-radius: 50%; vertical-align: 0.08em; }
.talks { font-size: 0.93rem; color: var(--muted); margin: 0.6rem 0 0; }

.paper { display: grid; grid-template-columns: 12.5rem minmax(0, 1fr); column-gap: 1.5rem; align-items: start; }
.paper-body:first-child, .paper > .panel { grid-column: 1 / -1; }
.thumb { width: 100%; margin: 0.3rem 0 0; }
.thumb img {
  display: block; width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 3px;
  background: #fff;
}
.thumb a:hover img { border-color: var(--accent); }
.takeaway { margin: 0.75rem 0 0; font-size: 0.98rem; line-height: 1.55; }

/* Abstract / Presentations buttons sit side by side; their panels open below */
.toggles { display: flex; flex-wrap: wrap; gap: 0.35rem 1.5rem; margin-top: 0.8rem; }
.toggle {
  appearance: none; background: none; border: 0; padding: 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--sans); font-weight: 500; font-size: 0.92rem; line-height: 1.5; color: var(--accent);
}
.toggle:hover { color: var(--ink); }
.toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.toggle::before { content: "+"; display: inline-block; width: 0.8rem; text-align: center; }
.toggle[aria-expanded="true"]::before { content: "\2212"; }
.paper-link { text-decoration: none; }
.paper-link::before { content: "\2197"; }   /* arrow: opens the PDF */
.panel .talks { margin: 0.7rem 0 0; padding-left: 1rem; border-left: 2px solid var(--rule); }
.panel .note { margin: 0; padding: 0.3rem 0 0 1rem; border-left: 2px solid var(--rule); font-size: 0.78rem; color: var(--muted); }
.panel-box { margin-top: 0.7rem; padding-left: 1rem; border-left: 2px solid var(--rule); }
.panel-box .score, .panel-box .small { margin: 0 0 0.4rem; font-size: 0.95rem; }
.panel-box blockquote { border-left: 0; padding-left: 0; margin: 0.8rem 0 0; }
.aside { color: var(--muted); font-size: 0.88em; }
.panel-box .note { border-left: 0; padding: 0; margin-top: 0.8rem; }
.abstract { margin: 0.7rem 0 0; padding-left: 1rem; border-left: 2px solid var(--rule); font-size: 0.95rem; line-height: 1.7; color: var(--ink); }

.wip { list-style: none; margin: 0; padding: 0; }
.wip li { padding: 1rem 0; border-bottom: 1px solid var(--rule); }
.wip li:last-child { border-bottom: 0; }
.wip .t { font-weight: 600; display: block; }

.pubs { padding: 1.2rem 0 0; }

/* ---------- Teaching ---------- */
.course { padding: 1.3rem 0; border-bottom: 1px solid var(--rule); }
.course:last-child { border-bottom: 0; }
.course-name { font-weight: 600; margin: 0; }
.course .meta { margin-bottom: 0.4rem; }
.course p.small { font-size: 0.95rem; margin: 0.3rem 0 0; }
.score { font-size: 0.95rem; margin: 0.6rem 0 0; }
.score strong { font-family: var(--sans); font-weight: 700; font-size: 1.05rem; }
blockquote {
  margin: 1rem 0 0; padding: 0 0 0 1rem; border-left: 2px solid var(--accent);
  font-style: italic; font-size: 0.98rem;
}
blockquote + blockquote { margin-top: 0.8rem; }
.ta-list { list-style: none; margin: 0; padding: 0; }
.ta-list li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0; border-bottom: 1px solid var(--rule); }
.ta-list li:last-child { border-bottom: 0; }
.ta-list .when { color: var(--muted); font-size: 0.93rem; text-align: right; white-space: nowrap; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.88rem; }
.site-footer .wrap { padding-top: 1.5rem; padding-bottom: 2rem; }

/* ---------- Small screens ---------- */
@media (max-width: 600px) {
  .masthead { padding-top: 1.75rem; }
  .profile { gap: 1.1rem; }
  .avatar { width: 96px; height: 96px; }
  .tabs { gap: 1.4rem; margin-top: 1.5rem; }
  main { padding-top: 2rem; }
  .facts li { grid-template-columns: 1fr; gap: 0.1rem; }
  .ta-list li { flex-direction: column; gap: 0; }
  .ta-list .when { text-align: left; }
}
@media (max-width: 600px) {
  .paper { grid-template-columns: minmax(0, 1fr); }
  .thumb { max-width: 22rem; margin-bottom: 0.9rem; }
}
@media (max-width: 400px) {
  .profile { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
