/* ========================================
   CSS Variables & Global Styles
=========================================== */
:root {
  /* Deep, rich palette for "Magical" feel */
  --primary-color: #4a148c;
  /* Deep Purple */
  --secondary-color: #880e4f;
  /* Deep Pink */
  --accent-color: #ffd700;
  /* Gold */

  --bg-gradient: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);

  --text-color: #e0e0e0;
  --text-muted: #b0bec5;
  --white: #ffffff;

  --font-heading: 'Comic Neue', cursive;
  --font-body: 'Poppins', sans-serif;
}

[data-theme="light"] {
  --bg-gradient: linear-gradient(135deg, #f5f7fa, #c3cfe2);
  --glass-bg: rgba(255, 255, 255, 0.4);
  --glass-border: rgba(255, 255, 255, 0.2);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
  --text-color: #2c3e50;
  --text-muted: #546e7a;
  --primary-color: #6a1b9a;
  --secondary-color: #ad1457;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background: var(--bg-gradient);
  background-attachment: fixed;
  /* Parallax-like background */
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
  transition: color 0.3s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

html {
  scroll-behavior: smooth;
}

/* ========================================
   Glassmorphism Utilities
=========================================== */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: 16px;
}

/* ========================================
   Header & Navigation
=========================================== */
header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  padding: 1rem 2rem;
  transition: padding 0.3s ease;
}

/* Scrolled state for header */
header.scrolled {
  padding: 0.5rem 2rem;
}

header.scrolled .nav-container {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.8rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 50px;
  /* Pillow shape */
  transition: all 0.3s ease;
}

.nav-logo {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(to right, var(--accent-color), #ff69b4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
}

nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
}

nav li a {
  font-weight: 500;
  position: relative;
  transition: color 0.3s ease;
}

nav li a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background: var(--accent-color);
  transition: width 0.3s ease;
}

nav li a:hover::after {
  width: 100%;
}

.theme-toggle {
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 1.2rem;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.theme-toggle:hover {
  transform: rotate(20deg) scale(1.1);
}

/* ========================================
   Hero Section
=========================================== */
#hero {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  padding: 0 2rem;
  position: relative;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 900px;
}

.hero-content h1 {
  font-family: var(--font-heading);
  font-size: 4.5rem;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeInDown 1s forwards;
  background: linear-gradient(to right, #ffffff, #e0e0e0);
  /* Gradient Text */
  -webkit-background-clip: text;
  background-clip: text;
}

[data-theme="light"] .hero-content h1 {
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}


.hero-content p {
  font-size: 1.4rem;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto 2.5rem auto;
  opacity: 0;
  animation: fadeInUp 1s forwards 0.3s;
}

.cta-button {
  display: inline-block;
  padding: 1rem 2.5rem;
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  color: white;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1.1rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  opacity: 0;
  animation: fadeInUp 1s forwards 0.6s;
}

.cta-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

/* 3D Canvas Background */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* ========================================
   Animations & Responsive
=========================================== */

/* ========================================
   Section Styling
=========================================== */
section {
  padding: 6rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

section h2 {
  font-family: var(--font-heading);
  font-size: 3rem;
  text-align: center;
  margin-bottom: 4rem;
  color: var(--white);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] section h2 {
  color: var(--primary-color);
  text-shadow: none;
}


/* ========================================
   Projects Grid
=========================================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2.5rem;
}

.project-card {
  /* Reuse glass-panel styles but extracted for specificity if needed */
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: 20px;

  padding: 2.5rem;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
}

.project-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.project-card:hover {
  transform: translateY(-10px) scale(1.02);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.project-card h3 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: var(--accent-color);
}

[data-theme="light"] .project-card h3 {
  color: var(--primary-color);
}

.project-card p {
  color: var(--text-color);
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-color);
  font-weight: 600;
  transition: gap 0.3s ease;
}

[data-theme="light"] .project-link {
  color: var(--secondary-color);
}


.project-link:hover {
  gap: 0.8rem;
}

/* ========================================
   Contact Section
=========================================== */
#contact form {
  max-width: 600px;
  margin: 0 auto;
  padding: 3rem;
  /* Glass effect */
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
}

.input-group {
  position: relative;
  margin-bottom: 2rem;
}

#contact input,
#contact textarea {
  width: 100%;
  padding: 12px 0;
  font-size: 1rem;
  color: var(--text-color);
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--glass-border);
  outline: none;
  transition: border-color 0.3s ease;
}

#contact label {
  position: absolute;
  top: 12px;
  left: 0;
  color: var(--text-muted);
  font-size: 1rem;
  transition: 0.3s ease all;
  pointer-events: none;
}

#contact input:focus~label,
#contact input:valid~label,
#contact textarea:focus~label,
#contact textarea:valid~label {
  top: -20px;
  font-size: 0.85rem;
  color: var(--accent-color);
}

#contact input:focus,
#contact textarea:focus {
  border-bottom-color: var(--accent-color);
}

#contact button {
  width: 100%;
  padding: 1rem;
  border: none;
  border-radius: 50px;
  background: var(--bg-gradient);
  /* Reverse gradient or specific color */
  background-size: 200% auto;
  color: white;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: 0.5s;
}

#contact button:hover {
  background-position: right center;
  transform: scale(1.02);
}

/* ========================================
   Footer
=========================================== */
footer {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--glass-border);
}

/* ========================================
   Animations & Responsive
=========================================== */
@keyframes float {

  0%,
  100% {
    transform: translate(0, 0);
  }

  50% {
    transform: translate(30px, -30px);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .hero-content h1 {
    font-size: 3rem;
  }

  .nav-container {
    flex-direction: column;
    gap: 1rem;
    border-radius: 0;
    width: 100%;
  }

  nav ul {
    gap: 1rem;
    font-size: 0.9rem;
  }
}