/* Kylie Jiwon Hwang — personal site
   Neutral, light, readable. Edit the tokens below to retheme. */

:root {
  --bg: #faf8f5;          /* warm off-white page */
  --surface: #ffffff;     /* cards, figure frames */
  --wash: #f2efe9;        /* abstract boxes, tags */
  --rule: #e4dfd6;        /* hairlines */
  --ink: #1f1d1a;         /* headings */
  --text: #3a3733;        /* body */
  --muted: #6e6860;       /* secondary text */
  --accent: #3d5a6c;      /* links: muted slate */
  --accent-hover: #24404f;
  --award: #8a6a3b;       /* awards: muted bronze */

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --max: 1080px;
  --measure: 68ch;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: clamp(16px, 0.25vw + 15px, 17.5px);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); text-decoration-color: currentColor; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; background: var(--surface); padding: 6px 12px; z-index: 10; }

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

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { font-family: var(--serif); font-size: 1.3rem; font-weight: 500; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.brand:hover { color: var(--ink); }
.nav { display: flex; gap: 4px 24px; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; font-size: 0.94rem; padding: 4px 0; border-bottom: 1.5px solid transparent; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

/* ---------- Type ---------- */
h1, h2 { font-family: var(--serif); color: var(--ink); font-weight: 500; }
h1, h2, h3 { color: var(--ink); letter-spacing: -0.015em; line-height: 1.25; }
h1 { font-size: clamp(2.1rem, 3vw + 1rem, 3rem); margin: 0 0 6px; }
h2 { font-size: 1.65rem; margin: 0 0 20px; }
h3 { font-family: var(--sans); font-weight: 600; letter-spacing: -0.01em; font-size: 1.12rem; margin: 0 0 6px; }

.eyebrow { font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin: 0 0 10px; }
.lede { font-size: 1.12rem; line-height: 1.65; color: var(--ink); }
.muted { color: var(--muted); }

main { padding: 56px 0 80px; }
section + section { margin-top: 72px; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--rule); padding-bottom: 10px; margin-bottom: 28px; }
.section-head h2 { margin: 0; }
.section-head a { font-size: 0.92rem; white-space: nowrap; }

/* ---------- Home ---------- */
.intro { display: grid; gap: 40px; }
.intro .title { color: var(--muted); margin: 0 0 28px; font-size: 1.02rem; }
.intro .bio p { max-width: var(--measure); }
.intro .portrait img { border-radius: 6px; width: 100%; max-width: 320px; }
.contact { list-style: none; padding: 0; margin: 20px 0 0; max-width: 320px; border-top: 1px solid var(--rule); }
.contact li { border-bottom: 1px solid var(--rule); }
.contact a { display: flex; align-items: center; gap: 12px; padding: 11px 4px; text-decoration: none; color: var(--ink); font-weight: 500; font-size: 0.95rem; }
.contact a:hover { color: var(--accent); background: var(--wash); }
.contact svg { flex: none; color: var(--accent); }
.contact small { display: block; font-weight: 400; font-size: 0.8rem; color: var(--muted); line-height: 1.3; word-break: break-all; }
.links { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 0.95rem; }

@media (max-width: 879px) {
  .intro .portrait { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: 18px; align-items: center; }
  .intro .portrait img { max-width: 100%; }
  .contact { margin-top: 0; }
  .contact a { padding: 9px 2px; font-size: 0.9rem; gap: 10px; }
}

@media (min-width: 880px) {
  .intro { grid-template-columns: minmax(0, 1fr) 300px; gap: 64px; align-items: start; }
  .intro .portrait { position: sticky; top: 96px; order: 2; }
}

.featured { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; }
.card .thumb { aspect-ratio: 16 / 10; background: var(--wash); display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--rule); }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .thumb.chart img { object-fit: contain; padding: 14px; background: var(--surface); }
.card .body { padding: 18px 20px 22px; }
.card .venue { font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.card h3 { font-size: 1.02rem; }
.card .who { font-size: 0.9rem; margin: 4px 0 0; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.card .take { font-size: 0.94rem; margin: 10px 0 0; }

.note { background: var(--wash); border-radius: 8px; padding: 20px 24px; max-width: var(--measure); }
.note p { margin: 0; }

/* ---------- Research ---------- */
.page-intro { max-width: var(--measure); margin-bottom: 56px; }

.impact { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 8px; }
.impact a, .impact .impact-card { display: block; background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 16px 18px; text-decoration: none; color: var(--text); }
.impact a:hover { border-color: var(--accent); }
.impact strong { display: block; font-weight: 600; font-size: 1.08rem; color: var(--ink); margin-bottom: 2px; }
.impact span { font-size: 0.88rem; color: var(--muted); }

.pub { display: grid; gap: 20px 36px; padding: 32px 0; border-top: 1px solid var(--rule); }
.pub:first-of-type { border-top: 0; padding-top: 4px; }
@media (min-width: 760px) { .pub { grid-template-columns: 260px minmax(0, 1fr); } }

.pub figure { margin: 0; }
a.fig-frame { display: block; }
.fig-frame { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 10px; }
.fig-frame + .fig-frame { margin-top: 12px; }
.fig-frame img { border-radius: 4px; }
.pub figcaption { font-size: 0.8rem; color: var(--muted); line-height: 1.45; margin-top: 8px; }

.pub .authors { font-style: italic; color: var(--muted); margin: 0 0 2px; }
.pub .cite { margin: 0 0 14px; font-size: 0.96rem; }
.pub .take { font-weight: 500; color: var(--ink); margin: 0 0 14px; max-width: var(--measure); }

.tag { display: inline-block; font-size: 0.74rem; letter-spacing: 0.05em; text-transform: uppercase; background: var(--wash); color: var(--muted); border-radius: 4px; padding: 1px 8px; margin-left: 6px; vertical-align: 2px; font-weight: 500; }
.tag.stage { background: var(--ink); color: var(--bg); margin-left: 0; margin-right: 8px; }

details { margin: 0 0 14px; }
summary { cursor: pointer; font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); font-weight: 500; list-style: none; display: inline-block; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "+ "; }
details[open] summary::before { content: "− "; }
details .abstract { background: var(--wash); border-left: 2px solid var(--rule); padding: 14px 18px; margin-top: 10px; font-size: 0.94rem; max-width: var(--measure); border-radius: 0 6px 6px 0; }

.meta { font-size: 0.9rem; margin: 6px 0 0; }
.meta .label { font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-right: 8px; font-weight: 500; }
.awards { list-style: none; padding: 0; margin: 8px 0 0; font-size: 0.9rem; color: var(--award); line-height: 1.6; }
.awards a { color: inherit; }
.awards li { position: relative; padding-left: 16px; }
.awards li::before { content: ""; position: absolute; left: 2px; top: 0.62em; width: 6px; height: 6px; background: var(--award); transform: rotate(45deg); }

.wp { padding: 20px 0; border-top: 1px solid var(--rule); }
.wp:first-of-type { border-top: 0; padding-top: 0; }
.wp h3 { font-size: 1.04rem; margin-bottom: 4px; }
.wp .status { font-size: 0.9rem; margin: 0 0 2px; }
.wp .authors { font-style: italic; color: var(--muted); margin: 0; font-size: 0.95rem; }

.plain { list-style: none; padding: 0; margin: 0; }
.plain li { padding: 10px 0; border-top: 1px solid var(--rule); }
.plain li:first-child { border-top: 0; }

/* ---------- Teaching ---------- */
.course { padding: 18px 0; border-top: 1px solid var(--rule); }
.course:first-of-type { border-top: 0; padding-top: 0; }
.course h3 { margin-bottom: 2px; }
.school { font-weight: 600; font-size: 1.05rem; color: var(--ink); margin: 32px 0 12px; }
.school:first-child { margin-top: 0; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--rule); padding: 28px 0 40px; font-size: 0.9rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.site-footer a { color: var(--muted); }

@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  main { padding-top: 36px; }
  .site-header .wrap { padding-top: 10px; padding-bottom: 10px; }
}

@media print {
  .site-header, .site-footer { display: none; }
  body { background: #fff; }
}

/* y-axis label beside AJS figures */
.yfig { display: flex; align-items: center; gap: 4px; width: 100%; height: 100%; }
.yfig img { flex: 1; min-width: 0; }
.ylab { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 0.72rem; letter-spacing: 0.04em; color: var(--muted); white-space: nowrap; font-weight: 500; }
.card .thumb.chart .yfig { padding-left: 8px; background: var(--surface); }
.card .thumb.chart .yfig img { padding-left: 4px; }


/* ---------- Research page: year rail + right-hand images ---------- */
@media (min-width: 760px) {
  .pub { grid-template-columns: minmax(0, 1fr) 230px; gap: 20px 40px; }
}
@media (max-width: 759px) {
  .pub figure { order: -1; }
  }

summary { text-transform: none; letter-spacing: 0; font-size: 0.92rem; }
summary::before { content: ""; }
summary::after { content: " ↓"; }
details[open] summary::before { content: ""; }
details[open] summary::after { content: " ↑"; }

.meta .label { text-transform: none; letter-spacing: 0; font-size: 0.9rem; font-style: italic; font-weight: 400; margin-right: 6px; }
.meta .label::after { content: ":"; }

.wp h4 { font-size: 1.04rem; font-weight: 600; color: var(--ink); margin: 0 0 2px; line-height: 1.4; }
.wp h4 a { color: var(--ink); }
.wp h4 a:hover { color: var(--accent); }
.wp-line { margin: 0; font-size: 0.95rem; color: var(--muted); }
.wp { padding: 14px 0; }
.wp:first-of-type { padding-top: 14px; }
.rr { display: inline-block; font-size: 0.76rem; font-weight: 500; color: #fff; background: color-mix(in srgb, var(--accent) 72%, var(--bg)); border-radius: 999px; padding: 1px 10px; margin-right: 8px; vertical-align: 1px; font-style: normal; }

/* Simplified research page */
.pub { padding: 26px 0; }
.pub .cite { margin: 2px 0 8px; color: var(--muted); }
.pub .cite em { color: var(--text); }
.pub details { margin: 0 0 6px; }
.meta { font-size: 0.86rem; color: var(--muted); margin: 3px 0 0; line-height: 1.55; }
.awards-line { color: var(--award); }
.awards-line a { color: inherit; }
.wp { padding: 12px 0; }
.wp .meta { margin-top: 2px; }
