/* Import premium Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Inter:wght@300;400;500;600&display=swap');

:root {
  /* Design Tokens - Light Theme Default */
  --bg-gradient-start: hsl(225, 60%, 98%);
  --bg-gradient-end: hsl(245, 50%, 95%);
  --card-bg: rgba(255, 255, 255, 0.75);
  --card-border: rgba(255, 255, 255, 0.6);
  --text-main: hsl(224, 60%, 12%);
  --text-muted: hsl(220, 20%, 42%);
  --primary: hsl(250, 85%, 63%);
  --primary-glow: rgba(124, 77, 255, 0.35);
  --secondary: hsl(320, 80%, 60%);
  --secondary-glow: rgba(244, 143, 177, 0.35);
  --accent-green: hsl(150, 60%, 45%);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 12px 30px rgba(124, 77, 255, 0.06);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.05);
  --glass-blur: 16px;
  --transition-speed: 0.4s;
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
}

/* Dark Theme overrides */
body.dark-theme {
  --bg-gradient-start: hsl(224, 70%, 5%);
  --bg-gradient-end: hsl(240, 50%, 9%);
  --card-bg: rgba(20, 24, 40, 0.65);
  --card-border: rgba(255, 255, 255, 0.06);
  --text-main: hsl(210, 40%, 98%);
  --text-muted: hsl(220, 15%, 72%);
  --primary: hsl(250, 100%, 75%);
  --primary-glow: rgba(124, 77, 255, 0.5);
  --secondary: hsl(320, 100%, 75%);
  --secondary-glow: rgba(244, 143, 177, 0.5);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 12px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.4);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--text-main);
  background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background var(--transition-speed) ease, color var(--transition-speed) ease;
}

/* Header & Navigation */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  background: var(--card-bg);
  border-bottom: 1px solid var(--card-border);
  transition: background var(--transition-speed) ease, border var(--transition-speed) ease;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.2rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 1.5rem;
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
  letter-spacing: -0.5px;
}

.nav-menu {
  display: flex;
  gap: 2rem;
  list-style: none;
  align-items: center;
}

.nav-link {
  text-decoration: none;
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.3s;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  transition: width 0.3s ease;
}

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

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

/* Theme Toggle Switch */
.theme-switch-wrapper {
  display: flex;
  align-items: center;
}

.theme-switch {
  display: inline-block;
  height: 28px;
  position: relative;
  width: 50px;
}

.theme-switch input {
  display: none;
}

.slider {
  background-color: #ccc;
  bottom: 0;
  cursor: pointer;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  transition: .4s;
  border-radius: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5px;
}

.slider::before {
  background-color: white;
  bottom: 3px;
  content: "";
  height: 22px;
  left: 3px;
  position: absolute;
  transition: .4s;
  width: 22px;
  border-radius: 50%;
  z-index: 2;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

input:checked + .slider {
  background: linear-gradient(45deg, var(--primary), var(--secondary));
}

input:checked + .slider::before {
  transform: translateX(22px);
}

.slider .sun-icon, .slider .moon-icon {
  width: 14px;
  height: 14px;
  fill: #fff;
  z-index: 1;
}

/* Main Layout */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8rem 2rem 4rem 2rem;
}

section {
  padding: 5rem 0;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

section:nth-of-type(1) { animation-delay: 0.1s; }
section:nth-of-type(2) { animation-delay: 0.2s; }
section:nth-of-type(3) { animation-delay: 0.3s; }
section:nth-of-type(4) { animation-delay: 0.4s; }

/* Grid systems */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

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

/* Cards & Glassmorphism */
.glass-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
              box-shadow 0.4s ease, 
              border var(--transition-speed) ease,
              background var(--transition-speed) ease;
}

.glass-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg), 0 10px 20px var(--primary-glow);
}

/* Hero Section */
.hero-content h1 {
  font-family: var(--font-title);
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.5rem;
}

.gradient-text {
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  max-width: 500px;
}

.hero-buttons {
  display: flex;
  gap: 1.2rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 2rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  font-family: var(--font-body);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), hsl(250, 90%, 68%));
  color: white;
  border: none;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px var(--primary-glow);
  transform: translateY(-2px);
}

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

.btn-secondary:hover {
  border-color: var(--primary);
  background: rgba(124, 77, 255, 0.05);
  transform: translateY(-2px);
}

/* Hero SVG Illustration */
.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-svg {
  width: 100%;
  max-width: 450px;
  height: auto;
}

/* Float Animations for SVG elements */
.float-element-1 {
  animation: float1 6s ease-in-out infinite alternate;
}

.float-element-2 {
  animation: float2 8s ease-in-out infinite alternate;
}

.float-element-3 {
  animation: float3 7s ease-in-out infinite alternate;
}

/* Section Headings */
.section-title {
  font-family: var(--font-title);
  font-size: 2.5rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 1rem;
}

.section-desc {
  text-align: center;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 3.5rem auto;
  font-size: 1.1rem;
}

/* Skills Section */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.skill-category h3 {
  font-family: var(--font-title);
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--primary);
}

.skill-list {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.skill-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.skill-info {
  display: flex;
  justify-content: space-between;
  font-weight: 500;
}

.skill-bar-bg {
  background: rgba(0, 0, 0, 0.05);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

body.dark-theme .skill-bar-bg {
  background: rgba(255, 255, 255, 0.08);
}

.skill-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 4px;
  width: 0; /* Animated dynamically by JS */
  transition: width 1.5s cubic-bezier(0.1, 1, 0.1, 1);
}

/* Projects Section */
.project-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.project-icon {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--primary-glow), var(--secondary-glow));
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
}

.project-title {
  font-family: var(--font-title);
  font-size: 1.4rem;
  margin-bottom: 0.8rem;
}

.project-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.tag {
  background: rgba(124, 77, 255, 0.08);
  color: var(--primary);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

body.dark-theme .tag {
  background: rgba(124, 77, 255, 0.15);
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: gap 0.2s;
}

.project-link:hover {
  gap: 0.8rem;
}

/* Contact Section */
.contact-container {
  display: grid;
  grid-template-columns: 1.2fr 1.8fr;
  gap: 3rem;
  align-items: start;
}

.contact-info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-info-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.contact-info-icon {
  width: 48px;
  height: 48px;
  background: var(--card-border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.contact-info-text h4 {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.contact-info-text p {
  font-weight: 500;
}

/* Contact Form */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 0.9rem;
}

.form-control {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 2px solid var(--card-border);
  background: rgba(255, 255, 255, 0.5);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: all 0.3s;
}

body.dark-theme .form-control {
  background: rgba(0, 0, 0, 0.2);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

/* Footer */
footer {
  text-align: center;
  padding: 3rem 0;
  border-top: 1px solid var(--card-border);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float1 {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-15px) rotate(3deg); }
}

@keyframes float2 {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(12px) rotate(-4deg); }
}

@keyframes float3 {
  0% { transform: scale(1) translate(0px, 0px); }
  100% { transform: scale(1.08) translate(8px, -8px); }
}

/* Responsive design */
@media (max-width: 968px) {
  .grid-2 {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .contact-container {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .hero-content {
    text-align: center;
  }
  .hero-content h1 {
    font-size: 2.8rem;
  }
  .hero-subtitle {
    margin: 0 auto 2.5rem auto;
  }
  .hero-buttons {
    justify-content: center;
  }
  .hero-visual {
    order: -1;
  }
}

@media (max-width: 576px) {
  .nav-menu {
    display: none; /* In production, we'd add a mobile menu, but for simple clean layout we keep switches */
  }
  .hero-buttons {
    flex-direction: column;
  }
  .hero-content h1 {
    font-size: 2.3rem;
  }
}
