:root {
  --bg: #fbfaf7; --surface: #ffffff; --text: #1f2430; --muted: #646b7a;
  --line: #e6e3dc; --accent: #2b59c3; --accent-soft: #e8eefc; --badge: #fff1d6; --badge-text: #8a5a00;
  --oral: #fde4e4; --oral-text: #a12a2a;
  --serif: "Inter", system-ui, sans-serif; --sans: "Inter", system-ui, sans-serif;
}
[data-theme="dark"] {
  --bg: #12151c; --surface: #1a1e28; --text: #e8eaf0; --muted: #9aa2b3;
  --line: #2a3040; --accent: #8fb0ff; --accent-soft: #212a42; --badge: #3a2f14; --badge-text: #f3c969;
  --oral: #43202a; --oral-text: #ff9aa8;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 1.5rem; }

.site-header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 1rem; height: 60px; }
.brand { font-weight: 700; letter-spacing: -.01em; color: var(--text); margin-right: auto; }
.nav { display: flex; gap: 1.1rem; flex-wrap: wrap; font-size: .95rem; }
.nav a { color: var(--muted); } .nav a:hover { color: var(--accent); text-decoration: none; }
.theme-toggle { border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 999px; width: 36px; height: 36px; cursor: pointer; font-size: 1rem; }

.hero { display: grid; grid-template-columns: 1fr 200px; gap: 2.5rem; align-items: center; padding: 4.5rem 0 2rem; }
.hero__hi { color: var(--accent); margin: 0; font-weight: 600; }
.hero h1 { font-weight: 700; letter-spacing: -.03em; font-size: clamp(2.3rem, 5.5vw, 3.2rem); line-height: 1.1; margin: 0 0 .4rem; }`n.hero__role { margin: 0 0 .9rem; font-size: 1.15rem; font-weight: 500; color: var(--accent); }
.hero__lead { color: var(--muted); font-size: 1.15rem; margin: 0 0 1.4rem; }
.hero__photo { width: 200px; height: 200px; border-radius: 50%; object-fit: cover; border: 4px solid var(--surface);
  box-shadow: 0 8px 30px rgba(0,0,0,.15); background: var(--accent-soft); }
.btns { display: flex; gap: .7rem; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: .45rem; padding: .5rem 1.1rem; border-radius: 999px; border: 1px solid var(--accent); font-weight: 600; font-size: .95rem; }
.btn--primary { background: var(--accent); color: var(--bg); } .btn--primary:hover { text-decoration: none; opacity: .9; }
.btn--ghost { color: var(--accent); }

.section { padding: 2.5rem 0 .5rem; }
.section__label { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; color: var(--accent); font-weight: 600; }
.section h2 { font-weight: 700; letter-spacing: -.02em; font-size: 1.7rem; margin: .1rem 0 1.2rem; }

.news { list-style: none; padding: 0; margin: 0; }
.news li { display: grid; grid-template-columns: 90px 1fr; gap: 1rem; padding: .45rem 0; border-bottom: 1px dashed var(--line); }
.news time { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }

.pub, .proj, .card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.2rem; margin-bottom: 1rem; }
.venue { display: inline-block; background: var(--badge); color: var(--badge-text); font-weight: 700; font-size: .78rem;
  padding: .1rem .55rem; border-radius: 6px; letter-spacing: .03em; margin-right: .3rem; }
.venue--oral { background: var(--oral); color: var(--oral-text); }
.pub__title { font-size: 1.05rem; font-weight: 600; letter-spacing: -.01em; margin: .45rem 0 .2rem; line-height: 1.35; }
.pub__authors { color: var(--muted); margin: 0 0 .4rem; font-size: .96rem; }
.pub__authors strong { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.links a { display: inline-flex; align-items: center; gap: .3rem; margin-bottom: .3rem; font-size: .85rem; margin-right: .5rem; padding: .05rem .6rem; border-radius: 6px; background: var(--accent-soft); }
.links a:hover { text-decoration: none; filter: brightness(.95); }
.sub { font-size: 1.1rem; font-weight: 600; margin: 1.6rem 0 .8rem; }

.proj { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.proj p { margin: .2rem 0 0; color: var(--muted); font-size: .95rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.grid .card { margin: 0; } .card p { margin: .3rem 0 0; color: var(--muted); font-size: .92rem; }

.tl { list-style: none; padding: 0; margin: 0; }
.tl li { display: grid; grid-template-columns: 130px 1fr; gap: 1rem; padding: .55rem 0; border-bottom: 1px dashed var(--line); }
.tl .when { color: var(--muted); font-size: .92rem; }
.tl .what small { display: block; color: var(--muted); }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: .6rem; padding: 0; }
.chips a { display: inline-flex; align-items: center; gap: .5rem; border: 1px solid var(--line); background: var(--surface); padding: .4rem .9rem; border-radius: 999px; color: var(--text); }
.chips a:hover { border-color: var(--accent); text-decoration: none; }
.site-footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 3rem 0 2rem; }

@media (max-width: 640px) {
  .hero { grid-template-columns: 1fr; padding-top: 2.5rem; } .hero__photo { order: -1; width: 140px; height: 140px; }
  .news li, .tl li { grid-template-columns: 1fr; gap: 0; } .nav { display: none; }
}

/* ---------- CV page / LaTeX-inspired Typography ---------- */
.cv { max-width: 820px; margin: 0 auto; padding: 2.5rem 1.5rem 3.5rem; }
.cv-header { margin-bottom: 1.6rem; border-bottom: 2px solid var(--text); padding-bottom: 1rem; }
.cv-header h1 { margin: 0 0 .3rem; font-size: 2.3rem; font-weight: 700; letter-spacing: -.03em; }
.cv-role { font-size: 1.05rem; font-weight: 500; color: var(--accent); margin: 0 0 .4rem; }
.cv-contact { font-size: .88rem; color: var(--muted); margin: 0; line-height: 1.5; }
.cv-contact a { color: inherit; } .cv-contact a:hover { color: var(--accent); }
.cv-actions { display: flex; gap: .7rem; margin-bottom: 1.8rem; }

.cv-sec { margin-bottom: 1.8rem; }
.cv-sec h2 { 
  font-size: .95rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; 
  color: var(--accent); border-bottom: 1px solid var(--line); padding-bottom: .3rem; margin: 0 0 .9rem; 
}

.cv-row { display: grid; grid-template-columns: 130px 1fr; gap: 1.2rem; margin-bottom: .85rem; }
.cv-date { font-size: .9rem; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 1px; }
.cv-content strong { color: var(--text); font-weight: 600; }
.cv-sub { font-size: .88rem; color: var(--muted); margin-top: .15rem; }
.cv-grade { display: inline-block; margin-left: .5rem; font-size: .88rem; color: var(--accent); font-weight: 600; }
.cv-note { font-size: .84rem; color: var(--muted); font-style: italic; margin: .4rem 0 0 142px; }

.cv-bullets { margin: .35rem 0 0 1.1rem; padding: 0; font-size: .9rem; color: var(--muted); line-height: 1.5; }
.cv-bullets li { margin-bottom: .2rem; }

.cv-pub { font-size: .92rem; line-height: 1.55; margin-bottom: .75rem; color: var(--text); padding-left: 1.2rem; text-indent: -1.2rem; }
.cv-pub strong { color: var(--text); font-weight: 600; }
.cv-pub em { font-style: italic; }

.cv-skills { display: flex; flex-direction: column; gap: .35rem; font-size: .92rem; }
.cv-skill-line strong { min-width: 130px; display: inline-block; color: var(--text); }

@media (max-width: 640px) {
  .cv-row { grid-template-columns: 1fr; gap: .1rem; }
  .cv-note { margin-left: 0; }
}

@media print {
  :root, [data-theme="dark"] { 
    --bg: #ffffff; --surface: #ffffff; --text: #0f172a; --muted: #475569; 
    --line: #cbd5e1; --accent: #1e3a8a; --accent-soft: #f8fafc; 
  }
  @page { size: A4; margin: 15mm 16mm; }
  body { font-size: 9.8pt; line-height: 1.45; background: #fff; color: #0f172a; }
  .site-header, .cv-actions, .site-footer { display: none !important; }
  .cv { padding: 0; max-width: none; }
  .cv-header { margin-bottom: 1.2rem; padding-bottom: .7rem; border-bottom: 1.5px solid #0f172a; }
  .cv-header h1 { font-size: 20pt; }
  .cv-role { font-size: 10.5pt; color: #1e3a8a; }
  .cv-contact { font-size: 8.5pt; }
  .cv-sec { margin-bottom: 1.2rem; }
  .cv-sec h2 { 
    font-size: 10pt; letter-spacing: .08em; border-bottom: 1px solid #94a3b8; 
    color: #1e3a8a; margin-bottom: .6rem; break-after: avoid; page-break-after: avoid; 
  }
  .cv-row { margin-bottom: .55rem; break-inside: avoid; page-break-inside: avoid; }
  .cv-pub { font-size: 9.3pt; margin-bottom: .55rem; break-inside: avoid; page-break-inside: avoid; }
  .cv-bullets { font-size: 9pt; }
  a { text-decoration: none; color: inherit; }
}

/* ---------- Conference photo gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 4/5; object-fit: cover; object-position: top; border-radius: 12px; border: 1px solid var(--line); display: block; transition: transform .2s; }
.gallery a:hover img { transform: translateY(-3px); }
.gallery figcaption { text-align: center; color: var(--muted); font-size: .88rem; margin-top: .4rem; }
.gallery figure:nth-child(2) img { object-position: 15% 70%; }

/* ---------- Icons, cards, notes ---------- */
.icon { width: 1.05em; height: 1.05em; flex: none; vertical-align: -.15em; }
.icon--lg { width: 1.5rem; height: 1.5rem; color: var(--accent); }
.card__head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.card__head strong { font-size: 1.02rem; }
.tag { margin-left: auto; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 0 .4rem; }
.card .stat { color: var(--accent); font-weight: 600; font-size: .85rem; }
.card .links { margin-top: .7rem; }
.note { color: var(--muted); font-size: .88rem; font-style: italic; margin-top: .8rem; }
.more { display: inline-flex; align-items: center; gap: .4rem; }
.grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
