:root {
  --primary: #485fc7;
  --primary-dark: #3a56c0;
  --secondary: #00d1b2;
  --dark: #363636;
  --light: #f5f5f5;
  --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 4px 20px rgba(0, 0, 0, 0.15);
  --shadow-large: 0 8px 30px rgba(0, 0, 0, 0.2);
  --border-radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  scroll-behavior: smooth;
  scroll-padding: 120px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Animated gradient background */
.hero.is-fullheight {
  background: linear-gradient(-45deg, #2c2b2a, #1002d1, #2c2b2a, #0f1020);
  background-size: 400% 400%;
  animation: gradient 20s ease infinite;
  color: white;
  position: relative;
  overflow: hidden;
}

.hero.is-fullheight::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.1) 100%);
  pointer-events: none;
}

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

/* Floating animation */
@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0px);
  }
}

.floating {
  animation: float 6s ease-in-out infinite;
}

/* Card hover effects */
.card {
  transition: var(--transition);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-light);
  border: 1px solid rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(10px);
}

.image-card-deck {
  position: relative;
  width: 420px; /* bigger deck width */
  height: 520px; /* bigger deck height */
  margin: 40px auto;
}

.image-card-deck .image-card {
  position: absolute;
  width: 320px;
  height: 480px;
  transition: transform 0.7s cubic-bezier(0.4,0,0.2,1), z-index 0.3s, filter 0.3s, opacity 0.5s;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  cursor: pointer;
  object-fit: cover;
  background: #fff;
  border: none;
  backdrop-filter: none;
.image-card-deck .image-card {
  position: absolute;
  width: 320px;
  height: 480px;
  transition: transform 0.7s cubic-bezier(0.4,0,0.2,1), z-index 0.3s, filter 0.3s, opacity 0.5s;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  cursor: pointer;
  object-fit: cover;
  background: #fff;
  border: none;
  backdrop-filter: none;
}

/* Skill tags */
.tag {
  margin: 0.25rem;
  transition: var(--transition);
  border-radius: 8px;
  font-weight: 500;
  letter-spacing: 0.025em;
}

.tag:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: var(--shadow-medium);
}

.tag.is-light {
  background-color: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

/* Timeline styling */
.timeline {
  position: relative;
  padding-left: 3rem;
  padding-right: 3rem;
}

/* Education timeline - enhanced design */
.education-timeline {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 0;
}

.education-timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--primary), var(--info), var(--success), var(--warning));
  border-radius: 3px;
}

.education-item {
  position: relative;
  margin-bottom: 3rem;
  width: 100%;
}

.education-item:nth-child(odd) .timeline-content {
  margin-left: 0;
  margin-right: 52%;
  text-align: right;
}

.education-item:nth-child(even) .timeline-content {
  margin-left: 52%;
  margin-right: 0;
  text-align: left;
}

.timeline-marker {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 3px solid white;
  z-index: 2;
  top: 2rem;
  box-shadow: var(--shadow-medium);
}

.timeline-marker.is-primary {
  background-color: var(--primary);
}

.timeline-marker.is-info {
  background-color: #3298dc;
}

.timeline-marker.is-success {
  background-color: #48c774;
}

.timeline-marker.is-warning {
  background-color: #ffdd57;
}

.timeline-content {
  position: relative;
}

.education-card {
  border-left: 4px solid transparent;
  transition: var(--transition);
}

.education-item:nth-child(1) .education-card {
  border-left-color: var(--primary);
}

.education-item:nth-child(2) .education-card {
  border-left-color: #3298dc;
}

.education-item:nth-child(3) .education-card {
  border-left-color: #48c774;
}

.education-item:nth-child(4) .education-card {
  border-left-color: #ffdd57;
}

.education-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: var(--shadow-large);
}

.education-card .media-left figure {
  border-radius: 50%;
  overflow: hidden;
  box-shadow: var(--shadow-light);
  transition: var(--transition);
}

.education-card:hover .media-left figure {
  transform: scale(1.1);
  box-shadow: var(--shadow-medium);
}

.education-card .title {
  margin-bottom: 0.5rem;
}

.education-card .subtitle {
  margin-bottom: 0.25rem;
}

.education-card .content {
  padding-top: 1rem;
  border-top: 1px solid rgba(0,0,0,0.1);
  margin-top: 1rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Mobile adjustments for education timeline */
@media screen and (max-width: 768px) {
  .education-timeline {
    padding: 1rem 0;
  }
  
  .education-timeline::before {
    left: 1.5rem;
    transform: none;
    width: 2px;
  }
  
  .timeline-marker {
    left: 1.5rem;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    top: 1.5rem;
  }
  
  .education-item {
    margin-bottom: 2rem;
  }
  
  .education-item:nth-child(odd) .timeline-content,
  .education-item:nth-child(even) .timeline-content {
    margin-left: 3rem;
    margin-right: 0;
    text-align: left;
  }
  
  .education-card {
    border-left-width: 3px;
    margin-bottom: 1rem;
  }
  
  .education-card .media-left figure {
    width: 40px;
    height: 40px;
  }
  
  .education-card .title {
    font-size: 1.1rem;
  }
  
  .education-card .subtitle {
    font-size: 0.9rem;
  }
}

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

/* Improved button styles */
.button {
  transition: var(--transition);
  border-radius: 8px;
  font-weight: 500;
  letter-spacing: 0.025em;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

.button.is-rounded {
  border-radius: 25px;
}

.button.is-white.is-outlined:hover {
  background-color: white;
  color: var(--primary);
  border-color: white;
}

/* Contact form */
.contact-form .control.has-icons-left .icon {
  height: 2.5em;
}

/* Dark mode toggle */
.dark-mode {
  background-color: #1a1a1a;
  color: #f5f5f5;
}

.dark-mode .card {
  background-color: #2d2d2d;
  color: #f5f5f5;
}

.dark-mode .title,
.dark-mode .subtitle {
  color: #f5f5f5 !important;
}

/* Particle.js container */
#particles-js {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 0;
}

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

/* Typewriter effect */
.typewriter {
  border-right: 3px solid white;
  white-space: nowrap;
  overflow: hidden;
  display: inline-block;
}

/* Mobile menu animation */
.navbar-menu.is-active {
  animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Enhanced project and publication cards */
.card .media-left figure {
  transition: transform 0.3s ease;
}

.card:hover .media-left figure {
  transform: scale(1.1);
}

/* Better spacing for card content */
.card-content {
  padding: 1.5rem;
}

.card-content .media {
  margin-bottom: 1rem;
}

.card-content .content {
  margin-top: 1rem;
}

/* Enhanced tags in cards */
.card .tags {
  margin-top: 1rem;
  gap: 0.5rem;
}

/* Profile image improvements */
.image.is-128x128 img {
  transition: transform 0.3s ease;
  box-shadow: var(--shadow-medium);
}

.floating:hover .image.is-128x128 img {
  transform: scale(1.05);
}

/* Footer improvements */
.footer {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  color: #ecf0f1;
  padding: 3rem 1.5rem;
}

.footer p {
  color: #bdc3c7;
}

.footer a {
  color: #ecf0f1;
  transition: var(--transition);
}

.footer a:hover {
  color: var(--primary);
  transform: translateY(-2px);
}

/* Contact section improvements */
#contact {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  position: relative;
  overflow: hidden;
}

#contact::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.05"><circle cx="30" cy="30" r="1.5"/></g></svg>');
  pointer-events: none;
}

/* Enhanced section backgrounds */
#about {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

#experience {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

#education {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

#projects {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

#publications {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* Mobile optimizations */
@media screen and (max-width: 768px) {
  /* Root variables for mobile */
  :root {
    --border-radius: 8px;
  }
  
  /* Make columns use full width on mobile */
  .column {
    padding: 0.75rem !important;
  }
  
  .columns {
    margin: 0 !important;
  }
  
  /* Reduce padding on sections for mobile */
  .section {
    padding: 3rem 1rem !important;
  }
  
  /* Make cards fill the full width on mobile */
  .column.is-8,
  .column.is-10 {
    width: 100% !important;
    flex: none !important;
  }
  
  /* Adjust project section for mobile */
  #projects .column.is-8 {
    width: 100% !important;
    max-width: 100% !important;
  }
  
  /* Adjust publications section for mobile */
  #publications .column.is-10 {
    width: 100% !important;
    max-width: 100% !important;
  }
  
  /* Education section mobile improvements */
  #education .column.is-5 {
    width: 100% !important;
    flex: none !important;
    margin-bottom: 1.5rem;
  }
  
  /* Adjust timeline padding for mobile */
  .timeline {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  /* Better mobile typography */
  .title.is-1 {
    font-size: 2.5rem !important;
    line-height: 1.2;
  }
  
  .title.is-2 {
    font-size: 2rem !important;
    line-height: 1.3;
  }
  
  .subtitle.is-4 {
    font-size: 1.25rem !important;
    line-height: 1.4;
  }
  
  /* Make buttons stack better on mobile */
  .buttons.is-centered {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }
  
  .button {
    margin: 0.25rem;
    min-width: 120px;
  }
  
  /* Improve card spacing on mobile */
  .card {
    margin-bottom: 1.5rem;
  }
  
  /* Make tags wrap better on mobile */
  .tags {
    justify-content: center;
    gap: 0.25rem;
  }
  
  .tag {
    margin: 0.125rem;
    font-size: 0.875rem;
  }
  
  /* Adjust hero section for mobile */
  .hero-content {
    padding: 0 1rem;
  }
  
  /* Make images responsive */
  .image {
    margin: 0 auto;
  }
  
  /* Contact section improvements */
  #contact .column.is-6 {
    width: 100% !important;
    padding: 0 1rem;
  }
  
  /* Footer improvements */
  .footer {
    padding: 3rem 1rem;
  }
  
  /* Reduce animations on mobile for better performance */
  .card:hover {
    transform: translateY(-4px) scale(1.01);
  }
  
  .tag:hover {
    transform: translateY(-1px) scale(1.02);
  }
  
  /* Improve mobile navigation */
  .navbar-menu.is-active {
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-large);
  }
  
  /* Better mobile section padding */
  #about, #experience, #education, #projects, #publications {
    background: #ffffff;
  }
  
  /* Mobile-specific button improvements */
  .button.is-rounded {
    border-radius: 20px;
  }
}

/* Tablet optimizations */
@media screen and (min-width: 769px) and (max-width: 1023px) {
  .section {
    padding: 3rem 1.5rem;
  }
  
  .column.is-8 {
    width: 90% !important;
  }
  
  .column.is-10 {
    width: 95% !important;
  }
}

/* Improved hover effects for touch devices */
@media (hover: none) and (pointer: coarse) {
  .card:hover {
    transform: none;
    box-shadow: var(--shadow-light);
  }
  
  .tag:hover {
    transform: none;
    box-shadow: none;
  }
  
  .button:hover {
    transform: none;
    box-shadow: var(--shadow-light);
  }
}

/* Better focus states for accessibility */
.button:focus,
.navbar-item:focus,
.card:focus {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
  box-shadow: 0 0 0 4px rgba(72, 95, 199, 0.1);
}

/* Navbar improvements */
.navbar {
  backdrop-filter: blur(10px);
  background-color: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-light);
}

.navbar-item:hover {
  background-color: rgba(72, 95, 199, 0.1);
  color: var(--primary);
}

/* Improve loading states */
.card {
  min-height: 100px;
}

/* Better image loading */
img {
  transition: opacity 0.3s ease;
}

img:not([src]) {
  opacity: 0;
}

/* Smooth scrolling improvements */
html {
  scroll-behavior: smooth;
}

/* Better print styles */
@media print {
  .navbar,
  #particles-js,
  .hero-foot,
  .loading-screen {
    display: none !important;
  }
  
  .section {
    page-break-inside: avoid;
  }
  
  .card {
    box-shadow: none !important;
    border: 1px solid #ddd;
  }
}

/* Loading screen */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(-45deg, #2c2b2a, #1002d1, #2c2b2a, #0f1020);
  background-size: 400% 400%;
  animation: gradient 20s ease infinite;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease-out;
}

.loading-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loader {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Smooth reveal animations */
.fade-in {
  animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

/* Section improvements */
.section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Content spacing improvements */
.content p {
  margin-bottom: 1.5rem;
}

.content p:last-child {
  margin-bottom: 0;
}

/* Enhanced title spacing */
.title {
  margin-bottom: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.subtitle {
  margin-bottom: 1rem;
  font-weight: 400;
  color: #666;
}
