/* Yijun Li — personal homepage */
:root {
  color-scheme: light;
  --bg: #fbfcfc;
  --band: #eaf4f4;
  --ink: #1f2a33;
  --text: #3a4752;
  --muted: #6f7d87;
  --accent: #127083;
  --accent-soft: #e1f0f1;
  --rule: #e3eaec;
  --head: "Bricolage Grotesque", "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
  --sans: "Figtree", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--text); font-family: var(--sans); font-size: 15.5px; line-height: 1.62; -webkit-font-smoothing: antialiased;
  background: radial-gradient(70% 50% at 0% 0%, #dcefef 0%, rgba(220,239,239,0) 70%) no-repeat, var(--bg); }
h1, h2, h3, h4, p, ul { margin: 0; }
img { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
strong { color: var(--ink); font-weight: 600; }
.skip { position: absolute; top: -80px; left: 16px; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 20; }
.skip:focus { top: 12px; }

/* Layout: profile on the left, content on the right */
.layout { max-width: 1080px; margin: 0 auto; padding: 44px 32px 20px; display: grid; grid-template-columns: 236px minmax(0, 1fr); column-gap: 52px; }
.profile { position: sticky; top: 40px; align-self: start; }
main { min-width: 0; }

.portrait { display: block; width: 132px; height: 132px; object-fit: cover; border-radius: 28px; border: 4px solid #fff; box-shadow: 0 2px 4px rgba(18,112,131,.08), 0 12px 28px rgba(18,112,131,.14); transform: rotate(-2deg); margin-bottom: 20px; }
.profile h1 { font-family: var(--head); font-size: 32px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.profile h1 a { color: var(--ink); }
.profile h1 a:hover { text-decoration: none; color: var(--accent); }
.role { margin-top: 8px; font-size: 14.5px; color: var(--muted); line-height: 1.5; }
.contact { list-style: none; padding: 0; margin-top: 16px; display: grid; gap: 4px; font-size: 14px; }
.contact li { display: flex; align-items: center; gap: 8px; color: var(--muted); min-width: 0; }
.contact a { display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.contact svg { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.contact .gh { fill: currentColor; stroke: none; }

.site-nav { display: grid; gap: 2px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--rule); }
.site-nav a { color: var(--muted); font-size: 15px; padding: 6px 12px; margin-left: -12px; border-radius: 10px; }
.site-nav a:hover { color: var(--ink); background: rgba(18,112,131,.06); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); font-weight: 600; }

/* Sections */
.block + .block { margin-top: 30px; }
.block > h2 { font-family: var(--head); font-size: 21px; font-weight: 700; color: var(--ink); line-height: 1.3; letter-spacing: -.01em; margin-bottom: 12px; display: flex; align-items: center; gap: 12px; }
.block > h2::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.block-body > p { max-width: 72ch; }

.interests { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.interests li { font-size: 13.5px; color: var(--accent); background: var(--accent-soft); padding: 2px 11px; border-radius: 999px; }

.entry, .edu { padding: 14px 18px; background: #fff; border: 1px solid var(--rule); border-radius: 14px; }
.entry + .entry, .edu + .edu { margin-top: 10px; }
.entry-head { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; }
.entry h3, .edu h3 { font-size: 16.5px; font-weight: 600; color: var(--ink); line-height: 1.4; }
.entry h3 a { color: var(--ink); }
.entry h3 a:hover { color: var(--accent); }
.date { flex-shrink: 0; color: var(--muted); font-size: 13.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sub { margin-top: 2px; color: var(--muted); font-size: 14px; }
.sub em { font-style: normal; color: var(--text); }
.entry > p { margin-top: 6px; }
.entry ul { margin-top: 6px; padding-left: 18px; }
.entry li + li { margin-top: 3px; }
.entry li::marker { color: #a3b3ba; }
.highlight { color: var(--accent); font-weight: 600; }

.authors { margin-top: 4px; font-size: 14.5px; }
.authors strong { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #9fcfd5; }
.venue { margin-top: 6px; font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.venue i { color: var(--text); }
.pub-links { display: inline-flex; }
.entry .pub-links { margin-top: 8px; }
.tag { display: inline-block; font-size: 12.5px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 0 10px; border-radius: 999px; }
.pill { display: inline-block; font-size: 13px; font-weight: 500; padding: 1px 12px; border: 1px solid #b9dade; border-radius: 999px; color: var(--accent); }
.pill:hover { text-decoration: none; background: var(--accent-soft); border-color: var(--accent); }

.edu { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 20px; }
.edu .sub { grid-column: 1 / -1; }

.site-footer { grid-column: 2; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 36px; padding-top: 14px; border-top: 1px solid var(--rule); font-size: 13px; color: var(--muted); }

/* Life page */
.swim-intro { max-width: 72ch; }
.photo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.swimming-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 12px 0 4px; }
.photo-trigger { display: block; width: 100%; padding: 0; margin: 0; border: 0; background: var(--band); cursor: zoom-in; border-radius: 10px; overflow: hidden; aspect-ratio: 3 / 2; }
.photo-trigger img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease, filter .2s; }
.photo-trigger:hover img { transform: scale(1.03); filter: brightness(.96); }
.photo-trigger[data-full$="photo-15.webp"] img { object-position: 50% 65%; }
.photo-trigger[hidden] { display: none; }
.swim-cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; margin-top: 16px; align-items: start; }
.sub-heading { font-family: var(--head); font-size: 16px; font-weight: 700; color: var(--ink); margin: 18px 0 8px; }
.swim-cols .sub-heading { margin-top: 0; }
.results { list-style: none; padding: 2px 16px; background: #fff; border: 1px solid var(--rule); border-radius: 14px; }
.result { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 10px; padding: 9px 0; }
.result + .result { border-top: 1px solid var(--rule); }
.result .year { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; padding-top: 1px; }
.result h4 { font-size: 14.5px; font-weight: 600; color: var(--ink); line-height: 1.4; }
.result .zh { font-size: 12px; color: var(--muted); }
.medals { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 3px; font-size: 13.5px; }
.medal { display: inline-flex; align-items: center; gap: 6px; }
.medal::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.gold { --c: #d4a72c; } .silver { --c: #aeb6c0; } .bronze { --c: #b87a4b; }
.medal b { font-weight: 600; color: var(--ink); }
.community-card { padding: 14px 16px; background: #fff; border: 1px solid var(--rule); border-radius: 14px; }
.affil { display: block; font-weight: 600; color: var(--ink); line-height: 1.4; }
.community-card .date { display: block; margin-top: 2px; }
.community { margin-top: 8px; font-size: 14.5px; }

.gallery-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.gallery-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.gallery-filter { font: inherit; font-size: 13.5px; padding: 2px 12px; border: 1px solid var(--rule); border-radius: 999px; color: var(--muted); background: #fff; cursor: pointer; }
.gallery-filter:hover { color: var(--ink); border-color: #c4ccd6; }
.gallery-filter[aria-pressed="true"] { color: #fff; background: var(--accent); border-color: var(--accent); }
#gallery-count { font-size: 13.5px; color: var(--muted); }

.viewing-photo { overflow: hidden; }
.photo-viewer { width: min(1160px, 96vw); max-width: 96vw; height: min(900px, 94dvh); max-height: 94dvh; border: 0; border-radius: 12px; padding: 14px 18px; background: #12191d; color: #f2f4f7; }
.photo-viewer[open] { display: flex; flex-direction: column; }
.photo-viewer::backdrop { background: rgba(10, 16, 20, .86); }
.viewer-top, .viewer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-shrink: 0; }
.viewer-top { padding-bottom: 10px; }
.viewer-top span, .viewer-bottom p { color: #b9c2cd; font-size: 13px; }
.viewer-bottom { padding-top: 10px; }
.viewer-bottom p { text-align: center; line-height: 1.5; }
.photo-viewer button { cursor: pointer; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; background: transparent; color: inherit; font: inherit; font-size: 13px; padding: 5px 14px; flex-shrink: 0; }
.photo-viewer button:hover { background: rgba(255,255,255,.08); }
.viewer-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.viewer-stage img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }

/* Responsive */
@media (max-width: 960px) {
  .photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .swim-cols { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; padding: 24px 16px 16px; }
  .profile { position: static; display: grid; grid-template-columns: 76px minmax(0, 1fr); column-gap: 16px; align-items: center; margin-bottom: 24px; }
  .portrait { width: 76px; height: 76px; border-radius: 20px; border-width: 3px; margin: 0; grid-row: span 2; }
  .profile h1 { font-size: 26px; }
  .role { margin-top: 2px; font-size: 13.5px; }
  .contact { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 14px; }
  .site-nav { grid-column: 1 / -1; display: flex; gap: 4px; margin-top: 12px; padding-top: 12px; }
  .site-nav a { margin-left: 0; padding: 5px 12px; }
  .site-nav a:first-child { margin-left: -12px; }
  .site-footer { grid-column: 1; }
  .entry-head { flex-direction: column; gap: 0; }
  .edu { grid-template-columns: 1fr; }
  .entry, .edu { padding: 12px 14px; }
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .swimming-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .viewer-bottom p { display: none; }
  .photo-viewer { padding: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .photo-trigger img { transition: none; }
  .photo-trigger:hover img { transform: none; }
}
@media print {
  .site-nav, .skip { display: none; }
  .profile { position: static; }
}
.interests-text { margin-top: 8px; max-width: 72ch; }
