/* ==========================================================================
   Personal Academic Homepage — style.css
   Light/Dark theming · responsive layout · reveal animations
   ========================================================================= */

/* --------------------------------------------------------------------------
   1. CSS CUSTOM PROPERTIES — LIGHT THEME (:root)
   -------------------------------------------------------------------------- */
:root {
  /* Backgrounds */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fc;
  --bg-card: #ffffff;
  --section-alt-bg: #f8f9fc;

  /* Text */
  --text-primary: #1a1a2e;
  --text-secondary: #495057;
  --text-muted: #868e96;

  /* Accent */
  --accent-1: #667eea;
  --accent-2: #764ba2;
  --accent-gradient: linear-gradient(135deg, var(--accent-1), var(--accent-2));

  /* Borders */
  --border: #dee2e6;
  --border-light: #e9ecef;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.06);

  /* Navigation (glass morphism) */
  --nav-bg: rgba(255, 255, 255, 0.82);
  --nav-blur: blur(12px);

  /* Hero radial gradient background */
  --hero-gradient:
    radial-gradient(circle at 18% 22%, rgba(102, 126, 234, 0.18), transparent 50%),
    radial-gradient(circle at 82% 28%, rgba(118, 75, 162, 0.18), transparent 50%),
    radial-gradient(circle at 50% 85%, rgba(102, 126, 234, 0.12), transparent 60%);

  /* Badges / tags / timeline / code / footer */
  --badge-bg: rgba(102, 126, 234, 0.12);
  --badge-text: #5566cc;
  --timeline-line: #dee2e6;
  --tag-bg: rgba(102, 126, 234, 0.10);
  --tag-text: #5566cc;
  --code-bg: #f1f3f9;
  --footer-bg: #f8f9fc;

  /* Layout */
  --max-width: 1200px;
  --nav-height: 64px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------------------
   1b. CSS CUSTOM PROPERTIES — DARK THEME
   -------------------------------------------------------------------------- */
[data-theme="dark"] {
  --bg-primary: #0f0f23;
  --bg-secondary: #13132f;
  --bg-card: #1a1a3e;
  --section-alt-bg: #13132f;

  --text-primary: #e0e0e0;
  --text-secondary: #a8a8c0;
  --text-muted: #6c6c8a;

  --border: #2a2a4a;
  --border-light: #222244;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.40), 0 1px 2px rgba(0, 0, 0, 0.30);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.50), 0 2px 4px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.60), 0 4px 8px rgba(0, 0, 0, 0.40);

  --nav-bg: rgba(15, 15, 35, 0.82);

  --hero-gradient:
    radial-gradient(circle at 18% 22%, rgba(102, 126, 234, 0.28), transparent 50%),
    radial-gradient(circle at 82% 28%, rgba(118, 75, 162, 0.26), transparent 50%),
    radial-gradient(circle at 50% 85%, rgba(102, 126, 234, 0.18), transparent 60%);

  --badge-bg: rgba(102, 126, 234, 0.15);
  --badge-text: #8899ee;
  --timeline-line: #2a2a4a;
  --tag-bg: rgba(102, 126, 234, 0.15);
  --tag-text: #8899ee;
  --code-bg: #1e1e3a;
  --footer-bg: #13132f;
}

/* --------------------------------------------------------------------------
   2. RESET & BASE STYLES
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 1rem);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition), color var(--transition);
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  line-height: 1.25;
  font-weight: 700;
  color: var(--text-primary);
}

p {
  color: var(--text-secondary);
}

a {
  color: var(--accent-1);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-2);
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

svg {
  flex-shrink: 0;
}

:focus-visible {
  outline: 2px solid var(--accent-1);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --------------------------------------------------------------------------
   3. UTILITY CLASSES
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--accent-1); /* fallback */
}

.section {
  padding: 5rem 0;
  background-color: var(--bg-primary);
  transition: background-color var(--transition);
}

.section-alt {
  background-color: var(--section-alt-bg);
}

.section-title {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
  padding-bottom: 0.75rem;
}

/* Gradient underline bar beneath section titles */
.section-title::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 80px;
  height: 4px;
  transform: translateX(-50%);
  background: var(--accent-gradient);
  border-radius: 2px;
}

/* --------------------------------------------------------------------------
   4. NAVIGATION
   -------------------------------------------------------------------------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--nav-bg);
  backdrop-filter: var(--nav-blur);
  -webkit-backdrop-filter: var(--nav-blur);
  border-bottom: 1px solid var(--border-light);
  transition: background-color var(--transition), border-color var(--transition),
    box-shadow var(--transition);
}

.navbar.scrolled {
  box-shadow: var(--shadow-sm);
}

.nav-container {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: var(--nav-height);
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 0.5rem;
  margin: 0 auto; /* center the links between logo and toggle */
  flex-wrap: wrap;
  justify-content: center;
}

.nav-link {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  position: relative;
  transition: color var(--transition), background-color var(--transition);
}

.nav-link:hover {
  color: var(--text-primary);
  background-color: var(--badge-bg);
}

.nav-link.active {
  color: var(--accent-1);
  font-weight: 600;
}

.nav-link.active::after {
  content: "";
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.15rem;
  height: 2px;
  background: var(--accent-gradient);
  border-radius: 1px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--badge-bg);
  font-size: 1.1rem;
  transition: background-color var(--transition), transform var(--transition);
  flex-shrink: 0;
}

.theme-toggle:hover {
  transform: rotate(20deg);
  background-color: var(--accent-1);
}

.theme-toggle:hover .theme-icon {
  filter: brightness(0) invert(1);
}

.theme-icon {
  display: inline-block;
  line-height: 1;
}

/* Hamburger button (hidden on desktop) */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  padding: 0 9px;
  flex-shrink: 0;
}

.mobile-menu-btn span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--text-primary);
  border-radius: 1px;
  transition: transform var(--transition), opacity var(--transition);
}

/* --------------------------------------------------------------------------
   5. HERO SECTION
   -------------------------------------------------------------------------- */
.hero-section {
  position: relative;
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  align-items: center;
  padding: 6rem 0 5rem;
  overflow: hidden;
}

.hero-bg-gradient {
  position: absolute;
  inset: 0;
  background-image: var(--hero-gradient);
  z-index: 0;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
}

.hero-avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 4px solid var(--bg-card);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.hero-name {
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  margin: 0;
}

.hero-title {
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  font-weight: 600;
  margin: 0;
}

.hero-quote {
  font-size: 1.05rem;
  font-style: italic;
  color: var(--text-secondary);
  border-left: 3px solid var(--accent-1);
  padding: 0.25rem 0 0.25rem 1rem;
  max-width: 600px;
  margin: 0.5rem 0;
}

.hero-bio {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0;
}

.hero-contact {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  background-color: var(--bg-card);
  transition: color var(--transition), border-color var(--transition),
    box-shadow var(--transition), transform var(--transition);
}

.contact-link:hover {
  color: var(--accent-1);
  border-color: var(--accent-1);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   6. TIMELINE
   -------------------------------------------------------------------------- */
.timeline {
  position: relative;
  max-width: 820px;
  margin: 0 auto;
  padding-left: 2.5rem;
}

/* Vertical line */
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--timeline-line);
  border-radius: 1px;
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -2.5rem;
  top: 1.4rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-gradient);
  border: 3px solid var(--bg-primary);
  box-shadow: 0 0 0 2px var(--accent-1);
  z-index: 1;
}

.timeline-content {
  padding: 1.5rem;
}

.timeline-content h3 {
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
}

.timeline-content p {
  color: var(--text-secondary);
  margin: 0;
}

.timeline-date {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--badge-text);
  background: var(--badge-bg);
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.6rem;
}

/* --------------------------------------------------------------------------
   7. CARDS
   -------------------------------------------------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.card {
  position: relative;
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition),
    border-color var(--transition);
  overflow: hidden;
}

/* Gradient top border — hidden by default, revealed on hover */
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--transition);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-1);
}

.card:hover::before {
  transform: scaleX(1);
}

.card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.card p {
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.card p:last-of-type {
  margin-bottom: 0;
}

.card-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--badge-text);
  background: var(--badge-bg);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}

/* Conference badge — red gradient */
.badge-conf {
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.95), rgba(255, 90, 90, 0.95));
}

.card-date,
.card-role {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.card-role {
  color: var(--badge-text);
}

.card-funding {
  font-size: 0.9rem;
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.card-authors {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Featured cards always show the gradient top bar */
.card-featured {
  border-color: var(--accent-1);
  box-shadow: var(--shadow-md);
}

.card-featured::before {
  transform: scaleX(1);
}

/* --------------------------------------------------------------------------
   8. BUTTONS
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.6rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent-1);
  background: var(--bg-card);
  border: 1px solid var(--accent-1);
  border-radius: 999px;
  transition: color var(--transition), background var(--transition),
    border-color var(--transition), transform var(--transition);
}

.btn:hover {
  color: #fff;
  background: var(--accent-gradient);
  border-color: transparent;
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.4rem 0.9rem;
  font-size: 0.82rem;
}

/* --------------------------------------------------------------------------
   9. PUBLICATIONS
   -------------------------------------------------------------------------- */
.pub-category {
  max-width: 860px;
  margin: 0 auto 2.5rem;
}

.pub-category:last-child {
  margin-bottom: 0;
}

.pub-category-title {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-light);
}

.pub-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pub-item {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--accent-1);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  transition: box-shadow var(--transition), transform var(--transition),
    border-color var(--transition);
}

.pub-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
  border-left-color: var(--accent-2);
}

.pub-item > span {
  display: block;
}

.pub-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.pub-authors {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.15rem;
}

.pub-venue {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.pub-link {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   10. TALKS
   -------------------------------------------------------------------------- */
.talks-list {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.talk-item {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition),
    border-color var(--transition);
}

.talk-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--accent-1);
}

.talk-date {
  flex-shrink: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-1);
  white-space: nowrap;
  padding-top: 0.1rem;
  min-width: 100px;
}

.talk-info {
  flex: 1;
  min-width: 0;
}

.talk-info h3 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.talk-info p {
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
}

.talk-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* --------------------------------------------------------------------------
   11. TAG CLOUD
   -------------------------------------------------------------------------- */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  max-width: 720px;
  margin: 0 auto;
}

.tag {
  display: inline-block;
  padding: 0.4rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--tag-text);
  background: var(--tag-bg);
  border: 1px solid transparent;
  border-radius: 999px;
  transition: transform var(--transition), background var(--transition),
    color var(--transition), border-color var(--transition);
}

.tag:hover {
  transform: translateY(-3px);
  color: #fff;
  background: var(--accent-gradient);
  border-color: transparent;
}

/* --------------------------------------------------------------------------
   12. FOOTER
   -------------------------------------------------------------------------- */
.footer {
  background-color: var(--footer-bg);
  border-top: 1px solid var(--border-light);
  padding: 2.5rem 0;
  text-align: center;
  transition: background-color var(--transition), border-color var(--transition);
}

.footer p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.footer p:last-child {
  margin-bottom: 0;
}

.footer-credit {
  font-size: 0.85rem !important;
  color: var(--text-muted) !important;
}

/* --------------------------------------------------------------------------
   13. ANIMATIONS — REVEAL ON SCROLL
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  will-change: opacity, transform;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered delays for timeline items */
.timeline-item.reveal:nth-child(1) { transition-delay: 0s; }
.timeline-item.reveal:nth-child(2) { transition-delay: 0.1s; }
.timeline-item.reveal:nth-child(3) { transition-delay: 0.2s; }
.timeline-item.reveal:nth-child(4) { transition-delay: 0.3s; }
.timeline-item.reveal:nth-child(5) { transition-delay: 0.4s; }
.timeline-item.reveal:nth-child(6) { transition-delay: 0.5s; }

/* Staggered delays for cards */
.card-grid .card.reveal:nth-child(1) { transition-delay: 0s; }
.card-grid .card.reveal:nth-child(2) { transition-delay: 0.1s; }
.card-grid .card.reveal:nth-child(3) { transition-delay: 0.2s; }
.card-grid .card.reveal:nth-child(4) { transition-delay: 0.3s; }
.card-grid .card.reveal:nth-child(5) { transition-delay: 0.4s; }
.card-grid .card.reveal:nth-child(6) { transition-delay: 0.5s; }

/* Staggered delays for talks */
.talks-list .talk-item.reveal:nth-child(2) { transition-delay: 0.1s; }
.talks-list .talk-item.reveal:nth-child(3) { transition-delay: 0.2s; }

/* --------------------------------------------------------------------------
   14. RESPONSIVE — max-width: 768px
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  /* Mobile nav: nav-links becomes a panel sliding in from the right.
     JS toggles the `.nav-open` class on `.navbar` to reveal it. */
  .mobile-menu-btn {
    display: flex;
  }

  .nav-logo {
    margin-right: auto;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(75vw, 320px);
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 0;
    padding: calc(var(--nav-height) + 1rem) 1rem 2rem;
    margin: 0;
    background-color: var(--bg-primary);
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform var(--transition);
    z-index: 1001;
    overflow-y: auto;
  }

  .navbar.nav-open .nav-links {
    transform: translateX(0);
  }

  .nav-link {
    display: block;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 1.05rem;
  }

  .nav-link.active::after {
    display: none;
  }

  /* Hamburger -> X animation */
  .navbar.nav-open .mobile-menu-btn span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .navbar.nav-open .mobile-menu-btn span:nth-child(2) {
    opacity: 0;
  }
  .navbar.nav-open .mobile-menu-btn span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* Layout adjustments */
  .section {
    padding: 3.5rem 0;
  }

  .section-title {
    margin-bottom: 2rem;
  }

  .hero-section {
    min-height: auto;
    padding: 4rem 0 3.5rem;
  }

  .hero-avatar {
    width: 110px;
    height: 110px;
  }

  .avatar-placeholder {
    font-size: 2.4rem;
  }

  .hero-contact {
    gap: 0.5rem;
  }

  .contact-link {
    padding: 0.45rem 0.85rem;
    font-size: 0.9rem;
  }

  /* Timeline: shrink left rail */
  .timeline {
    padding-left: 2rem;
  }
  .timeline-dot {
    left: -2rem;
  }

  /* Cards: single column */
  .card-grid {
    grid-template-columns: 1fr;
  }

  /* Talks: stack vertically — date above info */
  .talk-item {
    flex-direction: column;
    gap: 0.5rem;
  }
  .talk-date {
    min-width: 0;
  }
}

/* --------------------------------------------------------------------------
   14b. RESPONSIVE — max-width: 480px
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  .section {
    padding: 3rem 0;
  }

  .hero-avatar {
    width: 96px;
    height: 96px;
  }

  .avatar-placeholder {
    font-size: 2rem;
  }

  .hero-name {
    font-size: 2rem;
  }

  .hero-quote {
    font-size: 0.95rem;
    padding-left: 0.75rem;
  }

  .hero-bio {
    font-size: 0.95rem;
  }

  /* Contact links wrap to full-width pills */
  .hero-contact {
    flex-direction: column;
    align-items: stretch;
    max-width: 260px;
    margin-left: auto;
    margin-right: auto;
  }

  .contact-link {
    justify-content: center;
  }

  .card,
  .timeline-content,
  .pub-item,
  .talk-item {
    padding: 1.1rem;
  }

  .nav-logo {
    font-size: 1.25rem;
  }

  .theme-toggle,
  .mobile-menu-btn {
    width: 36px;
    height: 36px;
  }
}

/* --------------------------------------------------------------------------
   15. REDUCED MOTION
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  /* Reveal elements should be visible immediately, no transform */
  .reveal {
    opacity: 1;
    transform: none;
  }
}
