:root {
  --ink: #1b2330;
  --muted: #5d6878;
  --line: #e3e7ee;
  --bg: #ffffff;
  --bg-alt: #f5f7fa;
  --primary: #16325c;
  --primary-2: #1f4a86;
  --accent: #e8a33d;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.6; font-size: 16px; }
img { max-width: 100%; display: block; }
a { color: var(--primary-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.75rem); letter-spacing: -.01em; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }

.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 600; color: var(--accent); margin-bottom: .5em; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 720px; }
.prose p { margin-bottom: 1em; }

/* header */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand span { display: flex; flex-direction: column; line-height: 1.15; }
.brand strong { font-size: 1.1rem; letter-spacing: .04em; color: var(--primary); }
.brand small { font-size: .75rem; color: var(--muted); }
.nav { display: flex; align-items: center; gap: 4px; }
.nav > a { padding: 8px 12px; border-radius: 8px; color: var(--ink); font-weight: 500; font-size: .95rem; }
.nav > a:hover { background: var(--bg-alt); text-decoration: none; }
.nav > a.active { color: var(--primary); background: #eaf0f8; }
.lang { display: flex; margin-left: 10px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.lang button { border: 0; background: none; padding: 6px 10px; font: inherit; font-size: .8rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.lang button.current { background: var(--primary); color: #fff; }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 5px 0; border-radius: 2px; }

/* hero */
.hero { background: linear-gradient(135deg, #16325c 0%, #1f4a86 60%, #28599d 100%); color: #fff; padding: 72px 0 64px; }
.hero h1 { color: #fff; max-width: 680px; }
.hero .lead { color: rgba(255,255,255,.85); }
.hero-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 48px; align-items: center; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.btn { display: inline-block; padding: 11px 20px; border-radius: 8px; background: var(--accent); color: #1b2330; font-weight: 600; }
.btn:hover { text-decoration: none; filter: brightness(1.05); }
.btn-ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.5); }
.stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stats li { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); border-radius: var(--radius); padding: 18px; }
.stats strong { display: block; font-size: 1.8rem; line-height: 1.1; }
.stats span { font-size: .85rem; color: rgba(255,255,255,.75); }

/* sections */
.section { padding: 64px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; }
.story { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.group-photo { margin: 0; }
.group-photo img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; }
.group-photo figcaption { font-size: .85rem; color: var(--muted); margin-top: 8px; }
.photo-placeholder { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.photo-placeholder img { aspect-ratio: 4/5; object-fit: cover; border-radius: var(--radius); }

.project { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }
.project-badge { display: inline-block; font-size: .78rem; font-weight: 700; color: var(--primary); background: #eaf0f8; padding: 4px 10px; border-radius: 99px; margin-bottom: 12px; }
.project-meta { display: flex; flex-wrap: wrap; gap: 32px; margin: 16px 0 0; }
.project-meta dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.project-meta dd { margin: 0; font-weight: 600; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; background: #fff; }
.card-num { font-weight: 700; color: var(--accent); font-size: .9rem; }
.card h3 { margin-top: 8px; }
.card p { color: var(--muted); font-size: .95rem; margin: 0; }

.two-col { display: grid; grid-template-columns: 1.5fr 1fr; gap: 48px; }
.news-list { list-style: none; padding: 0; margin: 0; }
.news-list li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.news-list time { font-size: .8rem; color: var(--accent); font-weight: 600; }
.news-list h3 { margin: 2px 0 4px; }
.news-list p { font-size: .92rem; color: var(--muted); margin: 0; }

/* page head */
.page-head { background: var(--bg-alt); border-bottom: 1px solid var(--line); padding: 48px 0 28px; }
.subnav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.subnav a { padding: 6px 14px; border: 1px solid var(--line); background: #fff; border-radius: 99px; color: var(--ink); font-size: .9rem; }
.subnav a:hover { border-color: var(--primary-2); text-decoration: none; }
.count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 99px; background: var(--bg-alt); font-size: .75rem; text-align: center; color: var(--muted); }
.back { font-size: .9rem; display: inline-block; margin-bottom: 12px; }

/* people */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.people-lg { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.person { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.people-lg .person { flex-direction: row; }
.avatar { width: 100%; aspect-ratio: 1/1; object-fit: cover; object-position: top; background: #eaf0f8; }
.people-lg .avatar { width: 130px; min-width: 130px; aspect-ratio: auto; height: auto; }
.avatar-empty { display: flex; align-items: center; justify-content: center; font-size: 1.8rem; font-weight: 700; color: var(--primary); aspect-ratio: 16/7; }
.person-body { padding: 16px 18px; }
.person-body h3 { margin-bottom: 4px; }
.person-body h3 .muted { font-weight: 500; font-size: .9rem; display: block; }
.role { color: var(--accent); font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
.person-body p { margin-bottom: 4px; }
.links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; font-size: .85rem; font-weight: 500; }

/* research */
.research { padding-bottom: 64px; }
.block { padding-top: 48px; }
.block > h2 { padding-bottom: 10px; border-bottom: 2px solid var(--primary); }
.year { font-size: .95rem; color: var(--muted); margin: 24px 0 4px; }
.pub-list { list-style: none; margin: 0; padding: 0; }
.pub { padding: 14px 0; border-bottom: 1px solid var(--line); }
.pub-title { font-weight: 600; }
.pub-title a { color: var(--ink); }
.pub-title a:hover { color: var(--primary-2); }
.pub-authors { font-size: .92rem; color: var(--muted); }
.pub-venue { font-size: .92rem; }
.pub-links { display: flex; gap: 6px; margin-top: 6px; }
.chip { font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 4px; border: 1px solid var(--line); color: var(--primary-2); }
.chip:hover { text-decoration: none; border-color: var(--primary-2); }
.datasets { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; margin-top: 20px; }
.dataset { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.dataset h3 a { color: var(--ink); }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 4px; margin-bottom: 10px; color: #fff; background: #6b7280; }
.badge-zenodo { background: #1682d4; }
.badge-kaggle { background: #20beff; }
.badge-github { background: #24292f; }
.table-wrap { overflow-x: auto; margin-top: 16px; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--line); padding: 10px 12px; }
.table td { border-bottom: 1px solid var(--line); padding: 12px; vertical-align: top; }
.status { font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.status-completed { background: #e6f4ea; color: #1e6b35; }
.status-ongoing { background: #fff4e0; color: #8a5a00; }

/* gallery */
.albums { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.album { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: var(--ink); background: #fff; transition: box-shadow .2s; }
.album:hover { box-shadow: var(--shadow); text-decoration: none; }
.album img, .album-empty { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--bg-alt); }
.album-body { padding: 14px 16px; }
.album-body h3 { margin: 0 0 2px; }
.photos { columns: 3 260px; column-gap: 14px; }
.photos a { display: block; margin-bottom: 14px; break-inside: avoid; }
.photos img { border-radius: 8px; width: 100%; }
.lightbox { position: fixed; inset: 0; background: rgba(10, 14, 22, .92); z-index: 100; display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: 90vw; max-height: 88vh; text-align: center; }
.lightbox img { max-width: 90vw; max-height: 80vh; margin: 0 auto; border-radius: 6px; }
.lightbox figcaption { color: #dfe4ec; margin-top: 10px; font-size: .95rem; }
.lightbox button { position: absolute; background: none; border: 0; color: #fff; font-size: 2.6rem; cursor: pointer; padding: 10px 18px; line-height: 1; }
.lb-close { top: 10px; right: 10px; }
.lb-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 10px; top: 50%; transform: translateY(-50%); }

/* footer */
.footer { background: #0f213d; color: #c9d2e0; padding: 48px 0 0; font-size: .92rem; }
.footer a { color: #fff; }
.footer strong { color: #fff; display: block; margin-bottom: 8px; }
.footer p { margin: 0 0 4px; }
.footer .muted { color: #95a3b8; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 32px; padding-bottom: 32px; }
.copyright { border-top: 1px solid rgba(255,255,255,.1); padding-top: 18px; padding-bottom: 18px; font-size: .82rem; color: #95a3b8; }

@media (max-width: 900px) {
  .hero-grid, .story, .two-col, .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; top: 68px; left: 0; right: 0; background: #fff; flex-direction: column; align-items: stretch; padding: 12px 20px 20px; border-bottom: 1px solid var(--line); }
  .nav.open { display: flex; }
  .lang { margin: 10px 0 0; align-self: flex-start; }
  .people-lg { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .container { padding: 0 16px; }
  .people-lg .avatar { width: 104px; min-width: 104px; }
  .people { grid-template-columns: 1fr 1fr; gap: 12px; }
  .people-lg { grid-template-columns: 1fr; }
  .datasets { grid-template-columns: 1fr; }
  .stats strong { font-size: 1.5rem; }
}
