/* ═══════════════════════════════════════════════════════════
   Trung Tien Dong — personal site
   Shared stylesheet for home, blog and project pages.
═══════════════════════════════════════════════════════════ */

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

:root {
  --bg:        #f6f8fb;
  --bg-alt:    #eef2f8;
  --surface:   #ffffff;
  --border:    #e1e7f0;
  --text:      #0f1b2d;
  --muted:     #5b6880;
  --faint:     #8c97aa;
  --accent:    #0e8fa3;   /* ocean teal */
  --accent-2:  #3b5bdb;   /* deep blue */
  --accent-bg: rgba(14,143,163,0.09);
  --link:      #0b7d90;
  --hero-1:    #071d4f;
  --hero-2:    #0b4f7a;
  --hero-3:    #0e8fa3;
  --shadow:    0 1px 2px rgba(15,27,45,0.04), 0 6px 20px rgba(15,27,45,0.06);
  --shadow-h:  0 2px 6px rgba(15,27,45,0.08), 0 18px 40px rgba(15,27,45,0.12);
  --radius:    14px;
  --maxw:      1100px;
  --serif:     'Source Serif 4', Georgia, serif;
  --sans:      'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a111c; --bg-alt: #0f1826; --surface: #111c2b; --border: #1f2c3f;
    --text: #e6edf6; --muted: #9aa8bd; --faint: #6c7a90;
    --accent: #3cc6d6; --accent-2: #7d9bff; --accent-bg: rgba(60,198,214,0.10);
    --link: #5fd3e0;
    --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 6px 20px rgba(0,0,0,0.25);
    --shadow-h: 0 2px 6px rgba(0,0,0,0.4), 0 18px 40px rgba(0,0,0,0.4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a111c; --bg-alt: #0f1826; --surface: #111c2b; --border: #1f2c3f;
  --text: #e6edf6; --muted: #9aa8bd; --faint: #6c7a90;
  --accent: #3cc6d6; --accent-2: #7d9bff; --accent-bg: rgba(60,198,214,0.10);
  --link: #5fd3e0;
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 6px 20px rgba(0,0,0,0.25);
  --shadow-h: 0 2px 6px rgba(0,0,0,0.4), 0 18px 40px rgba(0,0,0,0.4);
  color-scheme: dark;
}

html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 15.5px;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s, color 0.25s;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem; }

/* ─────────── Top navigation ─────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(12px);
  -webkit-backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar__inner { display: flex; align-items: center; gap: 1rem; height: 60px; }
.topbar__brand { display: flex; align-items: center; gap: 0.6rem; color: var(--text); font-weight: 700; font-size: 0.98rem; }
.topbar__brand:hover { text-decoration: none; }
.topbar__brand img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; border: 1.5px solid var(--accent); }
.topbar__nav { margin-left: auto; display: flex; gap: 0.2rem; align-items: center; }
.topbar__nav a {
  color: var(--muted); font-size: 0.88rem; font-weight: 500;
  padding: 0.4rem 0.75rem; border-radius: 8px; transition: background 0.15s, color 0.15s;
}
.topbar__nav a:hover { background: var(--accent-bg); color: var(--text); text-decoration: none; }
.topbar__nav a.is-active { color: var(--accent); }
.theme-toggle {
  width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); cursor: pointer; font-size: 0.9rem;
  display: grid; place-items: center; margin-left: 0.4rem; transition: color 0.15s, border-color 0.15s;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle .fa-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .fa-sun { display: inline; }
:root[data-theme="dark"] .theme-toggle .fa-moon { display: none; }
.nav-toggle { display: none; background: none; border: 0; color: var(--text); font-size: 1.15rem; cursor: pointer; padding: 0.4rem; }

/* ─────────── Home hero ─────────── */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(1200px 400px at 85% -10%, rgba(60,198,214,0.35), transparent 60%),
    radial-gradient(800px 380px at 0% 120%, rgba(125,155,255,0.30), transparent 60%),
    linear-gradient(135deg, var(--hero-1), var(--hero-2) 55%, var(--hero-3));
}
.hero::after { /* subtle sonar rings */
  content: ''; position: absolute; right: -180px; top: -180px; width: 620px; height: 620px; border-radius: 50%;
  background: repeating-radial-gradient(circle, rgba(255,255,255,0.07) 0 1px, transparent 1px 46px);
  pointer-events: none;
}
.hero__inner { position: relative; z-index: 1; display: flex; align-items: center; gap: 2.5rem; padding: 4rem 1.5rem 4.2rem; }
.hero__avatar {
  width: 168px; height: 168px; flex-shrink: 0; border-radius: 50%; object-fit: cover;
  border: 3px solid rgba(255,255,255,0.85);
  box-shadow: 0 0 0 8px rgba(255,255,255,0.08), 0 18px 50px rgba(0,0,0,0.35);
}
.hero__eyebrow { text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.74rem; font-weight: 600; color: #9fe9f2; margin-bottom: 0.35rem; }
.hero h1 { font-family: var(--serif); font-size: 2.6rem; font-weight: 600; line-height: 1.12; letter-spacing: -0.01em; }
.hero__role { margin-top: 0.5rem; font-size: 1.02rem; color: rgba(255,255,255,0.85); }
.hero__role a { color: #fff; border-bottom: 1px solid rgba(255,255,255,0.4); }
.hero__role a:hover { text-decoration: none; border-bottom-color: #fff; }
.hero__links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.3rem; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.45rem 0.9rem; border-radius: 999px; font-size: 0.84rem; font-weight: 500;
  color: #fff; background: rgba(255,255,255,0.10); border: 1px solid rgba(255,255,255,0.25);
  transition: background 0.15s, transform 0.15s;
}
.chip-btn:hover { background: rgba(255,255,255,0.2); text-decoration: none; transform: translateY(-1px); }

/* ─────────── Home layout ─────────── */
.home { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 2.5rem; padding: 3rem 1.5rem 5rem; }
.home main { min-width: 0; }
section { margin-bottom: 3.4rem; }
.sec-title {
  display: flex; align-items: center; gap: 0.75rem;
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 1.2rem;
}
.sec-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.sec-title a { margin-left: auto; order: 3; font-size: 0.74rem; letter-spacing: 0.06em; text-transform: none; font-weight: 600; }

.prose { font-size: 0.97rem; line-height: 1.85; }
.prose p + p { margin-top: 0.9rem; }
.prose a { font-weight: 500; }
.prose strong { font-weight: 600; }

/* Sidebar */
.side { display: flex; flex-direction: column; gap: 1.25rem; position: sticky; top: 84px; align-self: start; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem 1.3rem; box-shadow: var(--shadow);
}
.card h3 { font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); font-weight: 700; margin-bottom: 0.8rem; }
.contact-list { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; font-size: 0.86rem; }
.contact-list li { display: flex; gap: 0.6rem; align-items: baseline; color: var(--muted); }
.contact-list i { width: 16px; text-align: center; color: var(--accent); }
.tags { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.tag {
  padding: 0.28rem 0.75rem; border-radius: 999px; font-size: 0.8rem; font-weight: 500;
  background: var(--accent-bg); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}
.timeline { list-style: none; position: relative; padding-left: 1.2rem; }
.timeline::before { content: ''; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline li { position: relative; margin-bottom: 1rem; }
.timeline li:last-child { margin-bottom: 0; }
.timeline li::before {
  content: ''; position: absolute; left: -1.2rem; top: 0.45rem; width: 10px; height: 10px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--accent);
}
.timeline .t-title { font-weight: 600; font-size: 0.88rem; line-height: 1.4; }
.timeline .t-sub { font-size: 0.8rem; color: var(--muted); }

/* ─────────── News list ─────────── */
.news { list-style: none; display: flex; flex-direction: column; }
.news li { display: grid; grid-template-columns: 92px 1fr; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px dashed var(--border); font-size: 0.92rem; }
.news li:last-child { border-bottom: 0; }
.news time { font-size: 0.78rem; font-weight: 600; color: var(--faint); font-variant-numeric: tabular-nums; padding-top: 0.15rem; }
.news .news-tag { display: inline-block; font-size: 0.68rem; font-weight: 700; padding: 0.05rem 0.45rem; border-radius: 4px; background: var(--accent-bg); color: var(--accent); margin-right: 0.35rem; vertical-align: 1px; }

/* ─────────── Publication cards ─────────── */
.pubs { display: flex; flex-direction: column; gap: 1.1rem; }
.pub {
  display: grid; grid-template-columns: 240px 1fr; gap: 1.3rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem; box-shadow: var(--shadow); transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}
.pub:hover { box-shadow: var(--shadow-h); transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.pub__thumb { position: relative; border-radius: 10px; overflow: hidden; background: var(--bg-alt); aspect-ratio: 16/10; }
.pub__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.pub:hover .pub__thumb img { transform: scale(1.04); }
.venue {
  position: absolute; top: 8px; left: 8px; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.02em;
  color: #fff; background: rgba(7,29,79,0.85); padding: 0.2rem 0.5rem; border-radius: 5px; backdrop-filter: blur(4px);
}
.venue--accepted { background: rgba(10,128,96,0.92); }
.pub__body { min-width: 0; display: flex; flex-direction: column; }
.pub__title { font-size: 1.02rem; font-weight: 700; line-height: 1.4; color: var(--text); }
.pub__title a { color: inherit; }
.pub__title a:hover { color: var(--accent); text-decoration: none; }
.pub__authors { font-size: 0.84rem; color: var(--muted); margin-top: 0.3rem; }
.pub__authors .me { color: var(--text); font-weight: 600; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.pub__venue { font-size: 0.82rem; font-style: italic; color: var(--muted); }
.pub__venue .status { font-style: normal; font-weight: 600; color: var(--accent); }
.pub__tldr { font-size: 0.86rem; color: var(--muted); margin-top: 0.5rem; }
.pub__links { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: auto; padding-top: 0.7rem; }
.pill {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.76rem; font-weight: 600; color: var(--text);
  border: 1px solid var(--border); background: var(--bg); border-radius: 7px; padding: 0.22rem 0.6rem;
  transition: color 0.15s, border-color 0.15s;
}
.pill:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.pill.is-soon { color: var(--faint); cursor: default; border-style: dashed; }
.pill.is-soon:hover { color: var(--faint); border-color: var(--border); }

/* ─────────── Page header (blog) ─────────── */
.page-head {
  color: #fff; position: relative; overflow: hidden;
  background:
    radial-gradient(900px 300px at 90% -20%, rgba(60,198,214,0.35), transparent 60%),
    linear-gradient(135deg, var(--hero-1), var(--hero-2));
}
.page-head .container { padding-top: 3rem; padding-bottom: 2.8rem; position: relative; z-index: 1; }
.page-head__eyebrow { text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.74rem; font-weight: 600; color: #9fe9f2; }
.page-head h1 { font-family: var(--serif); font-weight: 600; font-size: 2.3rem; margin-top: 0.3rem; }
.page-head p { color: rgba(255,255,255,0.82); max-width: 640px; margin-top: 0.5rem; }

/* ─────────── Blog ─────────── */
.blog { max-width: 760px; margin: 0 auto; padding: 2.5rem 1.5rem 5rem; }
.blog-filters { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.8rem; }
.blog-filters button {
  font: inherit; font-size: 0.82rem; font-weight: 500; cursor: pointer;
  padding: 0.32rem 0.85rem; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted);
}
.blog-filters button.is-active, .blog-filters button:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-bg); }
.post {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.4rem 1.5rem; margin-bottom: 1.4rem;
}
.post__head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.9rem; }
.post__head img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.post__who { font-weight: 600; font-size: 0.92rem; line-height: 1.3; }
.post__meta { font-size: 0.78rem; color: var(--faint); }
.post__src { margin-left: auto; color: #0a66c2; font-size: 1.3rem; }
:root[data-theme="dark"] .post__src { color: #5aa7ff; }
.post__title { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; line-height: 1.3; margin-bottom: 0.6rem; }
.post__body { font-size: 0.95rem; line-height: 1.8; white-space: pre-line; }
.post__body a { word-break: break-word; }
.post__body.is-clamped { max-height: 15.5em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.post__more { font: inherit; font-size: 0.84rem; font-weight: 600; color: var(--accent); background: none; border: 0; cursor: pointer; padding: 0.3rem 0; }
.post__more:hover { text-decoration: underline; }
.post__media { margin-top: 1rem; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.post__gallery { display: grid; grid-template-columns: 2fr 1fr; grid-auto-rows: 130px; gap: 6px; margin-top: 1rem; border-radius: 10px; overflow: hidden; }
.post__gallery a:first-child { grid-row: span 2; }
.post__gallery a:first-child:nth-last-child(4) { grid-row: span 3; }
.post__gallery a:first-child:nth-last-child(4) ~ a { grid-row: span 1; }
.post__gallery img { width: 100%; height: 100%; object-fit: cover; transition: opacity 0.2s; }
.post__gallery a:hover img { opacity: 0.88; }
.post__foot { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-top: 1rem; padding-top: 0.9rem; border-top: 1px solid var(--border); }
.post__foot .tag { font-size: 0.72rem; }
.post__foot a.orig { margin-left: auto; font-size: 0.82rem; font-weight: 600; }
.empty { text-align: center; color: var(--muted); padding: 3rem 1rem; }

/* ─────────── Project pages ─────────── */
.proj-hero {
  color: #fff; text-align: center; position: relative; overflow: hidden;
  background:
    radial-gradient(1000px 360px at 50% -20%, rgba(60,198,214,0.35), transparent 60%),
    linear-gradient(160deg, var(--hero-1), var(--hero-2) 70%, #0b6380);
}
.proj-hero .container { max-width: 960px; padding-top: 3.6rem; padding-bottom: 3.2rem; position: relative; z-index: 1; }
.proj-hero .badge {
  display: inline-block; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.04em;
  padding: 0.3rem 0.8rem; border-radius: 999px; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.25); color: #bdf3f9;
}
.proj-hero .acronym { display: block; font-family: var(--serif); font-size: 1.15rem; font-weight: 600; color: #9fe9f2; margin-top: 1.1rem; letter-spacing: 0.02em; }
.proj-hero h1 { font-family: var(--serif); font-size: 2.15rem; font-weight: 600; line-height: 1.22; margin-top: 0.3rem; }
.proj-hero .authors { margin-top: 1.1rem; font-size: 1rem; color: rgba(255,255,255,0.9); }
.proj-hero .authors a { color: #fff; border-bottom: 1px solid rgba(255,255,255,0.35); }
.proj-hero .authors a:hover { text-decoration: none; border-bottom-color: #fff; }
.proj-hero .affil { margin-top: 0.35rem; font-size: 0.88rem; color: rgba(255,255,255,0.7); }
.proj-hero .btns { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.6rem; }
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 1.15rem; border-radius: 999px; font-weight: 600; font-size: 0.9rem;
  background: #fff; color: var(--hero-1); border: 1px solid #fff; transition: transform 0.15s, background 0.15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); background: #e6fbfd; }
.btn.is-soon { background: transparent; color: rgba(255,255,255,0.75); border: 1px dashed rgba(255,255,255,0.45); cursor: default; }
.btn.is-soon:hover { transform: none; background: transparent; }
.btn .soon { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; padding: 0.1rem 0.4rem; border-radius: 4px; background: rgba(255,255,255,0.15); }

.proj-body { max-width: 900px; margin: 0 auto; padding: 2.8rem 1.5rem 3rem; }
.proj-body h2 { font-family: var(--serif); font-size: 1.6rem; font-weight: 600; margin: 2.6rem 0 1rem; color: var(--text); text-align: center; }
.proj-body h2:first-child { margin-top: 0; }
.proj-body h3 { font-size: 1.05rem; margin: 1.6rem 0 0.6rem; }
.proj-body p { margin-bottom: 1rem; font-size: 0.98rem; line-height: 1.85; }
.proj-body .abstract { text-align: justify; hyphens: auto; }
.proj-body ul.contrib { list-style: none; display: grid; gap: 0.7rem; margin: 0.4rem 0 1rem; }
.proj-body ul.contrib li {
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 10px; padding: 0.8rem 1rem; font-size: 0.94rem; line-height: 1.7;
}
.proj-body figure { margin: 1.4rem 0 1.8rem; }
.proj-body figure img { width: 100%; border-radius: 12px; border: 1px solid var(--border); background: #fff; box-shadow: var(--shadow); }
.proj-body figcaption { font-size: 0.86rem; color: var(--muted); margin-top: 0.7rem; line-height: 1.65; text-align: center; }
.proj-body figcaption b { color: var(--text); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.9rem; margin: 1.2rem 0 1.6rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.1rem; text-align: center; box-shadow: var(--shadow); }
.stat__num { font-family: var(--serif); font-size: 1.75rem; font-weight: 600; color: var(--accent); line-height: 1.15; }
.stat__label { font-size: 0.8rem; color: var(--muted); margin-top: 0.25rem; line-height: 1.45; }
.callout {
  background: var(--accent-bg); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: 12px; padding: 1rem 1.2rem; font-size: 0.92rem; color: var(--text);
}
.callout i { color: var(--accent); margin-right: 0.4rem; }
.bibtex { position: relative; }
.bibtex pre {
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: 12px;
  padding: 1.1rem 1.2rem; overflow-x: auto; font-size: 0.82rem; line-height: 1.6;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--text);
}
.copy-btn {
  position: absolute; top: 0.6rem; right: 0.6rem; font: inherit; font-size: 0.75rem; font-weight: 600; cursor: pointer;
  padding: 0.25rem 0.6rem; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--muted);
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }
.back-link { max-width: 900px; margin: 0 auto; padding: 0 1.5rem 3rem; font-size: 0.9rem; }


/* Project page extras */
.video-wrap { border-radius: 12px; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); background: #000; }
.video-wrap video { width: 100%; display: block; }
.fig-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; align-items: start; }
.fig-row figure { margin: 0.6rem 0 1.4rem; }
.proj-body > .callout { margin-top: 1.6rem; }

/* uScenes scene viewer */
.scene-gallery { margin: 0.4rem 0 1rem; }
.sg__main { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; border-radius: 12px; overflow: hidden; background: #000; box-shadow: var(--shadow); }
.sg__pane { position: relative; margin: 0 !important; aspect-ratio: 16/9; }
.sg__pane img { width: 100%; height: 100%; object-fit: cover; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
.sg__pane--sonar img { object-fit: contain; background: #000 !important; }
.sg__label { position: absolute; left: 10px; bottom: 10px; font-size: 0.74rem; font-weight: 600; color: #fff; background: rgba(0,0,0,0.55); padding: 0.2rem 0.55rem; border-radius: 6px; backdrop-filter: blur(4px); }
.sg__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer; background: rgba(255,255,255,0.9); color: #0f1b2d; box-shadow: 0 2px 10px rgba(0,0,0,0.3); }
.sg__nav:hover { background: #fff; }
.sg__nav--prev { left: 10px; } .sg__nav--next { right: 10px; }
.sg__thumbs { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 8px; }
.sg__thumb { padding: 0; border: 2px solid transparent; border-radius: 7px; overflow: hidden; cursor: pointer; background: none; opacity: 0.6; transition: opacity 0.15s, border-color 0.15s; aspect-ratio: 16/9; }
.sg__thumb img { width: 100%; height: 100%; object-fit: cover; }
.sg__thumb:hover { opacity: 0.9; }
.sg__thumb.is-active { border-color: var(--accent); opacity: 1; }
.sg__count { text-align: center; font-size: 0.82rem !important; color: var(--muted); margin-top: 0.5rem; }

/* ─────────── Footer ─────────── */
.site-footer { border-top: 1px solid var(--border); padding: 2rem 0; color: var(--faint); font-size: 0.82rem; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; }
.site-footer .socials { display: flex; gap: 0.9rem; font-size: 1.05rem; }
.site-footer .socials a { color: var(--muted); }
.site-footer .socials a:hover { color: var(--accent); }

/* Reveal-on-scroll */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ─────────── Responsive ─────────── */
@media (max-width: 900px) {
  .home { grid-template-columns: 1fr; }
  .side { position: static; }
}
@media (max-width: 680px) {
  .nav-toggle { display: block; margin-left: auto; }
  .topbar__nav {
    display: none; position: absolute; top: 60px; left: 0; right: 0; flex-direction: column; align-items: stretch;
    background: var(--surface); border-bottom: 1px solid var(--border); padding: 0.5rem 1rem 0.8rem;
  }
  .topbar__nav.is-open { display: flex; }
  .theme-toggle { margin: 0.4rem 0 0 0.75rem; }
  .hero__inner { flex-direction: column; text-align: center; padding: 3rem 1rem; gap: 1.4rem; }
  .hero__avatar { width: 132px; height: 132px; }
  .hero h1 { font-size: 2rem; }
  .hero__links { justify-content: center; }
  .container.home { padding: 2rem 1rem 4rem; }
  .proj-body .abstract { text-align: left; }
  .pub { grid-template-columns: 1fr; }
  .news li { grid-template-columns: 1fr; gap: 0.1rem; }
  .proj-hero h1 { font-size: 1.6rem; }
  .fig-row, .sg__main { grid-template-columns: 1fr; }
  .sg__thumbs { grid-template-columns: repeat(4, 1fr); }
  .container { padding: 0 1rem; }
  .proj-body, .blog { padding-left: 1rem; padding-right: 1rem; }
}
