/* ============================================================
   Jingwei Zuo — Personal Academic Website
   Design language adapted from Clarity template (lorenmt)
   ============================================================ */

/* ----------------------------------------------------------
   0. Custom Properties
   ---------------------------------------------------------- */
:root {
  /* Palette */
  --bg:             #fafaf8;
  --surface:        #ffffff;
  --text-primary:   #1a1a1a;
  --text-secondary: #555555;
  --text-tertiary:  #888888;
  --accent:         #1a56db;
  --accent-hover:   #1347b8;
  --accent-light:   #e8eefb;
  --border:         #e5e5e0;
  --border-light:   #f0f0ec;
  --red:            #d63031;
  --red-light:      #ffeaea;

  /* Typography */
  --font-serif: 'Source Serif 4', 'Charter', Georgia, serif;
  --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:  'JetBrains Mono', 'Fira Code', monospace;

  /* Layout */
  --max-width:   880px;
  --nav-height:  56px;
  --gutter:      24px;

  /* Motion */
  --ease:        0.2s ease;
}


/* ----------------------------------------------------------
   1. Reset & Base
   ---------------------------------------------------------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.65;
  color: var(--text-primary);
  background: var(--bg);
  text-align: justify;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-primary);
  text-align: left;
}

ul, ol { list-style: none; }

::selection { background: var(--accent); color: #fff; }


/* ----------------------------------------------------------
   2. Layout
   ---------------------------------------------------------- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

section {
  padding: 56px 0;
}

section + section {
  border-top: 1px solid var(--border-light);
}


/* ----------------------------------------------------------
   3. Navigation
   ---------------------------------------------------------- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--nav-height);
  text-align: left;
  background: rgba(250, 250, 248, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  transition: box-shadow var(--ease);
}

.navbar.scrolled {
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.045);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.nav-brand:hover { color: var(--text-primary); }

.nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
}

.nav-links a {
  font-size: 0.85rem;
  font-weight: 450;
  color: var(--text-secondary);
  position: relative;
  transition: color var(--ease);
}

.nav-links a:hover,
.nav-links a.active { color: var(--text-primary); }

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0; right: 0;
  height: 1.5px;
  background: var(--text-primary);
  border-radius: 1px;
}

/* Back link for project pages */
.nav-back {
  font-size: 0.85rem;
  font-weight: 450;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color var(--ease);
}
.nav-back:hover { color: var(--text-primary); }
.nav-back svg { width: 14px; height: 14px; }

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  width: 36px; height: 36px;
  position: relative;
}

.nav-toggle span {
  display: block;
  width: 20px; height: 1.5px;
  background: var(--text-primary);
  position: absolute;
  left: 8px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.nav-toggle span:nth-child(1) { top: 10px; }
.nav-toggle span:nth-child(2) { top: 17px; }
.nav-toggle span:nth-child(3) { top: 24px; }

.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }


/* ----------------------------------------------------------
   4. Hero / About
   ---------------------------------------------------------- */
.hero {
  padding-top: calc(var(--nav-height) + 56px);
  padding-bottom: 56px;
}

.hero-inner {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 44px;
  align-items: start;
}

.hero-photo {
  width: 220px; height: 220px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent), #6b8dd6);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.hero-photo .initials {
  font-family: var(--font-serif);
  font-size: 3.5rem;
  font-weight: 600;
  color: #fff;
  user-select: none;
}

.hero-text h1 {
  font-size: 2.1rem;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

/* Chinese calligraphy name */
.name-zh {
  font-family: 'Long Cang', cursive;
  font-weight: 400;
  font-size: 1.85rem;
  color: var(--text-tertiary);
  margin-left: 6px;
  letter-spacing: 0.08em;
  vertical-align: baseline;
}

/* Pronunciation guide */
.name-pronunciation {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-bottom: 6px;
  text-align: left;
}

.name-pronunciation .ipa {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}

.name-pronunciation em {
  font-style: italic;
  letter-spacing: 0.02em;
}

.hero-title {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.hero-title a { color: var(--text-secondary); text-decoration: underline; text-underline-offset: 2px; }
.hero-title a:hover { color: var(--accent); }

.hero-bio {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.72;
  margin-bottom: 24px;
}

.hero-bio p + p { margin-top: 12px; }
.hero-bio a { text-underline-offset: 2px; text-decoration: underline; text-decoration-color: var(--border); }
.hero-bio a:hover { text-decoration-color: var(--accent); }

/* Social pills */
.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  font-size: 0.8rem;
  font-weight: 480;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  transition: all var(--ease);
}
.social-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-light);
}
.social-link svg { width: 14px; height: 14px; flex-shrink: 0; }


/* ----------------------------------------------------------
   5. Featured Projects — Single Column, Horizontal Cards
   ---------------------------------------------------------- */
.section-heading {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 28px;
}

.projects-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.project-card {
  display: grid;
  grid-template-columns: 2fr 3fr;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow var(--ease), transform var(--ease);
}
.project-card:hover {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.055);
  transform: translateY(-2px);
}

.project-card-image {
  overflow: hidden;
  background: var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
}
.project-card-image img,
.project-card-image svg,
.project-card-image .placeholder-img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}

.project-card-body {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
}

.project-card-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.3;
}

.project-card-title a {
  color: var(--text-primary);
  transition: color var(--ease);
}
.project-card-title a:hover { color: var(--accent); }

.badge-new {
  display: inline-block;
  padding: 2px 7px;
  font-family: var(--font-sans);
  font-size: 0.62rem;
  font-weight: 650;
  color: var(--red);
  background: var(--red-light);
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  line-height: 1.5;
}

.project-card-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.pill-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  font-size: 0.76rem;
  font-weight: 520;
  color: var(--accent);
  background: var(--accent-light);
  border-radius: 14px;
  transition: all var(--ease);
}
.pill-link:hover {
  background: var(--accent);
  color: #fff;
}

/* Inline BibTeX toggle on project cards */
.cite-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  font-size: 0.76rem;
  font-weight: 520;
  color: var(--text-secondary);
  background: var(--border-light);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: all var(--ease);
}
.cite-toggle:hover {
  color: var(--text-primary);
  border-color: var(--text-tertiary);
}
.cite-toggle svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.card-bibtex {
  grid-column: 1 / -1;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
  background: var(--border-light);
  border-top: 0 solid var(--border);
  border-radius: 0 0 12px 12px;
}
.card-bibtex.open {
  max-height: 280px;
  border-top-width: 1px;
}
.card-bibtex-inner {
  position: relative;
  padding: 14px 20px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 1.55;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-all;
}
.card-bibtex-inner code {
  display: block;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
  background: none;
}
.card-bibtex-copy {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--ease);
}
.card-bibtex-copy:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* "View all projects" link */
.view-all-link {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin-top: 20px;
  font-size: 0.88rem;
  font-weight: 480;
  color: var(--accent);
  transition: color var(--ease);
}
.view-all-link::after {
  content: '\2192';
  display: inline-block;
  opacity: 0;
  width: 0;
  transform: translateX(-6px);
  transition: opacity 0.25s ease, transform 0.25s ease, width 0.25s ease;
  overflow: hidden;
}
.view-all-link:hover { color: var(--accent-hover); }
.view-all-link:hover::after {
  opacity: 1;
  width: 1.1em;
  transform: translateX(0);
}

/* Projects listing page */
.projects-page {
  padding-top: calc(var(--nav-height) + 40px);
  padding-bottom: 56px;
}

.projects-page-heading {
  font-size: 1.6rem;
  margin-bottom: 32px;
}


/* ----------------------------------------------------------
   6. News
   ---------------------------------------------------------- */
.news-list {
  display: flex;
  flex-direction: column;
}

.news-item {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 20px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-light);
  align-items: baseline;
}
.news-item:last-child { border-bottom: none; }

.news-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.news-content {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
  text-align: left;
}
.news-content a { text-underline-offset: 2px; text-decoration: underline; text-decoration-color: var(--border); }
.news-content a:hover { text-decoration-color: var(--accent); }
.news-content .badge-new { margin-left: 6px; vertical-align: text-top; }

.news-item.hidden { display: none; }

.news-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin-top: 14px;
  font-size: 0.84rem;
  font-weight: 450;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color var(--ease);
}
.news-toggle::after {
  content: '\2192';
  display: inline-block;
  opacity: 0;
  width: 0;
  transform: translateX(-6px);
  transition: opacity 0.25s ease, transform 0.25s ease, width 0.25s ease;
  overflow: hidden;
}
.news-toggle:hover { color: var(--accent-hover); }
.news-toggle:hover::after {
  opacity: 1;
  width: 1.1em;
  transform: translateX(0);
}


/* ----------------------------------------------------------
   7. Publications
   ---------------------------------------------------------- */
.publications-year + .publications-year { margin-top: 36px; }

.pub-year-label {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

.pub-item {
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  margin-bottom: 10px;
}
.pub-item:last-child { margin-bottom: 0; }

.pub-authors {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 3px;
  text-align: left;
}
.pub-authors strong {
  color: var(--text-primary);
  font-weight: 600;
}

.pub-title {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 3px;
}

.pub-venue {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  font-style: italic;
  margin-bottom: 10px;
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

/* Reuse .pill-link for pub links */

/* BibTeX toggle inside publication items */
.pub-bibtex {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
  margin-top: 0;
}
.pub-bibtex.open {
  max-height: 260px;
  margin-top: 12px;
}
.pub-bibtex-inner {
  position: relative;
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 1.55;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-all;
  background: var(--border-light);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.pub-bibtex-inner code {
  display: block;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
  background: none;
}
.pub-bibtex-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--ease);
}
.pub-bibtex-copy:hover {
  color: var(--accent);
  border-color: var(--accent);
}


/* ----------------------------------------------------------
   8. Background (Interests + Education)
   ---------------------------------------------------------- */
.bg-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

.sub-heading {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 16px;
  text-align: left;
}

/* Research interests prose */
.interests-prose {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
}

/* Education list */
.education-list {
  display: flex;
  flex-direction: column;
}

.education-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}
.education-item:last-child { border-bottom: none; }

.education-degree {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-primary);
  text-align: left;
}

.education-institution {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 1px;
}

.education-award {
  font-size: 0.78rem;
  color: var(--accent);
  font-style: italic;
}

.education-year {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-tertiary);
  white-space: nowrap;
  padding-top: 2px;
}


/* ----------------------------------------------------------
   9. Contact
   ---------------------------------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.contact-item {
  display: flex;
  gap: 12px;
  align-items: start;
}

.contact-icon {
  width: 18px; height: 18px;
  color: var(--text-tertiary);
  flex-shrink: 0;
  margin-top: 2px;
}

.contact-label {
  font-size: 0.76rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 550;
  margin-bottom: 3px;
  text-align: left;
}

.contact-value {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
  text-align: left;
}
.contact-value a { color: var(--accent); }


/* ----------------------------------------------------------
   10. Footer
   ---------------------------------------------------------- */
.site-footer {
  padding: 28px 0;
  border-top: 1px solid var(--border);
  text-align: center;
}
.site-footer p {
  font-size: 0.8rem;
  color: var(--text-tertiary);
}


/* ----------------------------------------------------------
   11. Project Brief Pages
   ---------------------------------------------------------- */
.project-page {
  padding-top: calc(var(--nav-height) + 40px);
}

.project-hero-fig {
  width: 100%;
  margin-bottom: 32px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.project-hero-fig img,
.project-hero-fig .placeholder-img {
  width: 100%;
  display: block;
}

.project-meta {
  margin-bottom: 32px;
}

.project-meta h1 {
  font-size: 1.8rem;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.project-authors {
  font-size: 0.88rem;
  color: var(--text-secondary);
  text-align: left;
  line-height: 1.55;
  margin-bottom: 4px;
}
.project-authors strong { color: var(--text-primary); font-weight: 600; }

.project-venue-date {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  font-style: italic;
  margin-bottom: 16px;
}

.project-meta .project-links { margin-bottom: 0; }

.project-divider {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 32px 0;
}

.project-section h2 {
  font-size: 1.2rem;
  margin-bottom: 14px;
}

.project-section p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.72;
  margin-bottom: 12px;
}

.project-section figure {
  margin: 24px 0;
}

.project-section figure img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border-light);
}

.project-section figcaption {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-top: 8px;
  line-height: 1.45;
  text-align: center;
  font-style: italic;
}

/* Highlights list */
.highlights-list {
  padding-left: 0;
}
.highlights-list li {
  position: relative;
  padding-left: 18px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 8px;
}
.highlights-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 5px; height: 5px;
  background: var(--accent);
  border-radius: 50%;
}

/* BibTeX block */
.bibtex-block {
  position: relative;
  background: var(--border-light);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.6;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-all;
}

.bibtex-copy {
  position: absolute;
  top: 10px; right: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--ease);
}
.bibtex-copy:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Placeholder image (used in both homepage cards and project pages) */
.placeholder-img {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  text-align: center;
  padding: 20px;
  line-height: 1.3;
}


/* ----------------------------------------------------------
   12. Responsive — Tablet (700–899px)
   ---------------------------------------------------------- */
@media (max-width: 899px) {
  .hero-inner {
    grid-template-columns: 180px 1fr;
    gap: 32px;
  }
  .hero-photo { width: 180px; height: 180px; }
  .hero-photo .initials { font-size: 2.8rem; }
  .hero-text h1 { font-size: 1.85rem; }

  .project-card { grid-template-columns: 2fr 3fr; }
  .project-card-body { padding: 20px 24px; }

  .bg-split { gap: 36px; }
}


/* ----------------------------------------------------------
   13. Responsive — Mobile (<700px)
   ---------------------------------------------------------- */
@media (max-width: 699px) {
  :root { --gutter: 20px; }

  section { padding: 44px 0; }

  .hero {
    padding-top: calc(var(--nav-height) + 36px);
    padding-bottom: 44px;
  }

  /* Mobile nav */
  .nav-toggle { display: block; }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(250, 250, 248, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.25s ease;
  }
  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav-links a {
    display: block;
    padding: 12px var(--gutter);
    font-size: 0.9rem;
  }
  .nav-links a.active::after { display: none; }

  /* Hero stacked & centered */
  .hero-inner {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 20px;
  }
  .hero-photo { width: 150px; height: 150px; }
  .hero-photo .initials { font-size: 2.4rem; }
  .hero-text h1 { font-size: 1.65rem; }
  .social-links { justify-content: center; }

  /* Project cards stacked */
  .project-card {
    grid-template-columns: 1fr;
  }
  .project-card-image { aspect-ratio: auto; }
  .project-card-body { padding: 20px; }

  /* News */
  .news-item {
    grid-template-columns: 76px 1fr;
    gap: 12px;
  }

  /* Background stacked */
  .bg-split {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  /* Contact stacked */
  .contact-grid { grid-template-columns: 1fr; gap: 20px; }

  /* Project pages */
  .project-meta h1 { font-size: 1.45rem; }

  /* Disable justify on narrow screens to avoid ugly word-spacing */
  body { text-align: left; }
  .hero-bio,
  .interests-prose,
  .project-section p { text-align: left; }
}


/* ----------------------------------------------------------
   14. Utilities
   ---------------------------------------------------------- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
