/* ==========================================================================
   Wenke Lee — personal site
   Clean academic design system. Georgia Tech navy + gold accents.
   ========================================================================== */

:root {
  --navy:        #003057;
  --navy-700:    #00436f;
  --navy-300:    #4a7fa5;
  --gold:        #b3a369;
  --gold-bright: #eaaa00;

  --bg:          #ffffff;
  --bg-alt:      #f6f7f9;
  --bg-card:     #ffffff;
  --border:      #e2e6ea;
  --border-soft: #eef1f4;

  --text:        #1c2530;
  --text-muted:  #5b6773;
  --text-faint:  #8a949e;
  --link:        #005a8c;
  --link-hover:  #003057;

  --radius:      10px;
  --radius-sm:   6px;
  --shadow:      0 1px 2px rgba(16,32,48,.05), 0 6px 20px rgba(16,32,48,.05);

  --measure:     72ch;
  --font-sans:   "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
  --font-serif:  "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:          #10151b;
    --bg-alt:      #161c24;
    --bg-card:     #161c24;
    --border:      #27303b;
    --border-soft: #1e2530;
    --text:        #e4e9ee;
    --text-muted:  #a3aeba;
    --text-faint:  #78838f;
    --link:        #7fc0ea;
    --link-hover:  #a9d7f5;
    --navy:        #0d2c46;
    --shadow:      0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* ---------- Header / navigation ---------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--navy);
  border-bottom: 3px solid var(--gold);
}

.nav {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 58px;
  flex-wrap: wrap;
}

.nav-brand {
  font-weight: 650;
  font-size: 1rem;
  letter-spacing: .02em;
  color: #fff;
  margin-right: auto;
  white-space: nowrap;
}
.nav-brand:hover { color: #fff; text-decoration: none; }
.nav-brand .brand-sub {
  display: block;
  font-weight: 400;
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(255,255,255,.62);
  margin-top: -2px;
}

.nav-links { display: flex; gap: 4px; flex-wrap: wrap; }

.nav-links a {
  color: rgba(255,255,255,.82);
  font-size: .92rem;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.nav-links a:hover { color: #fff; background: rgba(255,255,255,.1); text-decoration: none; }
.nav-links a[aria-current="page"] {
  color: #fff;
  background: rgba(255,255,255,.14);
  box-shadow: inset 0 -2px 0 var(--gold-bright);
}

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

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 24px 88px;
}
.wrap.narrow { max-width: 880px; }

.page-title {
  font-size: clamp(1.75rem, 1.2rem + 1.7vw, 2.35rem);
  line-height: 1.15;
  letter-spacing: -.02em;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 6px;
}
.page-lede {
  color: var(--text-muted);
  font-size: 1.02rem;
  margin: 0 0 34px;
  max-width: var(--measure);
}
.page-lede a { font-weight: 500; }

/* Home: profile aside + biography */

.home-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}
@media (max-width: 860px) {
  .home-grid { grid-template-columns: 1fr; gap: 32px; }
}

.profile { position: sticky; top: 86px; }
@media (max-width: 860px) { .profile { position: static; } }

.profile-photo {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center top;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: block;
  background: var(--bg-alt);
}

.profile-name {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -.015em;
  margin: 20px 0 2px;
}
.profile-role {
  color: var(--text-muted);
  font-size: .93rem;
  line-height: 1.5;
  margin: 0 0 18px;
}
.profile-role strong { color: var(--text); font-weight: 600; }

.contact {
  font-size: .88rem;
  line-height: 1.6;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 4px;
}
.contact dt {
  font-size: .68rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 600;
  margin-top: 14px;
}
.contact dt:first-child { margin-top: 0; }
.contact dd { margin: 2px 0 0; }

.profile-logo {
  margin-top: 22px;
  max-width: 150px;
  width: 100%;
  height: auto;
  opacity: .9;
}

.bio > p:first-child { margin-top: 0; }
.bio p { max-width: var(--measure); }
.bio .lead { font-size: 1.12rem; line-height: 1.6; color: var(--text); }

.quicklinks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text);
  font-size: .89rem;
  font-weight: 500;
  box-shadow: var(--shadow);
}
.btn:hover {
  text-decoration: none;
  border-color: var(--navy-300);
  color: var(--link-hover);
}
.btn.primary {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.btn.primary:hover { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }
.btn .arrow { color: var(--gold); font-weight: 700; }
.btn.primary .arrow { color: var(--gold-bright); }

/* ---------- Section headings -------------------------------------------- */

h2.section {
  font-size: 1.28rem;
  font-weight: 680;
  letter-spacing: -.01em;
  margin: 52px 0 4px;
  padding-bottom: 9px;
  border-bottom: 2px solid var(--navy);
  scroll-margin-top: 84px;
}
h2.section::after {
  content: "";
  display: block;
  width: 54px;
  height: 2px;
  background: var(--gold-bright);
  position: relative;
  top: 11px;
}
h3.subsection {
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: .01em;
  color: var(--navy-300);
  margin: 34px 0 10px;
  text-transform: uppercase;
  font-size: .8rem;
  letter-spacing: .1em;
  scroll-margin-top: 84px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) h3.subsection { color: var(--gold); }
}

h4.topic {
  font-size: 1.06rem;
  font-weight: 640;
  margin: 34px 0 6px;
  color: var(--text);
}

/* ---------- Entry lists ------------------------------------------------- */

ul.entries { list-style: none; margin: 14px 0 0; padding: 0; }
ul.entries > li {
  position: relative;
  padding: 0 0 0 22px;
  margin: 0 0 15px;
  max-width: var(--measure);
}
ul.entries > li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .72em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

ul.prose { margin: 14px 0 0; padding-left: 20px; }
ul.prose > li { margin-bottom: 14px; max-width: var(--measure); }

/* Publication entries */

ol.pubs { list-style: none; margin: 14px 0 0; padding: 0; counter-reset: pub; }
ol.pubs > li {
  position: relative;
  padding: 13px 0 13px 44px;
  border-bottom: 1px solid var(--border-soft);
  max-width: var(--measure);
}
ol.pubs > li:last-child { border-bottom: 0; }
ol.pubs > li::before {
  counter-increment: pub;
  content: counter(pub);
  position: absolute;
  left: 0;
  top: 15px;
  width: 30px;
  text-align: right;
  font-size: .76rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-faint);
  font-weight: 600;
}
.pub-authors { color: var(--text-muted); font-size: .93rem; }
/* Author names all render alike, including Wenke Lee. The .me span is left
   in the markup so the emphasis can be reinstated here if ever wanted. */
.pub-authors .me { color: inherit; font-weight: inherit; }
.pub-title { font-weight: 600; color: var(--text); }
a.pub-title { color: var(--link); }
.pub-venue { color: var(--text-muted); font-size: .93rem; }
.pub-venue em, .pub-venue i { font-style: italic; }

/* ---------- Course listing ---------------------------------------------- */

.course-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-size: .86rem;
  color: var(--text-muted);
  margin: 0 0 30px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.course-meta b { color: var(--text); font-weight: 600; }

.lectures { display: grid; gap: 10px; margin: 22px 0 0; padding: 0; list-style: none; }

.lecture {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 18px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 4px 16px;
  align-items: baseline;
}
.lecture-num {
  grid-row: 1 / span 2;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: #fff;
  background: var(--navy);
  border-radius: var(--radius-sm);
  padding: 5px 0;
  text-align: center;
  align-self: start;
}
.lecture-title { font-weight: 620; font-size: 1rem; letter-spacing: -.005em; }
.lecture-files { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 7px; }

.file-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  font-weight: 550;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  white-space: nowrap;
}
.file-link:hover { text-decoration: none; border-color: var(--navy-300); color: var(--link-hover); }
.file-link .kind {
  font-size: .64rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 700;
}
.file-link.notes { border-color: #d7c9a0; }
.file-link.video { border-color: #a9c9dd; }

.empty-note {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  color: var(--text-muted);
  background: var(--bg-alt);
  font-size: .94rem;
  max-width: var(--measure);
}

/* Course cards on the teaching page */

.course { margin: 0 0 44px; max-width: var(--measure); }
.course h2 { margin-bottom: 4px; }
.course h2 a { color: inherit; }
.course h2 a:hover { color: var(--link); text-decoration: none; }
.course-code {
  font-size: .74rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 700;
  display: block;
  margin-bottom: 4px;
}
.course-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: .88rem;
  font-weight: 550;
}

/* ---------- Table of contents (CV) -------------------------------------- */

.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 12px;
  padding: 18px 20px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.toc a {
  font-size: .82rem;
  font-weight: 500;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
}
.toc a:hover { text-decoration: none; border-color: var(--navy-300); color: var(--link-hover); }

.cv-head {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 12px 40px;
  align-items: start;
  padding-bottom: 24px;
  margin-bottom: 26px;
  border-bottom: 2px solid var(--navy);
}
@media (max-width: 700px) { .cv-head { grid-template-columns: 1fr; } }
.cv-head .affil { color: var(--text-muted); font-size: .94rem; line-height: 1.55; }
.cv-head .reach { color: var(--text-muted); font-size: .88rem; line-height: 1.6; }

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

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text-faint);
  font-size: .84rem;
}
.site-footer .wrap { padding: 24px; display: flex; flex-wrap: wrap; gap: 8px 24px; }

/* ---------- Utilities ---------------------------------------------------- */

.skip {
  position: absolute; left: -9999px;
  background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 0 0 6px 0; z-index: 100;
}
.skip:focus { left: 0; top: 0; }

@media print {
  .site-header, .site-footer, .toc, .quicklinks { display: none !important; }
  body { font-size: 10.5pt; }
  .wrap { max-width: none; padding: 0; }
  a { color: #000; text-decoration: none; }
}

/* ---------- BibTeX toggles ---------------------------------------------- */

details.bib { margin-top: 7px; }

details.bib > summary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  list-style: none;
  cursor: pointer;
  font-size: .72rem;
  font-weight: 650;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-faint);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 10px;
  user-select: none;
}
details.bib > summary::-webkit-details-marker { display: none; }
details.bib > summary::before { content: "＋"; font-size: .8em; line-height: 1; }
details.bib[open] > summary::before { content: "－"; }
details.bib > summary:hover { color: var(--link); border-color: var(--navy-300); }
details.bib > summary:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}

.bib-box {
  position: relative;
  margin-top: 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
}
.bib-box pre {
  margin: 0;
  padding: 13px 15px;
  padding-right: 74px;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: .78rem;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 2;
}
.bib-copy {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 1;
  font: inherit;
  font-size: .7rem;
  font-weight: 650;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
}
.bib-copy:hover { color: var(--link); border-color: var(--navy-300); }
.bib-copy:active { transform: translateY(1px); }

p.bib-all { margin: -18px 0 34px; }

@media print { details.bib { display: none; } }

/* ---------- Course access panel ----------------------------------------- */

.access {
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold-bright);
  border-radius: var(--radius);
  background: var(--bg-alt);
  padding: 20px 22px;
  margin: 0 0 8px;
  max-width: var(--measure);
}
.access h2 {
  margin: 0 0 6px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.access p { margin: 0; color: var(--text-muted); font-size: .95rem; }
.access-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px !important;
}

ol.lectures.plain { counter-reset: none; padding: 0; }
ol.lectures.plain > li.lecture {
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  padding: 11px 18px;
}
ol.lectures.plain > li.lecture::before { content: none; }
ol.lectures.plain > li.lecture .lecture-num { grid-row: auto; align-self: center; }
