:root {
  --color-primary: #334155;
  --color-primary-light: #475569;
  --color-primary-dark: #1e293b;
  --color-primary-darker: #0f172a;
  --color-secondary: #64748b;
  --color-secondary-light: #94a3b8;
  --color-secondary-dark: #475569;
  --color-accent: #334155;
  --color-accent-light: #475569;
  --color-accent-dark: #1e293b;
  --color-neutral-50: #f8fafc;
  --color-neutral-100: #f1f5f9;
  --color-neutral-200: #e2e8f0;
  --color-neutral-300: #cbd5e1;
  --color-neutral-400: #94a3b8;
  --color-neutral-500: #64748b;
  --color-neutral-600: #475569;
  --color-neutral-700: #334155;
  --color-neutral-800: #1e293b;
  --color-neutral-900: #0f172a;
  --color-white: #ffffff;
  --color-black: #000000;
  --font-family-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  --font-family-secondary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  --font-size-5xl: 3rem;
  --font-size-6xl: 3.75rem;
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.625;
  --line-height-loose: 2;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 2.5rem;
  --space-3xl: 3rem;
  --space-4xl: 4rem;
  --space-5xl: 5rem;
  --space-6xl: 6rem;
  --container-max-width: 1200px;
  --container-padding: var(--space-md);
  --border-radius-sm: 0.25rem;
  --border-radius-md: 0.375rem;
  --border-radius-lg: 0.5rem;
  --border-radius-xl: 0.75rem;
  --border-radius-2xl: 1rem;
  --border-radius-full: 9999px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --transition-fast: 0.15s ease-in-out;
  --transition-normal: 0.3s ease-in-out;
  --transition-slow: 0.5s ease-in-out;
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal: 1040;
  --z-popover: 1050;
  --z-tooltip: 1060;
}

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth;font-size:100%;line-height:var(--line-height-normal)}
body{font-family:var(--font-family-primary);font-size:var(--font-size-base);font-weight:var(--font-weight-normal);line-height:var(--line-height-normal);color:var(--color-neutral-800);background-color:var(--color-white);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;overflow-x:hidden}

.skip-link{position:absolute;top:-40px;left:6px;background:var(--color-neutral-800);color:var(--color-white);padding:var(--space-sm) var(--space-md);text-decoration:none;border-radius:var(--border-radius-md);font-weight:var(--font-weight-medium);z-index:var(--z-tooltip);transition:var(--transition-fast)}
.skip-link:focus{top:6px}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.nav__link.active{color:var(--color-neutral-800);background:rgba(51,65,85,0.15)}
.nav__link.active::after{width:80%;background:var(--color-neutral-800)}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-secondary);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-neutral-900);
  margin-bottom: var(--space-md);
}

h1 {
  font-size: var(--font-size-4xl);
}

h2 {
  font-size: var(--font-size-3xl);
}

h3 {
  font-size: var(--font-size-2xl);
}

p {
  margin-bottom: var(--space-md);
  line-height: var(--line-height-relaxed);
}

a {
  color: var(--color-neutral-700);
  text-decoration: none;
  transition: var(--transition-fast);
}

a:hover,
a:focus {
  color: var(--color-neutral-800);
  text-decoration: underline;
}

a:focus {
  outline: 2px solid var(--color-neutral-700);
  outline-offset: 2px;
  border-radius: var(--border-radius-sm);
}

/* Fix for white square issue on link/button focus and active states */
a:focus,
button:focus,
.nav__link:focus,
.social__link:focus,
.project-card__link:focus {
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.3) !important;
  background: transparent !important;
}

a:active,
button:active,
.nav__link:active,
.social__link:active,
.project-card__link:active {
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  transform: translateY(1px);
}

/* ===== LAYOUT COMPONENTS ===== */
.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.section__title {
  text-align: center;
  color: var(--color-neutral-800);
  margin-bottom: var(--space-3xl);
  position: relative;
}

.section__title::before {
  display: none !important;
}

.section__title::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 6px;
  background: #0f172a;
  border-radius: var(--border-radius-full);
  margin-top: var(--space-md);
}

.section__placeholder {
  text-align: center;
  color: var(--color-neutral-500);
  font-style: italic;
  padding: var(--space-4xl) var(--space-md);
  background: var(--color-neutral-50);
  border-radius: var(--border-radius-lg);
  border: 2px dashed var(--color-neutral-300);
}

/* ===== HEADER ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: var(--z-fixed);
  transition: var(--transition-normal);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

.nav {
  padding: var(--space-md) 0;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.nav__list {
  display: flex;
  justify-content: center;
  align-items: center;
  list-style: none;
  gap: var(--space-lg);
  flex-wrap: wrap;
}


/* ===== HAMBURGER MENU ===== */
.nav__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
  border-radius: var(--border-radius-md);
  transition: var(--transition-fast);
  position: relative;
  z-index: calc(var(--z-fixed) + 2);
}

.nav__hamburger:hover,
.nav__hamburger:focus {
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

.nav__hamburger:focus {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.nav__hamburger-line {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-neutral-700);
  margin: 3px 0;
  transition: var(--transition-fast);
  border-radius: 2px;
}

/* Light hamburger lines for hero section */
.nav__hamburger--light .nav__hamburger-line {
  background: var(--color-white);
}

/* Hamburger animation states */
.nav__hamburger--active .nav__hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav__hamburger--active .nav__hamburger-line:nth-child(2) {
  opacity: 0;
}

.nav__hamburger--active .nav__hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile overlay - hidden for dropdown style */
.nav__overlay {
  display: none;
}

.nav__overlay--active {
  display: none;
}

.nav__link {
  font-weight: var(--font-weight-medium);
  color: var(--color-neutral-700);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--border-radius-md);
  transition: var(--transition-normal);
  position: relative;
}

/* Dynamic navigation text colors based on scroll position */
.nav__link--light {
  color: rgba(255, 255, 255, 0.9);
}

.nav__link--light:hover,
.nav__link--light:focus {
  color: var(--color-white);
  background: rgba(255, 255, 255, 0.1);
}

.nav__link--light::after {
  background: var(--color-white);
}

.nav__link--light.active {
  color: var(--color-white);
  background: rgba(255, 255, 255, 0.15);
}

.nav__link--light.active::after {
  background: var(--color-white);
}

.nav__link:hover,
.nav__link:focus {
  color: var(--color-neutral-800);
  background: rgba(51, 65, 85, 0.1);
  text-decoration: none;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--color-neutral-800);
  transition: var(--transition-fast);
}

.nav__link:hover::after,
.nav__link:focus::after {
  width: 80%;
}

/* ===== HERO SECTION ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-neutral-900) 0%, var(--color-neutral-800) 50%, var(--color-neutral-700) 100%);
  color: var(--color-white);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(15, 23, 42, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(30, 41, 59, 0.2) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(79, 70, 229, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

.hero__container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-xl);
  position: relative;
  z-index: 1;
}

.hero__profile {
  margin-bottom: var(--space-2xl);
  position: relative;
}

.hero__image {
  width: 200px;
  height: 200px;
  border-radius: var(--border-radius-full);
  border: 4px solid rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow-xl);
  transition: var(--transition-normal);
  object-fit: cover;
}

.hero__image:hover {
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.4);
}

.hero__content {
  max-width: 600px;
}

.hero__title {
  font-size: var(--font-size-5xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-md);
  color: var(--color-white);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero__subtitle {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-normal);
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--space-3xl);
  line-height: var(--line-height-relaxed);
}

/* ===== SOCIAL LINKS ===== */
.social {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.social__link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--border-radius-full);
  transition: var(--transition-normal);
  backdrop-filter: blur(10px);
}

.social__link:hover,
.social__link:focus {
  background: var(--color-white);
  border-color: var(--color-white);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}

.social__icon {
  width: 24px;
  height: 24px;
  filter: brightness(0) invert(1);
  transition: var(--transition-fast);
}

.social__link:hover .social__icon,
.social__link:focus .social__icon {
  filter: none;
}

/* ===== MAIN SECTIONS ===== */
.main {
  position: relative;
}

section {
  padding: var(--space-6xl) 0;
}

.about {
  margin-top: 0;
  padding-top: var(--space-6xl);
  background: var(--color-white);
}

.about__content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.about__text {
  font-size: var(--font-size-lg);
  color: var(--color-neutral-600);
  line-height: var(--line-height-relaxed);
}

.publications {
  background: var(--color-neutral-50);
}

.projects {
  background: var(--color-white);
}

/* ===== RESPONSIVE GRID TIMELINE COMPONENT ===== */
.timeline {
  position: relative;
  width: 100%;
  margin: 0 auto;
  padding: var(--space-2xl) 0;
}

.timeline-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: var(--space-3xl);
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
  /* Ensure uniform card heights */
  align-items: stretch;
  justify-content: center; /* Center cards horizontally */
}

/* ===== TIMELINE ITEMS ===== */
.timeline-item {
  position: relative;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease-out;
}

.timeline-item.fade-in-up {
  opacity: 1;
  transform: translateY(0);
}

.timeline-item .timeline-content {
  margin: 0;
  text-align: left;
  position: relative;
  top: 0;
}

.timeline-marker {
  position: absolute;
  left: var(--space-lg);
  top: var(--space-lg);
  width: 16px;
  height: 16px;
  background: var(--color-neutral-700);
  border: 3px solid var(--color-white);
  border-radius: var(--border-radius-full);
  z-index: 3;
  box-shadow: var(--shadow-md);
}

.timeline-marker--loading {
  background: var(--color-neutral-400);
  animation: pulse 1.5s ease-in-out infinite;
}

/* ===== PROJECT CARDS ===== */
.project-card {
  background: var(--color-white);
  border-radius: var(--border-radius-xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-neutral-200);
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
  /* Ensure uniform card sizing */
  height: 100%;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--color-neutral-600);
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-neutral-700), var(--color-neutral-800));
}

.project-card__header {
  margin-bottom: var(--space-lg);
}

.project-card__title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-sm);
  line-height: var(--line-height-tight);
}

.project-card__title a {
  color: var(--color-neutral-900);
  text-decoration: none;
  transition: var(--transition-fast);
}

.project-card__title a:hover,
.project-card__title a:focus {
  color: var(--color-neutral-700);
  text-decoration: none;
}

.project-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  font-size: var(--font-size-sm);
}

.project-card__date {
  color: var(--color-neutral-500);
  font-weight: var(--font-weight-medium);
}

.project-card__language {
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--border-radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.project-card__description {
  color: var(--color-neutral-600);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-lg);
  /* Allow description to expand and take remaining space */
  flex-grow: 1;
}

.project-card__topics {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.project-card__topic {
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-neutral-100);
  color: var(--color-neutral-700);
  border-radius: var(--border-radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  transition: var(--transition-fast);
}

.project-card__topic:hover {
  background: var(--color-neutral-700);
  color: var(--color-white);
}

.project-card__stats {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-neutral-200);
}

.project-card__stat {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--color-neutral-600);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

.project-card__icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.project-card__actions {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  /* Keep actions at the bottom of the card */
  margin-top: auto;
}

.project-card__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--border-radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  text-decoration: none;
  transition: var(--transition-fast);
  border: 1px solid transparent;
}

.project-card__link--primary {
  background: var(--color-neutral-700);
  color: var(--color-white);
}

.project-card__link--primary:hover,
.project-card__link--primary:focus {
  background: var(--color-neutral-800);
  color: var(--color-white);
  text-decoration: none;
  transform: translateY(-1px);
}

.project-card__link--secondary {
  background: var(--color-neutral-100);
  color: var(--color-neutral-700);
  border-color: var(--color-neutral-300);
}

.project-card__link--secondary:hover,
.project-card__link--secondary:focus {
  background: var(--color-neutral-200);
  color: var(--color-neutral-900);
  text-decoration: none;
  transform: translateY(-1px);
}

.project-card__link-icon {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* ===== LOADING STATES ===== */
.projects-loading {
  text-align: center;
  padding: var(--space-4xl) var(--space-md);
}

.projects-loading__title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-medium);
  color: var(--color-neutral-600);
  margin-bottom: var(--space-3xl);
}

.project-card--loading {
  background: var(--color-neutral-50);
  border-color: var(--color-neutral-200);
  animation: pulse 1.5s ease-in-out infinite;
}

/* ===== SKELETON UI ===== */
.skeleton {
  background: linear-gradient(90deg, var(--color-neutral-200) 25%, var(--color-neutral-100) 50%, var(--color-neutral-200) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--border-radius-sm);
  margin-bottom: var(--space-md);
}

.skeleton--title {
  height: 24px;
  width: 70%;
}

.skeleton--text {
  height: 16px;
  width: 100%;
}

.skeleton--short {
  width: 60%;
}

.skeleton--stat {
  height: 16px;
  width: 40px;
}

.skeleton-stats {
  display: flex;
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* ===== ERROR STATES ===== */
.projects-error {
  text-align: center;
  padding: var(--space-4xl) var(--space-md);
  background: var(--color-neutral-50);
  border-radius: var(--border-radius-lg);
  border: 2px dashed var(--color-neutral-300);
}

.projects-error__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-lg);
  color: var(--color-neutral-400);
}

.projects-error__title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-neutral-700);
  margin-bottom: var(--space-md);
}

.projects-error__message {
  color: var(--color-neutral-600);
  margin-bottom: var(--space-xl);
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.projects-error__retry {
  background: var(--color-neutral-700);
  color: var(--color-white);
  border: none;
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--border-radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: var(--transition-fast);
}

.projects-error__retry:hover,
.projects-error__retry:focus {
  background: var(--color-neutral-800);
  transform: translateY(-1px);
}

/* ===== EMPTY STATES ===== */
.projects-empty {
  text-align: center;
  padding: var(--space-4xl) var(--space-md);
  background: var(--color-neutral-50);
  border-radius: var(--border-radius-lg);
  border: 2px dashed var(--color-neutral-300);
}

.projects-empty__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-lg);
  color: var(--color-neutral-400);
}

.projects-empty__title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-neutral-700);
  margin-bottom: var(--space-md);
}

.projects-empty__message {
  color: var(--color-neutral-600);
  max-width: 400px;
  margin: 0 auto;
}

/* ===== MOBILE NAVIGATION ===== */
@media (max-width: 767px) {
  .nav__hamburger {
    display: flex;
    position: absolute;
    right: var(--container-padding);
    top: 50%;
    transform: translateY(-50%);
  }

  .nav__list {
    display: flex !important;
    position: absolute;
    top: 100%;
    right: var(--container-padding);
    width: 200px;
    max-height: 0;
    background: var(--color-white);
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 0;
    padding: 0;
    margin: 0;
    transition: max-height 0.3s ease-in-out, padding 0.3s ease-in-out, border-width 0.3s ease-in-out;
    z-index: 1031;
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    border-radius: var(--border-radius-lg);
    border: 0px solid var(--color-neutral-200);
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
  }

  .nav__list--active {
    max-height: 300px;
    padding: var(--space-sm) 0;
    border: 1px solid var(--color-neutral-200);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    visibility: visible;
    opacity: 1;
  }

  .nav__item {
    width: 100%;
  }

  .nav__link {
    display: block;
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    color: var(--color-neutral-700);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    text-align: left;
    transition: var(--transition-fast);
    position: relative;
    border-radius: 0;
  }

  .nav__link:hover,
  .nav__link:focus {
    background: var(--color-neutral-50);
    color: var(--color-neutral-900);
    text-decoration: none;
  }

  .nav__link.active {
    background: var(--color-neutral-100);
    color: var(--color-neutral-900);
  }

  .nav__link::after {
    display: none;
  }

  .nav__overlay {
    display: none !important;
  }

  .nav__overlay--active {
    display: none !important;
  }

  /* Don't prevent body scroll for small dropdown */
  body.nav-open {
    /* No body scroll prevention needed for dropdown style */
  }
}

/* ===== RESPONSIVE GRID TIMELINE ===== */
@media (max-width: 1024px) {
  .timeline-container {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-2xl);
  }
}

@media (max-width: 767px) {
  .timeline {
    padding: var(--space-xl) 0;
  }

  .timeline-container {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .timeline-item .timeline-content {
    margin-left: calc(var(--space-lg) * 2 + var(--space-md));
    margin-right: 0;
  }

  .project-card__actions {
    flex-direction: column;
  }

  .project-card__link {
    justify-content: center;
    text-align: center;
  }

  .project-card__topics {
    justify-content: center;
  }

  .project-card__stats {
    justify-content: center;
  }

  /* Center the timeline container */
  .timeline-container {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .timeline-container {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  /* Ensure proper padding on small screens */
  .header {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }

  .nav__hamburger {
    right: var(--space-md);
  }

  .nav__list {
    width: calc(100vw - 2 * var(--space-md));
    right: var(--space-md);
  }
  
  .nav__list--active {
    max-height: 300px;
    padding: var(--space-sm) 0;
  }

  /* Ensure timeline container is properly centered */
  .timeline-container {
    padding: 0 var(--space-sm);
    justify-content: center;
  }

  /* Better spacing for project cards on mobile */
  .timeline-item .timeline-content {
    margin-left: 0;
    margin-right: 0;
  }
}

/* Mobile-specific improvements */
@media (max-width: 480px) {
  .project-card {
    padding: var(--space-lg);
  }
  
  .project-card__meta {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }
  
  .projects-loading__title,
  .projects-error__title,
  .projects-empty__title {
    font-size: var(--font-size-lg);
  }
}

/* ===== FOOTER ===== */
.footer {
  background: var(--color-neutral-900);
  color: var(--color-white);
  padding: var(--space-5xl) 0 var(--space-xl) 0;
}

.footer__content {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.footer__title {
  color: var(--color-white);
  margin-bottom: var(--space-lg);
}

.footer__text {
  font-size: var(--font-size-lg);
  color: var(--color-neutral-300);
  max-width: 600px;
  margin: 0 auto var(--space-lg);
}

.footer__social {
  margin-bottom: var(--space-2xl);
}

.footer__link {
  color: var(--color-neutral-400);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-lg);
}

.footer__link:hover,
.footer__link:focus {
  color: var(--color-white);
}

.footer__bottom {
  text-align: center;
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-neutral-700);
}

.footer__copyright {
  color: var(--color-neutral-400);
  font-size: var(--font-size-sm);
}

/* ===== RESPONSIVE DESIGN ===== */

/* Small devices (landscape phones, 568px and up) */
@media (min-width: 568px) {
  .hero__title {
    font-size: var(--font-size-6xl);
  }
  
  .social {
    gap: var(--space-xl);
  }
  
  .social__link {
    width: 70px;
    height: 70px;
  }
  
  .social__icon {
    width: 28px;
    height: 28px;
  }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
  :root {
    --container-padding: var(--space-xl);
  }
  
  .nav__list {
    gap: var(--space-2xl);
  }
  
  .hero__container {
    padding: var(--space-3xl);
  }
  
  .hero__image {
    width: 250px;
    height: 250px;
  }
  
  section {
    padding: var(--space-6xl) 0;
  }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
  .hero__title {
    font-size: clamp(var(--font-size-5xl), 8vw, var(--font-size-6xl));
  }
  
  .hero__subtitle {
    font-size: var(--font-size-2xl);
  }
  
  .about__text {
    font-size: var(--font-size-xl);
  }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
  :root {
    --container-padding: var(--space-2xl);
  }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
}

.fade-in {
  animation: fadeIn 0.6s ease-out forwards;
}

/* Initial hidden state for animated elements */
.hero__profile,
.hero__content {
  opacity: 0;
  transform: translateY(30px);
}

.hero__profile.fade-in-up,
.hero__content.fade-in-up {
  opacity: 1;
  transform: translateY(0);
}

/* ===== UTILITIES ===== */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ===== PRINT STYLES ===== */
@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  
  .header,
  .footer {
    display: none;
  }
  
  .hero {
    background: none !important;
    color: black !important;
    min-height: auto;
    page-break-after: always;
  }
  
  a {
    text-decoration: underline;
  }
  
  a[href^="http"]:after {
    content: " (" attr(href) ")";
  }
}
