* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: "Space Grotesk", sans-serif;
  transition:
    background-color 0.5s ease,
    color 0.5s ease;
}

body.dark-mode {
  background-color: #0f0f0f;
  color: #ffffff;
}

body.light-mode {
  background-color: #f5f5f5;
  color: #1a1a1a;
}

.glass-card {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark-mode .glass-card {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.light-mode .glass-card {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.glass-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 60px rgba(255, 214, 0, 0.15);
}

.light-mode .glass-card:hover {
  box-shadow: 0 20px 60px rgba(255, 140, 0, 0.2);
}

.accent-text {
  color: #ffd600;
}
.light-mode .accent-text {
  color: #ff8c00;
}

.accent-bg {
  background-color: #ffd600;
}
.light-mode .accent-bg {
  background-color: #ff8c00;
}

.accent-border {
  border-color: #ffd600;
}
.light-mode .accent-border {
  border-color: #ff8c00;
}

.glow-accent {
  box-shadow: 0 0 30px rgba(255, 214, 0, 0.3);
}
.light-mode .glow-accent {
  box-shadow: 0 0 30px rgba(255, 140, 0, 0.3);
}

.floating-object {
  position: absolute;
  opacity: 0.1;
  animation: float 6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(5deg);
  }
}

@media (max-width: 768px) {
  .floating-object {
    display: none;
  }
}

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

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

@keyframes pulse-glow {
  0%,
  100% {
    box-shadow: 0 0 20px rgba(255, 214, 0, 0.2);
  }
  50% {
    box-shadow: 0 0 40px rgba(255, 214, 0, 0.4);
  }
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.animate-fade-in {
  animation: fadeIn 1s ease-out forwards;
}

.delay-100 {
  animation-delay: 0.1s;
}
.delay-200 {
  animation-delay: 0.2s;
}
.delay-300 {
  animation-delay: 0.3s;
}
.delay-400 {
  animation-delay: 0.4s;
}
.delay-500 {
  animation-delay: 0.5s;
}

.skill-bubble {
  transition: all 0.3s ease;
  cursor: default;
  animation: float-skill 8s ease-in-out infinite;
}

@keyframes float-skill {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(5px, -10px) rotate(2deg);
  }
  50% {
    transform: translate(-5px, 5px) rotate(-1deg);
  }
  75% {
    transform: translate(10px, -5px) rotate(1deg);
  }
}

.skill-bubble:nth-child(even) {
  animation-duration: 10s;
  animation-delay: -2s;
}

.skill-bubble:nth-child(3n) {
  animation-duration: 12s;
  animation-delay: -5s;
}

.skill-bubble:hover {
  transform: scale(1.15) !important;
  z-index: 10;
  animation-play-state: paused;
}

.hero-gradient {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.3;
  animation: pulse-glow 4s ease-in-out infinite;
  pointer-events: none;
}

@media (max-width: 768px) {
  .hero-gradient {
    width: 300px;
    height: 300px;
    filter: blur(80px);
  }
}

.btn-primary {
  background: linear-gradient(135deg, #ffd600, #ffa500);
  color: #0f0f0f;
  font-weight: 600;
  padding: 14px 32px;
  border-radius: 50px;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.light-mode .btn-primary {
  background: linear-gradient(135deg, #ff8c00, #ff6600);
  color: #ffffff;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(255, 214, 0, 0.4);
}

.btn-secondary {
  background: transparent;
  border: 2px solid #ffd600;
  color: #ffd600;
  font-weight: 600;
  padding: 12px 30px;
  border-radius: 50px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.light-mode .btn-secondary {
  border-color: #ff8c00;
  color: #ff8c00;
}

.btn-secondary:hover {
  background: #ffd600;
  color: #0f0f0f;
  box-shadow: 0 10px 30px rgba(255, 214, 0, 0.3);
}

.light-mode .btn-secondary:hover {
  background: #ff8c00;
  color: #ffffff;
}

.nav-link {
  position: relative;
  padding: 8px 16px;
  transition: all 0.3s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: #ffd600;
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.light-mode .nav-link::after {
  background: #ff8c00;
}

.nav-link:hover::after {
  width: 80%;
}

/* Hide underlines in mobile menu */
@media (max-width: 1024px) {
  #mobileMenu .nav-link::after {
    display: none;
  }
}

.project-card {
  cursor: pointer;
  position: relative;
  overflow: hidden;
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  border: 2px solid rgba(255, 214, 0, 0.2);
  background: rgba(255, 255, 255, 0.03);
  padding: 1rem;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  width: 300px;
  height: 300px;
  margin: 0 auto;
  animation: wavy-morph 20s ease-in-out infinite alternate;
  flex-shrink: 0;
  /* Force hardware acceleration for better clipping */
  transform: translateZ(0);
}

.project-card-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.6;
  transition:
    opacity 0.5s ease,
    filter 0.5s ease;
  z-index: 0;
  filter: grayscale(40%) brightness(0.8);
}

.project-card:hover .project-card-bg {
  opacity: 0.85;
  filter: grayscale(0%) brightness(1);
}

.project-card-content {
  position: relative;
  z-index: 2;
  width: 90%;
  transition: all 0.4s ease;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.light-mode .project-card-content {
  text-shadow: 0 1px 4px rgba(255, 255, 255, 0.5);
}

.project-card:hover .project-card-content {
  transform: translateY(-5px);
}

.click-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  transition: all 0.4s ease;
  font-size: 0.8rem;
  color: #ffd600;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  z-index: 3;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}

.light-mode .click-hint {
  color: #ff8c00;
  text-shadow: 0 1px 4px rgba(255, 255, 255, 0.5);
}

.project-card:hover .click-hint {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Always show hint on mobile since there is no hover */
@media (max-width: 1024px) {
  .click-hint {
    opacity: 1 !important;
    transform: translateX(-50%) translateY(0) !important;
    visibility: visible !important;
  }
}

@keyframes wavy-morph {
  0% {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  }
  50% {
    border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
  }
  100% {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  }
}

.project-card:hover {
  transform: scale(1.05);
  border-color: #ffd600;
  box-shadow: 0 0 30px rgba(255, 214, 0, 0.2);
}

.light-mode .project-card {
  border-color: rgba(255, 140, 0, 0.2);
  background: rgba(0, 0, 0, 0.02);
}

.light-mode .project-card:hover {
  border-color: #ff8c00;
}

/* Carousel container */
.projects-carousel-wrapper {
  position: relative;
  overflow: hidden;
  padding: 2rem 0;
}

.projects-carousel-wrapper::before,
.projects-carousel-wrapper::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100px;
  z-index: 2;
  pointer-events: none;
}

.projects-carousel-wrapper::before {
  left: 0;
  background: linear-gradient(to right, #0f0f0f, transparent);
}

.projects-carousel-wrapper::after {
  right: 0;
  background: linear-gradient(to left, #0f0f0f, transparent);
}

@media (max-width: 768px) {
  .projects-carousel-wrapper::before,
  .projects-carousel-wrapper::after {
    width: 40px;
  }
}

.light-mode .projects-carousel-wrapper::before {
  background: linear-gradient(to right, #ffffff, transparent);
}

.light-mode .projects-carousel-wrapper::after {
  background: linear-gradient(to left, #ffffff, transparent);
}

.projects-carousel {
  display: flex;
  overflow-x: auto;
  gap: 2rem;
  padding: 2rem 4rem;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  align-items: center;
}
.projects-carousel::-webkit-scrollbar {
  display: none;
}

/* Detail Modal / Overlay */
.project-detail-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(15px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.project-detail-modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-inner {
  max-width: 700px;
  width: 90%;
  background: #1a1a1a;
  border: 2px solid #ffd600;
  border-radius: 2rem;
  padding: 3rem;
  transform: scale(0.8);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.project-detail-modal.active .modal-inner {
  transform: scale(1);
}

.light-mode .modal-inner {
  background: #ffffff;
  border-color: #ff8c00;
  color: #1a1a1a;
}

.close-modal {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  cursor: pointer;
  color: #888;
  transition: color 0.3s;
}

.close-modal:hover {
  color: #ffd600;
}

.tech-tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255, 214, 0, 0.15);
  color: #ffd600;
  transition: all 0.3s ease;
}

.light-mode .tech-tag {
  background: rgba(255, 140, 0, 0.15);
  color: #ff8c00;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 1.1rem;
  opacity: 0.7;
  margin-bottom: 3rem;
}

input,
textarea {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 13px 24px !important;
  color: inherit;
  width: 100%;
  transition: all 0.3s ease;
  font-family: "Space Grotesk", sans-serif;
}

.light-mode input,
.light-mode textarea {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.1);
}

input:focus,
textarea:focus {
  outline: none;
  border-color: #ffd600;
  box-shadow: 0 0 20px rgba(255, 214, 0, 0.2);
}

.light-mode input:focus,
.light-mode textarea:focus {
  border-color: #ff8c00;
  box-shadow: 0 0 20px rgba(255, 140, 0, 0.2);
}

.light-mode .social-icon:hover {
  background: #ff8c00;
  border-color: #ff8c00;
}

.social-icon:hover svg {
  stroke: #0f0f0f;
}

.social-links-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  .social-links-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

.social-link-item {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  width: auto;
  transition: all 0.3s ease;
  padding: 0.5rem;
  border-radius: 1.25rem;
}

@media (min-width: 1024px) {
  .social-link-item {
    width: 100%;
  }
  .social-link-item:hover {
    background: rgba(255, 255, 255, 0.05);
  }
  .light-mode .social-link-item:hover {
    background: rgba(0, 0, 0, 0.03);
  }
}

.social-btn {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: inherit;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  flex-shrink: 0;
}

.light-mode .social-btn {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
}

/* Hover effects only for desktop/hoverable devices */
@media (hover: hover) {
  .social-btn:hover {
    background: #ffd600;
    border-color: #ffd600;
    color: #0f0f0f;
    transform: translateY(-8px) scale(1.1);
    box-shadow: 0 15px 30px rgba(255, 214, 0, 0.3);
  }

  .light-mode .social-btn:hover {
    background: #ff8c00;
    border-color: #ff8c00;
    color: #ffffff;
    box-shadow: 0 15px 30px rgba(255, 140, 0, 0.3);
  }

  .social-btn svg {
    transition: transform 0.4s ease;
  }

  .social-btn:hover svg {
    transform: scale(1.1);
  }
}

/* Mobile specific resets to ensure links work smoothly */
@media (max-width: 1024px) {
  .social-btn {
    width: 54px;
    height: 54px;
    border-radius: 14px;
  }

  /* Disable hover transform on mobile to avoid click issues */
  .social-btn:hover,
  .social-btn:active {
    transform: none !important;
    box-shadow: none !important;
  }
}

.toggle-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
}

.light-mode .toggle-btn {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
}

.toggle-btn:hover {
  transform: rotate(360deg) scale(1.1);
  border-color: #ffd600;
  box-shadow: 0 0 20px rgba(255, 214, 0, 0.3);
}

.light-mode .toggle-btn:hover {
  border-color: #ff8c00;
  box-shadow: 0 0 20px rgba(255, 140, 0, 0.3);
}

.toggle-btn:active {
  transform: scale(0.9) rotate(180deg);
}

.toggle-btn svg {
  transition: all 0.5s ease;
}

.dark-mode .sun-icon {
  opacity: 0;
  transform: translateY(20px);
}
.dark-mode .moon-icon {
  opacity: 1;
  transform: translateY(0);
}

.light-mode .sun-icon {
  opacity: 1;
  transform: translateY(0);
}
.light-mode .moon-icon {
  opacity: 0;
  transform: translateY(-20px);
}

.sun-icon,
.moon-icon {
  position: absolute;
}

.header-glass {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(15, 15, 15, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.light-mode .header-glass {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
  background: #ffd600;
  border-radius: 4px;
}

.light-mode ::-webkit-scrollbar-track {
  background: #e5e5e5;
}

.light-mode ::-webkit-scrollbar-thumb {
  background: #ff8c00;
}
/* Desktop: rounded-full, Mobile: square */
@media (max-width: 1024px) {
  header {
    background: transparent !important;
    border: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    width: 100% !important;
    max-width: 100% !important;
    top: 1rem !important;
    padding: 0 1rem !important;
  }

  .toggle-btn.lg\:hidden,
  #mobileMenuBtn {
    background: rgba(15, 15, 15, 0.8) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  }

  .light-mode .toggle-btn.lg\:hidden,
  .light-mode #mobileMenuBtn {
    background: rgba(255, 255, 255, 0.8) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  }

  #mobileMenu {
    margin-top: 5rem !important;
    background: rgba(15, 15, 15, 0.95);
    border-radius: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  .light-mode #mobileMenu {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.1);
  }
}

/* Ensure header-glass has proper background */
.header-glass {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(15, 15, 15, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.light-mode .header-glass {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.1);
}
.timeline-line {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, #ffd600, transparent);
}

.light-mode .timeline-line {
  background: linear-gradient(180deg, #ff8c00, transparent);
}

.timeline-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffd600;
  box-shadow: 0 0 20px rgba(255, 214, 0, 0.5);
  flex-shrink: 0;
}

.light-mode .timeline-dot {
  background: #ff8c00;
  box-shadow: 0 0 20px rgba(255, 140, 0, 0.5);
}
#home {
  padding-top: 130px;
}

/* Mobile adjustments for experience cards */
@media (max-width: 1024px) {
  .glass-card.rounded-2xl {
    width: 100%;
  }
}
