﻿.post-card .post-tags--pipe {
  justify-content: flex-start;
}

:root {
  --site-font-family: 'Roboto', system-ui, -apple-system, sans-serif;
}

body[data-site-font="ubuntu"] {
  --site-font-family: 'Ubuntu', system-ui, -apple-system, sans-serif;
}

body[data-site-font="times"] {
  --site-font-family: 'Times New Roman', Times, serif;
}

:root {
  /* Colors - Light Theme */
  --bg-color: #fdfdfd;
  --text-color: #1a1a1a;
  --heading-color: #000000;
  --accent-color: #2563eb;
  /* Royal Blue */
  --accent-hover: #1e40af;
  --secondary-text: #525252;
  --border-color: #e5e5e5;
  --card-bg: #ffffff;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --nav-bg: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] {
  /* Colors - Dark Theme */
  --bg-color: #0f172a;
  /* Slate 900 */
  --text-color: #e2e8f0;
  /* Slate 200 */
  --heading-color: #f8fafc;
  /* Slate 50 */
  --accent-color: #38bdf8;
  /* Sky 400 */
  --accent-hover: #0ea5e9;
  --secondary-text: #94a3b8;
  --border-color: #1e293b;
  --card-bg: #1e293b;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5);
  --nav-bg: rgba(15, 23, 42, 0.8);
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--site-font-family);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.7;
  transition: background-color 0.3s ease, color 0.3s ease;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--site-font-family);
  color: var(--heading-color);
  margin-bottom: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
  margin-top: 2rem;
}

h3 {
  font-size: 1.5rem;
  margin-top: 1.5rem;
}

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

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

img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.wrapper {
  max-width: 1000px;
  /* Generous width */
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  padding: 0;
  border-bottom: 1px solid var(--border-color);
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0.375% 20px 0.375% 20px;
  gap: 20px;
}

.site-title {
  font-family: var(--site-font-family);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--heading-color);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.site-title:hover {
  text-decoration: none;
}

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

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 25px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1002;
}

.menu-toggle span {
  width: 30px;
  height: 3px;
  background: var(--text-color);
  border-radius: 10px;
  transition: all 0.3s linear;
  position: relative;
  transform-origin: 1px;
}

.menu-wrapper {
  display: flex;
  align-items: center;
  height: auto;
  width: auto;
  max-width: none;
}

.menu {
  display: flex;
  list-style: none;
  gap: 18px;
}

.page-link {
  color: var(--secondary-text);
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  padding: 6px 2px;
}

.page-link:hover {
  color: var(--accent-color);
  text-decoration: none;
}

.page-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  height: 2px;
  width: 0;
  background: var(--accent-color);
  transition: width 0.2s ease;
}

.page-link:hover::after,
.page-link:focus-visible::after {
  width: 100%;
}

/* Theme Toggle */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-color);
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  border: 1px solid transparent;
  transition: background-color 0.2s, border-color 0.2s;
}

.theme-toggle:hover {
  background-color: var(--border-color);
  border-color: var(--border-color);
}

[data-theme="dark"] .icon-sun {
  display: block;
}

[data-theme="dark"] .icon-moon {
  display: none;
}

[data-theme="light"] .icon-sun {
  display: none;
}

[data-theme="light"] .icon-moon {
  display: block;
}

/* Main Content */
.page-content {
  padding: 60px 0;
  min-height: calc(100vh - 200px);
}

/* Component: Hero Section */
.hero {
  display: flex;
  align-items: center;
  gap: 40px;
  margin-bottom: 60px;
}

.hero-text {
  flex: 1;
}

.hero-image {
  flex: 0 0 300px;
}

.hero-image img {
  width: 100%;
  border-radius: 50%;
  /* Circle profile */
  box-shadow: var(--shadow-md);
  border: 4px solid var(--card-bg);
  /* Ring effect */
}

.subtitle {
  font-size: 1.25rem;
  color: var(--secondary-text);
  margin-bottom: 20px;
  font-weight: 300;
}

/* Component: Post List */
.post-list {
  list-style: none;
}

.post-list li {
  margin-bottom: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--border-color);
}

.post-meta {
  font-size: 0.9rem;
  color: var(--secondary-text);
  margin-bottom: 5px;
  display: block;
}

.post-link {
  font-size: 1.5rem;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  color: var(--heading-color);
  text-decoration: none;
}

.post-link:hover {
  color: var(--accent-color);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-color);
  padding: 0.75rem 0 0.5rem;
  font-size: 0.9rem;
  color: var(--secondary-text);
  background-color: var(--bg-color);
  /* Matches body */
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  margin-bottom: 0;
}

.footer-content--compact {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.125rem;
}

.footer-social {
  line-height: 1;
}

.footer-copy {
  font-size: 0.8rem;
  opacity: 0.8;
  margin: 0;
  line-height: 1.15;
}

.footer-version {
  font-size: 0.75rem;
  opacity: 0.6;
  line-height: 1.1;
  margin: 0;
}

.footer-col h4 {
  color: var(--heading-color);
  margin-bottom: 15px;
}

.social-media-list {
  list-style: none;
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero,
.page-content>div>* {
  animation: fadeIn 0.8s ease-out forwards;
}

/* Buttons */
.cta-buttons {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

.button {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}

.button.primary {
  background-color: var(--accent-color);
  color: #fff;
}

.button.primary:hover {
  background-color: var(--accent-hover);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.button.secondary {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-color);
}

.button.secondary:hover {
  background-color: var(--card-bg);
  /* Slight difference handled by hover/border */
  border-color: var(--text-color);
  text-decoration: none;
  color: var(--heading-color);
}

/* Homepage template CTA */
.template-bulb {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.template-bulb__toggle {
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #facc15, #f59e0b);
  color: #3b2f00;
  cursor: pointer;
  box-shadow: 0 16px 32px rgba(245, 158, 11, 0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.template-bulb__toggle:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 20px 36px rgba(245, 158, 11, 0.34);
}

.template-bulb__toggle:focus-visible,
.template-bulb__close:focus-visible,
.template-bulb__link:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 3px;
}

.template-bulb__panel {
  width: min(320px, calc(100vw - 32px));
  padding: 18px 18px 16px;
  border-radius: 18px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  box-shadow: 0 22px 50px rgba(15, 23, 42, 0.18);
  position: relative;
}

.template-bulb__panel::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: -10px;
  width: 20px;
  height: 20px;
  background: var(--card-bg);
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  transform: rotate(45deg);
}

.template-bulb__panel p {
  margin: 0 28px 14px 0;
  color: var(--text-color);
  font-size: 0.98rem;
  line-height: 1.5;
}

.template-bulb__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--secondary-text);
  cursor: pointer;
}

.template-bulb__close:hover {
  background: var(--border-color);
  color: var(--heading-color);
}

.template-bulb__link {
  width: 100%;
  text-align: center;
}

[data-theme="dark"] .template-bulb__panel {
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.45);
}

@media (max-width: 640px) {
  .template-bulb {
    right: 14px;
    bottom: 14px;
  }

  .template-bulb__toggle {
    width: 54px;
    height: 54px;
  }

  .template-bulb__panel {
    width: min(290px, calc(100vw - 24px));
    padding: 16px 16px 14px;
  }
}

/* Grid Cards */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
  margin-bottom: 40px;
}

.card {
  background: var(--card-bg);
  padding: 25px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-color);
}

.card h3 {
  font-size: 1.25rem;
  margin-top: 0;
  margin-bottom: 10px;
}

.card p {
  color: var(--secondary-text);
  font-size: 0.95rem;
}

/* About Page Styling */
.about-hero {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 40px;
  margin-bottom: 50px;
  padding: 30px 0;
  align-items: center;
}

.about-image img {
  width: 100%;
  max-width: 300px;
  height: 300px;
  object-fit: cover;
  border-radius: 15px;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease;
}

.about-image img:hover {
  transform: scale(1.05);
}

.about-intro h2 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  color: var(--heading-color);
}

.title-subtitle {
  font-size: 1.25rem;
  color: var(--accent-color);
  font-weight: 600;
  margin-bottom: 20px;
}

.bio {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text-color);
}

.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  margin-bottom: 40px;
}

.research-item {
  background: var(--card-bg);
  padding: 25px;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

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

.research-item h3 {
  color: var(--accent-color);
  font-size: 1.2rem;
  margin-bottom: 12px;
}

/* About Page Sections */
.page h2 {
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 10px;
  margin: 40px 0 25px 0;
  font-size: 1.8rem;
}

.page ul {
  margin-bottom: 30px;
}

.page ul li {
  margin-bottom: 15px;
  line-height: 1.6;
}

.page strong {
  color: var(--heading-color);
}

/* Professional sections styling */
.page ul li ul {
  margin-top: 8px;
  margin-bottom: 0;
}

.page ul li ul li {
  margin-bottom: 5px;
  font-size: 0.95rem;
  color: var(--secondary-text);
}

/* Contact section styling */
.page hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 40px 0 20px 0;
}

.page p em {
  color: var(--secondary-text);
  font-size: 0.9rem;
}

/* Software Grid (About page tools) */
.software-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 15px;
  margin-bottom: 30px;
}

.software-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: all 0.2s ease;
}

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

.software-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 0 !important;
}

.software-name {
  font-size: 0.9rem;
  font-weight: 500;
}

/* Timeline Items (Education / Experience) */
.timeline-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--border-color);
}

.timeline-item:last-child {
  border-bottom: none;
}

.timeline-item h3 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 1.2rem;
}

.timeline-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}

/* Publication Card Styles */
.publications-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.publication-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 25px;
  transition: all 0.3s ease;
  position: relative;
}

.publication-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent-color);
}

.pub-type-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent-color);
}

.pub-title {
  font-size: 1.2rem;
  margin-top: 0 !important;
  margin-bottom: 8px;
  line-height: 1.4;
}

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

.pub-journal {
  font-size: 0.9rem;
  color: var(--accent-color);
  font-style: italic;
  margin-bottom: 10px;
}

.pub-abstract {
  font-size: 0.9rem;
  line-height: 1.6;
  padding: 15px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 8px;
  margin: 10px 0;
}

[data-theme="dark"] .pub-abstract {
  background: rgba(255, 255, 255, 0.03);
}

.pub-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.doi-link {
  font-size: 0.85rem;
  color: var(--secondary-text);
  word-break: break-all;
}

.pub-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.small-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s ease;
  text-decoration: none;
}

.small-btn.primary {
  background: var(--accent-color);
  color: #fff;
}

.small-btn.primary:hover {
  background: var(--accent-hover);
  text-decoration: none;
  color: #fff;
}

.small-btn.secondary {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-color);
}

.small-btn.secondary:hover {
  background: var(--card-bg);
  border-color: var(--accent-color);
}

.small-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--border-color);
  color: var(--secondary-text);
}

/* Tag Pills */
.tag-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent-color);
  text-decoration: none;
  transition: all 0.2s ease;
  margin: 2px;
}

.tag-pill:hover {
  background: var(--accent-color);
  color: #fff;
  text-decoration: none;
}

.tag-pill.transparent {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* Post Tags Container */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Post Layout */
.post-header {
  margin-bottom: 30px;
  text-align: center;
}

.post-header.hero-header {
  position: relative;
  padding: 80px 20px;
  background-size: cover;
  background-position: center;
  border-radius: 12px;
  margin-bottom: 40px;
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.7));
}

.hero-content {
  position: relative;
  z-index: 1;
  color: #fff;
}

.hero-content .post-title {
  color: #fff;
}

.hero-content .post-meta {
  color: rgba(255, 255, 255, 0.8);
}

.post-title {
  font-size: 2.2rem;
  margin-bottom: 10px;
}

.post-subtitle {
  font-size: 1.2rem;
  color: var(--secondary-text);
  font-weight: 300;
}

.post-tags--pipe {
  justify-content: center;
  gap: 8px;
}

.post-tag-link {
  color: var(--secondary-text);
  font-weight: 500;
  text-decoration: none;
}

.post-tag-link:hover {
  color: var(--heading-color);
  text-decoration: none;
}

.post-tag-link:not(:last-child)::after {
  content: " | ";
  color: var(--secondary-text);
  margin: 0 6px;
}

.post-content {
  line-height: 1.8;
  font-size: 1.05rem;
}

.post-content img {
  margin: 20px 0;
}

/* Related Posts */
.related-posts {
  margin-top: 50px;
  padding-top: 30px;
  border-top: 2px solid var(--border-color);
}

.related-posts-list {
  list-style: none;
}

.related-posts-list li {
  margin-bottom: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.related-posts-list li small {
  display: block;
  color: var(--secondary-text);
  font-size: 0.85rem;
}

/* Footer Enhancements */
.footer-content:not(.footer-content--compact) {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.footer-col h4 {
  font-size: 1.1rem;
  margin-bottom: 15px;
  color: var(--heading-color);
  font-weight: 600;
}

.footer-col p {
  color: var(--secondary-text);
  font-size: 0.95rem;
  line-height: 1.6;
}

.footer-links {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 25px;
  margin: 0;
  justify-content: center;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-links a {
  color: var(--secondary-text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}

.footer-links a:hover {
  color: var(--accent-color);
}

/* Social Links Icons */
.social-links-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin: 0;
}

.social-links-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background-color: transparent;
  border: 1.5px solid var(--border-color);
  color: var(--secondary-text);
  font-size: 1rem;
  transition: all 0.3s ease;
  text-decoration: none;
}

.social-links-icons i {
  font-size: 1.2rem !important;
}

/* Force FontAwesome icon sizes in footer */
.footer-social .fas,
.footer-social .fab,
.footer-social .fa-brands {
  font-size: 1.2rem !important;
}

.footer-social a {
  font-size: 1.2rem !important;
}

.social-links-icons a:hover {
  background-color: var(--accent-color);
  color: #fff;
  border-color: var(--accent-color);
  transform: translateY(-5px) scale(1.1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   RESPONSIVE DESIGN - Comprehensive breakpoints
   ========================================================================== */

/* ---- Ultra-Wide Screens (2560px+) ---- */
@media (min-width: 2560px) {
  .wrapper {
    max-width: 1400px;
    padding: 0 60px;
  }
  
  .header-inner {
    max-width: 1400px;
    padding: 1.375% 60px 1.375% 60px;
  }
  
  h1 {
    font-size: 3.5rem;
  }
  
  h2 {
    font-size: 2.8rem;
  }
  
  .hero {
    gap: 60px;
    margin-bottom: 80px;
  }
  
  .hero-image {
    flex: 0 0 400px;
  }
  
  .page-content {
    padding: 80px 0;
  }
}

/* ---- Large Ultra-Wide (1920px+) ---- */
@media (min-width: 1920px) {
  .wrapper {
    max-width: 1200px;
    padding: 0 40px;
  }
  
  .header-inner {
    max-width: 1200px;
    padding: 1.375% 40px 1.375% 40px;
  }
  
  h1 {
    font-size: 3rem;
  }
  
  h2 {
    font-size: 2.4rem;
  }
  
  .hero {
    gap: 50px;
    margin-bottom: 70px;
  }
  
  .hero-image {
    flex: 0 0 350px;
  }
}

/* ---- Wide Desktop (1440px+) ---- */
@media (min-width: 1440px) {
  .wrapper {
    max-width: 1200px;
    padding: 0 30px;
  }
  
  .header-inner {
    max-width: 1200px;
    padding: 1.375% 30px 1.375% 30px;
  }
  
  .grid-cards {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  }
  
  .research-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  }
}

/* ---- Large Desktop (1200px+) ---- */
/* Default styles already handle this well, but enhanced below */
@media (min-width: 1200px) {
  /* Enhanced large screen optimizations */
  .about-hero {
    grid-template-columns: 1fr 3fr;
    gap: 50px;
  }
  
  .footer-content {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 50px;
  }
}

/* ---- Medium Desktop / Tablet Landscape (1024px) ---- */
@media (max-width: 1024px) {
  .wrapper {
    max-width: 100%;
    padding: 0 30px;
  }

  .header-inner {
    max-width: 100%;
    padding: 0 30px;
  }

  .hero {
    gap: 30px;
  }

  .hero-image {
    flex: 0 0 250px;
  }

  .about-hero {
    gap: 30px;
  }

  .social-links-icons a {
    width: 80px;
    height: 80px;
  }

  .social-links-icons i {
    font-size: 3rem !important;
  }
}

/* ---- Tablet Portrait (768px) ---- */
@media (max-width: 768px) {

  /* Typography */
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.6rem;
  }

  h3 {
    font-size: 1.3rem;
  }

  .wrapper {
    padding: 0 20px;
  }

  /* Header - Mobile Menu */
  .menu-toggle {
    display: flex;
  }

  .site-title {
    font-size: 1.1rem;
  }

  .menu-wrapper {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    height: 100dvh;
    width: 100%;
    max-width: 300px;
    background: var(--card-bg);
    padding: 80px 25px 25px;
    flex-direction: column;
    transition: right 0.3s ease-in-out;
    box-shadow: -2px 0 15px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    overflow-y: auto;
  }

  .menu-wrapper.is-active {
    right: 0;
  }

  .menu {
    flex-direction: column;
    width: 100%;
    gap: 0;
    align-items: flex-start;
  }

  .menu li {
    width: 100%;
    border-bottom: 1px solid var(--border-color);
    padding: 12px 0;
  }

  .menu li:last-child {
    border-bottom: none;
  }

  .page-link {
    font-size: 1.15rem;
    display: block;
    width: 100%;
    padding: 5px 0;
  }

  /* Hamburger Animation */
  .menu-toggle.is-active span:first-child {
    transform: rotate(45deg);
  }

  .menu-toggle.is-active span:nth-child(2) {
    opacity: 0;
    transform: translateX(20px);
  }

  .menu-toggle.is-active span:nth-child(3) {
    transform: rotate(-45deg);
  }

  /* Overlay */
  .menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
  }

  .menu-overlay.is-active {
    opacity: 1;
    visibility: visible;
  }

  /* Main Content */
  .page-content {
    padding: 40px 0;
  }

  /* Hero - Column layout on tablet */
  .hero {
    flex-direction: column-reverse;
    text-align: center;
    gap: 25px;
    margin-bottom: 40px;
  }

  .hero-image {
    flex: 0 0 auto;
    width: 200px;
    margin: 0 auto;
  }

  .hero-text .page-heading {
    font-size: 2rem;
  }

  .cta-buttons {
    justify-content: center;
    flex-wrap: wrap;
  }

  /* About Page */
  .about-hero {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 25px;
  }

  .about-image {
    display: flex;
    justify-content: center;
  }

  .about-image img {
    max-width: 220px;
    height: 220px;
  }

  .about-intro h2 {
    font-size: 2rem;
  }

  .bio {
    font-size: 1rem;
  }

  /* Grid / Cards */
  .grid-cards {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .research-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  /* Software Grid */
  .software-grid {
    gap: 12px;
    justify-content: center;
  }

  /* Timeline */
  .timeline-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  /* Publications */
  .pub-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .pub-actions {
    width: 100%;
  }

  .pub-title {
    font-size: 1.1rem;
  }

  /* Blog Grid */
  .blog-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  /* Post */
  .post-title {
    font-size: 1.8rem;
  }

  .post-header.hero-header {
    padding: 50px 15px;
  }

  .post-content {
    font-size: 1rem;
  }

  /* Footer */
  .footer-content:not(.footer-content--compact) {
    text-align: center;
  }

  .footer-content:not(.footer-content--compact) .social-links-icons {
    gap: 15px;
  }

  .footer-content:not(.footer-content--compact) .social-links-icons a {
    width: 65px;
    height: 65px;
    font-size: 1.8rem;
  }

  .footer-content:not(.footer-content--compact) .social-links-icons i {
    font-size: 2.5rem !important;
  }

  .footer-content:not(.footer-content--compact) .footer-social .fas,
  .footer-content:not(.footer-content--compact) .footer-social .fab,
  .footer-content:not(.footer-content--compact) .footer-social .fa-brands {
    font-size: 2.5rem !important;
  }

  .footer-content:not(.footer-content--compact) .footer-social a {
    font-size: 2.5rem !important;
  }

  .site-footer {
    padding: 30px 0;
  }

  /* Contact grid on About page */
  .about-section .research-grid {
    grid-template-columns: 1fr !important;
  }

  /* Page sections */
  .page h2 {
    font-size: 1.5rem;
    margin: 30px 0 20px 0;
  }

  /* Latest News section */
  .post-list li h3 {
    font-size: 1.1rem;
  }

  .post-link {
    font-size: 1.2rem;
  }

  .subtitle {
    font-size: 1.05rem;
  }
}

/* ---- Small Tablet / Large Phone (600px) ---- */
@media (max-width: 600px) {
  .wrapper {
    padding: 0 16px;
  }

  .header-inner {
    padding: 1.25% 16px 1.25% 16px;
  }

  .site-header {
    padding: 0;
  }

  .site-title {
    font-size: 0.95rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.2rem;
  }

  .hero-text .page-heading {
    font-size: 1.75rem;
  }

  .hero {
    margin-bottom: 30px;
  }

  .hero-image {
    width: 180px;
  }

  .button {
    padding: 8px 16px;
    font-size: 0.9rem;
  }

  .card {
    padding: 20px;
  }

  .research-item {
    padding: 20px;
  }

  .publication-card {
    padding: 20px;
  }

  .social-links-icons a {
    width: 55px;
    height: 55px;
  }

  .social-links-icons i {
    font-size: 2rem !important;
  }

  .footer-social .fas,
  .footer-social .fab,
  .footer-social .fa-brands {
    font-size: 2rem !important;
  }

  .footer-social a {
    font-size: 2rem !important;
  }
}

/* ---- Mobile (480px) ---- */
@media (max-width: 480px) {
  body {
    font-size: 15px;
  }

  .wrapper {
    padding: 0 14px;
  }

  .header-inner {
    padding: 0 14px;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.3rem;
  }

  h3 {
    font-size: 1.15rem;
  }

  .site-title {
    font-size: 1.1rem;
  }

  .page-content {
    padding: 25px 0;
  }

  /* Hero */
  .hero {
    gap: 20px;
    margin-bottom: 25px;
  }

  .hero-image {
    width: 160px;
  }

  .hero-text .page-heading {
    font-size: 1.5rem;
  }

  .subtitle {
    font-size: 0.95rem;
    margin-bottom: 15px;
  }

  .cta-buttons {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .button {
    text-align: center;
    padding: 10px 16px;
  }

  /* About page */
  .about-hero {
    gap: 20px;
    padding: 15px 0;
    margin-bottom: 30px;
  }

  .about-image img {
    max-width: 180px;
    height: 180px;
  }

  .about-intro h2 {
    font-size: 1.6rem;
  }

  .title-subtitle {
    font-size: 1.05rem;
  }

  .bio {
    font-size: 0.95rem;
  }

  /* Cards & Grid */
  .card {
    padding: 16px;
    border-radius: 10px;
  }

  .card h3 {
    font-size: 1.1rem;
  }

  .research-item {
    padding: 16px;
    border-radius: 10px;
  }

  /* Publications */
  .publication-card {
    padding: 16px;
    border-radius: 10px;
  }

  .pub-title {
    font-size: 1rem;
  }

  .pub-abstract {
    padding: 10px;
    font-size: 0.85rem;
  }

  .small-btn {
    padding: 4px 10px;
    font-size: 0.75rem;
  }

  .doi-link {
    font-size: 0.75rem;
  }

  /* Blog */
  .blog-header h1 {
    font-size: 1.5rem;
  }

  /* Post */
  .post-title {
    font-size: 1.5rem;
  }

  .post-subtitle {
    font-size: 1rem;
  }

  .post-header.hero-header {
    padding: 40px 12px;
    border-radius: 8px;
  }

  .post-content {
    font-size: 0.95rem;
    line-height: 1.7;
  }

  /* Software grid */
  .software-grid {
    gap: 8px;
  }

  .software-item {
    padding: 6px 12px;
    font-size: 0.85rem;
  }

  /* Timeline */
  .timeline-item h3 {
    font-size: 1.05rem;
  }

  /* Footer */
  .footer-content:not(.footer-content--compact) .social-links-icons {
    gap: 10px;
  }

  .footer-content:not(.footer-content--compact) .social-links-icons a {
    width: 50px;
    height: 50px;
  }

  .footer-content:not(.footer-content--compact) .social-links-icons i {
    font-size: 1.5rem !important;
  }

  .footer-content:not(.footer-content--compact) .footer-social .fas,
  .footer-content:not(.footer-content--compact) .footer-social .fab,
  .footer-content:not(.footer-content--compact) .footer-social .fa-brands {
    font-size: 1.5rem !important;
  }

  .footer-content:not(.footer-content--compact) .footer-social a {
    font-size: 1.5rem !important;
  }

  .site-footer {
    padding: 20px 0;
  }

  .footer-links {
    gap: 15px;
    flex-direction: column;
  }

  /* Page section headings */
  .page h2 {
    font-size: 1.3rem;
    margin: 25px 0 15px 0;
  }

  .post-list li {
    margin-bottom: 20px;
    padding-bottom: 20px;
  }

  .post-link {
    font-size: 1.1rem;
  }

  .post-meta {
    font-size: 0.8rem;
  }

  /* Aura decoration: hide on mobile */
  .aura-strip {
    display: none !important;
  }
}

/* ---- Very Small Mobile (360px and below) ---- */
@media (max-width: 360px) {
  body {
    font-size: 14px;
  }

  .wrapper {
    padding: 0 12px;
  }

  .header-inner {
    padding: 0 12px;
  }

  .site-title {
    font-size: 1rem;
  }

  h1 {
    font-size: 1.35rem;
  }

  .hero-image {
    width: 140px;
  }

  .about-image img {
    max-width: 150px;
    height: 150px;
  }

  .menu-wrapper {
    max-width: 260px;
  }

  .publication-card {
    padding: 12px;
  }

  .card {
    padding: 12px;
  }

  .social-links-icons a {
    width: 44px;
    height: 44px;
  }

  .social-links-icons i {
    font-size: 1.2rem !important;
  }

  .social-links-icons {
    gap: 8px;
  }
}

/* ---- Print Styles ---- */
@media print {

  .site-header,
  .site-footer,
  .menu-toggle,
  .menu-overlay,
  .theme-toggle,
  .cta-buttons,
  .aura-strip {
    display: none !important;
  }

  .page-content {
    padding: 0;
  }

  body {
    color: #000;
    background: #fff;
  }
}

/* ==========================================================================
   ADVANCED PERFORMANCE & ACCESSIBILITY OPTIMIZATIONS
   ========================================================================== */

/* Ensure images never overflow their containers */
img,
iframe,
video,
embed,
object {
  max-width: 100%;
  height: auto;
}

/* Modern aspect ratio support with fallback */
.hero-image img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.about-image img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

/* Prevent horizontal scrollbar */
html {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
  /* Enhanced text rendering */
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

/* Enhanced touch targets for accessibility */
a,
button,
.button,
.small-btn,
.theme-toggle {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.menu-toggle {
  min-height: 44px;
  min-width: 44px;
}

/* Improved focus indicators */
a:focus-visible,
button:focus-visible,
.button:focus-visible,
.small-btn:focus-visible,
.theme-toggle:focus-visible,
.menu-toggle:focus-visible {
  outline: 3px solid var(--accent-color);
  outline-offset: 2px;
  border-radius: 3px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border-color: #000000;
    --shadow-sm: none;
    --shadow-md: none;
  }
  
  [data-theme="dark"] {
    --border-color: #ffffff;
  }
  
  .card,
  .research-item,
  .publication-card {
    border-width: 2px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .hero,
  .page-content > div > * {
    animation: none;
  }
}

/* Modern fluid typography with clamp() */
h1 {
  font-size: clamp(1.75rem, 4vw + 1rem, 3.5rem);
}

h2 {
  font-size: clamp(1.5rem, 3vw + 1rem, 2.8rem);
}

h3 {
  font-size: clamp(1.25rem, 2vw + 1rem, 2rem);
}

.subtitle {
  font-size: clamp(1rem, 1.5vw + 0.5rem, 1.5rem);
}

/* Enhanced container queries preparation */
.wrapper {
  container-type: inline-size;
  container-name: main-container;
}

/* Modern responsive units */
.page-content {
  min-height: 100dvh; /* Use dynamic viewport height when supported */
  min-height: calc(100vh - 200px); /* Fallback */
}

/* ==========================================================================
   ENHANCED PRINT OPTIMIZATION
   ========================================================================== */
@media print {
  .site-header,
  .site-footer,
  .menu-toggle,
  .menu-overlay,
  .theme-toggle,
  .cta-buttons,
  .aura-strip,
  .social-links-icons {
    display: none !important;
  }

  .page-content {
    padding: 0;
  }

  body {
    color: #000 !important;
    background: #fff !important;
    font-size: 12pt;
    line-height: 1.5;
  }
  
  h1, h2, h3, h4, h5, h6 {
    color: #000 !important;
    page-break-after: avoid;
    orphans: 3;
    widows: 3;
  }
  
  p, li {
    orphans: 3;
    widows: 3;
  }
  
  .publication-card,
  .research-item,
  .timeline-item {
    page-break-inside: avoid;
    border: 1px solid #ccc !important;
    margin-bottom: 1rem;
    padding: 1rem;
  }
  
  .wrapper {
    max-width: none;
    padding: 0;
  }
  
  a {
    text-decoration: underline;
    color: #000 !important;
  }
  
  /* Print URLs after links */
  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
  
  /* Don't print URLs for internal links */
  a[href^="#"]:after,
  a[href^="/"]:after {
    content: "";
  }
}

/* ==========================================================================
   ACCESSIBILITY & ANIMATION ENHANCEMENTS
   ========================================================================== */

/* Skip link for screen readers */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--accent-color);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 0 0 4px 4px;
  z-index: 10000;
  font-weight: 500;
}

.skip-link:focus {
  top: 0;
  outline: 3px solid var(--accent-hover);
  outline-offset: 2px;
}

/* Enhanced animation classes for JavaScript-triggered animations */
.animate-in {
  animation: slideInUp 0.6s ease-out forwards;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Error message styling for forms */
.error-message {
  color: #dc2626;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: block;
}

input.error,
textarea.error,
select.error {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* Enhanced loading states */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  animation: loading-shimmer 1.5s infinite;
}

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

/* Enhanced hover effects with better performance */
.card,
.research-item,
.publication-card,
.button,
.social-links-icons a {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  will-change: transform;
}

.card:hover,
.research-item:hover,
.publication-card:hover {
  will-change: auto;
}

/* ==========================================================================
   ENHANCED RESPONSIVE UTILITIES
   ========================================================================== */

/* Container queries preparation for future enhancement */
@supports (container-type: inline-size) {
  .wrapper {
    container-type: inline-size;
    container-name: main-container;
  }
}

/* Fluid spacing using clamp() */
.page-content {
  padding: clamp(2rem, 5vw, 5rem) 0;
}

.hero {
  gap: clamp(1.5rem, 4vw, 4rem);
  margin-bottom: clamp(2rem, 6vw, 6rem);
}

/* Keep the actual site footer vertically tight across all breakpoints. */
.site-footer {
  padding: 0.75rem 0 0.5rem;
}

.site-footer .footer-content.footer-content--compact {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin: 0;
  text-align: center;
}

.site-footer .footer-content.footer-content--compact > * {
  margin: 0;
}

.site-footer .footer-content.footer-content--compact .footer-social {
  line-height: 1;
  margin-bottom: 0.25rem;
}

.site-footer .footer-content.footer-content--compact .social-links-icons {
  margin: 0;
  gap: 0.75rem;
}

.site-footer .footer-content.footer-content--compact .footer-copy {
  margin: 0 0 0.05rem;
  line-height: 1.05;
}

.site-footer .footer-content.footer-content--compact .footer-version {
  margin: 0;
  line-height: 1.05;
}

/* Enhanced focus indicators */
*:focus-visible {
  outline: 3px solid var(--accent-color);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Hide outline for mouse users */
*:focus:not(:focus-visible) {
  outline: none;
}

/* CSS Grid with enhanced fallbacks */
@supports (display: grid) {
  .grid-cards {
    display: grid;
  }
}

/* Flexbox fallback for older browsers */
@supports not (display: grid) {
  .grid-cards {
    display: flex;
    flex-wrap: wrap;
  }
  
  .grid-cards > * {
    flex: 1 1 280px;
    margin: 10px;
  }
}

/* Modern color functions with fallbacks */
@supports (color: oklch(0.7 0.15 180)) {
  :root {
    --accent-color: oklch(0.55 0.15 250); /* More perceptually uniform */
    --accent-hover: oklch(0.45 0.15 250);
  }
}

/* Backdrop filter fallback */
@supports not (backdrop-filter: blur(10px)) {
  .site-header {
    background: rgba(255, 255, 255, 0.95);
  }
  
  [data-theme="dark"] .site-header {
    background: rgba(15, 23, 42, 0.95);
  }
}
