/* ==========================================================================
   Dr. Prabhat Prakash — Style 5: Modern Persson-Inspired Academic Layout
   - Soft, subtle borders across cards, tables, and sections
   - Font dropdown menu [A]: Telex (default), Lexend (ADHD Friendly), Helvetica, Times, Sans
   - Responsive across Desktop, Tablet, and Mobile (images constrained at all widths)
   - Uniform, readable typography (17px / 1.0625rem base) — strictly NO small fonts
   ========================================================================== */

:root {
  --bg-page: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-card: #ffffff;
  --bg-button: #f1f5f9;

  --text-main: #1e293b;
  --text-heading: #0f172a;
  --text-secondary: #475569;

  --accent: #0f4c81;
  --accent-hover: #0b3559;
  --accent-soft: #eff6ff;

  /* Soft, subtle borders */
  --border: #e5eaf2;
  --border-strong: #d4dce8;
  --shadow-soft: 0 2px 10px rgba(15, 23, 42, 0.03);

  --font-main: 'Telex', sans-serif;

  /* Uniform readable font scale — strictly NO small fonts */
  --fs-body: 1.0625rem;   /* 17px — standard text, nav, dates, captions, badges, footer */
  --fs-h3: 1.25rem;       /* 20px — card & item titles */
  --fs-h2: 1.5rem;        /* 24px — section headings */
  --fs-h1: 1.9rem;        /* 30.4px — page titles */

  --container-max: 1180px;
  --header-height: 74px;
  --radius: 10px;
}

/* Font family options in the [A] dropdown */
html[data-font="telex"] {
  --font-main: 'Telex', sans-serif;
}

html[data-font="adhd"] {
  --font-main: 'Lexend', -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: 0.012em;
  word-spacing: 0.04em;
}

html[data-font="helvetica"] {
  --font-main: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

html[data-font="times"] {
  --font-main: 'Times New Roman', Times, Georgia, serif;
}

html[data-font="sans"] {
  --font-main: 'Open Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

[data-theme="dark"] {
  --bg-page: #0f172a;
  --bg-subtle: #162033;
  --bg-card: #162033;
  --bg-button: #1e293b;

  --text-main: #e2e8f0;
  --text-heading: #f8fafc;
  --text-secondary: #cbd5e1;

  --accent: #60a5fa;
  --accent-hover: #93c5fd;
  --accent-soft: rgba(96, 165, 250, 0.15);

  --border: #263449;
  --border-strong: #334155;
  --shadow-soft: 0 2px 10px rgba(0, 0, 0, 0.2);
}

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

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

body {
  font-family: var(--font-main);
  font-size: var(--fs-body);
  line-height: 1.72;
  color: var(--text-main);
  background-color: var(--bg-page);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
}

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

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p {
  font-size: var(--fs-body);
  color: var(--text-main);
  margin-bottom: 14px;
}

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

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

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

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

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--accent);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: var(--radius);
  z-index: 9999;
  font-size: var(--fs-body);
}
.skip-link:focus {
  top: 12px;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   Header, Navigation & [A] Font Dropdown Menu
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-height);
  background-color: var(--bg-page);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand-mark:hover {
  text-decoration: none;
}

.brand-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.brand-name {
  font-size: var(--fs-h3);
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.2;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}

.nav-link {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: var(--fs-body);
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
}

.nav-link:hover {
  color: var(--text-heading);
  background-color: var(--bg-subtle);
  text-decoration: none;
}

.nav-link.active {
  color: var(--accent);
  background-color: var(--accent-soft);
  font-weight: 700;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Square [A] Font Dropdown & Theme Toggle */
.font-dropdown-wrap {
  position: relative;
}

.font-toggle,
.theme-toggle,
.mobile-menu-btn {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-heading);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: inherit;
  font-size: var(--fs-body);
  font-weight: 700;
  line-height: 1;
}

.font-toggle:hover,
.theme-toggle:hover,
.mobile-menu-btn:hover {
  background: var(--accent-soft);
  border-color: var(--border-strong);
  color: var(--accent);
}

.font-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 230px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  padding: 6px;
  list-style: none;
  display: none;
  z-index: 1200;
}

.font-menu.open {
  display: block;
}

.font-option {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: var(--fs-body);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.font-option:hover {
  background-color: var(--bg-subtle);
  color: var(--accent);
}

.font-option.active {
  background-color: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.mobile-menu-btn {
  display: none;
}

/* ==========================================================================
   Home Page: Left Info Column + Right Research Showcase Column (Soft Borders)
   ========================================================================== */
.home-split {
  display: grid;
  grid-template-columns: 1fr 1.42fr;
  gap: 36px;
  padding-top: 32px;
  padding-bottom: 56px;
  align-items: start;
}

.showcase-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 28px;
}

.showcase-lead {
  font-size: var(--fs-body);
  color: var(--text-main);
  margin-bottom: 20px;
}

.carousel {
  position: relative;
  margin: 18px 0 6px;
  border-radius: 8px;
  overflow: hidden;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border);
}

.carousel-inner {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.carousel .item {
  display: none;
  position: relative;
  width: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.carousel .item.active {
  display: flex;
}

.carousel-img-stage {
  width: 100%;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 54px;
  overflow: hidden;
  background: #ffffff;
}

.carousel .item img {
  max-height: 225px;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.carousel-caption {
  width: 100%;
  padding: 14px 20px 34px;
  background-color: var(--bg-subtle);
  color: var(--text-main);
  text-align: center;
  border-top: 1px solid var(--border);
}

.carousel-caption h3 {
  color: var(--text-heading);
  font-size: var(--fs-h3);
  font-weight: 700;
  margin-bottom: 4px;
}

.carousel-caption p {
  color: var(--text-secondary);
  font-size: var(--fs-body);
  margin: 0;
}

.carousel-indicators {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  display: flex;
  gap: 2px;
}

.carousel-indicators button {
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.carousel-indicators button::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--border-strong);
}

.carousel-indicators button.active::before {
  background-color: var(--accent);
}

.carousel-control {
  position: absolute;
  top: 38%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--text-heading);
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 12;
}

.carousel-control.left { left: 10px; }
.carousel-control.right { right: 10px; }

.carousel-control:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

/* Left Column: Profile Card + Recent Highlights */
.profile-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.profile-avatar {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-strong);
  flex-shrink: 0;
}

.profile-details h2,
.profile-details .profile-name {
  font-size: var(--fs-h3);
  margin-bottom: 4px;
}

.profile-details p {
  font-size: var(--fs-body);
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.pill-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.pill-link {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 6px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border);
  font-size: var(--fs-body);
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.pill-link:hover {
  background-color: var(--accent-soft);
  border-color: var(--accent);
  text-decoration: none;
}

/* Recent Highlights Panel (Soft Border, 3 Items) */
.news-panel {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-soft);
}

.news-panel-title {
  font-size: var(--fs-h2);
  padding-bottom: 12px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.news-feed {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.news-feed-item {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 14px;
  align-items: start;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.news-feed-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.news-badge-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background-color: var(--accent-soft);
  border: 1px solid var(--border);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.news-date {
  display: block;
  font-size: var(--fs-body);
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

.news-text p {
  font-size: var(--fs-body);
  color: var(--text-main);
  margin: 0;
}

/* ==========================================================================
   About & Research Page: Sticky Left Section Sidenav + Illustrated Blocks
   Responsive across Computer, Tablet, and Mobile
   ========================================================================== */
.page-shell-sidenav {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 36px;
  padding-top: 32px;
  padding-bottom: 56px;
  align-items: start;
}

.section-sidenav {
  position: sticky;
  top: calc(var(--header-height) + 24px);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.sidenav-heading {
  font-size: var(--fs-h3);
  font-weight: 700;
  color: var(--text-heading);
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.sidenav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidenav-links a {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: var(--fs-body);
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}

.sidenav-links a:hover {
  background-color: var(--accent-soft);
  color: var(--accent-hover);
  text-decoration: none;
}

.sidenav-contact {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: var(--fs-body);
  color: var(--text-secondary);
}

.content-block {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-soft);
}

.content-block h2 {
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.thrust-row {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 24px;
  align-items: center;
}

/* Constrained figure size so images NEVER blow up on tablet or mobile */
.thrust-figure {
  width: 100%;
  max-width: 240px;
  max-height: 200px;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #ffffff;
  padding: 6px;
  object-fit: contain;
  justify-self: center;
}

/* ==========================================================================
   Publications & Talks: Two-Column Table + Expand/Roll-Out Buttons
   ========================================================================== */
.page-wrapper {
  padding-top: 32px;
  padding-bottom: 56px;
}

.page-header-bar {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
}

.pub-status {
  font-size: var(--fs-body);
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  background-color: transparent;
  border: none;
  box-shadow: none;
}

.table > tbody > tr > td {
  padding: 12px 16px 12px 0;
  vertical-align: top;
  border: none;
  font-size: var(--fs-body);
  line-height: 1.68;
}

.table > tbody > tr:last-child > td {
  border: none;
}

.table td.date-col {
  width: 110px;
  white-space: nowrap;
  background-color: transparent;
  border: none;
  color: var(--text-secondary);
}

.table td.date-col strong {
  font-size: var(--fs-h3);
  color: var(--accent);
}

.table td.publication .pubtitle {
  font-weight: 700;
  color: var(--text-heading);
}

.table td.publication .authors {
  color: var(--text-main);
}

.table td.publication .venue {
  font-style: italic;
  color: var(--text-secondary);
}

.is-collapsed-row {
  display: none !important;
}

.is-collapsed-section {
  display: none !important;
}

.expand-btn-wrap {
  margin-bottom: 36px;
}

.expand-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background-color: var(--bg-subtle);
  color: var(--accent);
  font-family: inherit;
  font-size: var(--fs-body);
  font-weight: 600;
  cursor: pointer;
}

.expand-btn:hover {
  background-color: var(--accent-soft);
  border-color: var(--accent);
}

/* ==========================================================================
   Research Areas Interactive Word Cloud (Soft Border)
   ========================================================================== */
.wordcloud-box {
  position: relative;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.wordcloud-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.35;
}

.wordcloud-content {
  position: relative;
  z-index: 1;
}

.cloud {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: baseline;
}

.word {
  display: inline-block;
  line-height: 1.35;
  cursor: pointer;
  user-select: none;
}

.word[data-tier="top"] {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent);
}

.word[data-tier="mid"] {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-heading);
}

.word[data-tier="low"] {
  font-size: var(--fs-body);
  font-weight: 500;
  color: var(--text-secondary);
}

.cloud .word:not(:last-child)::after {
  content: "•";
  margin-left: 12px;
  color: var(--text-secondary);
  opacity: 0.45;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: var(--fs-body);
  background: var(--bg-subtle);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  padding: 28px 0;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: var(--fs-body);
  color: var(--text-secondary);
}

/* ==========================================================================
   Responsive Design (Computer, Tablet, and Mobile)
   ========================================================================== */
@media (max-width: 1024px) {
  .mobile-menu-btn {
    display: inline-flex;
  }

  .nav-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-page);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 16px 24px;
    gap: 6px;
    display: none;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
  }

  .nav-menu.open {
    display: flex;
  }
}

@media (max-width: 960px) {
  .home-split,
  .page-shell-sidenav {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .section-sidenav {
    position: static;
  }

  .sidenav-links {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .sidenav-links a {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
  }

  /* Keep side-by-side on medium tablets, with compact image column */
  .thrust-row {
    grid-template-columns: 1fr 200px;
    gap: 20px;
  }

  .thrust-figure {
    max-width: 200px;
    max-height: 175px;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }


  .profile-card {
    flex-direction: column;
    text-align: center;
  }

  .pill-links {
    justify-content: center;
  }

  /* On mobile phones, stack text and figure, keeping figure compact & centered */
  .thrust-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .thrust-figure {
    max-width: 220px;
    max-height: 180px;
    margin: 0 auto;
  }

  .carousel-img-stage {
    height: 210px;
    padding: 10px 44px;
  }

  .carousel .item img {
    max-height: 185px;
  }

  .table > tbody > tr {
    display: block;
    border: none;
    padding-bottom: 12px;
  }

  .table > tbody > tr:last-child {
    border: none;
  }

  .table > tbody > tr > td {
    display: block;
    width: 100%;
    border: none;
    padding: 4px 0;
  }

  .table td.date-col {
    border: none;
    padding: 8px 0 2px;
  }
}


/* ==========================================================================
   Accessibility helpers
   ========================================================================== */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.carousel:focus-visible,
.carousel-indicators button:focus-visible {
  outline-offset: -3px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   Profile card: clickable emails + CV button
   ========================================================================== */
.contact-list {
  list-style: none;
  margin: 4px 0 6px;
}

.contact-list li {
  font-size: var(--fs-body);
  overflow-wrap: anywhere;
}

.pill-link.pill-link-primary {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.pill-link.pill-link-primary:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #ffffff;
}

[data-theme="dark"] .pill-link.pill-link-primary,
[data-theme="dark"] .pill-link.pill-link-primary:hover {
  color: #0f172a;
}

.nav-link-cv {
  color: var(--accent);
  font-weight: 700;
}

/* Research Areas heading row + shuffle button */
.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.cloud-shuffle {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background-color: var(--bg-subtle);
  color: var(--accent);
  font-family: inherit;
  font-size: var(--fs-body);
  font-weight: 600;
  cursor: pointer;
}

.cloud-shuffle:hover {
  background-color: var(--accent-soft);
  border-color: var(--accent);
}

/* Year labels in publication / talk lists (replaces obsolete <big>) */
.table td.date-col strong.year {
  font-size: var(--fs-h3);
}

/* ==========================================================================
   Publications: Selected Publications cards
   ========================================================================== */
.pub-summary {
  margin-bottom: 24px;
}

.pub-stats {
  margin-bottom: 6px;
}

.pub-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  color: var(--text-secondary);
}

.mark {
  color: var(--accent);
  font-weight: 700;
  margin-left: 1px;
}

.selected-pubs {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 32px;
  counter-reset: selpub;
}

.sel-pub {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 22px;
  align-items: start;
  padding: 20px;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.sel-pub-fig {
  width: 170px;
  height: 140px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #ffffff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sel-pub-fig img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sel-pub-placeholder {
  background: repeating-linear-gradient(135deg, var(--bg-subtle), var(--bg-subtle) 10px, var(--bg-page) 10px, var(--bg-page) 20px);
  border-style: dashed;
  border-color: var(--border-strong);
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.4;
}

.sel-pub-body p {
  margin-bottom: 6px;
}

.sel-pub-ref {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
}

.sel-pub-ref a {
  text-decoration: none;
}

.sel-pub-ref a:hover .journal {
  text-decoration: underline;
}

.sel-pub-ref .journal {
  font-size: var(--fs-h3);
  font-weight: 700;
  font-style: italic;
  color: var(--accent);
}

.sel-pub-ref .ref-details {
  font-weight: 600;
  color: var(--text-heading);
  white-space: nowrap;
}

.role-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background-color: var(--accent-soft);
  color: var(--accent);
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: 1.5;
}

.sel-pub-authors {
  color: var(--text-main);
}

.sel-pub-title {
  font-weight: 600;
  color: var(--text-heading);
}

.sel-pub-press {
  color: var(--text-secondary);
}

.list-heading {
  margin-bottom: 16px;
}

.expand-btn-wrap.expand-btn-wrap-tight {
  margin-bottom: 16px;
}

@media (max-width: 768px) {
  .sel-pub {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px;
  }

  .sel-pub-fig {
    width: 100%;
    max-width: 320px;
    height: 180px;
  }
}

/* Prevent horizontal overflow on narrow phones */
.sel-pub > *,
.home-split > *,
.page-shell-sidenav > * {
  min-width: 0;
}

.sel-pub-authors,
.sel-pub-title,
.table td.publication {
  overflow-wrap: anywhere;
}

@media (max-width: 768px) {
  .sel-pub-ref .ref-details {
    white-space: normal;
  }
}

@media (max-width: 420px) {
  .nav-container {
    gap: 10px;
  }

  .nav-actions {
    gap: 6px;
  }

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

  .brand-mark {
    gap: 8px;
  }

  .brand-name {
    white-space: nowrap;
  }
}

/* ==========================================================================
   Home layout: [Profile | Showcase] equal row → Research Areas bar → Highlights
   ========================================================================== */
.home-page {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-top: 32px;
  padding-bottom: 56px;
}

.home-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: stretch;
}

.home-top > * {
  min-width: 0;
  margin-bottom: 0;
}

.home-top .profile-card {
  flex-direction: column;
  justify-content: center;
  text-align: center;
  gap: 18px;
  padding: 32px 28px;
}

.home-top .profile-avatar {
  width: 168px;
  height: 168px;
}

.home-top .pill-links {
  justify-content: center;
}

.home-top .showcase-card {
  display: flex;
  flex-direction: column;
}

.home-top .carousel {
  margin-bottom: 0;
}

/* Research Areas: thin full-width bar */
.research-bar .section-heading-row {
  margin-bottom: 8px;
}

.research-bar .wordcloud-box {
  padding: 12px 22px;
}

.research-bar .cloud {
  gap: 4px 14px;
  align-items: center;
}

.research-bar .word[data-tier="top"] {
  font-size: 1.2rem;
}

.research-bar .word[data-tier="mid"] {
  font-size: 1.1rem;
}

/* Recent Highlights: full width, three side-by-side items */
.home-page .news-feed {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
}

.home-page .news-feed-item {
  border-bottom: none;
  padding-bottom: 0;
}

@media (max-width: 960px) {
  .home-top {
    grid-template-columns: 1fr;
  }

  .home-page .news-feed {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .home-page .news-feed-item {
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
  }

  .home-page .news-feed-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
}

/* ==========================================================================
   Teaching & Contact pages
   ========================================================================== */
.teach-item + .teach-item {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.teach-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  margin-bottom: 6px;
  color: var(--text-heading);
}

.teach-when {
  color: var(--text-secondary);
  font-weight: 600;
  white-space: nowrap;
}

.mentee-list {
  padding-left: 22px;
}

.mentee-list li {
  margin-bottom: 10px;
}

.mentee-list li:last-child {
  margin-bottom: 0;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.contact-grid > * {
  min-width: 0;
}

.contact-list-large li {
  font-size: var(--fs-h3);
  margin-bottom: 6px;
}

address {
  font-style: normal;
  margin-bottom: 12px;
}

@media (max-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

/* ==========================================================================
   Publications: "Please wait, loading..." indicator
   ========================================================================== */
.pub-status {
  font-weight: 600;
  color: var(--text-main);
}

.table.is-loading {
  display: none;
}

.loading-word {
  color: var(--accent);
  animation: pp-blink 1.1s ease-in-out infinite;
}

.loading-dots span {
  color: var(--accent);
  animation: pp-blink 1.1s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.18s; }
.loading-dots span:nth-child(3) { animation-delay: 0.36s; }

@keyframes pp-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

@media (prefers-reduced-motion: reduce) {
  .loading-word,
  .loading-dots span {
    animation: none;
  }
}

/* "New preprint" badge in carousel captions */
.new-badge {
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
  padding: 1px 10px;
  border-radius: 999px;
  background-color: var(--accent);
  color: #ffffff;
  font-size: var(--fs-body);
  font-weight: 700;
  line-height: 1.6;
}

[data-theme="dark"] .new-badge {
  color: #0f172a;
}

/* Teaching: mentoring papers (no figure column) */
.sel-pub.sel-pub-compact {
  grid-template-columns: 1fr;
}

.mentoring-pubs {
  margin: 14px 0 0;
}

.selected-pubs.selected-pubs-preprint {
  margin-bottom: 28px;
}

.sel-pub-ref .new-badge {
  margin-right: 0;
}

/* ==========================================================================
   Contact: research profile links with brand icons
   ========================================================================== */
.profile-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.profile-link {
  display: inline-flex;
  border-radius: 12px;
  text-decoration: none;
}

.profile-link:hover .profile-icon {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.profile-icon {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #ffffff;
  border: 1px solid var(--border);
}

.profile-icon svg {
  display: block;
}

.profile-icon-scholar  { color: #4285f4; }
.profile-icon-rg       { color: #ffffff; background-color: #00ccbb; border-color: #00ccbb; }
.profile-icon-orcid    { color: #a6ce39; }
.profile-icon-wos      { color: #5e33bf; }
.profile-icon-linkedin { color: #0a66c2; }
.profile-icon-github   { color: #181717; }

.profile-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.35;
}

.profile-name {
  font-weight: 700;
  color: var(--text-heading);
}

.profile-id {
  color: var(--text-secondary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--fs-body);
  overflow-wrap: anywhere;
}

/* Home: compact profile card (name, role, emails only) */
.home-top .profile-card {
  align-self: start;
  padding: 28px 24px;
  gap: 14px;
}

.home-top .profile-avatar {
  width: 140px;
  height: 140px;
}

.home-top .profile-details p {
  margin-bottom: 4px;
}

/* ==========================================================================
   CV page: embedded PDF viewer
   ========================================================================== */
.cv-viewer {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background-color: var(--bg-subtle);
  box-shadow: var(--shadow-soft);
}

.cv-viewer object {
  display: block;
  width: 100%;
  height: calc(100vh - var(--header-height) - 150px);
  min-height: 640px;
  border: 0;
}

.cv-fallback {
  padding: 32px 24px;
  text-align: center;
}

.cv-fallback .pill-link {
  margin: 6px;
}

@media (max-width: 768px) {
  .cv-viewer object {
    min-height: 520px;
  }
}

/* Home: thinner intro (profile) column */
.home-top {
  grid-template-columns: minmax(260px, 1fr) 2fr;
}

.home-top .profile-card {
  padding: 24px 18px;
}

.home-top .profile-avatar {
  width: 120px;
  height: 120px;
}

.profile-links-home {
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.profile-links-home .profile-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

@media (max-width: 960px) {
  .home-top {
    grid-template-columns: 1fr;
  }
}

/* Research page: Drsta feature list and snapshots carousel */
.drsta-features {
  list-style: disc;
  padding-left: 1.5rem;
  margin: 0 0 14px;
}

.drsta-features li {
  margin-bottom: 6px;
}

.carousel-drsta {
  margin: 18px 0 20px;
}

.carousel-drsta .carousel-img-stage {
  height: 390px;
  padding: 14px 56px;
  background: #f8fafc;
}

.carousel-drsta .item img {
  max-height: 362px;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
}

@media (max-width: 768px) {
  .carousel-drsta .carousel-img-stage {
    height: 250px;
    padding: 10px 44px;
  }

  .carousel-drsta .item img {
    max-height: 226px;
  }
}
