/* ============================================================
   CSS Custom Properties — Light Mode Defaults
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-secondary: #f6f8fa;
  --text: #24292f;
  --text-muted: #57606a;
  --accent: #2962ff;
  --accent-hover: #1a46d0;
  --border: #d0d7de;
  --code-bg: #f6f8fa;
  --code-text: #24292f;
  --nav-bg: rgba(255, 255, 255, 0.92);
  --hero-bg: navy;
  --hero-text: #ffffff;
  --radius: 6px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* System dark preference */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117;
    --bg-secondary: #161b22;
    --text: #e6edf3;
    --text-muted: #8b949e;
    --accent: #90b4ff;
    --accent-hover: #b3d0ff;
    --border: #30363d;
    --code-bg: #161b22;
    --code-text: #e6edf3;
    --nav-bg: rgba(13, 17, 23, 0.92);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  }
}

/* Explicit dark mode */
[data-theme="dark"] {
  --bg: #0d1117;
  --bg-secondary: #161b22;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #90b4ff;
  --accent-hover: #b3d0ff;
  --border: #30363d;
  --code-bg: #161b22;
  --code-text: #e6edf3;
  --nav-bg: rgba(13, 17, 23, 0.92);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* ============================================================
   Reset & Base
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* ============================================================
   Typography
   ============================================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
  font-weight: 600;
  line-height: 1.3;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}

h1 { font-size: 2rem; font-weight: 700; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p { margin: 0 0 1rem; }

ul, ol {
  margin: 0 0 1rem;
  padding-left: 1.75rem;
}
li { margin-bottom: 0.25rem; }

blockquote {
  border-left: 4px solid var(--accent);
  margin: 1.5rem 0;
  padding: 0.5rem 1rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ============================================================
   Layout
   ============================================================ */

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ============================================================
   Navigation
   ============================================================ */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.site-title {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.site-title:hover {
  color: var(--accent);
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
}
.nav-links a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* Dark mode toggle button */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 8px;
  cursor: pointer;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: border-color 0.15s, color 0.15s;
}
.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Moon shown in light mode; sun shown in dark mode */
.icon-sun { display: none; }
.icon-moon { display: block; }

[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: block; }
  :root:not([data-theme="light"]) .icon-moon { display: none; }
}

/* ============================================================
   Hero Section
   ============================================================ */

.hero {
  background-color: var(--hero-bg);
  color: var(--hero-text);
  padding: 5rem 1.5rem;
  text-align: center;
}

.hero h1 {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--hero-text);
  margin: 0 0 0.5rem;
}

.hero p {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.82);
  margin: 0;
  font-weight: 300;
  letter-spacing: 0.02em;
}

/* ============================================================
   Post Listing
   ============================================================ */

.recent-posts {
  padding: 2rem 0 4rem;
}

.post-list {
  margin-top: 0.5rem;
}

.all-posts-link {
  margin-top: 2rem;
  text-align: center;
}
.all-posts-link a {
  font-size: 0.95rem;
  font-weight: 500;
}

.post-item {
  display: flex;
  gap: 1.5rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.post-item:first-child { border-top: 1px solid var(--border); }

.post-item-body {
  flex: 1;
  min-width: 0;
}

.post-item-title {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 0.4rem;
  line-height: 1.35;
}
.post-item-title a {
  color: var(--text);
  text-decoration: none;
}
.post-item-title a:hover {
  color: var(--accent);
  text-decoration: none;
}

.post-item-meta {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.post-item-meta a { color: var(--text-muted); }
.post-item-meta a:hover { color: var(--accent); }

.post-item-summary {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.6;
}

.post-item-thumb {
  flex-shrink: 0;
  width: 120px;
}
.post-item-thumb img {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: block;
}

/* ============================================================
   Page Header (section / taxonomy term pages)
   ============================================================ */

.page-header {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}
.page-header h1 {
  margin: 0;
  font-size: 1.75rem;
}

/* ============================================================
   Post Single
   ============================================================ */

.post {
  padding: 2.5rem 0 5rem;
}

.post-header {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}
.post-header h1 {
  font-size: 2rem;
  margin: 0 0 0.75rem;
  line-height: 1.25;
}

.post-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
}
.post-meta a { color: var(--text-muted); }
.post-meta a:hover { color: var(--accent); }

.featured-image {
  margin: 0 0 2.5rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.featured-image img {
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: cover;
  display: block;
}

/* Two-column: post content (left) + TOC sidebar (right) */
.post-layout {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 3.5rem;
  align-items: start;
}

/* ============================================================
   Article Content
   ============================================================ */

.post-content {
  min-width: 0; /* prevent overflow in grid context */
}

.post-content > h2:first-child,
.post-content > h3:first-child {
  margin-top: 0;
}

/* Headings inside content */
.post-content h2 { font-size: 1.45rem; }
.post-content h3 { font-size: 1.2rem; }
.post-content h4 { font-size: 1.05rem; }

/* Tables */
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  overflow-x: auto;
  display: block;
}
.post-content th,
.post-content td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  text-align: left;
  white-space: nowrap;
}
.post-content th {
  background: var(--bg-secondary);
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
}
.post-content tr:nth-child(even) td {
  background: var(--bg-secondary);
}

/* Inline code */
.post-content code {
  font-family: 'Roboto Mono', 'Courier New', monospace;
  font-size: 0.875em;
  background: var(--code-bg);
  color: var(--code-text);
  padding: 0.15em 0.35em;
  border-radius: 3px;
  border: 1px solid var(--border);
}

/* Fenced code blocks */
.post-content pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  line-height: 1.5;
}
.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.875rem;
  color: var(--code-text);
}

/* Chroma highlight wrapper */
.highlight {
  margin: 1.5rem 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.highlight pre {
  margin: 0;
  border: none;
  border-radius: 0;
  padding: 1rem;
  overflow-x: auto;
}
.highlight pre,
.highlight .chroma {
  font-family: 'Roboto Mono', 'Courier New', monospace;
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Dark mode: override Chroma's light background */
[data-theme="dark"] .chroma,
[data-theme="dark"] .highlight pre {
  background-color: #161b22 !important;
  color: #e6edf3 !important;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .chroma,
  :root:not([data-theme="light"]) .highlight pre {
    background-color: #161b22 !important;
    color: #e6edf3 !important;
  }
}

/* Math */
.katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.25rem 0;
  margin: 1.5rem 0;
}
.katex { font-size: 1.05em; }

/* Images in content */
.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  display: block;
  margin: 1.5rem auto;
}

/* Footnotes */
.post-content .footnotes {
  font-size: 0.875rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: 3rem;
}
.post-content .footnotes ol { color: var(--text-muted); }

/* Suppress ox-hugo's own TOC — we render Hugo's instead */
.ox-hugo-toc {
  display: none !important;
}

/* ============================================================
   Table of Contents Sidebar
   ============================================================ */

.post-toc {
  position: sticky;
  top: 4.5rem;
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
  font-size: 0.85rem;
  padding: 0;
}

.post-toc > strong {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.post-toc nav#TableOfContents ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.post-toc nav#TableOfContents > ul > li {
  margin-bottom: 0.4rem;
  border-left: 2px solid var(--border);
  padding-left: 0.6rem;
}
.post-toc nav#TableOfContents > ul > li:has(> a:hover),
.post-toc nav#TableOfContents > ul > li:focus-within {
  border-left-color: var(--accent);
}
.post-toc nav#TableOfContents ul ul {
  padding-left: 0.75rem;
  margin-top: 0.25rem;
}
.post-toc nav#TableOfContents a {
  color: var(--text-muted);
  text-decoration: none;
  line-height: 1.4;
  display: block;
  padding: 0.1rem 0;
}
.post-toc nav#TableOfContents a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* ============================================================
   Post Footer — Tags, Author Card, Related Posts
   ============================================================ */

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.tag {
  display: inline-block;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 0.2rem 0.65rem;
  border-radius: 2rem;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.tag:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.author-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 2.5rem;
}
.author-card h3 {
  font-size: 1rem;
  margin: 0 0 0.35rem;
}
.author-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}
.author-links {
  display: flex;
  gap: 1rem;
  margin-top: 0.6rem;
  flex-wrap: wrap;
}
.author-links a {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.author-links a:hover { color: var(--accent); }

.related-posts {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.related-posts h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}
.related-posts ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.related-posts li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
}
.related-posts li:last-child { border-bottom: none; }
.related-posts a {
  color: var(--text);
  font-size: 0.95rem;
}
.related-posts a:hover { color: var(--accent); }

/* ============================================================
   Taxonomy Overview (Topics / Tags page)
   ============================================================ */

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
  margin-bottom: 3rem;
}

.tag-cloud .tag-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 2rem;
  padding: 0.35rem 0.85rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  transition: border-color 0.15s, color 0.15s;
}
.tag-cloud .tag-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.tag-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 0.05rem 0.45rem;
}

/* ============================================================
   Pagination
   ============================================================ */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin: 3rem 0;
  list-style: none;
  padding: 0;
}

.page-item .page-link {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.15s, border-color 0.15s;
}
.page-item .page-link:hover {
  background: var(--bg-secondary);
  text-decoration: none;
}
.page-item.active .page-link {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.page-item.disabled .page-link {
  color: var(--text-muted);
  pointer-events: none;
  opacity: 0.6;
}

/* ============================================================
   Site Footer
   ============================================================ */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--accent); }
.site-footer p { margin: 0; }

/* ============================================================
   Responsive
   ============================================================ */

/* Collapse to single column below 900px */
@media (max-width: 900px) {
  .post-layout {
    grid-template-columns: 1fr;
  }
  .post-toc {
    display: none;
  }
}

/* Small screens */
@media (max-width: 640px) {
  .hero { padding: 3.5rem 1rem; }
  .hero h1 { font-size: 1.85rem; }
  .hero p { font-size: 1rem; }

  .post-header h1 { font-size: 1.6rem; }

  .post-item-thumb { display: none; }

  .container { padding: 0 1rem; }
  .nav-inner { padding: 0 1rem; }

  .post-item { padding: 1.25rem 0; }
}

/* ============================================================
   Home Page Sections
   ============================================================ */

.home-section {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
}

.section-header {
  margin-bottom: 1.75rem;
}
.section-header h2 {
  font-size: 1.3rem;
  margin: 0;
  color: var(--text);
}

/* ── Biography ── */

.bio-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 3rem;
  align-items: start;
}

.bio-aside {
  text-align: center;
}

.bio-avatar {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto 0.75rem;
  border: 3px solid var(--border);
}

.bio-name {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 0.2rem;
}

.bio-role {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 0.15rem;
}

.bio-org {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}
.bio-org a { color: var(--text-muted); }
.bio-org a:hover { color: var(--accent); }

.bio-social {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.bio-social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.bio-social-icon:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
.bio-social-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bio-text {
  margin-bottom: 1.25rem;
}
.bio-text p { color: var(--text); line-height: 1.7; }

.bio-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.bio-interests h3,
.bio-education h3 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin: 0 0 0.6rem;
}

.bio-interests ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.bio-interests li {
  font-size: 0.9rem;
  padding: 0.2rem 0;
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}
.bio-interests li::before {
  content: "◎";
  color: var(--accent);
  font-size: 0.65rem;
  flex-shrink: 0;
  margin-top: 0.3rem;
}

.edu-item {
  margin-bottom: 0.75rem;
}
.edu-degree {
  font-size: 0.9rem;
  font-weight: 500;
}
.edu-institution {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ── Projects ── */

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.project-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.project-card h3 {
  font-size: 1rem;
  margin: 0 0 0.4rem;
}
.project-card h3 a {
  color: var(--text);
  text-decoration: none;
}
.project-card h3 a:hover { color: var(--accent); text-decoration: none; }

.project-card > p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
  line-height: 1.5;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.project-tag {
  font-size: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 0.1rem 0.45rem;
  color: var(--text-muted);
}

/* ── Publications ── */

.publication-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.publication-item {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}
.publication-item:first-child { padding-top: 0; }
.publication-item:last-child { border-bottom: none; }

.pub-thumb {
  flex-shrink: 0;
  width: 110px;
}
.pub-thumb img {
  width: 110px;
  height: 75px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: block;
}

.pub-body {
  flex: 1;
  min-width: 0;
}

.publication-item h3 {
  font-size: 1rem;
  margin: 0 0 0.25rem;
}
.publication-item h3 a {
  color: var(--text);
  text-decoration: none;
}
.publication-item h3 a:hover { color: var(--accent); }

.pub-venue {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  margin: 0 0 0.4rem;
}

.pub-abstract {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pub-links {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.pub-link {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.pub-link:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

/* ── Projects (thumbnail support) ── */

.project-thumb {
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  margin: -1.25rem -1.25rem 0.75rem;
}
.project-thumb img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  display: block;
}

.project-body { flex: 1; }

/* ── Talks ── */

.talk-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.talk-item {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}
.talk-item:first-child { padding-top: 0; }
.talk-item:last-child { border-bottom: none; }

.talk-thumb {
  width: 100px;
}
.talk-thumb img {
  width: 100px;
  height: 68px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: block;
}

.talk-date {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding-top: 3px;
  text-align: right;
  flex-shrink: 0;
  width: 70px;
}

.talk-body h3 {
  font-size: 1rem;
  margin: 0 0 0.2rem;
}

.talk-event {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0 0 0.4rem;
}

.talk-summary {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Responsive for home sections ── */

@media (max-width: 900px) {
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .bio-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .bio-aside {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 1rem;
    text-align: left;
    align-items: start;
  }
  .bio-avatar {
    width: 100px;
    height: 100px;
    margin: 0;
  }
  .bio-social { justify-content: flex-start; }
  .bio-details {
    grid-template-columns: 1fr;
  }
  .project-grid {
    grid-template-columns: 1fr;
  }
  .talk-item { flex-wrap: wrap; gap: 0.5rem; }
  .talk-thumb { display: none; }
  .talk-date { width: auto; text-align: left; }
  .talk-body { flex: 1; min-width: 0; }
  .pub-thumb { display: none; }
}
