/* --- Custom Fonts --- */
/* Import Google Fonts for stylized display font */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&family=Playfair+Display:wght@400;500;600;700;800;900&family=Cormorant+Garamond:wght@300;400;500;600;700&display=swap');

/* IBM Plex Sans for all text */
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('fonts/ibm-plex-sans.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Sans';
  src: url('fonts/ibm-plex-sans.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Simplifica';
  src: url('fonts/simplifica.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* Removed Simplifica - using IBM Plex Sans for all text */

/* System font stack for performance */
:root {
  --bg: #0b0f14;
  --bg-2: #0e1320;
  --text: #e8eef9;
  --muted: #a7b1c2;
  --brand: #7aa2ff;
  --brand-2: #9b7aff;
  --card: rgba(4, 15, 40, 0.547);
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f8fbff;
    --bg-2: #eef4ff;
    --text: #101624;
    --muted: #475269;
    --brand: #305eff;
    --brand-2: #8b3dff;
    --card: rgba(41, 102, 246, 0.12);
    --border: rgba(0,0,0,0.12);
    --shadow: 0 10px 30px rgba(0,0,0,0.10);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }

/* Smooth scrolling with offset for fixed header */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px; /* Adjust for fixed header height */
}
body {
  margin: 0;
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: url('assets/back.jpg') no-repeat center center fixed,
              radial-gradient(1200px 800px at 10% 10%, rgba(255, 255, 255, 0.08), transparent 60%),
              radial-gradient(1200px 800px at 90% 20%, rgba(255, 255, 255, 0.08), transparent 60%),
              var(--bg);
  background-size: cover, 1200px 800px, 1200px 800px, auto;
  background-position: center center, 10% 10%, 90% 20%, center;
  background-attachment: fixed;
  line-height: 1.55;
}

/* All text using IBM Plex Sans */
h1, h2, h3, h4, h5, h6,
.hero h2, .section-head h3, .modal-title h2,
.project-title h3, .skill-name,
.nav a, .btn, .modal-title {
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Specific heading styles */
h1 {
  font-weight: 700;
}

h2, .hero h2 {
  font-weight: 600;
}

h3, .section-head h3 {
  font-weight: 600;
}

/* Body text and descriptions with IBM Plex Sans */
p, .tagline, .hero p, .section-head p, .project-description,
.skill-details, .meta, .status, .loading, .resume-placeholder p {
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 400;
}

/* Font rendering optimization */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Header Name Animations */
@keyframes shimmer {
  0% {
    background-position: 20% 50%;
  }
  50% {
    background-position: 80% 50%;
  }
  100% {
    background-position: 20% 50%;
  }
}

@keyframes glow-pulse {
  0%, 100% {
    filter: drop-shadow(0 0 5px rgba(244, 208, 63, 0.4));
  }
  50% {
    filter: drop-shadow(0 0 20px rgba(244, 208, 63, 0.8)) drop-shadow(0 0 30px rgba(244, 208, 63, 0.4));
  }
}

@keyframes text-float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-3px);
  }
}

@keyframes sparkle {
  0%, 100% {
    opacity: 0;
    transform: scale(0) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: scale(1) rotate(180deg);
  }
}

@keyframes particle-float {
  0% {
    transform: translateY(0px) translateX(0px) rotate(0deg);
    opacity: 0.7;
  }
  33% {
    transform: translateY(-10px) translateX(5px) rotate(120deg);
    opacity: 1;
  }
  66% {
    transform: translateY(-5px) translateX(-3px) rotate(240deg);
    opacity: 0.8;
  }
  100% {
    transform: translateY(0px) translateX(0px) rotate(360deg);
    opacity: 0.7;
  }
}

@keyframes breathe {
  0%, 100% {
    opacity: 0.7;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.02);
  }
}

@keyframes nav-glow {
  0%, 100% {
    box-shadow: 0 0 5px rgba(122, 162, 255, 0.2);
  }
  50% {
    box-shadow: 0 0 15px rgba(122, 162, 255, 0.4), 0 0 25px rgba(122, 162, 255, 0.2);
  }
}

@keyframes fade-in-up {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes typewriter {
  0% {
    width: 0;
  }
  100% {
    width: 100%;
  }
}

@keyframes blink {
  0%, 50% {
    border-color: #f4d03f;
  }
  51%, 100% {
    border-color: transparent;
  }
}

@keyframes slide-in-left {
  0% {
    transform: translateX(-100px);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slide-in-right {
  0% {
    transform: translateX(100px);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes bounce-in {
  0% {
    transform: scale(0.3) rotate(-10deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.05) rotate(2deg);
    opacity: 0.8;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

@keyframes wave {
  0%, 100% {
    transform: translateY(0);
  }
  25% {
    transform: translateY(-5px);
  }
  75% {
    transform: translateY(5px);
  }
}

@keyframes gradient-shift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes tilt {
  0%, 100% {
    transform: perspective(1000px) rotateY(0deg);
  }
  25% {
    transform: perspective(1000px) rotateY(2deg);
  }
  75% {
    transform: perspective(1000px) rotateY(-2deg);
  }
}

@keyframes neon-pulse {
  0%, 100% {
    box-shadow: 0 0 5px currentColor, 0 0 10px currentColor, 0 0 15px currentColor;
  }
  50% {
    box-shadow: 0 0 10px currentColor, 0 0 20px currentColor, 0 0 30px currentColor;
  }
}

/* Logo reveal sequence */
@keyframes logo-reveal {
  0% {
    opacity: 0;
    transform: scale(0.8) rotate(-5deg);
    filter: blur(2px);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.1) rotate(2deg);
    filter: blur(1px);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    filter: blur(0px);
  }
}

/* Favicon pulse effect for brand identity */
@keyframes favicon-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Animation Delays for Staggered Effects */
.animate-delay-1 { animation-delay: 0.1s !important; }
.animate-delay-2 { animation-delay: 0.2s !important; }
.animate-delay-3 { animation-delay: 0.3s !important; }
.animate-delay-4 { animation-delay: 0.4s !important; }
.animate-delay-5 { animation-delay: 0.5s !important; }
.animate-delay-6 { animation-delay: 0.6s !important; }

/* Staggered delays for social icons */
.social-item:nth-child(1) .social-icon { animation-delay: 0.2s; }
.social-item:nth-child(2) .social-icon { animation-delay: 0.4s; }
.social-item:nth-child(3) .social-icon { animation-delay: 0.6s; }
.social-item:nth-child(4) .social-icon { animation-delay: 0.8s; }

/* Certifications Section */
.certifications-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.cert-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 120px;
}

.cert-item:hover {
  border-color: var(--brand);
  box-shadow: 0 4px 16px rgba(122, 162, 255, 0.1);
  transform: translateY(-2px);
}

.cert-header {
  margin-bottom: 12px;
}

.cert-header h3 {
  margin: 0 0 4px 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.cert-issuer {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.cert-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.cert-date {
  color: var(--muted);
  font-size: 0.85rem;
}

.cert-status {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Social Media Section */
.social-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.social-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 16px;
}

.social-item:hover {
  border-color: var(--brand);
  box-shadow: 0 4px 16px rgba(122, 162, 255, 0.1);
  transform: translateY(-2px);
  text-decoration: none;
  color: var(--text);
}

.social-icon {
  width: 48px;
  height: 48px;
  background: var(--brand);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  animation: bounce-in 0.8s ease-out both;
  transition: all 0.3s ease;
}

.social-icon::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transform: rotate(45deg);
  transition: transform 0.6s ease;
}

.social-icon:hover::before {
  transform: rotate(45deg) translate(100%, 100%);
}

.social-icon:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 8px 25px rgba(122, 162, 255, 0.4);
  animation: social-pulse 1s ease-in-out infinite;
}

@keyframes social-pulse {
  0%, 100% {
    box-shadow: 0 8px 25px rgba(122, 162, 255, 0.4);
  }
  50% {
    box-shadow: 0 12px 35px rgba(122, 162, 255, 0.6);
  }
}

.social-info h3 {
  margin: 0 0 4px 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.social-info p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Section Icon Styling */
.section-icon {
  width: 32px;
  height: 32px;
  margin-right: 12px;
  vertical-align: middle;
  border-radius: 50%;
  object-fit: cover;
  display: inline-block;
  transition: transform 0.2s ease;
}

.section-icon:hover {
  transform: scale(1.1);
}

/* Responsive section icons */
@media (max-width: 768px) {
  .section-icon {
    width: 28px;
    height: 28px;
    margin-right: 10px;
  }
}

/* Character image and GitHub button styling for index.html hero */
.character-image {
  margin-bottom: 20px;
  text-align: center;
  position: relative;
  animation: fade-in-up 1s ease-out 0.3s both;
}

.character-image::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 220px;
  height: 220px;
  border: 2px solid var(--brand);
  border-radius: 50%;
  opacity: 0;
  animation: logo-ring-appear 2s ease-out 1.5s both;
  z-index: -1;
}

@keyframes logo-ring-appear {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
  50% {
    opacity: 0.6;
  }
  100% {
    opacity: 0.3;
    transform: translate(-50%, -50%) scale(1.1);
  }
}

.character-img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, opacity 0.3s ease, filter 0.3s ease;
  border: 3px solid var(--brand);
  cursor: pointer;
  position: relative;
  animation: 
    bounce-in 1.2s ease-out 0.5s both,
    float-gentle 4s ease-in-out 2s infinite;
}

@keyframes float-gentle {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-5px) rotate(1deg);
  }
  50% {
    transform: translateY(-8px) rotate(0deg);
  }
  75% {
    transform: translateY(-3px) rotate(-1deg);
  }
}

.character-img:hover {
  transform: scale(1.05);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.character-img.switching {
  opacity: 0.3;
  transform: scale(0.95);
  filter: blur(2px);
}

/* Add a subtle animation hint */
.character-img::after {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: linear-gradient(45deg, var(--brand), var(--brand-2)) border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: exclude;
  mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.character-img:hover::after {
  opacity: 0.6;
}

.character-img:active {
  transform: scale(0.98);
  transition: transform 0.1s ease;
}

.hero-cta {
  margin-top: 30px;
  text-align: center;
}

.github-btn {
  display: inline-block;
  background: linear-gradient(135deg, #7aa2ff 0%, #9b7aff 100%);
  color: white;
  text-decoration: none;
  padding: 16px 32px;
  border-radius: 50px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 8px 20px rgba(122, 162, 255, 0.3);
  border: 2px solid transparent;
}

.github-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(122, 162, 255, 0.4);
  background: linear-gradient(135deg, #9b7aff 0%, #7aa2ff 100%);
}

/* Responsive design for character image */
@media (max-width: 768px) {
  .character-img {
    width: 150px;
    height: 150px;
  }
  
  .github-btn {
    font-size: 1.1rem;
    padding: 14px 28px;
  }
  
  .project-card {
    height: 280px;
    width: 320px;
  }
  
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 320px));
  }
  
  .certifications-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .social-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .character-img {
    width: 120px;
    height: 120px;
  }
  
  .container {
    width: 100%;
    padding: 0 12px;
    margin: 0 auto;
  }
  
  body {
    margin: 0;
    padding: 0;
  }
  
  .hero, .section {
    text-align: center;
  }
  
  .grid {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 16px;
  }
  
  .card, .project-card {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
  }
  
  .project-card {
    height: 260px;
    width: 100%;
    max-width: 300px;
  }
  
  .grid {
    grid-template-columns: 1fr;
    max-width: 300px;
    margin: 0 auto;
  }
  
  .cert-item {
    padding: 16px;
    min-height: 100px;
  }
  
  .social-item {
    padding: 16px;
    gap: 12px;
  }
  
  .social-icon {
    width: 40px;
    height: 40px;
  }
}

.bg-animated {
  position: fixed;
  inset: -10% -10% -10% -10%;
  background: radial-gradient(800px 500px at 0% 20%, rgba(122,162,255,0.18), transparent 65%),
              radial-gradient(700px 600px at 100% 0%, rgba(155,122,255,0.18), transparent 65%);
  filter: blur(40px) saturate(1.2);
  z-index: -1;
  animation: float 22s ease-in-out infinite alternate;
}

@media (prefers-reduced-motion: reduce) {
  .bg-animated { animation: none; }
}

@keyframes float {
  from { transform: translate3d(0,0,0) scale(1); }
  to   { transform: translate3d(0,-2%,0) scale(1.02); }
}

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: border-box;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  backdrop-filter: saturate(1.2) blur(10px);
  background: linear-gradient(to bottom, rgba(0,0,0,0.7), rgba(0,0,0,0.3));
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: all 0.3s ease;
  overflow: hidden;
}

.site-header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(circle at 20% 80%, rgba(244, 208, 63, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(247, 220, 111, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(249, 231, 159, 0.04) 0%, transparent 50%);
  animation: particle-float 8s ease-in-out infinite;
  pointer-events: none;
}

/* Header scrolled state */
.site-header.scrolled {
  background: linear-gradient(to bottom, rgba(0,0,0,0.9), rgba(0,0,0,0.7));
  backdrop-filter: saturate(1.5) blur(15px);
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.site-header.scrolled .header-inner {
  padding: 10px 0; /* More compact when scrolled */
}

/* Standardized spacing system */
:root {
  --section-spacing-large: 80px;
  --section-spacing-medium: 60px;
  --section-spacing-small: 40px;
  --section-spacing-xs: 24px;
}

/* Main content padding to account for fixed header */
main {
  padding-top: 80px; /* Adjust based on header height */
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}
.brand { 
  display: flex; 
  align-items: center;
  animation: fade-in-up 1s ease-out 0.2s both;
}
.brand-text { 
  display: grid; 
  animation: fade-in-up 1s ease-out 0.5s both;
}
.name { 
  font-size: 1.2rem; 
  margin: 0; 
  font-family: 'Cinzel', 'Playfair Display', serif;
  font-weight: 600;
  background: linear-gradient(135deg, #f4d03f 0%, #f7dc6f 25%, #f9e79f 50%, #f7dc6f 75%, #f4d03f 100%);
  background-size: 110% 110%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 4px rgba(244, 208, 63, 0.3);
  letter-spacing: 0.1em;
  animation: 
    glow-pulse 4s ease-in-out infinite,
    text-float 6s ease-in-out infinite;
  cursor: default;
  transition: all 0.3s ease;
  position: relative;
  display: inline-block;
}

.name::before,
.name::after {
  content: '✨';
  position: absolute;
  font-size: 0.8rem;
  color: #f4d03f;
  animation: sparkle 2s ease-in-out infinite;
  pointer-events: none;
}

.name::before {
  top: -5px;
  left: -15px;
  animation-delay: 0s;
}

.name::after {
  top: -5px;
  right: -15px;
  animation-delay: 1s;
}

.name:hover {
  transform: scale(1.05);
  filter: brightness(1.2);
  text-shadow: 0 4px 8px rgba(244, 208, 63, 0.5);
  animation-play-state: paused;
}

.name:hover::before,
.name:hover::after {
  animation-play-state: running;
  animation-duration: 0.5s;
}

/* Animated header typewriter effect */
.animated-header {
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid transparent;
  animation: 
    glow-pulse 4s ease-in-out infinite,
    text-float 6s ease-in-out infinite,
    typewriter 1.5s steps(6) 1s both,
    blink 1s step-end 2.5s 3;
}

/* Enhanced sparkle effect on page load */
.animated-header::before,
.animated-header::after {
  animation-delay: 3s;
}
.tagline { 
  margin: 0; 
  color: var(--muted); 
  font-size: 0.9rem; 
  animation: breathe 5s ease-in-out infinite;
  transition: all 0.3s ease;
}
.nav { 
  display: flex; 
  gap: 14px; 
  animation: fade-in-up 1s ease-out 0.8s both;
}

.header-social {
  display: flex;
  gap: 12px;
  margin-left: 16px;
  animation: fade-in-up 1s ease-out 1s both;
}

.header-social-link {
  color: var(--muted);
  transition: all 0.3s ease;
  padding: 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.header-social-link::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 100%;
  height: 100%;
  background: var(--brand);
  border-radius: 8px;
  transition: transform 0.3s ease;
  z-index: -1;
}

.header-social-link:hover {
  color: white;
  transform: translateY(-2px);
}

.header-social-link:hover::before {
  transform: translate(-50%, -50%) scale(1);
}

/* Mobile responsive styles for header social */
@media (max-width: 768px) {
  .header-social {
    margin-left: 12px;
    gap: 8px;
  }
  
  .header-social-link {
    padding: 6px;
  }
  
  .header-social-link svg {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 480px) {
  .header-social {
    margin-left: 8px;
    gap: 6px;
  }
  
  .header-social-link {
    padding: 4px;
  }
  
  .header-social-link svg {
    width: 16px;
    height: 16px;
  }
}
.nav a { 
  color: var(--text); 
  text-decoration: none; 
  padding: 8px 12px; 
  border-radius: 10px; 
  border: 1px solid transparent; 
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.nav a::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(122, 162, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.nav a:hover::before {
  left: 100%;
}

.nav a:hover { 
  border-color: var(--border); 
  background: var(--card); 
  animation: nav-glow 2s ease-in-out infinite;
  transform: translateY(-1px);
}

.nav a.active { 
  background: var(--primary); 
  color: white; 
  border-color: var(--primary);
  animation: nav-glow 3s ease-in-out infinite;
}

.hero { 
  display: grid; 
  place-items: center; 
  min-height: 56vh; 
  text-align: center; 
  padding: var(--section-spacing-large) 0 var(--section-spacing-medium);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(circle at 30% 70%, rgba(122, 162, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 70% 30%, rgba(244, 208, 63, 0.08) 0%, transparent 50%);
  animation: gradient-shift 8s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}

.hero-content { 
  max-width: 800px; 
  animation: slide-in-left 1s ease-out 0.3s both;
}

.hero h2 { 
  font-size: clamp(1.8rem, 3.2vw + 1rem, 3rem); 
  margin: 0 0 12px; 
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text) 0%, var(--brand) 50%, var(--text) 100%);
  background-size: 200% 200%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 4s ease-in-out infinite;
}

.hero p { 
  margin: 0 0 24px; 
  color: var(--muted); 
  font-size: 1.05rem;
  animation: wave 3s ease-in-out infinite;
  animation-delay: 0.5s;
}
.hero-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.btn { 
  display: inline-block; 
  padding: 10px 14px; 
  border-radius: 12px; 
  border: 1px solid var(--border); 
  color: var(--text); 
  text-decoration: none; 
  background: var(--card); 
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.btn:hover { 
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.btn:hover::before {
  left: 100%;
}

.btn.primary { 
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); 
  border: none; 
  color: white;
  animation: neon-pulse 2s ease-in-out infinite;
}

.section { padding: var(--section-spacing-medium) 0; }
.section.compact { padding: var(--section-spacing-small) 0; }
.section.spacious { padding: var(--section-spacing-large) 0; }
.section-head { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  gap: 16px; 
  margin-bottom: var(--section-spacing-xs);
  position: relative;
}

.section-head::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  border-radius: 2px;
  animation: gradient-shift 3s ease-in-out infinite;
}

.section-head h3 { 
  margin: 0; 
  font-size: 1.4rem;
  background: linear-gradient(135deg, var(--text) 0%, var(--brand) 50%, var(--text) 100%);
  background-size: 200% 200%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 5s ease-in-out infinite;
}
.section-actions { display: flex; align-items: center; gap: 12px; }

.resume-viewer { aspect-ratio: 11 / 14; width: 100%; background: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: auto; box-shadow: var(--shadow); }
.resume-viewer.has-resume { aspect-ratio: auto; }

/* PDF container styles */
.pdf-container { width: 100%; height: 800px; border: 1px solid #ddd; border-radius: 8px; overflow: hidden; background: #f5f5f5; }
.pdf-container embed { border: none; }
.pdf-fallback { padding: 40px; text-align: center; color: #666; }
.pdf-fallback h3 { margin-bottom: 16px; color: #333; }
.pdf-fallback p { margin-bottom: 16px; }


/* Enhanced resume content styles */
.resume-content { font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.4; color: #333; }

/* Header styling */
.resume-header { text-align: center; margin-bottom: 20px; color: #043670 !important; }
.resume-header span[style*="30pt"] { display: block; font-weight: bold; margin-bottom: 8px; }
.resume-header span[style*="16pt"] { display: block; font-weight: bold; margin-bottom: 12px; }

/* Section titles */
.section-title { color: #043670 !important; font-size: 15pt !important; font-weight: bold !important; margin: 20px 0 12px 0 !important; padding: 8px 0 !important; border-top: 0.8pt solid #043670 !important; border-bottom: 0.8pt solid #043670 !important; text-align: center !important; }

/* Entry containers */
.one-col-entry { margin: 12px 0; padding: 0 8px; }
.two-col-entry { display: flex; justify-content: space-between; margin: 8px 0; align-items: flex-start; }
.two-col-entry .left-col { flex: 1; }
.two-col-entry .right-col { text-align: right; font-style: italic; white-space: nowrap; margin-left: 20px; }

/* Lists and highlights */
.highlights, .highlights-bullet { margin: 8px 0; padding-left: 20px; }
.highlights li, .highlights-bullet li { margin: 4px 0; line-height: 1.3; }

/* Skills table */
.skills-table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.skills-table td { padding: 8px 12px; vertical-align: top; border: none; }
.skills-table td:first-child { font-weight: bold; width: 25%; color: #043670; }
.skills-table td:last-child { width: 75%; }

/* Links */
.resume-content a { color: #043670; text-decoration: none; }
.resume-content a:hover { text-decoration: underline; }

/* Typography */
.resume-content strong { font-weight: bold; color: #043670; }
.resume-content em { font-style: italic; }

/* Spacing adjustments */
.resume-content br + br { display: none; }
.resume-content div[style*="margin"] { margin: 6px 0 !important; }

/* Font size overrides */
.resume-content span[style*="11pt"] { font-size: 11pt !important; line-height: 1.3 !important; }
.resume-content span[style*="16pt"] { font-size: 16pt !important; line-height: 1.2 !important; }
.resume-content span[style*="30pt"] { font-size: 30pt !important; line-height: 1.1 !important; }

@media print {
  body * { visibility: hidden; }
  #resumeViewer, #resumeViewer * { visibility: visible; }
  #resumeViewer { position: absolute; inset: 0; border: 0; box-shadow: none; background: white; }
  #resumeViewer .latex { width: 8.5in; min-height: 11in; margin: 0; padding: 0.5in; }
}
.resume-placeholder { display: grid; place-items: center; height: 100%; color: var(--muted); padding: 20px; text-align: center; }

.filters input[type="search"] { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--card); color: var(--text); min-width: 220px; }
.switch { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 350px)); gap: 20px; justify-content: center; align-items: stretch; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px; box-shadow: var(--shadow); display: grid; gap: 10px; }
.card h4 { margin: 0; font-size: 1.05rem; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 0.88rem; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; background: rgba(122, 162, 255, 0.12); border: 1px solid var(--border); border-radius: 999px; }
.actions { display: flex; gap: 8px; }
.actions a { text-decoration: none; border: 1px solid var(--border); padding: 8px 10px; border-radius: 10px; color: var(--text); background: transparent; }
.actions a:hover { background: var(--card); }

.status { margin-top: 8px; color: var(--muted); text-align: center; }

.site-footer { border-top: 1px solid var(--border); padding: var(--section-spacing-small) 0; margin-top: var(--section-spacing-medium); }
.site-footer p { margin: 0; color: var(--muted); text-align: center; }

code { padding: 2px 6px; border-radius: 8px; background: var(--card); border: 1px solid var(--border); color: var(--text); }

/* Enhanced Project Cards */
.project-card { 
  background: var(--card); 
  border: 1px solid var(--border); 
  border-radius: 12px; 
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 320px;
  width: 350px;
  position: relative;
  /* animation: bounce 0.6s ease-out both; */
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(122, 162, 255, 0.1), transparent);
  transition: left 0.6s ease;
  z-index: 1;
  pointer-events: none;
}

.project-card:hover { 
  border-color: var(--primary); 
  box-shadow: 0 8px 24px rgba(4, 54, 112, 0.15); 
  transform: translateY(-2px);
  animation: tilt 0.6s ease-in-out;
  /* background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%); */
}

.project-card:hover::before {
  left: 100%;
}

.project-card.expanded {
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(4, 54, 112, 0.15);
}

.project-header {
  padding: 20px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.2s ease;
  flex-shrink: 0;
}

.project-header:hover {
  background-color: rgba(4, 54, 112, 0.02);
}

.project-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.project-title h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 600;
}

.toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.toggle-btn:hover {
  background-color: rgba(4, 54, 112, 0.1);
}

.toggle-icon {
  font-size: 14px;
  color: var(--primary);
  transition: transform 0.2s ease;
}

.project-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-stats span {
  background: var(--bg);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.language {
  background: var(--primary) !important;
  color: white !important;
}

.project-description {
  padding: 0 20px 16px;
  margin: 0;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

.project-links {
  padding: 0 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: auto;
  flex-shrink: 0;
}

.project-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.project-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 8px;
}

.repo-link, .demo-link {
  text-decoration: none;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.repo-link {
  color: var(--text);
  border: 1px solid var(--border);
  background: var(--card);
}

.repo-link:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.demo-link {
  background: linear-gradient(135deg, #f39c12, #e67e22);
  color: white;
  border: 1px solid #e67e22;
  font-weight: 600;
}

.demo-link:hover {
  background: linear-gradient(135deg, #e67e22, #d35400);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(230, 126, 34, 0.3);
}

.updated {
  color: var(--muted);
  font-size: 0.85rem;
}

.project-content {
  border-top: 1px solid var(--border);
  background: rgba(4, 54, 112, 0.02);
}

.readme-section {
  padding: 20px;
}

.readme-section h4 {
  margin: 0 0 16px;
  color: var(--text);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.readme-content {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  max-height: 400px;
  overflow-y: auto;
}

.readme-text {
  color: var(--text);
  line-height: 1.6;
}

.readme-text h1, .readme-text h2, .readme-text h3 {
  color: var(--primary);
  margin-top: 0;
  margin-bottom: 12px;
}

.readme-text h1 { font-size: 1.4rem; }
.readme-text h2 { font-size: 1.2rem; }
.readme-text h3 { font-size: 1.1rem; }

.readme-text code {
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 0.9em;
}

.readme-text pre {
  background: var(--bg);
  padding: 12px;
  border-radius: 6px;
  overflow-x: auto;
  border: 1px solid var(--border);
}

.readme-text a {
  color: var(--primary);
  text-decoration: none;
}

.readme-text a:hover {
  text-decoration: underline;
}

.loading, .no-readme, .error {
  text-align: center;
  color: #ff0000;
  /* color: var(--text-muted); */
  font-style: italic;
  padding: 20px;
}

.error {
  color: #e74c3c;
}

/* Click hint */
.click-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

.project-card:hover .click-hint {
  color: var(--primary);
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 54, 112, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  box-sizing: border-box;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.modal-content {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow: hidden;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  padding: 28px;
  border-bottom: 1px solid #e1e8ed;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  position: relative;
}

.modal-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary) 0%, #7c3aed 100%);
  border-radius: 16px 16px 0 0;
}

.modal-title h2 {
  margin: 0 0 12px 0;
  color: #1e293b;
  font-size: 1.5rem;
  font-weight: 700;
}

.modal-stats {
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px;
  opacity: 1 !important;
  visibility: visible !important;
}

.modal-stats span {
  background: rgba(255, 255, 255, 0.9) !important;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  color: #374151 !important;
  border: 1px solid rgba(148, 163, 184, 0.4);
  backdrop-filter: blur(4px);
  font-weight: 600;
  display: inline-block !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.modal-stats .language,
.modal-stats span.language,
span.language {
  background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%) !important;
  color: #1f2937 !important;
  border: 1px solid #9ca3af !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  opacity: 1 !important;
  display: inline-block !important;
  visibility: visible !important;
  font-weight: 600 !important;
  padding: 6px 12px !important;
  border-radius: 20px !important;
  transition: all 0.2s ease !important;
}

.modal-stats .language:hover,
.modal-stats span.language:hover,
span.language:hover {
  transform: scale(1.05) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
  background: linear-gradient(135deg, #d1d5db 0%, #9ca3af 100%) !important;
}

.modal-close {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  font-size: 20px;
  cursor: pointer;
  color: #dc2626;
  padding: 8px;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  transition: all 0.2s ease;
  line-height: 1;
}

.modal-close:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #b91c1c;
  transform: scale(1.05);
}

.modal-body {
  padding: 28px;
  overflow-y: auto;
  max-height: calc(90vh - 140px);
  background: #ffffff;
}

.modal-links {
  display: flex !important;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  opacity: 1 !important;
  visibility: visible !important;
}

.modal-links .repo-link,
.modal-links .demo-link {
  color: white !important;
  text-decoration: none;
  font-weight: 600;
  padding: 12px 20px;
  border: none;
  border-radius: 10px;
  transition: all 0.3s ease;
  font-size: 0.95rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
  display: inline-block !important;
  opacity: 1 !important;
  visibility: visible !important;
  min-width: 120px;
  text-align: center;
}

.modal-links .repo-link {
  background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
}

.modal-links .demo-link,
.modal-links a.demo-link,
a.demo-link {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
  opacity: 1 !important;
  display: inline-block !important;
  visibility: visible !important;
  color: #1f2937 !important;
  text-decoration: none !important;
  padding: 12px 20px !important;
  border-radius: 10px !important;
  font-weight: 700 !important;
  border: 2px solid #f59e0b !important;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) !important;
}

.modal-links .repo-link:hover,
.modal-links .demo-link:hover,
.modal-links a.demo-link:hover,
a.demo-link:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25) !important;
  opacity: 0.9 !important;
}

.modal-links .repo-link:hover {
  background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
}

.modal-links .demo-link:hover {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: #111827 !important;
  border-color: #d97706 !important;
}

.modal-description {
  margin-bottom: 28px;
  padding: 20px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 12px;
  border-left: 4px solid var(--primary);
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.modal-description::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(4, 54, 112, 0.02) 0%, rgba(124, 58, 237, 0.02) 100%);
  border-radius: 12px;
  pointer-events: none;
}

.modal-description p {
  color: #1f2937;
  line-height: 1.7;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

.modal-readme h3 {
  color: #1e293b;
  margin: 0 0 16px 0;
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-readme .readme-content {
  background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 28px;
  max-height: 600px;
  overflow-y: auto;
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  position: relative;
}

.modal-readme .readme-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(4, 54, 112, 0.1) 50%, transparent 100%);
}

.modal-readme .readme-content::-webkit-scrollbar {
  width: 8px;
}

.modal-readme .readme-content::-webkit-scrollbar-track {
  background: rgba(148, 163, 184, 0.1);
  border-radius: 4px;
}

.modal-readme .readme-content::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
  border-radius: 4px;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.modal-readme .readme-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
}

.modal-readme .readme-text {
  color: #374151;
  line-height: 1.8;
  font-size: 0.95rem;
}

/* Enhanced heading styles */
.modal-readme .readme-text h1,
.modal-readme .readme-text h2,
.modal-readme .readme-text h3,
.modal-readme .readme-text h4,
.modal-readme .readme-text h5,
.modal-readme .readme-text h6 {
  color: #1e293b;
  font-weight: 700;
  margin-top: 32px;
  margin-bottom: 16px;
  line-height: 1.3;
}

.modal-readme .readme-text h1:first-child,
.modal-readme .readme-text h2:first-child,
.modal-readme .readme-text h3:first-child {
  margin-top: 0;
}

.modal-readme .readme-text h1 {
  font-size: 1.8rem;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 8px;
  color: #111827;
}
.modal-readme .readme-text h2 {
  font-size: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 6px;
  color: #1f2937;
}
.modal-readme .readme-text h3 { font-size: 1.3rem; }
.modal-readme .readme-text h4 { font-size: 1.1rem; }
.modal-readme .readme-text h5 { font-size: 1rem; }
.modal-readme .readme-text h6 { font-size: 0.95rem; }

/* Paragraph styling */
.modal-readme .readme-text p {
  margin: 16px 0;
  line-height: 1.7;
  color: #4b5563;
  font-weight: 400;
}

/* List styling */
.modal-readme .readme-text ul,
.modal-readme .readme-text ol {
  margin: 16px 0;
  padding-left: 24px;
  color: #4b5563;
}

.modal-readme .readme-text li {
  margin: 8px 0;
  line-height: 1.6;
}

.modal-readme .readme-text ul li {
  list-style-type: disc;
}

.modal-readme .readme-text ol li {
  list-style-type: decimal;
}

/* Code styling */
.modal-readme .readme-text code {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  color: #e11d48;
  padding: 3px 8px;
  border-radius: 6px;
  font-family: 'Monaco', 'Menlo', 'Consolas', 'Courier New', monospace;
  font-size: 0.85em;
  font-weight: 600;
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.modal-readme .readme-text pre {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: #e2e8f0;
  border: 1px solid #475569;
  border-radius: 12px;
  padding: 24px;
  margin: 24px 0;
  overflow-x: auto;
  font-family: 'Monaco', 'Menlo', 'Consolas', 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
}

.modal-readme .readme-text pre::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(226, 232, 240, 0.2) 50%, transparent 100%);
}

.modal-readme .readme-text pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
  font-size: inherit;
}

/* Blockquote styling */
.modal-readme .readme-text blockquote {
  border-left: 4px solid var(--primary);
  margin: 20px 0;
  padding: 16px 20px;
  background: rgba(4, 54, 112, 0.05);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--text-muted);
}

/* Link styling */
.modal-readme .readme-text a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}

.modal-readme .readme-text a:hover {
  border-bottom-color: #2563eb;
  color: #1d4ed8;
}

/* Table styling */
.modal-readme .readme-text table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.modal-readme .readme-text th,
.modal-readme .readme-text td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.modal-readme .readme-text th {
  background: var(--bg);
  font-weight: 600;
  color: var(--primary);
}

.modal-readme .readme-text tr:last-child td {
  border-bottom: none;
}

/* Horizontal rule */
.modal-readme .readme-text hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 32px 0;
}

/* Image styling */
.modal-readme .readme-text img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 16px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Mobile responsiveness */
/* Skills Section */
.skills-container {
  max-width: 800px;
  margin: 0 auto;
}

.loading-skills {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.skill-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  transition: all 0.3s ease;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  /* animation: slide-in-right 0.8s ease-out both; */
  overflow: hidden;
}

.skill-item::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 3px;
  height: 0;
  background: linear-gradient(to bottom, var(--brand), var(--brand-2));
  transition: height 0.4s ease;
}

.skill-item:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(4, 54, 112, 0.1);
  transform: translateY(-2px);
  animation: wave 1s ease-in-out;
}

.skill-item:hover::after {
  height: 100%;
}

.skill-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.skill-name {
  font-weight: 600;
  color: var(--text);
  font-size: 1rem;
}

.skill-percentage {
  font-weight: 600;
  color: var(--primary);
  font-size: 0.9rem;
}

.skill-bar {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.skill-progress {
  height: 100%;
  border-radius: 4px;
  transition: width 1.5s ease-out;
  position: relative;
  overflow: hidden;
}

.skill-progress::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.606), transparent);
  animation: shimmer 2s infinite;
}

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

.skill-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.repo-count {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Language-specific colors */
/* .skill-progress.javascript { background: linear-gradient(90deg, #f7df1e, #f0db4f); }
.skill-progress.typescript { background: linear-gradient(90deg, #3178c6, #2d79c7); }
.skill-progress.python { background: linear-gradient(90deg, #3776ab, #ffd43b); }
.skill-progress.java { background: linear-gradient(90deg, #ed8b00, #f89820); }
.skill-progress.cpp, .skill-progress.c { background: linear-gradient(90deg, #00599c, #004482); }
.skill-progress.csharp { background: linear-gradient(90deg, #239120, #68217a); }
.skill-progress.php { background: linear-gradient(90deg, #777bb4, #8892bf); }
.skill-progress.ruby { background: linear-gradient(90deg, #cc342d, #e25649); }
.skill-progress.go { background: linear-gradient(90deg, #00add8, #00a29c); }
.skill-progress.rust { background: linear-gradient(90deg, #dea584, #ce6d39); }
.skill-progress.swift { background: linear-gradient(90deg, #fa7343, #ff8c42); }
.skill-progress.kotlin { background: linear-gradient(90deg, #7f52ff, #9c27b0); }
.skill-progress.dart { background: linear-gradient(90deg, #0175c2, #13b9fd); }
.skill-progress.html { background: linear-gradient(90deg, #e34f26, #f06529); }
.skill-progress.css { background: linear-gradient(90deg, #1572b6, #33a9dc); }
.skill-progress.shell { background: linear-gradient(90deg, #89e051, #4ade80); }
.skill-progress.default { background: linear-gradient(90deg, var(--primary), #7c3aed); } */

/* Unified progress bar colors */
.skill-progress {
  background: linear-gradient(90deg,  #89e051,  #4ade80);
}

/* Responsive design for skills */
@media (max-width: 768px) {
  .skills-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .skill-item {
    min-height: 100px;
    padding: 14px;
  }
  
  .skill-name {
    font-size: 0.95rem;
  }
  
  .skill-percentage {
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .skills-grid {
    gap: 10px;
    justify-items: center;
    margin: 0 auto;
  }
  
  .skill-item {
    padding: 12px;
    min-height: 90px;
    width: 100%;
    max-width: 300px;
  }
}

/* Pagination Controls - Separate for Projects and Skills */
.projects-pagination,
.skills-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin: var(--section-spacing-xs) 0;
  padding: var(--section-spacing-xs);
  animation: fade-in-up 0.8s ease-out both;
  position: relative;
}

.projects-pagination::before,
.skills-pagination::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
  animation: gradient-shift 3s ease-in-out infinite;
}

.projects-pagination button,
.skills-pagination button {
  padding: 10px 18px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  position: relative;
  overflow: hidden;
  animation: bounce-in 0.6s ease-out both;
}

/* Staggered animation delays for pagination buttons */
.projects-pagination button:nth-child(1),
.skills-pagination button:nth-child(1) {
  animation-delay: 0.1s;
}

.projects-pagination span,
.skills-pagination span {
  animation-delay: 0.2s;
}

.projects-pagination button:nth-child(3),
.skills-pagination button:nth-child(3) {
  animation-delay: 0.3s;
}

.projects-pagination button::before,
.skills-pagination button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(122, 162, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.projects-pagination button:hover:not(:disabled),
.skills-pagination button:hover:not(:disabled) {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 25px rgba(4, 54, 112, 0.3);
  animation: neon-pulse 1s ease-in-out infinite;
}

.projects-pagination button:hover::before,
.skills-pagination button:hover::before {
  left: 100%;
}

.projects-pagination button:disabled,
.skills-pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--border);
  color: var(--text-muted);
  animation: none;
  transform: none;
}

.projects-pagination button:active:not(:disabled),
.skills-pagination button:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
  transition: transform 0.1s ease;
}

.projects-pagination span,
.skills-pagination span {
  color: var(--text);
  font-weight: 500;
  padding: 0 8px;
  font-size: 0.95rem;
  background: linear-gradient(135deg, var(--text) 0%, var(--brand) 50%, var(--text) 100%);
  background-size: 200% 200%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 4s ease-in-out infinite;
  position: relative;
}

.projects-pagination span::after,
.skills-pagination span::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
  border-radius: 1px;
  animation: gradient-shift 3s ease-in-out infinite;
}

@media (max-width: 768px) {
  /* Responsive spacing adjustments for mobile */
  :root {
    --section-spacing-large: 60px;
    --section-spacing-medium: 40px;
    --section-spacing-small: 24px;
    --section-spacing-xs: 16px;
  }

  /* Responsive scroll padding for mobile */
  html {
    scroll-padding-top: 80px; /* Adjust for mobile header height */
  }

  /* Fixed header adjustments for mobile */
  main {
    padding-top: 70px; /* Slightly less padding on mobile */
  }
  
  .site-header {
    background: linear-gradient(to bottom, rgba(0,0,0,0.8), rgba(0,0,0,0.4));
  }
  
  .header-inner {
    padding: 10px 0; /* Less padding on mobile */
    gap: 10px; /* Reduce gap between brand and nav */
  }
  
  .brand {
    /* No gap needed since no avatar */
  }
  
  .name {
    font-size: 1.1rem;
    letter-spacing: 0.08em;
  }
  
  .animated-header {
    animation: 
      glow-pulse 4s ease-in-out infinite,
      text-float 6s ease-in-out infinite,
      typewriter 1.2s steps(6) 1s both,
      blink 0.8s step-end 2.2s 3;
  }
  
  .tagline {
    font-size: 0.8rem;
  }
  
  .nav {
    gap: 8px; /* Smaller gap between nav items */
  }
  
  .nav a {
    font-size: 0.85rem; /* Smaller nav text on mobile */
    padding: 6px 8px; /* Smaller nav padding on mobile */
  }
}

@media (max-width: 480px) {
  .header-inner {
    padding: 8px 0;
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
  
  .brand {
    justify-content: center;
    /* No gap needed since no avatar */
  }
  
  .name {
    font-size: 1rem;
    letter-spacing: 0.06em;
  }
  
  .animated-header {
    animation: 
      glow-pulse 4s ease-in-out infinite,
      text-float 6s ease-in-out infinite,
      typewriter 1s steps(6) 1s both,
      blink 0.6s step-end 2s 3;
  }
  
  .tagline {
    font-size: 0.75rem;
    line-height: 1.2;
  }
  
  .nav {
    gap: 6px;
    justify-content: center;
  }
  
  .nav a {
    font-size: 0.8rem;
    padding: 5px 8px;
  }
  
  /* Adjust main padding for stacked header */
  main {
    padding-top: 90px !important; /* More space for stacked header */
  }
  
  html {
    scroll-padding-top: 90px !important;
  }

  .projects-pagination,
  .skills-pagination {
    flex-direction: column;
    gap: 12px;
  }
  
  .projects-pagination button,
  .skills-pagination button {
    width: 120px;
  }

  .modal {
    padding: 10px;
  }
  
  .modal-content {
    max-height: 95vh;
  }
  
  .modal-header {
    padding: 16px;
  }
  
  .modal-body {
    padding: 16px;
    max-height: calc(95vh - 100px);
  }
  
  .modal-title h2 {
    font-size: 1.3rem;
  }
  
  .modal-links {
    flex-direction: column;
  }
  
  .modal-readme .readme-content {
    max-height: 300px;
  }
}


