/* ===== CSS Variables & Design System ===== */
:root {
  /* Dark Theme Colors */
  --bg-primary: #0a0e27;
  --bg-secondary: #151b3d;
  --bg-card: rgba(21, 27, 61, 0.6);
  --text-primary: #e8eaf6;
  --text-secondary: #b0b8d4;
  --accent-primary: #00d4ff;
  --accent-secondary: #f59e0b;
  --gradient-primary: linear-gradient(135deg, #00d4ff 0%, #f59e0b 100%);
  --gradient-gold: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --gradient-secondary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  /* Z-Index Layers */
  --z-background: -1;
  --z-normal: 1;
  --z-overlay: 950;
  --z-nav-drawer: 998;
  --z-header: 1000;
  --z-dropdown: 1001;
  --z-modal: 2000;
  --z-tooltip: 2000;

  --border-radius: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Colors */
[data-theme="light"] {
  --bg-primary: #f8f9fa;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.8);
  --text-primary: #1a1a2e;
  --text-secondary: #4a5568;
  --accent-primary: #0891b2;
  --accent-secondary: #d97706;
  --gradient-primary: linear-gradient(135deg, #0891b2 0%, #d97706 100%);
  --gradient-gold: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --gradient-secondary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
  /* Height of fixed header + spacing */
  font-size: 16px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* ===== Typography ===== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  color: var(--text-primary);
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--text-primary);
  position: relative;
  display: inline-block;
  margin-bottom: 2rem;
}

h2::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--gradient-gold);
  border-radius: 2px;
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--text-primary);
}

p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

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

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

/* ===== Site Header ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  /* Fallback / Base */
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1rem 2rem;
  z-index: var(--z-header);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

/* Use pseudo-element for backdrop-filter to avoid creating a containing block for fixed children */
.site-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: var(--z-background);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Nav Brand (Hidden on Desktop by default unless desired) */
.nav-brand {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
  display: none;
  /* Hidden on large screens, show on mobile */
  text-decoration: none;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Header Actions container */
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* ===== Toggles (Theme & Language) Refactored ===== */
/* Resetting fixed positions to standard buttons */
.theme-toggle,
.lang-toggle {
  position: static;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  overflow: hidden;
  /* Ensure circular crop for flags if needed */
}

.flag-icon {
  width: 1.5rem;
  height: 1.5rem;
  display: block;
  border-radius: 50%;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

.theme-toggle:hover,
.lang-toggle:hover {
  transform: translateY(-2px);
  background: rgba(0, 212, 255, 0.1);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.theme-toggle span {
  font-size: 1.25rem;
}

/* Global Navigation Lists Reset */
.main-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ===== Desktop Navigation (Min-width: 769px) ===== */
@media (min-width: 769px) {
  .main-nav {
    flex: 1;
    display: flex;
    justify-content: center;
  }

  /* Target direct child to avoid specificty wars with dropdowns */
  .main-nav>ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 0;
    padding: 0;
  }
}

/* Base Link Styles (Shared) */
.main-nav a {
  color: var(--text-secondary);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: var(--transition);
  text-decoration: none;
  display: block;
}

.main-nav a:hover {
  color: var(--accent-primary);
  background: rgba(0, 212, 255, 0.1);
}

/* Mobile Menu Toggle (Hamburger) */
.mobile-menu-toggle {
  display: none;
  /* Hidden on desktop */
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: var(--z-dropdown);
}

.hamburger-box {
  width: 24px;
  height: 24px;
  display: inline-block;
  position: relative;
}

.hamburger-inner {
  display: block;
  top: 50%;
  margin-top: -2px;
  width: 24px;
  height: 2px;
  background-color: var(--text-primary);
  border-radius: 2px;
  position: absolute;
  transition: transform 0.15s ease;
}

.hamburger-inner::before,
.hamburger-inner::after {
  content: "";
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--text-primary);
  border-radius: 2px;
  position: absolute;
  transition: transform 0.15s ease;
}

.hamburger-inner::before {
  top: -8px;
}

.hamburger-inner::after {
  bottom: -8px;
}

/* Hamburger Active State Animation */
.mobile-menu-toggle.active .hamburger-inner {
  transform: rotate(45deg);
}

.mobile-menu-toggle.active .hamburger-inner::before {
  top: 0;
  opacity: 0;
}

.mobile-menu-toggle.active .hamburger-inner::after {
  bottom: 0;
  transform: rotate(-90deg);
}

/* Dropdown Menu Styles */
.main-nav ul li {
  position: relative;
}

.dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--bg-card);
  backdrop-filter: blur(15px);
  padding: 0.5rem 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: var(--z-dropdown);
  display: flex;
  flex-direction: column;
  gap: 0;
}

.main-nav ul li:hover .dropdown,
.main-nav ul li:focus-within .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.dropdown li {
  width: 100%;
}

.dropdown a {
  display: block;
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  white-space: nowrap;
  border-radius: 0;
  text-align: left;
}

.dropdown a:hover {
  background: rgba(245, 158, 11, 0.1);
  /* Slight Amber tint */
  color: var(--accent-secondary);
  padding-left: 1.75rem;
  /* Slide effect */
}

/* ===== Hero Section ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: left;
  padding: 6rem 2rem 4rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-secondary);
  opacity: 0.1;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  animation: fadeInUp 1s ease-out;
  display: flex;
  align-items: center;
  gap: 3rem;
  justify-content: center;
}

.hero-image-container {
  flex-shrink: 0;
}

.hero-image {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--accent-primary);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
  transition: var(--transition);
}

.hero-image:hover {
  transform: scale(1.05);
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
}

.hero-text-content {
  flex: 1;
}

.hero-title {
  margin-bottom: 0.5rem;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.5rem);
  color: var(--accent-primary);
  font-weight: 600;
  margin-bottom: 1.5rem;
  white-space: nowrap;
}

.hero-description {
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  color: var(--text-secondary);
  max-width: 800px;
  margin: 0 0 1.5rem;
  line-height: 1.7;
}

.hero-links {
  display: flex;
  gap: 1rem;
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.btn {
  padding: 1rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background: var(--gradient-gold);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 2px solid var(--accent-primary);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: var(--accent-primary);
  color: white;
  transform: translateY(-2px);
  text-decoration: none;
}

/* Hero Icon Links */
.icon-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--accent-primary);
  color: var(--accent-primary);
  transition: var(--transition);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
}

.icon-link:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

.icon-link svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: currentColor;
  /* For LinkedIn path fill */
  stroke: currentColor;
  /* For Downlaod stroke */
}

/* Specific adjustment for Fill vs Stroke icons if needed, 
   but currentColor handles both usually if SVG is set up right.
   LinkedIn SVG uses fill, Download SVG uses stroke.
*/
.icon-link svg[fill="none"] {
  fill: none;
}



/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  animation: bounce 2s infinite;
  z-index: 10;
  cursor: pointer;
}

.scroll-indicator a {
  display: block;
  padding: 1rem;
}

.chevron {
  display: block;
  width: 24px;
  height: 24px;
  border-bottom: 3px solid var(--accent-primary);
  border-right: 3px solid var(--accent-primary);
  transform: rotate(45deg);
  transition: var(--transition);
}

.scroll-indicator:hover .chevron {
  border-color: var(--accent-secondary);
}

@keyframes bounce {

  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateX(-50%) translateY(0);
  }

  40% {
    transform: translateX(-50%) translateY(-10px);
  }

  60% {
    transform: translateX(-50%) translateY(-5px);
  }
}

/* ===== Container & Sections ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

section {
  margin-bottom: 6rem;
  animation: fadeInUp 0.8s ease-out;
}

/* ===== Cards ===== */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius);
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(0, 212, 255, 0.3);
}

/* ===== Timeline ===== */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5rem;
  /* Starts at the first dot */
  bottom: 0;
  width: 2px;
  background: var(--accent-secondary);
}

.timeline-item {
  position: relative;
  margin-bottom: 3rem;
  padding-left: 2rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-2rem - 5px);
  /* Center aligned with .timeline line (2px width) */
  top: 0.5rem;
  width: 12px;
  height: 12px;
  background: var(--accent-primary);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--bg-primary), 0 0 0 6px var(--accent-primary);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.timeline-title {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin: 0;
}

.timeline-period {
  color: var(--accent-primary);
  font-weight: 600;
  font-size: 0.95rem;
}

.timeline-company {
  color: var(--accent-secondary);
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.timeline-description {
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ===== Skills Layout (Horizontal Rows) ===== */
.skills-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.skill-category {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  padding: 1.5rem 2rem;
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.skill-category:hover {
  transform: translateX(10px);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
}

.skill-category h3 {
  flex: 0 0 220px;
  color: var(--text-primary);
  margin-bottom: 0;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.skill-tags {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.skill-tag {
  background: rgba(0, 212, 255, 0.1);
  color: var(--accent-primary);
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  /* Slightly squarer for professional look */
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid rgba(0, 212, 255, 0.2);
  transition: var(--transition);
  white-space: nowrap;
}

.skill-tag:hover {
  background: var(--accent-primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

/* Mobile Skills: Stack label and tags */
@media (max-width: 768px) {
  .skill-category {
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
  }

  .skill-category h3 {
    flex: none;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
    width: 100%;
  }

  .skill-category:hover {
    transform: translateY(-5px);
  }
}

/* ===== Education & Courses ===== */
.education-grid,
.courses-grid {
  display: grid;
  gap: 1.5rem;
  margin-top: 2rem;
}

.education-item,
.course-item {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  transition: var(--transition);
}

.education-item:hover,
.course-item:hover {
  transform: translateX(8px);
  border-color: rgba(168, 85, 247, 0.3);
}

.education-period,
.course-year {
  color: var(--accent-primary);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.education-title,
.course-title {
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.education-institution,
.course-provider {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ===== Certifications ===== */
.certification-group {
  margin-bottom: 4rem;
}

.certification-group-title {
  color: var(--accent-secondary);
  font-size: 1.5rem;
  margin-bottom: 2rem;
  font-weight: 600;
}

.certifications-grid {
  display: grid;
  gap: 1.5rem;
  margin-top: 2rem;
}

.certification-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: var(--transition);
}

.certification-card:hover {
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: var(--shadow-md);
}

.certification-card.expanded {
  border-color: var(--accent-secondary);
}

.certification-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  cursor: pointer;
  gap: 1rem;
  transition: var(--transition);
}

.certification-header:hover {
  background: rgba(245, 158, 11, 0.05);
}

.certification-title {
  color: var(--text-primary);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
}

.certification-subtitle {
  color: var(--accent-primary);
  font-size: 0.95rem;
  font-weight: 500;
  margin: 0;
}

.expand-icon {
  font-size: 2rem;
  color: var(--accent-secondary);
  font-weight: 300;
  line-height: 1;
  min-width: 30px;
  text-align: center;
  transition: var(--transition);
}

.certification-card.expanded .expand-icon {
  transform: rotate(180deg);
}

.certification-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.certification-details p {
  padding: 0 1.5rem 1.5rem;
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* Simple certification card (for non-expandable certs) */
.certification-card.simple {
  cursor: default;
}

.certification-card.simple:hover {
  transform: translateX(8px);
}

.certification-simple-content {
  padding: 1.5rem;
}

.certification-year {
  color: var(--accent-primary);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.certification-provider {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.certification-name {
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 600;
}


/* ===== Status Badge ===== */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.status-badge.in-progress {
  background: rgba(245, 158, 11, 0.15);
  /* Amber/Yellow tint */
  color: var(--accent-secondary);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* ===== Languages ===== */
.languages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.language-item {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  text-align: center;
  transition: var(--transition);
}

.language-item:hover {
  transform: scale(1.05);
  border-color: rgba(0, 212, 255, 0.3);
}

.language-name {
  color: var(--text-primary);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.language-level {
  color: var(--accent-primary);
  font-size: 0.9rem;
}

/* ===== Interests ===== */
.interests-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
  justify-content: center;
}

.interest-tag {
  background: var(--accent-secondary);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.interest-tag:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: var(--shadow-md);
}

/* ===== Footer ===== */
footer {
  background: var(--bg-secondary);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 3rem 2rem;
  text-align: center;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

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

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

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {

  /* Reset Header padding for mobile */
  .site-header {
    padding: 1rem;
  }

  /* Show controls on mobile */
  .nav-brand,
  .mobile-menu-toggle {
    display: block;
  }

  /* Mobile Navigation Drawer */
  .main-nav {
    display: block;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 80%;
    height: 100%;
    /* Ensure full height */
    max-width: 300px;
    background: var(--bg-card);
    /* Lighter background than body for contrast */
    padding: 4.25rem 1.5rem 1rem;
    /* Optimized top padding (clears header) and minimized bottom padding */
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5);
    transform: translateX(100%);
    /* Hidden by default */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 998;
    /* Behind the hamburger button */
    overflow-y: auto;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    /* Custom Scrollbar for this element */
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) transparent;
  }

  .main-nav::-webkit-scrollbar {
    width: 4px;
  }

  .main-nav::-webkit-scrollbar-track {
    background: transparent;
  }

  .main-nav::-webkit-scrollbar-thumb {
    background-color: var(--accent-primary);
    border-radius: 4px;
  }

  /* Backdrop Overlay for better focus */
  .main-nav::before {
    content: '';
    position: fixed;
    top: 0;
    left: -100vw;
    /* Covers the rest of the screen */
    width: 100vw;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    /* Dimming overlay */
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: var(--z-background);
    /* Behind the menu content but above main page content effectively */
    pointer-events: none;
  }

  .main-nav.active {
    transform: translateX(0);
  }

  /* Activate backdrop when active */
  .main-nav.active::before {
    left: -100vw;
    /* Keeps it positioned but we rely on body::after usually or specifically handled */
  }

  /* Reset ul for vertical stacking */
  /* Reset ul for vertical stacking */
  .main-nav ul {
    list-style: none;
    /* Removed bullets */
    padding: 0;
    margin: 0;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0;
    align-items: flex-start;
  }

  .main-nav ul li {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  /* Mobile Dropdowns: hidden as requested */
  .dropdown {
    display: none !important;
  }

  .main-nav a {
    padding: 0.5rem 0;
    /* Compact but usable padding */
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    /* Separators for items */
    display: block;
    width: 100%;
  }

  /* Remove border from last item */
  .main-nav>ul>li:last-child>a {
    border-bottom: none;
  }

  .dropdown a {
    /* Kept for reference but hidden */
    font-size: 0.95rem;
    padding: 0.75rem 0;
    color: var(--text-secondary);
  }

  /* Prevent body scroll when menu open and show overlay */
  body.menu-open {
    overflow: hidden;
  }

  body.menu-open::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    z-index: 990;
    /* High enough to cover content, below menu (998) and header (1000) */
    opacity: 0;
    animation: fadeIn 0.3s forwards;
  }

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

  div.header-container {
    padding-right: 0.5rem;
    /* Adjustment for hamburger alignment */
  }

  /* Adjust Hero padding since header is fixed */
  .hero {
    padding-top: 8rem;
  }

  .hero-content {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
  }

  .hero-subtitle {
    white-space: normal;
  }

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

  .container {
    padding: 3rem 1rem;
  }

  .timeline {
    padding-left: 1rem;
  }

  .timeline-item {
    padding-left: 1.5rem;
  }

  .timeline-item::before {
    left: calc(-1rem - 5px);
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .hero-links {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  h2::after {
    width: 40px;
    height: 3px;
  }

  .timeline-header {
    flex-direction: column;
    gap: 0.5rem;
  }
}

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

  .theme-toggle,
  nav,
  .hero-links {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  .card,
  .skill-category,
  .education-item,
  .course-item,
  .language-item {
    border: 1px solid #ddd;
    box-shadow: none;
    page-break-inside: avoid;
  }
}