/* General Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Smooth theme transitions */
*, *::before, *::after {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Theme Variables */
:root {
  /* Default to dark theme colors */
  --primary-color: #00d1b2; /* Vibrant Teal/Cyan */
  --secondary-color: #b0bec5; /* Lighter gray for contrast */
  --accent-color: #00f0ff; /* Brighter Cyan for accents */
  --light-accent-bg: rgba(0, 209, 178, 0.1);
  --background-color: #000000; /* Pitch Black */
  --text-color: #f5f5f5;
  --light-color: #111; /* Slightly lighter dark for elements on primary bg */
  --dark-color: #f5f5f5;
  --card-bg: #1a1a1a; /* Slightly lighter than pitch black */
  --navbar-bg: rgba(0, 0, 0, 0.95); /* Changed to pure black with opacity */
  --contact-bg: #1a1a1a; /* Slightly lighter */
  --border-color: #333; /* Adjusted border for contrast */
  --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); /* Slightly stronger shadow */
  --transition: all 0.3s ease;
}

/* Light Theme Variables (Optional) */
[data-theme="light"] {
  --primary-color: #009688;
  --secondary-color: #2c3e50;
  --accent-color: #00bfa5;
  --light-accent-bg: rgba(0, 150, 136, 0.1);
  --background-color: #f9f9f9;
  --text-color: #333;
  --light-color: #fff;
  --dark-color: #222;
  --card-bg: #fff;
  --navbar-bg: rgba(255, 255, 255, 0.95);
  --contact-bg: #fff;
  --border-color: #ddd;
  --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

/* ===== LOADER STYLES ===== */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--background-color); /* Use theme background */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999; /* High z-index to be on top */
  transition: opacity 1s ease-out; /* For the fade-out */
}

/* ===== GLITCH EFFECT ===== */
.glitch-text {
  position: relative;
  font-family: 'Courier New', Courier, monospace;
  font-size: 4rem;
  color: var(--primary-color); /* Use theme primary color */
  text-transform: uppercase;
}

.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--background-color); /* Use theme background */
  overflow: hidden;
}

.glitch-text::before {
  left: 2px;
  text-shadow: -2px 0 red;
  animation: glitch 2s infinite linear alternate-reverse;
}

.glitch-text::after {
  left: -2px;
  text-shadow: 2px 0 blue;
  animation: glitch 3s infinite linear alternate-reverse;
}

/* Keyframes for the glitch animation */
@keyframes glitch {
  0% { clip-path: inset(10% 0 80% 0); }
  10% { clip-path: inset(50% 0 30% 0); }
  20% { clip-path: inset(90% 0 5% 0); }
  30% { clip-path: inset(25% 0 70% 0); }
  40% { clip-path: inset(60% 0 20% 0); }
  50% { clip-path: inset(5% 0 90% 0); }
  60% { clip-path: inset(40% 0 45% 0); }
  70% { clip-path: inset(85% 0 10% 0); }
  80% { clip-path: inset(20% 0 65% 0); }
  90% { clip-path: inset(75% 0 15% 0); }
  100% { clip-path: inset(45% 0 40% 0); }
}

/* ===== FADE OUT & HIDE ===== */
.hidden {
  animation: fadeOut 1s forwards;
}

@keyframes fadeOut {
  100% {
    opacity: 0;
    visibility: hidden; /* Hide element after animation */
  }
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background-color); /* Ensures body bg uses the variable */
  overflow-x: hidden;
  /* Ensure GPU acceleration for smoother scrolling */
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.section-padding {
  padding: 100px 0;
}

.section-title {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 50px;
  position: relative;
  animation: float 5s ease-in-out infinite;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background-color: var(--primary-color);
}

.btn {
  display: inline-block;
  padding: 12px 30px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  font-weight: 600;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.3s, box-shadow 0.3s;
}

.btn-primary {
  background-color: var(--primary-color);
  color: var(--dark-color);
  font-weight: bold;
}

.btn-primary:hover {
  background-color: var(--accent-color); /* Use accent color for hover */
  color: var(--light-color); /* Ensure text remains readable */
  transform: translateY(-5px) translateZ(10px);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
  background-color: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
  background-color: var(--primary-color);
  color: var(--light-color); /* Use light color for text on primary bg */
  transform: translateY(-5px) translateZ(10px);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

.btn-small {
  padding: 8px 20px;
  font-size: 0.9rem;
}

img {
  width: 100%;
  height: auto;
}

/* Navigation */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: var(--navbar-bg); /* Use variable */
  box-shadow: var(--box-shadow);
  z-index: 1000; /* Ensure high z-index */
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Force navbar styling for dark theme */
[data-theme="dark"] #navbar {
  background-color: rgba(0, 0, 0, 0.95) !important; /* Force black navbar in dark mode */
}

[data-theme="light"] #navbar {
  background-color: rgba(255, 255, 255, 0.95) !important; /* Force white navbar in light mode */
}

#navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px; /* Consistent padding */
}

.logo {
  font-size: 1.8rem;
  color: var(--primary-color);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 1010; /* Ensure logo is clickable */
}

.nav-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  z-index: 1005; /* Below logo/hamburger */
}

.nav-menu li {
  margin-left: 30px;
  position: relative;
}

.nav-link {
  /* Renamed from .nav-menu a for clarity */
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 0;
  display: inline-block;
  position: relative;
  color: var(--text-color);
  transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-color);
}

.nav-link::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.hamburger {
  display: none;
  cursor: pointer;
  z-index: 1010; /* Ensure hamburger is clickable */
  position: relative;
  padding: 5px; /* Add padding for easier tapping */
}

.bar {
  display: block;
  width: 25px;
  height: 3px;
  margin: 5px auto;
  background-color: var(--text-color); /* Use variable */
  transition: var(--transition);
}

/* Theme Toggle Buttons */
.theme-toggle-wrapper {
  display: flex;
  align-items: center;
  position: relative;
  z-index: 1010; /* Ensure toggle is clickable */
}

#theme-toggle,
#mobile-theme-toggle {
  background-color: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-color); /* Use variable */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  border-radius: 50%;
  transition: var(--transition);
  width: 40px;
  height: 40px;
  outline: none;
}

#theme-toggle:hover,
#mobile-theme-toggle:hover {
  background-color: var(--light-accent-bg); /* Use light accent bg for hover */
}

#theme-toggle .fa-sun,
#mobile-theme-toggle .fa-sun {
  display: none;
}

#theme-toggle .fa-moon,
#mobile-theme-toggle .fa-moon {
  display: block;
}

[data-theme="dark"] #theme-toggle .fa-sun,
[data-theme="dark"] #mobile-theme-toggle .fa-sun {
  display: block;
}

[data-theme="dark"] #theme-toggle .fa-moon,
[data-theme="dark"] #mobile-theme-toggle .fa-moon {
  display: none;
}

#mobile-theme-toggle {
  display: none; /* Hidden by default, shown in media query */
}

/* Hero Section */
.hero {
  height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  background-size: cover;
  background-position: center;
  padding-top: 70px; /* Account for navbar height */
  color: var(--text-color); /* Adjusted text color for dark bg */
  background-color: var(--background-color); /* Explicitly set background color */
}

.hero-content {
  text-align: center;
}

.hero-content h1 {
  font-size: 3.5rem;
  margin-bottom: 20px;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7); /* Improved shadow */
  color: var(--text-color); /* Ensure heading uses text color */
}

.hero-content .highlight {
  color: var(--primary-color) !important; /* Ensure highlight color */
  font-weight: 700;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8); /* Stronger shadow for highlight */
}

.lead {
  font-size: 1.5rem;
  margin-bottom: 30px;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7); /* Improved shadow */
  color: var(--text-color); /* Ensure lead text uses text color */
}

.social-icons {
  margin-top: 20px;
}

.social-icons a {
  display: inline-block;
  width: 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  background-color: var(--primary-color);
  color: var(--dark-color);
  border-radius: 50%;
  margin: 0 10px;
  transition: var(--transition);
  transform-style: preserve-3d;
  backface-visibility: hidden;
  transition: transform 0.5s;
}

.social-icons a:hover {
  /* Corrected selector */
  background-color: var(--text-color); /* Use text color (light) for hover bg */
  color: var(--primary-color);
  transform: rotateY(360deg) translateY(-5px);
}

/* About Section */
.about {
  /* Update gradient to use new primary color */
  background-image: linear-gradient(
    to bottom right,
    transparent 50%,
    var(--light-accent-bg) 50% /* Use light accent bg */
  );
}

.about-content {
  display: flex;
  align-items: center;
  gap: 50px;
}

.about-img {
  flex: 1;
}

.about-img img {
  border-radius: 10px;
  box-shadow: 0 10px 20px var(--light-accent-bg); /* Use light accent bg for shadow */
  transition: transform 0.3s ease;
  transform-style: preserve-3d;
}

.about-text {
  flex: 1;
}

.about-text h3 {
  font-size: 2rem;
  margin-bottom: 20px;
}

.about-text p {
  margin-bottom: 20px;
}

/* Skills Section */
.skills {
  background-color: var(--background-color); /* Use theme variable instead of hardcoded color */
}

.skills-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

.skill-box {
  background-color: var(--card-bg); /* Use card background variable for better contrast */
  padding: 30px;
  border-radius: 10px;
  box-shadow: var(--box-shadow);
  text-align: center;
  transition: var(--transition);
}

.skill-box:hover {
  transform: translateY(-5px);
  border-bottom: 3px solid var(--primary-color);
}

.skill-icon {
  font-size: 3rem;
  color: var(--primary-color);
  display: block;
  margin-bottom: 20px;
}

.progress-bar {
  width: 100%;
  height: 10px;
  background-color: var(--border-color);
  border-radius: 5px;
  margin-top: 15px;
  overflow: hidden;
}

.progress {
  width: 0; /* start at zero for animation */
  height: 100%;
  background-color: var(--primary-color);
  border-radius: 5px;
  transition: width 1s ease; /* animate width */
}

/* Projects Section */
.projects {
   /* Update gradient to use new primary color */
  background-image: linear-gradient(
    to bottom left,
    transparent 50%,
    var(--light-accent-bg) 50% /* Use light accent bg */
  );
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.project-card {
  background-color: var(--card-bg); /* Use variable */
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  transform-style: preserve-3d;
  transition: transform 0.5s;
}

.project-card .project-img,
.project-card .project-info {
  backface-visibility: hidden;
}

.project-card:hover {
  transform: translateY(-5px);
  border-bottom: 3px solid var(--primary-color);
}

.project-img {
  overflow: hidden;
  height: 200px;
}

.project-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.project-card:hover .project-img img {
  transform: scale(1.1);
}

.project-info {
  padding: 20px;
}

.project-info h3 {
  margin-bottom: 10px;
}

.project-info p {
  color: #666;
  margin-bottom: 15px;
}

.project-links {
  display: flex;
  gap: 10px;
}

/* Contact Section */
.contact {
  background-color: var(--contact-bg); /* Use variable */
}

.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 50px;
}

.contact-info {
  background-color: var(--primary-color);
  color: var(--light-color); /* Use light color for text on primary bg */
  padding: 30px;
  border-radius: 10px;
}

.contact-info h3 {
  margin-bottom: 30px;
  font-size: 1.5rem;
  color: var(--light-color); /* Use light color for text on primary bg */
  font-weight: bold;
}

.contact-item {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.contact-item i {
  font-size: 1.5rem;
  margin-right: 20px;
}

.contact-form .form-group {
  margin-bottom: 20px;
}

.contact-form label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  font-family: inherit;
  background-color: var(--card-bg); /* Ensure form elements follow theme */
  color: var(--text-color); /* Ensure form elements follow theme */
}

/* Form button */
.contact-form button.btn-primary {
  background-color: var(--primary-color);
  color: var(--dark-color);
  font-weight: bold;
  border: none;
}

.contact-form button.btn-primary:hover {
  background-color: var(--accent-color); /* Use accent color for hover */
  color: var(--light-color); /* Ensure text remains readable */
}

/* Alert styles for form feedback */
.alert {
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 4px;
  width: 100%;
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Form status styles */
.form-status {
  margin-bottom: 20px;
  padding: 15px;
  border-radius: 5px;
  font-weight: 500;
}

.form-status .success {
  background-color: #d4edda;
  color: #155724;
  padding: 15px;
  border-radius: 4px;
  border: 1px solid #c3e6cb;
  text-align: center;
}

.form-status .error {
  background-color: #f8d7da;
  color: #721c24;
  padding: 15px;
  border-radius: 4px;
  border: 1px solid #f5c6cb;
  text-align: center;
}

.form-status .loading {
  padding: 15px;
  color: #31708f;
  background-color: #d9edf7;
  border-radius: 4px;
  border: 1px solid #bce8f1;
  text-align: center;
}

/* Footer */
footer {
  background-color: #0a0a0a; /* Very dark, but not pitch black */
  color: #ccc;
  padding: 30px 0;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

footer .social-icons a {
  background-color: var(--primary-color);
  color: var(--dark-color);
}

footer .social-icons a:hover {
  background-color: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

/* 3D Elements Styles */
/* (Keep existing 3D styles) */
.project-card {
  transform-style: preserve-3d;
  transition: transform 0.5s;
}
.project-card .project-img,
.project-card .project-info {
  backface-visibility: hidden;
}
.tilt-wrapper {
  perspective: 1000px;
  overflow: visible;
  position: relative;
}
.about-img img {
  transition: transform 0.3s ease;
  transform-style: preserve-3d;
}
.cube-container {
  width: 200px;
  height: 200px;
  perspective: 1000px;
  margin: 0 auto 60px;
}
.cube {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(-15deg) rotateY(15deg);
  transition: transform 0.5s;
}
.cube-face {
  position: absolute;
  width: 200px;
  height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: var(--primary-color);
  color: var(--light-color); /* Use light color for text on primary bg */
  border: 2px solid var(--light-color); /* Use light color for border */
  opacity: 0.9;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}
.cube-face-front {
  transform: translateZ(100px);
}
.cube-face-back {
  transform: rotateY(180deg) translateZ(100px);
}
.cube-face-right {
  transform: rotateY(90deg) translateZ(100px);
}
.cube-face-left {
  transform: rotateY(-90deg) translateZ(100px);
}
.cube-face-top {
  transform: rotateX(90deg) translateZ(100px);
}
.cube-face-bottom {
  transform: rotateX(-90deg) translateZ(100px);
}
.skill-icon-3d {
  font-size: 3rem;
  margin-bottom: 10px;
  color: var(--light-color); /* Use light color for icon on primary bg */
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}
.social-icons a {
  transform-style: preserve-3d;
  backface-visibility: hidden;
  transition: transform 0.5s;
}
.social-icons a:hover {
  transform: rotateY(360deg) translateY(-5px);
}

/* Yellow accent elements */
.highlight-dot {
  color: var(--primary-color);
  font-size: 1.5em;
  vertical-align: middle;
  margin-left: 5px;
}
.yellow-tag { /* Rename or repurpose if needed, updating color */
  background-color: var(--primary-color);
  color: var(--light-color); /* Use light color for text on primary bg */
  font-size: 0.4em;
  padding: 3px 8px;
  border-radius: 20px;
  vertical-align: middle;
  margin-left: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: bold;
}

/* Scroll Reveal Animations */
.reveal-element {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.reveal-element.revealed {
  opacity: 1;
  transform: translateY(0);
}
.skill-box.reveal-element,
.project-card.reveal-element {
  transition-delay: calc(var(--item-index, 0) * 0.1s);
}

/* Custom scrollbar styling */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color); /* Use accent color for hover */
}

/* Media Queries */

/* Medium screens (tablets) */
@media (max-width: 992px) {
  .about-content {
    flex-direction: column;
    text-align: center;
  }
  .contact-wrapper {
    grid-template-columns: 1fr;
  }
  .section-padding {
    padding: 80px 0;
  } /* Slightly reduced padding */
  .hero-content h1 {
    font-size: 3rem;
  }
  .lead {
    font-size: 1.3rem;
  }
}

/* Small screens (landscape phones, small tablets) */
@media (max-width: 768px) {
  .container {
    padding: 0 15px;
  } /* Reduce container padding */
  .section-padding {
    padding: 60px 0;
  }
  .section-title {
    font-size: 2rem;
    margin-bottom: 40px;
  }
  .section-title::after {
    width: 70px;
  }

  /* Navbar Mobile */
  .hamburger {
    display: block;
  }
  .theme-toggle-wrapper {
    display: none;
  } /* Hide desktop toggle */
  #mobile-theme-toggle {
    display: flex;
    margin-left: 15px;
  } /* Show mobile toggle */

  .nav-menu {
    position: fixed;
    left: -100%;
    top: 70px; /* Adjust based on navbar height */
    flex-direction: column;
    background-color: var(--card-bg); /* Ensure mobile menu uses card bg */
    width: 100%;
    text-align: center;
    transition: 0.3s ease-in-out;
    box-shadow: 0 10px 27px rgba(0, 0, 0, 0.1);
    z-index: 1000; /* Below navbar icons */
    padding-top: 1rem;
    padding-bottom: 1rem;
  }
  .nav-menu.active {
    left: 0;
  }
  .nav-menu li {
    margin: 15px 0;
  }
  .nav-link {
    display: block;
    padding: 1rem 0;
    font-size: 1.1rem;
  }
  .nav-link::after {
    display: none;
  } /* Remove underline for mobile nav */
  .nav-link:hover,
  .nav-link.active {
    color: var(--primary-color);
    background: var(--light-accent-bg); /* Use light accent bg for hover */
  } /* Subtle hover/active */

  /* Hamburger Animation */
  .hamburger.active .bar:nth-child(2) {
    opacity: 0;
  }
  .hamburger.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  .hamburger.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  /* Hero Mobile */
  .hero {
    padding-top: 60px;
  } /* Adjust for potentially smaller navbar */
  .hero-content {
    padding: 0 10px;
  }
  .hero-content h1 {
    font-size: 2.2rem;
    line-height: 1.2;
    margin-bottom: 15px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
  }
  .lead {
    font-size: 1.1rem;
    margin-bottom: 25px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
  }
  .social-icons a {
    width: 35px;
    height: 35px;
    line-height: 35px;
    font-size: 0.9rem;
    margin: 0 8px;
  } /* Slightly smaller social icons */

  /* Other Sections Mobile */
  .skills-container,
  .projects-grid {
    gap: 20px;
  }
  .project-card {
    margin-bottom: 20px;
  }
  .project-img {
    height: 180px;
  }
  .contact-wrapper {
    gap: 30px;
  }
  .footer-content {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }
  .cube-container {
    width: 150px;
    height: 150px;
  } /* Adjust 3D cube */
  .cube-face {
    width: 150px;
    height: 150px;
  }
  .cube-face-front {
    transform: translateZ(75px);
  }
  .cube-face-back {
    transform: rotateY(180deg) translateZ(75px);
  }
  .cube-face-right {
    transform: rotateY(90deg) translateZ(75px);
  }
  .cube-face-left {
    transform: rotateY(-90deg) translateZ(75px);
  }
  .cube-face-top {
    transform: rotateX(90deg) translateZ(75px);
  }
  .cube-face-bottom {
    transform: rotateX(-90deg) translateZ(75px);
  }
}

/* Extra small screens (portrait phones) */
@media (max-width: 480px) {
  .hero-content h1 {
    font-size: 1.8rem;
    margin-bottom: 10px;
  }
  .lead {
    font-size: 1rem;
    margin-bottom: 20px;
  }

  /* Stack hero buttons */
  .hero-content .btn {
    display: block;
    margin: 15px auto; /* Increased margin */
    width: 80%;
    max-width: 280px; /* Slightly larger max-width */
    padding: 12px 20px; /* Ensure decent padding */
  }

  .about-img {
    margin-bottom: 30px;
  }
  .contact-form .form-group {
    margin-bottom: 15px;
  }
  .contact-form input,
  .contact-form textarea {
    padding: 10px;
  } /* Slightly larger padding */
  .btn {
    padding: 10px 20px;
  }
  .btn-small {
    padding: 8px 18px;
    font-size: 0.85rem;
  }
  .project-links {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }
  .social-icons a {
    width: 32px;
    height: 32px;
    line-height: 32px;
    font-size: 0.8rem;
    margin: 0 5px;
  } /* Even smaller social icons */
}

/* Scroll Progress Bar */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 5px;
  background-color: var(--primary-color);
  width: 0;
  z-index: 2000;
  transition: width 0.25s ease-out;
}

/* Typewriter Effect Styles */
.roles {
  text-align: center;
  font-size: 1.2rem;
  margin-top: 10px;
}
.cursor {
  font-weight: bold;
  display: inline-block;
  margin-left: 2px;
  animation: blink 0.7s infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Scroll-down indicator */
.scroll-down-indicator {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2rem;
  color: var(--text-color); /* Changed from --light-color to --text-color */
  animation: bounce 2s infinite;
  z-index: 3;
  cursor: pointer;
}
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translate(-50%, 0); }
  40% { transform: translate(-50%, -10px); }
  60% { transform: translate(-50%, -5px); }
}
.scroll-down-indicator.hidden {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s, visibility 0.5s;
}

/* Projects Filter Buttons */
.projects-filter {
  text-align: center;
  margin-bottom: 30px;
}
.projects-filter .filter-btn {
  background: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  padding: 8px 16px;
  margin: 0 5px;
  border-radius: 5px;
  cursor: pointer;
  transition: var(--transition);
}
.projects-filter .filter-btn.active,
.projects-filter .filter-btn:hover {
  background: var(--primary-color);
  color: var(--dark-color);
}

/* Hover Overlay for Project Cards */
.project-card {
  position: relative;
  overflow: hidden;
}
.project-card .overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}
.project-card:hover .overlay {
  opacity: 1;
}
.overlay-content {
  text-align: center;
  color: var(--light-color);
}
.overlay-content p {
  margin-bottom: 10px;
}
.overlay-content a {
  display: inline-block;
  margin: 5px;
  padding: 8px 12px;
  background: var(--primary-color);
  color: var(--dark-color);
  border-radius: 4px;
  text-decoration: none;
  transition: var(--transition);
}
.overlay-content a:hover {
  background: var(--dark-color);
  color: var(--light-color);
}

/* Lightbox Modal */
.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}
.lightbox-modal.hidden {
  display: none;
}
.lightbox-content {
  max-width: 90%;
  max-height: 80%;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 40px;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
}
.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  color: #fff;
  font-size: 3rem;
  cursor: pointer;
  padding: 0 10px;
  user-select: none;
  transform: translateY(-50%);
}
.lightbox-prev { left: 10px; }
.lightbox-next { right: 10px; }
.lightbox-caption {
  position: absolute;
  bottom: 30px;
  color: #fff;
  font-size: 1rem;
  text-align: center;
  width: 100%;
}

/* Button Micro-interactions */
.btn {
  position: relative; /* for ripple */
  overflow: hidden;
}
.btn i {
  transition: transform 0.3s ease;
}
.btn:hover i {
  transform: rotate(360deg) scale(1.2);
}

/* Ripple Effect */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}
@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Form Input Focus & Validation */
.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 5px var(--primary-color);
  outline: none;
}
.contact-form input:invalid {
  border-color: #e74c3c;
}

/* Toast/Snackbar Notifications */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 3000;
}
.toast {
  min-width: 250px;
  max-width: 300px;
  padding: 12px 20px;
  border-radius: 8px;
  color: var(--light-color);
  font-weight: 500;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.toast.visible {
  opacity: 1;
  transform: translateY(0);
}
.toast.success {
  background: #2ecc71;
}
.toast.error {
  background: #e74c3c;
}

/* Anime.js Animation Styles */
.hero-title {
  opacity: 1; /* Visible by default now */
}

.hero-subtitle,
.hero-roles,
.hero-buttons,
.hero-social {
  opacity: 0; /* Initially hidden for animation */
}

/* Enhanced animation support */
.hero-content * {
  will-change: transform, opacity;
}

/* Navigation link animation support */
.nav-link {
  transform: translateY(0);
  transition: transform 0.2s ease;
}

/* Button animation support */
.btn {
  transform: scale(1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Social icon animation support */
.social-icons a {
  transform: scale(1) rotateZ(0);
  transition: transform 0.3s ease;
}

/* Scroll animation elements */
.section-title,
.project-card,
.skill-box {
  opacity: 1; /* Default visible, will be set to 0 by JS */
}
