/* ============ Design tokens ============ */
:root {
  --bg: #fafaf9;
  --bg-card: #ffffff;
  --bg-subtle: #f4f4f3;
  --text: #1c1c1a;
  --text-soft: #57534e;
  --text-faint: #a8a29e;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.09);
  --border: #e7e5e4;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.05);
  --radius: 14px;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Newsreader", Georgia, serif;
}

[data-theme="dark"] {
  --bg: #111113;
  --bg-card: #1a1a1d;
  --bg-subtle: #202024;
  --text: #ececee;
  --text-soft: #b4b0ab;
  --text-faint: #78736e;
  --accent: #7aa2f7;
  --accent-soft: rgba(122, 162, 247, 0.12);
  --border: #2c2c30;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
.container { max-width: 980px; margin: 0 auto; padding: 0 24px; }

/* ============ Nav ============ */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { max-width: 1180px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; gap: 18px; }
.nav-name { font-weight: 700; color: var(--text); font-size: 15px; white-space: nowrap; }
.nav-name:hover { text-decoration: none; color: var(--accent); }
.nav-cn { font-weight: 500; color: var(--text-faint); font-size: 12.5px; margin-left: 6px; }
.nav-links { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav-links a { color: var(--text-soft); font-size: 13.5px; font-weight: 500; padding: 6px 10px; border-radius: 8px; }
.nav-links a:hover { color: var(--text); background: var(--bg-subtle); text-decoration: none; }
.nav-links a.active { color: var(--accent); background: var(--accent-soft); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.theme-toggle {
  border: 1px solid var(--border); background: var(--bg-card);
  width: 34px; height: 34px; border-radius: 10px; cursor: pointer;
  font-size: 15px; line-height: 1; display: grid; place-items: center; color: var(--text);
}
.theme-toggle:hover { border-color: var(--text-faint); }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 10px; font-weight: 600; font-size: 14px;
  border: 1px solid var(--border); color: var(--text); background: var(--bg-card);
  transition: transform .12s ease, border-color .12s ease, opacity .12s ease;
}
.btn:hover { text-decoration: none; border-color: var(--text-faint); transform: translateY(-1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { border-color: var(--accent); opacity: .92; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ============ Two-column layout ============ */
.layout {
  max-width: 1180px; margin: 0 auto;
  display: grid; grid-template-columns: 280px minmax(0, 1fr);
  gap: 48px; padding: 40px 24px 64px;
}

/* ---- Left sidebar ---- */
/* Sidebar content can exceed the viewport: give it its own scroll so the
   bottom (links / CV button) is reachable without scrolling the page to the end. */
.sidebar {
  position: sticky; top: 84px; align-self: start;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--text-faint) transparent;
}
.side-photo {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: 24px; border: 1px solid var(--border); box-shadow: var(--shadow);
}
.side-name { font-family: var(--font-display); font-size: 24px; font-weight: 600; margin: 18px 0 2px; line-height: 1.25; letter-spacing: -.01em; }
.side-cn { font-size: 15px; color: var(--text); font-weight: 600; margin: 0 0 12px; }
.side-cn .pron { font-size: 11.5px; color: var(--text-faint); font-weight: 500; margin-left: 6px; letter-spacing: .03em; }
.side-credential { color: var(--text-soft); font-size: 13.5px; margin: 0 0 12px; }
.side-mission { color: var(--text-soft); font-size: 13.5px; margin: 0 0 14px; font-style: italic; font-family: var(--font-display); }
.side-status {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--text-soft);
  background: var(--bg-subtle); border: 1px solid var(--border);
  padding: 6px 10px; border-radius: 999px; margin: 0 0 18px;
}
.side-pv {
  display: none; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); padding: 6px 10px;
  border-radius: 999px; margin: -12px 0 18px;
}
.side-pv.pv-on { display: flex; }
.side-pv svg { width: 14px; height: 14px; flex: none; }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; flex: none; animation: pulse 2.2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34,197,94,.45); }
  70% { box-shadow: 0 0 0 8px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
.side-links { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.side-links a {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-soft); font-size: 13.5px; font-weight: 500;
  padding: 7px 10px; border-radius: 8px;
}
.side-links a:hover { color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.side-links svg { width: 16px; height: 16px; flex: none; }
.side-cv { width: 100%; justify-content: center; }

/* ---- Right content ---- */
.sec { padding: 0 0 44px; scroll-margin-top: 76px; }
.sec-title {
  font-family: var(--font-display); font-size: 23px; font-weight: 600;
  margin: 0 0 18px; padding-bottom: 10px; border-bottom: 1px solid var(--border); letter-spacing: -.01em;
}
.sub-title { font-size: 15px; font-weight: 650; color: var(--text-soft); margin: 24px 0 10px; text-transform: uppercase; letter-spacing: .04em; }
.title-note { font-family: var(--font-body); font-size: 13.5px; font-weight: 500; color: var(--text-faint); margin-left: 8px; }

/* ============ Logo chips (work in dark mode: white backing) ============ */
.logo-chip {
  flex: none; width: 44px; height: 44px; border-radius: 12px;
  background: #fff; border: 1px solid var(--border);
  display: grid; place-items: center; overflow: hidden;
}
.logo-chip img { max-width: 82%; max-height: 82%; object-fit: contain; }
.logo-chip.sm { width: 36px; height: 36px; border-radius: 10px; }
.logo-chip.monogram { font-weight: 700; font-size: 15px; color: #fff; background: linear-gradient(135deg, #4f46e5, #8b5cf6); border: none; }

/* ============ About ============ */
.about-text { max-width: 800px; }
.about-text p { margin: 0 0 12px; color: var(--text-soft); font-size: 14.5px; }
.about-text p:last-child { margin-bottom: 0; }
.about-text strong { color: var(--text); font-weight: 600; }

/* ============ Education ============ */
.edu-item {
  display: flex; gap: 14px; align-items: center;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 12px;
}
.edu-degree { font-weight: 600; font-size: 14.5px; }
.edu-school { color: var(--text-soft); font-size: 13.5px; margin-top: 1px; }
.edu-meta { color: var(--text-faint); font-size: 12.5px; margin-top: 4px; }

/* ============ Experience ============ */
.xp-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px; margin-bottom: 14px;
  box-shadow: var(--shadow);
}
/* photo embedded to the right of the bullets, text wraps around it */
.xp-fig { float: right; width: 200px; margin: 6px 0 10px 18px; text-align: center; }
.xp-fig button.lb { display: block; padding: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--bg-subtle); }
.xp-fig img { display: block; width: 100%; height: auto; transition: transform .25s ease; }
.xp-fig button.lb:hover img { transform: scale(1.03); }
.xp-fig figcaption { font-size: 11.5px; color: var(--text-faint); margin-top: 5px; }
.xp-card .chips { clear: both; }
.xp-head { display: flex; gap: 14px; align-items: flex-start; }
.xp-titles h3 { margin: 0; font-size: 16px; font-weight: 650; }
.xp-org { color: var(--text-soft); font-size: 13.5px; margin-top: 2px; }
.xp-note { color: var(--text-faint); }
.xp-when { margin-left: auto; color: var(--text-faint); font-size: 12.5px; text-align: right; white-space: nowrap; padding-top: 2px; }
.xp-bullets { margin: 12px 0 12px; padding-left: 20px; color: var(--text-soft); font-size: 14px; }
.xp-bullets li { margin-bottom: 6px; }
.xp-bullets li:last-child { margin-bottom: 0; }
.xp-bullets strong { color: var(--text); font-weight: 600; }

/* compact earlier-experience rows */
.row-list { list-style: none; margin: 0; padding: 0; }
.row-list li {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 16px; margin-bottom: 8px;
}
.row-main { flex: 1; font-size: 13.5px; }
.row-main strong { font-weight: 650; }
.row-org { display: block; color: var(--text-faint); font-size: 12.5px; margin-top: 1px; }
.row-desc { display: block; color: var(--text-soft); font-size: 12.5px; margin-top: 4px; line-height: 1.5; }
.row-when { flex: none; color: var(--text-faint); font-size: 12px; padding-top: 2px; }

/* ============ Chips ============ */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span {
  font-size: 11.5px; font-weight: 500; color: var(--text-soft);
  background: var(--bg-subtle); border: 1px solid var(--border);
  padding: 2px 9px; border-radius: 999px;
}

/* ============ Open Source ============ */
.oss-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.oss-card {
  display: block; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); color: var(--text);
}
.oss-card:hover { text-decoration: none; border-color: var(--accent); }
.oss-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.oss-head h3 { margin: 0; font-size: 14.5px; font-weight: 650; }
.oss-card p { color: var(--text-soft); font-size: 13px; margin: 8px 0 10px; }
.oss-foot { display: flex; align-items: center; gap: 8px; }
.lang-dot { width: 10px; height: 10px; border-radius: 50%; }
.lang-dot.py { background: #3572A5; }
.lang-name { font-size: 12px; color: var(--text-faint); font-weight: 500; }
.oss-count { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 2px 9px; border-radius: 999px; }
.shield { height: 19px; }

.pr-list { list-style: none; margin: 0; padding: 0; }
.pr-list li {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding: 9px 4px; border-bottom: 1px solid var(--border); font-size: 13.5px;
}
.pr-list li:last-child { border-bottom: none; }
.pr-repo { font-size: 11.5px; font-weight: 600; color: var(--text-faint); background: var(--bg-subtle); padding: 2px 8px; border-radius: 6px; flex: none; }
.pr-list a { color: var(--text); font-weight: 550; }
.pr-list a:hover { color: var(--accent); }
.pr-tag { font-size: 11px; font-weight: 650; padding: 2px 8px; border-radius: 999px; flex: none; }
.pr-merged { color: #16a34a; background: rgba(34,197,94,.12); }
.pr-issue { color: #9333ea; background: rgba(147,51,234,.12); }
.pr-date { margin-left: auto; color: var(--text-faint); font-size: 12px; flex: none; }
.oss-more { margin: 16px 0 0; font-size: 13px; color: var(--text-soft); }

/* ============ Publications ============ */
.pub-card {
  display: grid; grid-template-columns: 1fr; gap: 16px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.pub-card.with-thumb { grid-template-columns: 210px 1fr; align-items: center; }
.pub-thumb img { border-radius: 10px; border: 1px solid var(--border); background: #fff; max-height: 140px; object-fit: cover; width: 100%; }
.pub-venues { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.venue-badge {
  font-size: 11px; font-weight: 650; color: var(--accent);
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  padding: 2px 9px; border-radius: 999px;
}
.venue-demo { color: #b45309; background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.35); }
.venue-thesis { color: #7c3aed; background: rgba(124,58,237,.1); border-color: rgba(124,58,237,.3); }
.pub-card h3 { margin: 0 0 6px; font-size: 15.5px; font-weight: 600; line-height: 1.4; }
.pub-card h3 a { color: var(--text); }
.pub-card h3 a:hover { color: var(--accent); }
.pub-authors { margin: 0 0 4px; color: var(--text-soft); font-size: 13.5px; }
.pub-authors strong { color: var(--text); }
.pub-meta { margin: 0; color: var(--text-faint); font-size: 12.5px; }
.pub-links { display: flex; gap: 14px; margin-top: 8px; font-size: 13px; font-weight: 600; }

/* ============ Awards ============ */
.cert-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.cert-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); box-shadow: var(--shadow);
  transition: transform .12s ease, border-color .12s ease;
}
.cert-card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
.cert-card img {
  width: 100%; height: 170px; object-fit: contain; background: #fff;
  border-bottom: 1px solid var(--border); padding: 8px;
}
.cert-body { padding: 10px 14px 12px; }
.cert-name { font-size: 13px; font-weight: 650; line-height: 1.35; }
.cert-note { font-size: 12px; color: var(--text-faint); margin-top: 2px; line-height: 1.4; }
.cert-date { font-size: 12px; font-weight: 600; color: var(--accent); margin-top: 6px; }

.award-list { list-style: none; margin: 0; padding: 0; }
.award-list li { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--border); font-size: 14px; }
.award-list li:last-child { border-bottom: none; }
.award-name { font-weight: 600; }
.award-note { color: var(--text-faint); font-size: 12.5px; }
.award-year { margin-left: auto; color: var(--text-faint); font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* ---- WWDC23 flagship award card ---- */
.wwdc-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.wwdc-head { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.wwdc-titles { flex: 1; }
.wwdc-titles h3 { margin: 0; font-size: 16px; font-weight: 650; }
.wwdc-head .cert-date { flex: none; padding-top: 2px; }
.wwdc-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.wwdc-tile {
  position: relative; overflow: hidden; padding: 0; border: 1px solid var(--border);
  border-radius: 10px; background: var(--bg-subtle); cursor: zoom-in;
}
.wwdc-tile img { width: 100%; height: 150px; object-fit: cover; transition: transform .25s ease; }
.wwdc-tile:hover img { transform: scale(1.03); }
.tile-cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 20px 9px 7px; font-size: 11px; font-weight: 600; color: #fff; text-align: left;
  background: linear-gradient(transparent, rgba(0,0,0,.62));
}

/* ---- Life filmstrip (auto-scrolling, draggable) ---- */
.life-intro {
  margin: -6px 0 16px; color: var(--text-soft); font-size: 14px;
  font-family: var(--font-display); font-style: italic;
}
.reel {
  overflow: hidden; padding: 4px 0 6px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.reel-track { display: flex; width: max-content; will-change: transform; touch-action: pan-y; cursor: grab; }
.reel-track.dragging { cursor: grabbing; }
.reel-set { display: flex; gap: 14px; padding-right: 14px; }
.reel-card {
  position: relative; overflow: hidden; flex: none; padding: 0; border: 1px solid var(--border);
  border-radius: 12px; background: var(--bg-subtle); cursor: zoom-in;
}
.reel-card img { display: block; height: 216px; width: auto; pointer-events: none; transition: transform .3s ease; }
.reel-card:hover img { transform: scale(1.03); }
.reel-cap {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 0;
  padding: 26px 11px 8px; text-align: left; color: #fff; pointer-events: none;
  background: linear-gradient(transparent, rgba(0,0,0,.68));
}
.reel-cap strong { font-size: 12px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reel-cap em { font-size: 11px; font-weight: 400; color: rgba(255,255,255,.88); font-family: var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Phones: the filmstrip scrolls natively instead of running the JS marquee */
.reel-native {
  overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
  -webkit-overflow-scrolling: touch; scroll-snap-type: x mandatory;
}
.reel-native::-webkit-scrollbar { display: none; }
.reel-native .reel-track { touch-action: pan-x pan-y; }
.reel-native .reel-card { scroll-snap-align: start; }

/* ---- Lightbox ---- */
button.lb, a.lb { cursor: zoom-in; }
button.lb { background: none; border: 0; padding: 0; }
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: none; place-items: center;
  background: rgba(12,12,14,.9); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.lightbox.open { display: grid; }
.lightbox figure { margin: 0; text-align: center; max-width: 92vw; }
.lightbox img {
  max-width: 92vw; max-height: 80vh; width: auto; height: auto; margin: 0 auto;
  border-radius: 10px; box-shadow: 0 24px 70px rgba(0,0,0,.55);
}
.lightbox figcaption { margin-top: 14px; color: #e7e7ea; font-size: 13.5px; }
.lb-btn {
  position: fixed; z-index: 101; display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.08); color: #fff;
  font-size: 22px; line-height: 1; cursor: pointer; transition: background .15s ease;
}
.lb-btn:hover { background: rgba(255,255,255,.2); }
.lb-close { top: 20px; right: 24px; }
.lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 18px; top: 50%; transform: translateY(-50%); }
@media (max-width: 720px) { .lb-prev { left: 8px; } .lb-next { right: 8px; } }

/* ---- Travel map (offline-generated: tools/gen_map.py) ---- */
.map-note { margin: 0 0 12px; font-family: var(--font-display); font-style: italic; font-size: 13.5px; color: var(--text-faint); }
.map-fig {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 10px 8px; margin: 0 0 8px;
}
.map-fig figcaption { padding: 6px 8px 0; font-size: 11.5px; color: var(--text-faint); text-align: center; }
.world-map { display: block; width: 100%; height: auto; }
.world-map .m-land { fill: var(--bg-subtle); stroke: var(--border); stroke-width: .5; }
.world-map .m-visited { fill: var(--accent); }
.world-map .m-visited, .world-map .m-city { opacity: 0; transition: opacity .45s ease; transition-delay: calc(min(var(--i, 0), 14) * 60ms); }
.map-fig.visible .world-map .m-visited, .map-fig.visible .world-map .m-city { opacity: 1; }
.world-map .m-visited:hover { fill: color-mix(in srgb, var(--accent) 78%, var(--text)); }
.world-map .m-visited:focus, .world-map .m-city:focus { outline: none; stroke: var(--text); stroke-width: 1.5; }
.world-map .m-dot { stroke: var(--bg-card); stroke-width: 1; }
.world-map .m-city { fill: var(--bg); stroke: var(--accent); stroke-width: 1.4; }
.world-map .m-city:hover { stroke-width: 2.4; }
.map-tip {
  position: fixed; z-index: 90; pointer-events: none;
  background: var(--text); color: var(--bg);
  font-size: 12px; font-weight: 600; line-height: 1; padding: 6px 10px;
  border-radius: 8px; box-shadow: var(--shadow);
}

/* ============ Projects ============ */
.proj-featured {
  display: grid; grid-template-columns: 1fr 1.15fr; gap: 22px; align-items: center;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.proj-media { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.video-thumb { position: relative; display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.video-thumb img { width: 100%; height: 108px; object-fit: cover; }
.video-thumb .play {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: #fff; font-size: 22px; text-shadow: 0 2px 10px rgba(0,0,0,.5);
  background: rgba(0,0,0,.18); transition: background .15s ease;
}
.video-thumb:hover .play { background: rgba(0,0,0,.32); }
.proj-body h3 { margin: 0 0 2px; font-size: 16.5px; font-weight: 650; }
.proj-body p { color: var(--text-soft); font-size: 14px; margin: 8px 0 12px; }
.proj-body p strong { color: var(--text); font-weight: 600; }
.proj-meta { color: var(--text-faint) !important; font-size: 12.5px !important; margin: 0 0 8px !important; }
.badge {
  font-size: 11px; font-weight: 600; color: #16a34a;
  background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.3);
  padding: 2px 9px; border-radius: 999px; vertical-align: 2px; margin-left: 6px;
}
.proj-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.proj-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow);
}
.proj-card h3 { margin: 0 0 2px; font-size: 15.5px; font-weight: 650; }
.proj-card p { color: var(--text-soft); font-size: 13.5px; margin: 8px 0 10px; }
.proj-card p strong { color: var(--text); font-weight: 600; }
.proj-link { font-weight: 600; font-size: 13.5px; margin-right: 14px; }
.proj-photo-card { grid-column: 1 / -1; display: grid; grid-template-columns: 280px 1fr; gap: 18px; align-items: center; }
.proj-photo-trigger { display: block; padding: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--bg-subtle); cursor: zoom-in; }
.proj-photo { border-radius: 0; border: none; max-height: 200px; object-fit: cover; width: 100%; }
.proj-photo-body h3 { margin-bottom: 2px; }
.proj-photo-body p { margin: 8px 0 10px; }

/* ============ Contact & footer ============ */
.sec-contact p { color: var(--text-soft); font-size: 14.5px; }
.hero-links { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.contact-links { margin-top: 16px; }
.footer { border-top: 1px solid var(--border); padding: 26px 0 34px; color: var(--text-faint); font-size: 13px; }
.footer-inner { display: flex; gap: 8px; flex-wrap: wrap; justify-content: space-between; }

/* ============ CV page (resume.html) ============ */
.cv-title { font-family: var(--font-display); font-size: 32px; font-weight: 600; margin: 28px 0 6px; }
.cv-meta { color: var(--text-soft); margin: 0 0 22px; font-size: 14.5px; }
.cv-frame { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg-card); box-shadow: var(--shadow); }
.cv-frame iframe { width: 100%; height: min(1100px, 130vh); border: 0; display: block; }
.cv-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 6px; }
.cv-note { color: var(--text-faint); font-size: 13px; }

/* ============ Reveal animation ============ */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .world-map .m-visited, .world-map .m-city { opacity: 1; transition: none; }
  html { scroll-behavior: auto; }
}

/* ============ Responsive ============ */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; gap: 32px; padding-top: 28px; }
  .sidebar { position: static; max-height: none; overflow: visible; max-width: 420px; margin: 0 auto; text-align: center; }
  .side-photo { width: min(240px, 70vw); margin: 0 auto; }
  .side-status { justify-content: center; }
  .side-pv { justify-content: center; }
  .side-links { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 4px; }
  .side-cv { width: auto; }
  .oss-grid, .proj-grid, .cert-grid { grid-template-columns: 1fr; }
  .proj-featured { grid-template-columns: 1fr; }
  .pub-card.with-thumb { grid-template-columns: 1fr; }
  .proj-photo-card { grid-template-columns: 1fr; }
  .xp-when { margin-left: 58px; text-align: left; white-space: normal; }
  .nav-links { display: none; }
  .wwdc-strip { grid-template-columns: 1fr 1fr; }
  .wwdc-tile img { height: 150px; }
  .xp-fig { float: none; width: min(260px, 82%); margin: 10px auto 2px; }
  .reel-card img { height: 190px; }
}
@media (max-width: 560px) {
  .reel-card img { height: 168px; }
  .reel-cap em { display: none; }
  .reel-cap strong { font-size: 11.5px; }
  .lightbox figcaption { font-size: 12px; padding: 0 12px; }
  .award-list li { flex-wrap: wrap; }
  .award-name { flex: 1; }
  .award-note { order: 1; flex-basis: 100%; margin-top: 3px; }
}
