/* ============================================================
   Shivanand Kundargi — Academic Portfolio
   Premium dark-theme with vivid accents & depth
   ============================================================ */

/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}

/* ── Design Tokens ──────────────────────────────────────────── */
:root {
  /* Surfaces — richer, warmer dark */
  --bg-base: #0b0d14;
  --bg-surface: #12141f;
  --bg-elevated: #181b2a;
  --bg-card: rgba(24, 27, 42, 0.72);
  --bg-card-hover: rgba(32, 36, 56, 0.85);
  --bg-nav: rgba(11, 13, 20, 0.78);

  /* Text */
  --fg: #cbd5e1;
  --fg-body: #d1d9e6;
  --fg-muted: #8892a8;
  --fg-heading: #f0f4fc;

  /* Accents — vibrant violet → cyan spectrum */
  --accent-start: #8b5cf6;
  --accent-mid: #6366f1;
  --accent-end: #38bdf8;
  --accent-gradient: linear-gradient(135deg, var(--accent-start), var(--accent-mid), var(--accent-end));
  --accent-solid: #818cf8;
  --accent-hover: #a5b4fc;

  /* Borders */
  --border: rgba(148, 163, 184, 0.1);
  --border-subtle: rgba(148, 163, 184, 0.06);
  --border-hover: rgba(129, 140, 248, 0.4);

  /* Glow */
  --glow-soft: rgba(129, 140, 248, 0.08);
  --glow: rgba(129, 140, 248, 0.15);
  --glow-strong: rgba(129, 140, 248, 0.30);

  /* Radius */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;

  /* Transition */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Base ────────────────────────────────────────────────────── */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--fg-body);
  background: var(--bg-base);
  line-height: 1.72;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Ambient gradient glow — hero area */
body::before {
  content: '';
  position: fixed;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 1000px;
  height: 700px;
  background: radial-gradient(ellipse at center,
    rgba(139, 92, 246, 0.07) 0%,
    rgba(99, 102, 241, 0.04) 40%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}
/* Secondary glow — bottom right */
body::after {
  content: '';
  position: fixed;
  bottom: -200px;
  right: -150px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.04) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 1;
}

/* ── Global Links ────────────────────────────────────────────── */
a {
  color: var(--accent-solid);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
a:visited { color: var(--accent-solid); }
a:hover {
  color: var(--accent-hover);
  text-decoration: none;
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent-solid);
  outline-offset: 3px;
}

/* ── Navigation ──────────────────────────────────────────────── */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  height: 64px;
  background: var(--bg-nav);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 1000;
  transition: background 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
}
.nav.scrolled {
  background: rgba(11, 13, 20, 0.94);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4), 0 0 40px var(--glow-soft);
  border-bottom-color: var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.brand {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  text-decoration: none;
  color: var(--fg-heading);
  letter-spacing: -0.3px;
  font-size: 19px;
  display: flex;
  align-items: center;
  height: 64px;
  transition: color 0.2s var(--ease);
}
.brand:hover { color: var(--accent-solid); }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--fg);
  margin: 5px 0;
  border-radius: 2px;
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 4px;
}
.nav-links a {
  text-decoration: none;
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  height: 64px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  position: relative;
  transition: color 0.25s var(--ease);
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 14px;
  left: 16px;
  right: 16px;
  height: 2px;
  background: var(--accent-gradient);
  border-radius: 1px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s var(--ease);
}
.nav-links a:hover { color: var(--fg-heading); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-links a[aria-current="page"] {
  color: var(--fg-heading);
  font-weight: 600;
}
.nav-links a[aria-current="page"]::after { transform: scaleX(1); }

/* ── Main ────────────────────────────────────────────────────── */
.main { margin-top: 64px; }

.home-section {
  padding: 72px 0;
  border-bottom: 1px solid var(--border-subtle);
  scroll-margin-top: 80px;
}
.home-section:last-of-type { border-bottom: 0; }

.section-heading {
  margin-bottom: 32px;
}
.section-heading h2 {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 30px;
  letter-spacing: -0.5px;
  color: var(--fg-heading);
  position: relative;
  display: inline-block;
  padding-bottom: 12px;
}
.section-heading h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 52px;
  height: 3px;
  background: var(--accent-gradient);
  border-radius: 2px;
}

/* ── About Section ───────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 60px;
  align-items: start;
}

.profile {
  position: sticky;
  top: 96px;
  text-align: center;
}

/* Gradient ring around profile photo */
.portrait {
  width: 176px;
  height: 176px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  position: relative;
  padding: 3.5px;
  background: var(--accent-gradient);
  box-shadow:
    0 0 40px rgba(139, 92, 246, 0.15),
    0 0 80px rgba(56, 189, 248, 0.06);
}
.portrait img,
.project-card .img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.portrait-title { text-align: center; }
.portrait-title h1 {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 24px;
  margin-top: 20px;
  color: var(--fg-heading);
  letter-spacing: -0.3px;
}
.portrait-title h2 {
  font-size: 14px;
  color: var(--fg-muted);
  font-weight: 500;
  margin-top: 6px;
  line-height: 1.5;
}
.portrait-title h2 a { color: var(--accent-solid); }
.portrait-title h2 a:hover { color: var(--accent-hover); }
.portrait-title .affiliation a { color: var(--accent-solid); text-decoration: none; }
.portrait-title .affiliation a:hover { text-decoration: underline; }

/* Social link pills */
.social {
  list-style: none;
  display: flex;
  gap: 8px;
  margin-top: 20px;
  flex-wrap: wrap;
  justify-content: center;
}
.social a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--fg-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: 24px;
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.28s var(--ease);
}
.social a:hover {
  color: var(--fg-heading);
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  box-shadow: 0 0 20px var(--glow), 0 4px 16px rgba(0,0,0,0.2);
  transform: translateY(-2px);
}
.social a svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.7;
}
.social a:hover svg { opacity: 1; }

/* About text */
.about-text h2 {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 24px;
  margin-bottom: 20px;
  color: var(--fg-heading);
  letter-spacing: -0.3px;
  position: relative;
  display: inline-block;
  padding-bottom: 10px;
}
.about-text h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background: var(--accent-gradient);
  border-radius: 2px;
}
.about-text p {
  margin: 0 0 16px 0;
  text-align: justify;
  text-justify: inter-word;
  color: var(--fg-body);
  line-height: 1.78;
  font-size: 15.5px;
}
.about-text a {
  color: var(--accent-solid);
  text-decoration: none;
  border-bottom: 1px solid rgba(129, 140, 248, 0.2);
  padding-bottom: 1px;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.about-text a:hover {
  color: var(--accent-hover);
  border-bottom-color: rgba(165, 180, 252, 0.5);
}

.content p { text-align: justify; text-justify: inter-word; }

/* ── Affiliations ────────────────────────────────────────────── */
.affiliation-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
}
.affiliation-list li { display: flex; }

.affiliation-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 28px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: inherit;
  text-decoration: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease), background 0.35s var(--ease);
  width: 100%;
  position: relative;
  overflow: hidden;
}
/* Subtle top-edge glow on cards */
.affiliation-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(129, 140, 248, 0.3), transparent);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}
.affiliation-card:hover::before { opacity: 1; }

.affiliation-card img {
  width: 140px;
  height: 70px;
  object-fit: contain;
  filter: brightness(0.88) contrast(1.05);
  transition: filter 0.3s var(--ease);
}
.affiliation-card:hover img { filter: brightness(1) contrast(1.1); }

.affiliation-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.affiliation-name {
  font-weight: 600;
  font-size: 13.5px;
  text-align: center;
  line-height: 1.4;
  color: var(--fg-heading);
}
.affiliation-period {
  font-size: 12px;
  color: var(--fg-muted);
  text-align: center;
  font-weight: 400;
}
.affiliation-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3), 0 0 24px var(--glow);
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  text-decoration: none;
}

/* ── News Timeline ───────────────────────────────────────────── */
.news-list {
  margin-top: 0;
  padding: 24px 24px 24px 36px;
  max-height: 340px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  list-style: none;
  position: relative;
}
/* Timeline line */
.news-list::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 24px;
  bottom: 24px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-start), var(--accent-end), transparent);
  border-radius: 1px;
}

.news-list li {
  margin: 0 0 18px 0;
  padding-left: 18px;
  position: relative;
  line-height: 1.65;
  color: var(--fg-body);
  font-size: 14.5px;
}
.news-list li:last-child { margin-bottom: 0; }
/* Timeline dot */
.news-list li::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 7px;
  width: 8px;
  height: 8px;
  background: var(--accent-solid);
  border-radius: 50%;
  border: 2px solid var(--bg-base);
  box-shadow: 0 0 10px var(--glow-strong);
}

.news-list strong { color: var(--fg-heading); font-weight: 600; }
.news-list a { border-bottom: 1px solid rgba(129, 140, 248, 0.2); }
.news-list a:hover { border-bottom-color: var(--accent-hover); }

/* Custom scrollbar */
.news-list::-webkit-scrollbar { width: 5px; }
.news-list::-webkit-scrollbar-track { background: transparent; }
.news-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.15);
  border-radius: 3px;
}
.news-list::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.3); }


/* ── Projects ────────────────────────────────────────────────── */
.projects-toolbar {
  display: flex;
  gap: 8px;
  margin: 12px 0 20px;
  flex-wrap: wrap;
}
.filter-btn {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--fg-muted);
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.25s var(--ease);
}
.filter-btn.active,
.filter-btn:hover {
  border-color: var(--accent-solid);
  color: #fff;
  background: var(--accent-gradient);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.project-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.3s var(--ease), transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.project-card:hover {
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
  transform: translateY(-3px);
  border-color: var(--border-hover);
}
.project-card .img {
  width: 100%;
  height: 150px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  object-fit: cover;
  display: block;
  border-radius: 0;
}
.project-card .card-text { padding: 14px 16px; }
.project-card h3 {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--fg-heading);
}
.project-card p { font-size: 14px; color: var(--fg-muted); }

/* ── Publications ────────────────────────────────────────────── */
.pubs {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Year badge — prominent pill */
.pub-year {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--fg-heading);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 24px;
  width: fit-content;
  position: relative;
}
.pub-year::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-gradient);
  flex-shrink: 0;
  box-shadow: 0 0 8px var(--glow-strong);
}

/* Publication card */
.pub-card {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  align-items: start;
  position: relative;
  overflow: hidden;
  transition: border-color 0.35s var(--ease), box-shadow 0.35s var(--ease), transform 0.35s var(--ease);
}
/* Hover glow edge */
.pub-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(129, 140, 248, 0.35), transparent);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}
.pub-card:hover {
  border-color: var(--border-hover);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.25),
    0 0 20px var(--glow),
    inset 0 1px 0 rgba(129, 140, 248, 0.08);
  transform: translateY(-3px);
}
.pub-card:hover::before { opacity: 1; }

/* Thumbnail — crisp white bg so figures pop on dark */
.pub-thumb {
  width: 240px;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  align-self: start;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  transition: box-shadow 0.35s var(--ease);
}
.pub-card:hover .pub-thumb {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}
.pub-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.pub-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pub-title {
  font-weight: 700;
  color: var(--fg-heading);
  font-size: 17px;
  line-height: 1.45;
  letter-spacing: -0.2px;
}
.pub-authors {
  color: var(--fg-muted);
  font-size: 14px;
  line-height: 1.55;
}
.pub-authors strong {
  font-weight: 600;
  color: var(--fg-body);
}
.pub-authors a {
  border-bottom: 1px solid rgba(129, 140, 248, 0.15);
}
.pub-authors a:hover { border-bottom-color: var(--accent-hover); }
.pub-venue {
  font-style: italic;
  color: var(--fg-muted);
  font-size: 13.5px;
  line-height: 1.45;
}

.pub-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.pub-badges a {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--fg-muted);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  font-weight: 400;
  letter-spacing: 0.3px;
  transition: all 0.25s var(--ease);
  position: relative;
}
.pub-badges a:hover {
  border-color: var(--accent-solid);
  color: #fff;
  background: var(--accent-solid);
  box-shadow: 0 0 16px var(--glow);
  text-decoration: none;
  transform: translateY(-1px);
}

/* ── Experience / Education ──────────────────────────────────── */
.content { font-size: 16px; }
.experience-item,
.education-item {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.experience-item:last-child,
.education-item:last-child { border-bottom: 0; }
.experience-item h3,
.education-item h3 {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--fg-heading);
}
.company,
.institution {
  font-weight: 600;
  color: var(--accent-solid);
  font-size: 14px;
}
.period {
  font-size: 13px;
  color: var(--fg-muted);
  margin-bottom: 6px;
}

/* ── Contact ─────────────────────────────────────────────────── */
#contact .content { max-width: 600px; }
#contact .content a {
  color: var(--accent-solid);
  transition: color 0.2s var(--ease);
}
#contact .content a:hover { color: var(--accent-hover); }

.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 36px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  max-width: 580px;
  position: relative;
  overflow: hidden;
}
.contact-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(129, 140, 248, 0.3), transparent);
}
.contact-card p {
  margin-bottom: 14px;
  color: var(--fg-body);
  line-height: 1.75;
  font-size: 15px;
}
.contact-card p:last-of-type { margin-bottom: 0; }

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}
.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--bg-elevated);
  color: var(--fg-muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.28s var(--ease);
}
.contact-link:hover {
  color: var(--fg-heading);
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  box-shadow: 0 0 24px var(--glow), 0 8px 24px rgba(0,0,0,0.2);
  transform: translateY(-2px);
}
.contact-link svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  opacity: 0.65;
}
.contact-link:hover svg { opacity: 1; }

/* ── Footer ──────────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 48px 0;
  border-top: 1px solid var(--border-subtle);
  color: var(--fg-muted);
  font-size: 13px;
  letter-spacing: 0.3px;
  position: relative;
}
.footer::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 2px;
  background: var(--accent-gradient);
  border-radius: 1px;
}

/* ── Scroll Animations ───────────────────────────────────────── */
.animate-in {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.animate-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .container { padding: 0 24px; }
}

@media (max-width: 860px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .profile { position: static; }
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    width: 100%;
    height: 0;
    overflow: hidden;
    background: rgba(11, 13, 20, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    gap: 0;
    transition: height 0.35s var(--ease);
    border-bottom: 1px solid var(--border);
  }
  .nav-links.active {
    height: auto;
    padding: 16px 0 28px;
  }
  .nav-links a {
    height: auto;
    padding: 14px 0;
    font-size: 15px;
  }
  .nav-links a::after {
    bottom: 6px;
    left: 0;
    right: 0;
  }

  .home-section { padding: 52px 0; }
  .news-list { max-height: 260px; }
  .section-heading { margin-bottom: 24px; }
}

@media (max-width: 600px) {
  .pub-card {
    grid-template-columns: 1fr;
  }
  .pub-thumb {
    width: 100%;
    max-width: 360px;
  }
  .affiliation-list { grid-template-columns: 1fr 1fr; }
  .affiliation-card { padding: 20px 12px; }
  .affiliation-card img { width: 110px; height: 55px; }
  .portrait { width: 148px; height: 148px; }
  .contact-card { padding: 24px 20px; }
}

@media (max-width: 400px) {
  .affiliation-list { grid-template-columns: 1fr; }
}

/* Align brand on homepage */
@media (min-width: 861px) {
  .home .brand { width: 280px; justify-content: center; margin-left: 0; }
}

/* ── Print ────────────────────────────────────────────────────── */
@media print {
  .nav, .footer { display: none; }
  .main { margin-top: 0; }
  .home-section { page-break-inside: avoid; }
  body { background: #fff; color: #000; }
  body::before, body::after { display: none; }
  .pub-card, .affiliation-card, .contact-card { background: #fff; border-color: #ccc; }
  .pub-thumb { background: #fff; }
  .animate-in { opacity: 1; transform: none; }
}
