/* Base Styles */
:root {
  --color-primary: #0056b3;
  --color-secondary: #2b2b2b;
  --color-text: #333333;
  --color-background: #ffffff;
  --font-primary: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Arial', sans-serif;
  --color-primary-hover: #004494;
  --color-link: #0056b3;
  --color-link-hover: #004494;
  
  /* Heading styling */
  --h2-gradient-start: #2b65c6;
  --h2-gradient-end: #0e4594;
  --h2-border-color: #2278d4;
  --h2-shadow-color: rgba(14, 69, 148, 0.2);
  
  /* Header elements */
  --header-bg: rgba(104, 35, 109, 0.15);
  --header-shadow: rgba(104, 35, 109, 0.2);
  --nav-item-bg: rgba(255, 255, 255, 0.25);
  --nav-item-color: #1a1a1a;
  --nav-item-hover-bg: rgba(255, 255, 255, 0.35);
  --nav-item-shadow: rgba(0, 0, 0, 0.1);
  --nav-item-hover-shadow: rgba(0, 0, 0, 0.4);
}

/* Dark theme variables */
[data-theme="dark"] {
  --color-text: #e0e0e0;
  --color-background: #121212;
  --color-primary: #4c8dff;
  --color-secondary: #a0a0a0;
  --color-primary-hover: #6fa1ff;
  --color-link: #58A6FF;
  --color-link-hover: #79B8FF;
  
  /* Heading styling */
  --h2-gradient-start: #78aaff;
  --h2-gradient-end: #4a7dff;
  --h2-border-color: #589fff;
  --h2-shadow-color: rgba(74, 125, 255, 0.4);
  
  /* Header elements */
  --header-bg: rgba(40, 15, 45, 0.75);
  --header-shadow: rgba(0, 0, 0, 0.4);
  --nav-item-bg: rgba(30, 30, 30, 0.6);
  --nav-item-color: #ffffff;
  --nav-item-hover-bg: rgba(40, 40, 40, 0.8);
  --nav-item-shadow: rgba(0, 0, 0, 0.3);
  --nav-item-hover-shadow: rgba(0, 0, 0, 0.4);
}

html {
  font-size: 62.5%;
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-primary);
  font-size: 1.6rem;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Make icons white in dark mode */
[data-theme="dark"] .s-header__nav i,
[data-theme="dark"] .s-header__nav-list i,
[data-theme="dark"] .fa-brands,
[data-theme="dark"] .fa-solid,
[data-theme="dark"] .ai,
[data-theme="dark"] .s-footer i,
[data-theme="dark"] .site-footer i,
[data-theme="dark"] .footer-left i,
[data-theme="dark"] .footer-right i {
  color: white !important;
}

/* Theme-aware content styling */
[data-theme="dark"] #about-content a,
[data-theme="dark"] #news-content a,
[data-theme="dark"] .teaching-content a,
[data-theme="dark"] .s-teaching a {
  color: #78AAFF;
  text-decoration: none;
}

[data-theme="dark"] #about-content h1,
[data-theme="dark"] #about-content h3,
[data-theme="dark"] #news-content h1,
[data-theme="dark"] #news-content h3 {
  color: var(--color-text);
}

/* Handle specific link and icon coloring in news */
[data-theme="dark"] #news-content a[href$=".pdf"] {
  color: #6fa1ff !important;
}

[data-theme="dark"] #news-content a[href^="https://doi.org"] {
  color: #ff8650 !important;
}

[data-theme="dark"] #news-content a[href$=".pdf"] i,
[data-theme="dark"] #news-content a[href^="https://doi.org"] i {
  color: inherit !important;
}

/* Fix image shadows in dark mode */
[data-theme="dark"] #news-content img {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4) !important;
}

/* Fix section backgrounds in dark mode */
[data-theme="dark"] .s-about,
[data-theme="dark"] .s-featured,
[data-theme="dark"] .s-featured__left,
[data-theme="dark"] .s-featured__right,
[data-theme="dark"] .featured-paper {
  background-color: var(--color-background) !important;
}

/* Ensure content is contained within viewport on all screens */
.s-about, 
.s-about__grid,
.s-about__left,
.s-about__desc,
.s-about__right,
.s-about__desc p,
.s-about__desc li,
.s-about__desc a,
.s-about__desc h1,
.s-about__desc h2,
.s-about__desc h3,
.s-about__desc strong,
.s-about__desc ul,
.s-research,
.s-research p,
.s-featured,
.s-featured p,
.s-teaching,
.s-teaching p {
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* Match About and News container styles in dark mode */
[data-theme="dark"] .s-about__grid {
  background: linear-gradient(145deg, rgba(35, 35, 45, 0.7), rgba(30, 30, 38, 0.8)) !important;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Global strong element styling */
strong:not(a strong):not(h1 strong):not(h2 strong):not(h3 strong):not(h4 strong):not(h5 strong):not(h6 strong),
#news-content strong:not(a strong):not(a *),
.s-about__desc strong:not(a strong):not(a *) {
  font-weight: 600;
  color: #8B4513;
  background: linear-gradient(transparent 80%, rgba(205, 133, 63, 0.35) 100%);
  padding: 0 2px;
  border-radius: 2px;
}

[data-theme="dark"] strong:not(a strong):not(h1 strong):not(h2 strong):not(h3 strong):not(h4 strong):not(h5 strong):not(h6 strong),
[data-theme="dark"] #news-content strong:not(a strong):not(a *),
[data-theme="dark"] .s-about__desc strong:not(a strong):not(a *) {
  color: #e5c070;
  background: linear-gradient(transparent 80%, rgba(205, 133, 63, 0.35) 100%);
  border-radius: 2px;
}

/* Global heading styles */
h2 {
  position: relative;
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--color-text);
  padding-bottom: 0.5rem;
  margin: 1.5rem 0 1rem;
  background: linear-gradient(to right, var(--h2-gradient-start), var(--h2-gradient-end));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  border-bottom: 2px solid var(--h2-border-color);
  letter-spacing: 0.01em;
  text-shadow: 0 1px 1px var(--h2-shadow-color);
}

h2::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 50%;
  height: 2px;
  background: linear-gradient(to right, var(--h2-border-color), transparent);
}

/* Enhanced h2 styling for dark theme */
[data-theme="dark"] h2 {
  background: linear-gradient(to right, var(--h2-gradient-start), var(--h2-gradient-end));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 1px 2px rgba(74, 125, 255, 0.5);
  filter: drop-shadow(0 0 2px rgba(120, 170, 255, 0.3));
}

/* Fix h3 headings in dark mode */
[data-theme="dark"] h3 {
  color: #e0e0e0 !important;
}

/* YouTube stats card theme switching */
.youtube-stats-light {
  display: block;
  max-width: 100%;
  height: auto;
}

.youtube-stats-dark {
  display: none;
  max-width: 100%;
  height: auto;
}

[data-theme="dark"] .youtube-stats-light {
  display: none;
}

[data-theme="dark"] .youtube-stats-dark {
  display: block;
}

/* Make YouTube stats card responsive */
img.youtube-stats-light,
img.youtube-stats-dark {
  max-width: 100%;
  height: auto;
  box-sizing: border-box;
}

@media screen and (max-width: 768px) {
  img.youtube-stats-light,
  img.youtube-stats-dark {
    max-width: 100%;
    height: auto !important;
    width: 100% !important;
  }
}

/* Fix box shadows and borders in dark mode */
[data-theme="dark"] .featured-paper,
[data-theme="dark"] .s-about__grid {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .s-about__social-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Preloader */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-background);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

#loader {
  width: 60px;
  height: 60px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Header */
.s-header {
  position: fixed;
  top: 0;
  width: 100%;
  height: 80px;
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 3rem;
  box-shadow: 0 4px 16px var(--header-shadow);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.s-header__logo {
  height: 65px;
}

.s-header__logo img {
  height: 100%;
  max-height: 65px;
  width: auto;
}

/* Menu Toggle Button */
.s-header__menu-toggle {
  display: none;
  color: var(--color-text);
  text-decoration: none;
  align-items: center;
  gap: 1rem;
}

.s-header__menu-text {
  font-size: 1.6rem;
}

.s-header__menu-icon {
  width: 24px;
  height: 2px;
  background-color: var(--color-text);
  position: relative;
}

.s-header__menu-icon::before,
.s-header__menu-icon::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: var(--color-text);
  transition: transform 0.3s ease;
}

.s-header__menu-icon::before {
  transform: translateY(-8px);
}

.s-header__menu-icon::after {
  transform: translateY(8px);
}

/* Navigation */
.s-header__nav {
  display: flex;
  align-items: center;
}

.s-header__nav-list {
  display: flex;
  gap: 0.8rem;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}

.s-header__nav-list li {
  display: flex;
  align-items: center;
  height: 100%;
}

.s-header__nav-list a {
  color: #1a1a1a;
  text-decoration: none;
  font-size: 1.6rem;
  transition: all 0.3s ease;
  padding: 0.8rem 1.6rem;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  height: 40px;
}

.s-header__nav-list a:hover {
  background: var(--nav-item-hover-bg);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px var(--nav-item-hover-shadow);
}

/* Special styling for the Bluesky icon */
.s-header__nav-list li[style="background: none;"] a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.s-header__nav-close-btn {
  display: none;
  position: absolute;
  top: 2rem;
  right: 2rem;
  color: #000000;
  text-decoration: none;
  font-size: 1.6rem;
  transition: all 0.3s ease;
  padding: 0.8rem 1.6rem;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-left: 0.8rem;
}

.s-header__nav-close-btn:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* Theme toggle button */
.theme-toggle {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  background: var(--nav-item-bg);
  box-shadow: 0 2px 10px var(--nav-item-shadow);
  transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
  position: relative;
}

/* Special styling for dark theme text and icons */
[data-theme="dark"] .s-header__nav-list a,
[data-theme="dark"] .s-header__nav-list a i,
[data-theme="dark"] .command-k-style-btn,
[data-theme="dark"] .command-k-style-btn span,
[data-theme="dark"] .command-k-style-btn i,
[data-theme="dark"] .s-header__menu-text,
[data-theme="dark"] .s-header__menu-icon,
[data-theme="dark"] .s-header__menu-icon::before,
[data-theme="dark"] .s-header__menu-icon::after {
  color: #ffffff;
}

[data-theme="dark"] .fa-bluesky {
  color: #0085ff !important;
}

[data-theme="dark"] .theme-toggle-icon {
  stroke: #ffffff;
}

.theme-toggle:hover {
  background: var(--nav-item-hover-bg);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px var(--nav-item-hover-shadow);
}

.theme-toggle-icon {
  width: 24px;
  height: 24px;
  transition: opacity 0.3s ease, transform 0.5s ease;
}

.theme-toggle-icon.moon {
  position: absolute;
  opacity: 1;
}

.theme-toggle-icon.sun {
  position: absolute;
  opacity: 0;
  transform: rotate(90deg);
}

[data-theme="dark"] .theme-toggle-icon.moon {
  opacity: 0;
  transform: rotate(-90deg);
}

[data-theme="dark"] .theme-toggle-icon.sun {
  opacity: 1;
  transform: rotate(0);
}

/* Dark mode styling for browsers that support media queries */
@media (prefers-color-scheme: dark) {
  /* Dark mode for the navigation close button */
  .s-header__nav-close-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #000000; /* Keep text black in dark mode too to match command palette */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  }
  
  .s-header__nav-close-btn:hover {
    background: rgba(255, 255, 255, 0.15);
  }
}

/* Intro Section */
.s-intro {
  min-height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8rem 2rem;
  overflow: hidden;
}

.s-intro__bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('../../featured/GraphicalAbstract_v7_FrontOnly.jpg');
  background-size: cover;
  background-position: center;
  opacity: 0.75;
  z-index: -1;
  filter: brightness(0.9) contrast(1.1);
  backdrop-filter: blur(5px);
}

[data-theme="dark"] .s-intro__bg {
  background-image: url('../../featured/GraphicalAbstract_v7_FrontOnly-darkTheme.jpg');
  opacity: 0.42;
  filter: brightness(0.85) contrast(1.15);
  backdrop-filter: blur(8px);
}

.s-intro__content {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  padding: 4rem;
  border-radius: 10px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .s-intro__content {
  background: linear-gradient(145deg, rgba(35, 35, 45, 0.75), rgba(30, 30, 38, 0.85));
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Social icons styling - matching title gradient in dark mode */
[data-theme="dark"] .ai-orcid {
  color: #ff8888 !important; /* Match left side of gradient (red) */
}

[data-theme="dark"] .fa-github {
  color: #9077ff !important; /* Match middle of gradient (purple/blue mix) */
}

[data-theme="dark"] .ai-google-scholar {
  color: #546cff !important; /* Match right side of gradient (blue) */
}

/* Make Google Scholar icon white in command palette dark theme */
[data-theme="dark"] .cmdk-item .ai-google-scholar,
[data-theme="dark"] [cmdk-item] .ai-google-scholar,
[data-theme="dark"] [data-cmdk-item] .ai-google-scholar,
[data-theme="dark"] .cmdk-list .ai-google-scholar,
[data-theme="dark"] [role="dialog"] .ai-google-scholar,
[data-theme="dark"] #command-modal .ai-google-scholar,
[data-theme="dark"] .command-palette-icon .ai-google-scholar,
[data-theme="dark"] .command-palette-command .ai-google-scholar {
  color: white !important;
}

.s-intro__pretitle {
  font-size: 2.4rem;
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeInUp 1s ease forwards;
  animation-delay: 0.2s;
  color: #1a1a1a;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
  font-weight: 600;
}

.s-intro__title {
  font-size: 5rem;
  font-weight: bold;
  margin-bottom: 3rem;
  opacity: 0;
  animation: fadeInUp 1s ease forwards;
  animation-delay: 0.2s;
  background: linear-gradient(90deg, 
    #ff6b6b 0%, 
    #fa5252 45%, 
    #4c6ef5 55%, 
    #364fc7 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 2px 2px 3px rgba(0, 0, 0, 0.2);
  letter-spacing: 0.015em;
  font-weight: 800;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

[data-theme="dark"] .s-intro__title {
  background: linear-gradient(90deg, 
    #ff8888 0%, 
    #ff6666 35%, 
    #8897ff 65%, 
    #514880 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-stroke: 0.5px rgba(255, 255, 255, 0.15);
  text-shadow: none;
  letter-spacing: 0.015em;
}

.s-intro__subtitle {
  font-size: 2.25rem;
  font-weight: 600;
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeInUp 1s ease forwards;
  animation-delay: 0.4s;
  color: #1a1a1a;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .s-intro__subtitle {
  color: #e0e0e0;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);
}

/* Featured Research button styling */
.s-intro__subtitle a.smoothscroll {
  display: inline-block;
  padding: 8px 16px;
  background-color: rgba(3, 102, 214, 0.9); 
  color: white;
  text-decoration: none;
  border-radius: 25px;
  font-size: 0.9em;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  backdrop-filter: blur(5px);
}

.s-intro__subtitle a.smoothscroll:hover {
  background-color: rgba(3, 102, 214, 1);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  transform: translateY(-2px);
}

[data-theme="dark"] .s-intro__subtitle a.smoothscroll {
  background-color: rgba(33, 107, 255, 0.8);
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  color: #ffffff;
  text-shadow: 0px 1px 2px rgba(0,0,0,0.2);
}

[data-theme="dark"] .s-intro__subtitle a.smoothscroll:hover {
  background-color: rgba(59, 130, 255, 0.9);
  box-shadow: 0 4px 12px rgba(59, 130, 255, 0.3);
}

.s-intro__caption {
  margin-top: 2rem;
  font-size: 1.6rem;
  color: #1a1a1a;
  opacity: 0;
  animation: fadeInUp 1s ease forwards;
  animation-delay: 0.4s;
  font-weight: 500;
}

[data-theme="dark"] .s-intro__caption {
  color: #e0e0e0;
}

[data-theme="dark"] .s-intro__caption a {
  color: #6fa1ff;
}

[data-theme="dark"] .s-intro__caption a:hover {
  color: #8bb5ff;
}

.s-intro__caption p {
  margin: 0;
  line-height: 1.6;
}

.s-intro__caption a {
  color: #4c6ef5;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.s-intro__caption a:hover {
  color: #364fc7;
  text-decoration: none;
}

/* Make sure the Learn More button is visible */
.s-intro__more {
  margin-top: 2rem;
}

.s-intro__more-btn {
  display: inline-block;
  padding: 1.2rem 2.8rem;
  background: rgba(255, 255, 255, 0.3);
  color: #1a1a1a;
  text-decoration: none;
  border-radius: 5px;
  font-size: 1.8rem;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(4px);
}

.s-intro__more-btn:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* About Section */
.s-about {
  padding: 10rem 2rem;
  background: white;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
}

.s-about__content {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

.s-about__grid {
  display: flex;
  gap: 4rem;
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  border-radius: 15px;
  justify-content: space-between;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  padding: 3rem;
  overflow: hidden;
}

@media (max-width: 900px) {
  .s-about__grid {
    flex-direction: column;
    gap: 3rem;
  }
}

.s-about__left {
  display: flex;
  flex-direction: column;
  height: auto;
  width: 60%;
}

@media (max-width: 900px) {
  .s-about__left {
    width: 100%;
  }
}

.s-about__right {
  display: flex;
  flex-direction: column;
  height: auto;
  width: 42%;
}

@media (max-width: 900px) {
  .s-about__right {
    width: 100%;
  }
}

.s-about__social {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  overflow: hidden;
  background-color: white;
}

[data-theme="dark"] .s-about__social {
  background-color: #1e1e1e;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.s-about__social-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 2rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  margin-bottom: 0.5rem;
}

[data-theme="dark"] .s-about__social-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.s-about__social-header img {
  width: 24px;
  height: 24px;
}

.s-about__social-header h3 {
  margin: 0;
  font-size: 1.8rem;
  color: #1a1a1a;
  font-weight: 600;
}

.s-about__social-header a {
  color: #4c6ef5;
  text-decoration: none;
  transition: color 0.3s ease;
}

.s-about__social-header a:hover {
  color: #364fc7;
  text-decoration: none;
}

.s-about__social bsky-embed {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

/* News content padding to match About section */
#news-content {
  padding: 1.5rem 2rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
  overflow-y: auto;
  font-size: 1.6rem;
  line-height: 1.6;
  flex: 1;
}

[data-theme="dark"] #news-content {
  color: #e0e0e0;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

/* Force all content inside bsky-embed to fit */
.s-about__social bsky-embed * {
  max-width: 100%;
  box-sizing: border-box;
  word-wrap: break-word;
}

/* Ensure images don't overflow */
.s-about__social bsky-embed img {
  max-width: 100%;
  height: auto;
}

/* Custom scrollbar for Bluesky feed */
.s-about__social bsky-embed::-webkit-scrollbar {
  width: 6px;
}

.s-about__social bsky-embed::-webkit-scrollbar-track {
  background: transparent;
}

.s-about__social bsky-embed::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.s-about__social bsky-embed::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, 0.3);
}

.text-pretitle {
  font-size: 1.8rem;
  color: var(--color-primary);
  margin-bottom: 2rem;
}

.s-about__desc {
  font-size: 1.8rem;
  line-height: 1.8;
  max-width: 800px;
  margin: 0 auto;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
  width: 100%;
  box-sizing: border-box;
}

.s-about__desc h1 {
  font-size: 3.6rem;
  margin-bottom: 0.5rem;
  color: #2b2b2b;
}

.s-about__desc h2 {
  font-size: 2.4rem;
  margin: 1rem 0 0.5rem;
  color: #4c6ef5;
}

[data-theme="dark"] .s-about__desc h2 {
  color: #6e8aff;
}

.s-about__desc h3 {
  font-size: 2rem;
  margin: 0 0 0.5rem;
  color: #fa5252;
  border-bottom: 2px solid rgba(250, 82, 82, 0.2);
  padding-bottom: 0.5rem;
  display: inline-block;
}

[data-theme="dark"] .s-about__desc h3 {
  color: #ff8989 !important;
  border-bottom: 2px solid rgba(255, 137, 137, 0.3);
  text-shadow: 0 0 10px rgba(255, 137, 137, 0.2);
}

.s-about__desc p {
  margin-bottom: 1.5rem;
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.s-about__desc ul {
  list-style-type: disc;
  margin-left: 2rem;
  margin-bottom: 1.5rem;
}

.s-about__desc li {
  margin-bottom: 0.5rem;
}

/* Prevent unwanted line breaks in list items */
.s-about__desc li p {
  display: inline;
}

.s-about__desc a {
  color: #4c6ef5;
  text-decoration: none;
  transition: color 0.3s ease;
}

.s-about__desc a:hover {
  color: #364fc7;
  text-decoration: none;
}

/* Add styles for code blocks if needed */
.s-about__desc pre {
  background: rgba(0, 0, 0, 0.05);
  padding: 1.5rem;
  border-radius: 5px;
  overflow-x: auto;
  margin: 2rem 0;
}

.s-about__desc code {
  font-family: monospace;
  font-size: 1.6rem;
}

/* Footer */
.s-footer {
  padding: 4rem 2rem;
  background: var(--color-secondary);
  color: white;
  text-align: center;
}

.ss-copyright {
  font-size: 1.4rem;
}

.ss-go-top {
  display: none;
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 100;
  padding: 15px;
  background: rgba(255, 255, 255, 0.2);
  color: #333;
  text-decoration: none;
  border-radius: 50%;
  transition: all 0.3s ease-in-out;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.ss-go-top:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.ss-go-top i {
  font-size: 1.5em;
  color: #333;
  display: block;
}

.link-is-visible {
  display: block;
}

/* Adjust footer layout */
.footer-right {
  flex: 0 1 auto;
  justify-content: flex-end;
  margin-right: 0;
  gap: 2rem;
  padding-right: 0;
}

.footer-right a:last-child {
  margin-right: -15px;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Design */
@media screen and (max-width: 1200px) {
  .s-about__grid {
    grid-template-columns: minmax(400px, 1.2fr) minmax(450px, 1fr);
    gap: 3rem;
  }

  .footer-right {
    padding-right: 0px;
  }
}

@media screen and (max-width: 1000px) {
  .s-about__grid {
    grid-template-columns: minmax(350px, 1.2fr) minmax(400px, 1fr);
    gap: 2rem;
  }
}

@media screen and (max-width: 768px) {
  /* General mobile responsiveness improvements */
  body {
    overflow-x: hidden;
    width: 100%;
  }

  .s-header__menu-toggle {
    display: flex;
    z-index: 90;
  }

  .s-header__nav {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    padding: 2rem;
    flex-direction: column;
    align-items: flex-start;
    transition: right 0.3s ease;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
  }
  
  [data-theme="dark"] .s-header__nav {
    background: rgba(30, 30, 35, 0.95);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
  }

  .s-header__nav.is-active {
    right: 0;
  }

  .s-header__nav-close-btn {
    display: block;
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: var(--color-text);
    text-decoration: none;
    font-size: 1.6rem;
  }

  .s-header__nav h3 {
    margin: 3rem 0;
    font-size: 2rem;
  }

  .s-header__nav-list {
    flex-direction: column;
    width: 100%;
    align-items: flex-start;
  }

  .s-header__nav-list li {
    margin: 1rem 0;
    height: auto;
    width: 100%;
  }

  .s-header__nav-list a {
    display: flex;
    padding: 1rem 0;
    font-size: 1.8rem;
    background: none;
    box-shadow: none;
    width: 100%;
    text-align: center;
    justify-content: center;
    height: auto;
  }

  .s-header__nav-list a:hover {
    background: rgba(255, 255, 255, 0.35);
  }
  
  [data-theme="dark"] .s-header__nav-list a:hover {
    background: rgba(60, 60, 70, 0.5);
  }

  /* Special handling for Bluesky icon in mobile view */
  .s-header__nav-list li[style="background: none;"] {
    display: flex;
    justify-content: center;
    width: 100%;
  }

  .s-header__nav-list li[style="background: none;"] a {
    width: auto;
    justify-content: center;
  }

  /* Mobile command palette button */
  .command-palette-button {
    width: 100%;
    margin: 1rem 0;
  }

  .command-k-style-btn {
    width: 100%;
    height: auto;
    padding: 1rem 0;
  }

  .s-about__grid {
    grid-template-columns: 1fr;
    gap: 4rem;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    padding: 0 1rem;
  }

  .s-about__left {
    padding-right: 0;
    width: 100%;
    overflow-x: hidden;
  }

  .s-about__right {
    padding-left: 0;
    border-left: none;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding-top: 4rem;
  }

  .s-about__social {
    height: 500px;
  }

  .s-about__social bsky-embed {
    max-height: calc(500px - 60px);
  }

  .footer-right a:last-child {
    margin-right: 0;
  }

  .s-header__nav-list li:first-child {
    margin-right: 4rem;
  }
}

/* Team Section */
.s-team {
  padding: 10rem 2rem;
  background: var(--color-background);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.s-team__desc {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  text-align: center;
}

.s-team__desc h1 {
  font-size: 4rem;
  margin-bottom: 4rem;
  color: var(--color-text);
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(4, 400px);
  gap: 3rem;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  justify-content: center;
}

.team-member {
  width: 400px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 10px;
  padding: 2rem;
  text-align: justify;
  transition: transform 0.3s ease;
}

/* Center the name */
.team-member h2 {
  text-align: center;
  margin-bottom: 1rem;
}

/* Center social links (they come right after h2) */
.team-member h2 + p {
  text-align: center !important;
  margin-bottom: 1rem;
}

/* Center member image */
.team-member img {
  display: block;
  margin: 0 auto 1rem;
}

/* Center "Joint with" text (it's a paragraph with a single link) */
.team-member p:has(a[href*="Detlef"]),
.team-member p:has(a[href*="Martin"]),
.team-member p:has(a[href*="Jacco"]),
.team-member p:has(a[href*="Alvaro"]) {
  text-align: center !important;
  margin: 1rem 0;
}

/* Style for social icons */
.team-member .fa,
.team-member .ai {
  display: inline-block;
  margin: 0 5px;
}

/* Center the CV button */
.cv-button {
  display: block;
  text-align: center;
  margin: 1rem auto;
}

/* Keep lists and other paragraphs justified */
.team-member ul,
.team-member p:not(:has(a[href*="Detlef"])):not(:has(a[href*="Martin"])):not(:has(a[href*="Jacco"])):not(:has(a[href*="Alvaro"])):not(:has(.fa)):not(:has(.ai)):not(:has(.cv-button)) {
  text-align: justify;
}

/* Responsive breakpoints */
@media screen and (max-width: 1700px) {
  .team-grid {
    grid-template-columns: repeat(3, 400px);
  }
}

@media screen and (max-width: 1300px) {
  .team-grid {
    grid-template-columns: repeat(2, 400px);
  }
}

@media screen and (max-width: 900px) {
  .team-grid {
    grid-template-columns: repeat(1, 400px);
  }
}

@media screen and (max-width: 500px) {
  .team-grid {
    grid-template-columns: 1fr;
  }


  
  .team-member {
    width: 100%;
  }
  
  .team-member img {
    width: 100%;
    height: auto;
  }
}

.member-image {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
  background-color: #f8f9fa;
  min-height: 250px;
  overflow: hidden;
  content-visibility: auto;
  contain: layout paint;
}

/* Dark theme text color fixes for team section */
[data-theme="dark"] .team-member p,
[data-theme="dark"] .team-member strong,
[data-theme="dark"] .team-member ul,
[data-theme="dark"] .team-member li,
[data-theme="dark"] .team-section h1 {
  color: var(--color-text);
}

/* Apply the enhanced h2 styling to team page (without hover effects) */
[data-theme="dark"] .team-member h2 {
  /* Simplified styling to prevent blurriness */
  color: var(--h2-gradient-start);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

/* Fix link colors in team section for dark theme */
[data-theme="dark"] .team-member a:not(.cv-button):not([href^="https://github"]):not([href^="https://scholar.google"]):not([href^="https://orcid"]):not([href^="https://bsky"]) {
  color: var(--color-link);
}

[data-theme="dark"] .team-member a:not(.cv-button):not([href^="https://github"]):not([href^="https://scholar.google"]):not([href^="https://orcid"]):not([href^="https://bsky"]):hover {
  color: var(--color-link-hover);
}

[data-theme="dark"] .member-image {
  background-color: #2a2a2a;
}

[data-theme="dark"] .team-member {
  background: rgba(30, 30, 38, 0.7);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Make GitHub and Bluesky icons white in dark theme */
[data-theme="dark"] .fa-github,
[data-theme="dark"] .fa-bluesky {
  color: white !important;
}

.member-image::before {
  display: none;
}

.member-image img {
  position: relative;
  width: 250px;
  height: 250px;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s ease, filter 0.3s ease;
  will-change: opacity, filter;
  filter: blur(0);
}

.member-image img.loaded {
  opacity: 1;
}

/* Add blur while loading full version */
.member-image img.loading-full {
  filter: blur(5px);
}

/* Remove blur when full version is loaded */
.member-image img.loaded:not(.loading-full) {
  filter: blur(0);
}

/* Loading animation */
.member-image::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(0, 86, 179, 0.1),
    transparent
  );
  animation: loading 1.5s infinite;
  contain: paint;
}

@keyframes loading {
  0% {
    left: -100%;
  }
  100% {
    left: 200%;
  }
}

/* Hide loading animation when image is loaded */
.member-image.loaded::after {
  display: none;
}

.member-content {
  padding: 0 2rem;
}

.member-content strong,
.member-content b {
  font-weight: 700;
  color: #2b2b2b;
}

.member-content h2 {
  font-size: 2rem;
  color: #4c6ef5;
  margin: 0 0 0.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  transition: color 0.3s ease;
}

/* Removed hover effect and transitions to prevent blurriness */
.member-content h2 {
  transition: none;
}

.member-content h2:hover {
  /* Disable any hover effects */
  color: inherit;
  filter: none;
  transform: none;
}

/* Responsive breakpoints */
@media screen and (max-width: 1700px) {
  .team-grid {
    grid-template-columns: repeat(3, 400px);
  }
}

@media screen and (max-width: 1300px) {
  .team-grid {
    grid-template-columns: repeat(2, 400px);
  }
}

@media screen and (max-width: 900px) {
  .team-grid {
    grid-template-columns: 400px;
  }
}

@media screen and (max-width: 500px) {
  .team-grid {
    grid-template-columns: 1fr;
  }
  
  .team-member,
  .member-image {
    width: 100%;
  }
  
  .member-image {
    height: auto;
    padding-bottom: 0;
  }
  
  .member-image img {
    width: 100%;
    max-width: 250px;
    height: auto;
    aspect-ratio: 1/1;
  }
}

.member-content ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.member-content li {
  margin: 0.4rem 0;
  font-size: 1.3rem;
  color: #666;
  line-height: 1.4;
}

.member-content p {
  margin: 0.4rem 0;
  font-size: 1.3rem;
  color: #666;
  line-height: 1.4;
}

.member-content a {
  color: #4c6ef5;
  text-decoration: none;
  transition: color 0.3s ease;
}

.member-content a:hover {
  color: #364fc7;
  text-decoration: none;
}

.member-cv {
  margin-top: 2rem;
  text-align: center;
}

.cv-button {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  background: #4c6ef5;
  color: white !important;
  border-radius: 4px;
  font-weight: 500;
  font-size: 1.2rem;
  text-decoration: none !important;
  transition: all 0.3s ease;
}

.cv-button:hover {
  background: #364fc7;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(76, 110, 245, 0.15);
}

/* Research Section
--------------------------------------------- */
.s-research {
    padding: 12rem 0 8rem;
    background-color: white;
    color: var(--color-text);
}

.s-research .row {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.s-research .column {
    width: 100%;
}

.research-content {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    padding: 4rem;
    border-radius: 10px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.research-content h1 {
    font-size: 3.6rem;
    margin-bottom: 4rem;
    color: #2b2b2b;
    text-align: center;
}

.research-content h2 {
    font-size: 2.8rem;
    margin: 4rem 0 2rem;
    color: #4c6ef5;
    border-bottom: 2px solid rgba(76, 110, 245, 0.2);
    padding-bottom: 1rem;
}

.research-content h3 {
    font-size: 1.8rem;
    margin: 2rem 0 1rem;
    color: #2b2b2b;
    font-weight: 500;
}

.research-content h4 {
    font-size: 1.6rem;
    margin: 2rem 0 1rem;
    color: #4c6ef5;
    font-weight: 600;
    font-style: italic;
}

.research-content ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.research-content ul li {
    margin-bottom: 1rem;
    font-size: 1.5rem;
    line-height: 1.6;
}

.research-content h4 + ul {
    margin-left: 2rem;
    border-left: 3px solid rgba(76, 110, 245, 0.2);
    padding-left: 1rem;
}

.research-content h4 + ul li {
    color: #666;
}

.research-content ul li p {
    margin: 0.5rem 0;
}

.research-content ul li:first-child p {
    margin-top: 0;
}

.research-content img {
    margin-right: 0.5rem;
    vertical-align: middle;
}

.research-content a {
    color: #4c6ef5;
    text-decoration: none;
    transition: color 0.3s ease;
}

.research-content a:hover {
    color: #364fc7;
    text-decoration: none;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .s-research {
        padding: 10rem 0 6rem;
    }

    .research-content {
        padding: 2rem;
    }

    .research-content h1 {
        font-size: 3rem;
    }

    .research-content h2 {
        font-size: 2.4rem;
    }

    .research-content h3 {
        font-size: 1.6rem;
    }

    .research-content h4 {
        font-size: 1.5rem;
    }

    .research-content ul li {
        font-size: 1.4rem;
    }
}

/* Markdown Content Styles */
.markdown-content strong,
.markdown-content b {
    font-weight: 700;
    color: #2b2b2b;
}

.markdown-content em,
.markdown-content i {
    font-style: italic;
}

.markdown-content code {
    font-family: monospace;
    background: rgba(0, 0, 0, 0.05);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9em;
}

.markdown-content pre code {
    display: block;
    padding: 1rem;
    overflow-x: auto;
}

.markdown-content blockquote {
    border-left: 4px solid #4c6ef5;
    margin: 1.5rem 0;
    padding-left: 1rem;
    color: #666;
}

.markdown-content hr {
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    margin: 2rem 0;
}

/* Add to existing styles.css where other image rules exist */
.team-member img {
  width: 250px;
  height: 250px;
  object-fit: cover;
  transform: translateZ(0);
  will-change: transform;
}

@media screen and (max-width: 768px) {
  .team-member img {
    width: 100%;
    height: auto;
  }
}

.team-section {
  margin-bottom: 4rem;
  width: 100%;
  max-width: 1600px;
  margin-left: auto;
  margin-right: auto;
}

.team-section h1 {
  font-size: 2.4rem;
  margin-bottom: 2rem;
  color: var(--color-1);
  text-align: center;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(4, 400px);
  gap: 2rem;
  margin-bottom: 2rem;
  justify-content: center;
}

.team-member {
  width: 400px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 10px;
  padding: 2rem;
  text-align: justify;
  transition: transform 0.3s ease;
}

.team-member:hover {
  transform: translateY(-5px);
}

/* Responsive breakpoints for team grid */
@media screen and (max-width: 1700px) {
  .team-grid {
    grid-template-columns: repeat(3, 400px);
  }
}

@media screen and (max-width: 1300px) {
  .team-grid {
    grid-template-columns: repeat(2, 400px);
  }
}

@media screen and (max-width: 900px) {
  .team-grid {
    grid-template-columns: repeat(1, 400px);
  }
}

@media screen and (max-width: 500px) {
  .team-grid {
    grid-template-columns: 1fr;
  }


  
  .team-member {
    width: 100%;
  }
}

/* Badge/Shield Styles */
.s-about__desc img[src*="img.shields.io"] {
  height: 24px;
  margin: 5px 8px;
  transform: scale(1.1);
  vertical-align: middle;
  transition: transform 0.3s ease;
}

.s-about__desc a {
  display: inline-block;
  padding: 2px;
  transition: transform 0.3s ease;
}

.s-about__desc a:hover {
  color: #364fc7;
  text-decoration: none;
  transform: translateY(-2px);
}

.s-about__desc a:hover img[src*="img.shields.io"] {
  transform: scale(1.15);
}

.s-about__desc strong,
.s-about__desc b {
  font-weight: 700;
  color: #4c6ef5;
  padding: 0.1em 0.2em;
  background: linear-gradient(120deg, rgba(76, 110, 245, 0.1) 0%, rgba(76, 110, 245, 0.05) 100%);
  border-radius: 3px;
  transition: all 0.3s ease;
}

.s-about__desc strong:hover,
.s-about__desc b:hover {
  background: linear-gradient(120deg, rgba(76, 110, 245, 0.15) 0%, rgba(76, 110, 245, 0.08) 100%);
}

/* Code block styling for contact info */
.s-about__desc code.copyable {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.95em;
  background: rgba(76, 110, 245, 0.05);
  padding: 0.4em 0.8em;
  border-radius: 4px;
  border: 1px solid rgba(76, 110, 245, 0.1);
  color: #4c6ef5;
  margin: 0;
  display: inline-block;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  user-select: all;
  text-decoration: none;
  pointer-events: auto;
}

.s-about__desc code.copyable:link,
.s-about__desc code.copyable:visited,
.s-about__desc code.copyable:hover,
.s-about__desc code.copyable:active {
  text-decoration: none;
  color: #4c6ef5;
}

.s-about__desc code.copyable::before {
  content: "Click to copy";
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  white-space: nowrap;
  pointer-events: none;
}

.s-about__desc code.copyable::after {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  border: 5px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.8);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
}

.s-about__desc code.copyable:hover::before,
.s-about__desc code.copyable:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.s-about__desc code.copyable.copied::before {
  content: "Copied!";
  background: #4c6ef5;
}

.s-about__desc code.copyable.copied::after {
  border-top-color: #4c6ef5;
}

.s-about__desc code.copyable:hover {
  background: rgba(76, 110, 245, 0.1);
  border-color: rgba(76, 110, 245, 0.2);
}

.s-about__desc code.copyable:active {
  background: rgba(76, 110, 245, 0.15);
  transform: scale(0.98);
}

/* Email wrapper styles */
.email-wrapper {
  margin: 1em 0;
}

.email-wrapper pre {
  margin: 0;
  padding: 0;
  background: none;
}

.email-wrapper code.copyable {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.95em;
  background: rgba(76, 110, 245, 0.05);
  padding: 0.4em 0.8em;
  border-radius: 4px;
  border: 1px solid rgba(76, 110, 245, 0.1);
  color: #4c6ef5;
  display: inline-block;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  user-select: all;
}

.email-wrapper code.copyable::before {
  content: "Click to copy";
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  white-space: nowrap;
  pointer-events: none;
}

.email-wrapper code.copyable::after {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  border: 5px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.8);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
}

.email-wrapper code.copyable:hover::before,
.email-wrapper code.copyable:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.email-wrapper code.copyable.copied::before {
  content: "Copied!";
  background: #4c6ef5;
}

.email-wrapper code.copyable.copied::after {
  border-top-color: #4c6ef5;
}

.email-wrapper code.copyable:hover {
  background: rgba(76, 110, 245, 0.1);
  border-color: rgba(76, 110, 245, 0.2);
}

.email-wrapper code.copyable:active {
  background: rgba(76, 110, 245, 0.15);
  transform: scale(0.98);
}

/* Email container styles */
.email-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(76, 110, 245, 0.05);
    border: 1px solid rgba(76, 110, 245, 0.1);
    border-radius: 6px;
    padding: 0.8em 1em;
    margin: 1em 0;
    transition: all 0.3s ease;
}

.email-container:hover {
    background: rgba(76, 110, 245, 0.08);
    border-color: rgba(76, 110, 245, 0.2);
}

.email-text {
    font-family: 'Consolas', 'Monaco', monospace;
    color: #4c6ef5;
    font-size: 0.95em;
    user-select: all;
}

.copy-btn {
    background: transparent;
    border: none;
    color: #4c6ef5;
    cursor: pointer;
    padding: 0.6em;
    border-radius: 4px;
    transition: all 0.2s ease;
    opacity: 0.7;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
}

.copy-btn:hover {
    opacity: 1;
    background: rgba(76, 110, 245, 0.1);
}

.copy-btn:active {
    transform: scale(0.95);
}

.copy-btn.copied {
    background: #4c6ef5;
    color: white;
    opacity: 1;
}

.copy-btn i {
    pointer-events: none;
}

/* Footer Styles */
.site-footer {
    background-color: #333;
    color: white;
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    bottom: 0;
    width: 100%;
}

.footer-left, .footer-center, .footer-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.footer-left {
    flex: 0 1 auto;
}

.footer-center {
    flex-direction: column;
    text-align: center;
    justify-content: center;
    align-items: center;
    flex: 0 1 auto;
    margin: 0 2rem;
}

.footer-right {
    flex: 0 1 auto;
    justify-content: flex-end;
    margin-right: 0;
    gap: 2rem;
    padding-right: 0;
}

.footer-right a:last-child {
    margin-right: -15px;
}

.copyright-text {
    font-size: 1em;
    margin: 0;
    opacity: 0.9;
    line-height: 1.5;
    white-space: nowrap;
}

.edit-link {
    color: white !important;
    text-decoration: none;
    font-size: 0.9em;
    padding: 0.5em 1em;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
}

.edit-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

/* Specific dark theme override to ensure white text on edit links */
[data-theme="dark"] .edit-link,
[data-theme="dark"] .edit-link:visited,
[data-theme="dark"] .edit-link:link {
    color: white !important;
}

.edit-link i {
    font-size: 1.25em;
}

.footer-logo {
    height: 55px;
    width: auto;
    filter: brightness(0) invert(1);
    transition: opacity 0.3s ease;
}

.pof-logo {
    height: 60px;
}

.footer-logo:hover {
    opacity: 0.8;
}

.footer-left a, .footer-right a {
    transition: transform 0.3s ease, opacity 0.3s ease;
    color: white;
}

.footer-left a:hover, .footer-right a:hover {
    transform: translateY(-2px);
    opacity: 0.8;
}

/* Responsive footer adjustments */
@media screen and (max-width: 1200px) {
    .footer-logo {
        height: 45px;
    }
    
    .pof-logo {
        height: 50px;
    }
    
    .footer-left, .footer-right {
        gap: 1.5rem;
    }

    .footer-right {
        padding-right: 0px;
    }
}

@media screen and (max-width: 900px) {
    .footer-logo {
        height: 35px;
    }
    
    .pof-logo {
        height: 40px;
    }
    
    .footer-left, .footer-right {
        gap: 1rem;
    }
    
    .footer-right {
        padding-right: 0px;
    }
    
    .footer-right i {
        font-size: 2em !important;
    }
}

@media screen and (max-width: 768px) {
    .site-footer {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
        padding: 2rem 1rem;
    }
    
    .footer-left, .footer-center, .footer-right {
        justify-content: center;
        width: 100%;
        flex-wrap: wrap;
        margin: 0;
        padding-right: 0;
    }

    .footer-right a:last-child {
        margin-right: 0;
    }
    
    .footer-logo {
        height: 30px;
    }
    
    .pof-logo {
        height: 35px;
    }
    
    .footer-center {
        order: -1;
    }
    
    .footer-right {
        gap: 1.5rem;
    }
    
    .footer-right i {
        font-size: 1.75em !important;
    }
    
    .edit-link {
        width: 100%;
        justify-content: center;
        margin-top: 1rem;
        color: white;
    }
}

/* Featured Section */
.s-featured {
    padding: 0 2rem;
    background: white;
    display: flex;
    align-items: flex-start;
}

.s-featured__content {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.s-featured__grid {
    display: flex;
    justify-content: center;
    width: 100%;
}

.s-featured__left {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.s-featured__header {
    text-align: center;
    margin-bottom: 4rem;
}

.s-featured__header .text-pretitle {
    font-size: 3.6rem;
    color: #4c6ef5;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
}

.s-featured__header .text-display-title {
    font-size: 3.6rem;
    color: #2b2b2b;
    margin: 0;
    font-weight: 700;
}

.featured-papers {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    overflow-x: auto;
    padding: 1rem 0;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

/* Hide scrollbar but keep functionality */
.featured-papers::-webkit-scrollbar {
    display: none;
}

.featured-papers {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.featured-paper {
    flex: 0 0 auto;
    width: calc(50% - 1rem);
    min-width: 600px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 2rem;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    scroll-snap-align: start;
}

.featured-paper:hover {
    transform: translateY(-5px);
}

.featured-paper h3 {
    font-size: 2rem;
    margin: 0 0 1rem;
    color: #4c6ef5;
}

/* Style tags */
.featured-paper tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.featured-paper tags span {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background: rgba(76, 110, 245, 0.1);
    color: #4c6ef5;
    border-radius: 4px;
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.featured-paper tags span:hover {
    background: rgba(76, 110, 245, 0.2);
    transform: translateY(-2px);
}

.featured-paper iframe {
    width: 100%;
    border-radius: 8px;
    margin: 1rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Hide year headers */
.featured-paper h2 {
    display: none;
}

@media screen and (max-width: 1200px) {
    .featured-paper {
        width: calc(100% - 1rem);
        min-width: 500px;
    }
}

@media screen and (max-width: 768px) {
    .featured-paper {
        min-width: 400px;
    }
    
    .featured-papers {
        gap: 1.5rem;
    }
}

/* Join Us Section Styles */
.s-join {
  padding: 12rem 0 8rem;
  background-color: var(--color-background);
}

.join-content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 4rem;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  border-radius: 10px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .join-content {
  background: rgba(30, 30, 30, 0.4);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.join-content h1 {
  font-size: 3.6rem;
  margin-bottom: 4rem;
  color: #2b2b2b;
  text-align: center;
}

[data-theme="dark"] .join-content h1 {
  color: #ffffff;
}

.position-section {
  margin-bottom: 4rem;
}

.position-section h2 {
  font-size: 2.4rem;
  color: #4c6ef5;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(76, 110, 245, 0.2);
}

[data-theme="dark"] .position-section h2 {
  color: #6fa1ff;
  border-bottom: 2px solid rgba(111, 161, 255, 0.3);
}

.position-section h3 {
  font-size: 1.8rem;
  color: #2b2b2b;
  margin-bottom: 0.5rem;
}

[data-theme="dark"] .position-section h3 {
  color: #e0e0e0;
}

.position-section p {
  font-size: 1.6rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.position-section ul {
  list-style-type: disc;
  margin-left: 2rem;
  margin-bottom: 2rem;
}

.position-section li {
  font-size: 1.6rem;
  margin-bottom: 0.8rem;
}

.application-info {
  background: rgba(76, 110, 245, 0.05);
  padding: 2rem;
  border-radius: 8px;
  margin-top: 2rem;
}

[data-theme="dark"] .application-info {
  background: rgba(76, 110, 245, 0.15);
}

.external-links a {
  color: #4c6ef5;
  text-decoration: none;
  transition: color 0.3s ease;
}

[data-theme="dark"] .external-links a {
  color: #6fa1ff;
}

.external-links a:hover {
  color: #364fc7;
  text-decoration: none;
}

[data-theme="dark"] .external-links a:hover {
  color: #9cbeff;
  text-decoration: none;
}

.project-list li {
  margin-bottom: 2rem;
}

.project-list h3 {
  color: #4c6ef5;
  margin-bottom: 0.5rem;
}

.funding-info {
  background: rgba(76, 110, 245, 0.05);
  padding: 2rem;
  border-radius: 8px;
  margin-top: 4rem;
}

@media screen and (max-width: 768px) {
  .s-join {
    padding: 10rem 0 6rem;
  }

  .join-content {
    padding: 2rem;
  }

  .join-content h1 {
    font-size: 3rem;
  }

  .position-section h2 {
    font-size: 2.2rem;
  }

  .position-section h3 {
    font-size: 1.6rem;
  }
}

/* Ensure consistent height and alignment for all header items including icons */
.s-header__nav-list li[style="background: none;"] {
  display: flex;
  align-items: center;
  height: 100%;
}

.s-header__nav-list li[style="background: none;"] a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  width: 40px;
}

/* Ensure the Bluesky icon is centered */
.s-header__nav-list .fa-bluesky {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Ensure all nav links have consistent height */
.s-header__nav-list a {
  color: #1a1a1a;
  text-decoration: none;
  font-size: 1.6rem;
  transition: all 0.3s ease;
  padding: 0.8rem 1.6rem;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  height: 40px;
}

/* Explicitly set link and visited link colors for better browser compatibility */
[data-theme="dark"] a {
  color: var(--color-link) !important; /* Force color for all links in dark mode */
}

[data-theme="dark"] a:visited {
  color: var(--color-link) !important; /* Use the same variable for consistency */
}

/* Fix for external links that might be using #00E */
[data-theme="dark"] a[href^="http"],
[data-theme="dark"] a[href^="https"] {
  color: var(--color-link) !important; /* Ensure external links use the correct color */
}