:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --secondary: #ec4899;
  --accent: #f59e0b;
  --bg-color: #ffffff;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --glass: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(0, 0, 0, 0.1);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  --transition-fast: 0.2s ease;
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --theme-transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, transform 0.4s ease;
}

/* Custom Purple Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
  background: #7c3aed; /* Purple */
  border-radius: 10px;
  border: 3px solid var(--bg-color);
}
::-webkit-scrollbar-thumb:hover {
  background: #6d28d9;
}

html.light .btn-primary {
  background: #000;
  color: #fff;
}

html.light .btn-primary:hover {
  background: #222;
}

/* Dark Mode Overrides */
html.dark {
  --bg-color: #030712;
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --glass: rgba(3, 7, 18, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

@media (prefers-color-scheme: dark) {
  html:not(.light) {
    --bg-color: #030712;
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --glass: rgba(3, 7, 18, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  }
}

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

html {
  transition: var(--theme-transition);
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  width: 100%;
  overflow-x: hidden;
  position: relative;
  transition: var(--theme-transition);
}

* {
  transition: background-color 0.4s ease, border-color 0.4s ease, color 0.4s ease;
}

/* Typography */
h1, h2, h3, h4 {
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.02em;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition-fast);
}

/* Glassmorphism Navigation */
nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1.25rem 2rem;
  z-index: 1000;
  display: flex;
  justify-content: center; /* Centering the entire navbar content */
  align-items: center;
  gap: 4rem; /* Spacing between logo, links, and cta */
  backdrop-filter: blur(12px);
  background: var(--glass);
  border-bottom: 1px solid var(--glass-border);
  transition: transform 0.3s ease;
}

nav.hidden {
  transform: translateY(-100%);
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  cursor: pointer;
}

.logo img {
  max-height: 40px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}

.nav-links a {
  font-weight: 500;
  font-size: 0.95rem;
  opacity: 0.8;
}

.nav-links a:hover {
  opacity: 1;
  color: var(--primary);
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 32px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

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

.slider i {
  width: 14px;
  height: 14px;
  z-index: 1;
}

.sun-icon { color: #f59e0b; }
.moon-icon { color: #9ca3af; opacity: 0.3; }

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

input:checked + .slider {
  background-color: #1f2937;
}

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

input:checked + .slider .moon-icon { color: #818cf8; opacity: 1; }
input:checked + .slider .sun-icon { opacity: 0.3; }

.slider.round {
  border-radius: 34px;
}

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

.about-grid, .contact-grid {
  display: grid;
  gap: 4rem;
}

.about-grid {
  grid-template-columns: 1fr 1fr;
  align-items: center;
}

.contact-grid {
  grid-template-columns: 1fr 1.5fr;
  align-items: start;
}

/* Custom Cursor (Optional but cool) */
.cursor {
  width: 20px;
  height: 20px;
  border: 2px solid var(--primary);
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  transition: transform 0.1s ease;
  mix-blend-mode: difference;
}

/* Hero Section */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
  position: relative;
  background-image: linear-gradient(rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.6)), url('hero-bg.png');
  background-size: cover;
  background-position: center;
  width: 100%;
  box-sizing: border-box;
}

/* Removed the glass/transparent background as per user preference */
.hero .reveal h1, .hero .reveal p {
  padding: 0.5rem 0;
}

.hero .reveal {
  max-width: 900px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
}

@media (prefers-color-scheme: dark) {
  html:not(.light) .hero {
    background-image: linear-gradient(rgba(3, 7, 18, 0.7), rgba(3, 7, 18, 0.8)), url('hero-bg.png');
  }
}

html.dark .hero {
  background-image: linear-gradient(rgba(3, 7, 18, 0.7), rgba(3, 7, 18, 0.8)), url('hero-bg.png');
}

.badge {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  border-radius: 2rem;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  text-shadow: 0 0 40px rgba(255, 255, 255, 0.5);
}

html.dark .hero h1 {
  text-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin-bottom: 3rem;
}

.cta-group {
  display: flex;
  gap: 1.5rem;
}

.btn {
  padding: 1rem 2.5rem;
  border-radius: 3rem;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.btn.primary {
  background: var(--primary);
  color: white;
  border: none;
}

.btn.primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

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

.btn.outline:hover {
  background: var(--text-primary);
  color: var(--bg-color);
}

/* Animated Background Shapes */
.blob {
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
  width: 50vw;
  height: 50vw;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(236, 72, 153, 0.1) 100%);
  filter: blur(100px);
  border-radius: 50%;
  animation: move 20s infinite alternate;
}

@keyframes move {
  from { transform: translate(-10%, -10%); }
  to { transform: translate(10%, 10%); }
}

/* Section Headlines */
.section-header {
  margin-bottom: 4rem;
}

.section-header h2 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* Skills Grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.skill-card {
  text-align: center;
  padding: 2.5rem 2rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 2rem;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.skill-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
}

.skill-card i {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  display: block;
}

.skill-card h4 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.skill-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.project-card {
  border-radius: 1.5rem;
  overflow: hidden;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.project-image {
  width: 100%;
  height: 250px;
  background: #f3f4f6;
  position: relative;
  overflow: hidden;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-content {
  padding: 1.5rem;
}

.project-content h3 {
  margin-bottom: 0.5rem;
}

.tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 1rem;
  font-size: 0.8rem;
  margin-right: 0.5rem;
}

/* Contact Form */
.contact-container {
  max-width: 600px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 1.5rem;
}

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

input, textarea {
  width: 100%;
  padding: 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 16px; /* Prevents auto-zoom on iOS focus */
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
}

/* Animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Platforms Grid */
.platform-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3rem;
  max-width: 1100px;
  margin: 0 auto;
  opacity: 0.8;
}

.platform-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  background: transparent;
  border: none;
}

.platform-card img {
  max-width: 180px;
  max-height: 70px;
  object-fit: contain;
  margin-bottom: 1.5rem;
}

.platform-card span {
  font-size: 0.8rem;
  font-weight: 500;
  color: #888;
  transition: all 0.3s ease;
}

/* Mobile Responsive Excellence */
@media (max-width: 992px) {
  nav { gap: 2rem; padding: 1rem 1.5rem; }
  .nav-links { display: none; }
  header.hero h1 { font-size: 3.5rem; }
}

@media (max-width: 768px) {
  section { padding: 4rem 1.5rem; width: 100%; overflow-x: hidden; }
  
  /* Stack all grids to 1 column */
  .about-grid, 
  .skills-grid, 
  .projects-grid, 
  .github-grid, 
  .contact-grid,
  .platform-grid {
    grid-template-columns: 1fr !important;
    display: flex !important;
    flex-direction: column;
    gap: 3rem;
    align-items: center; /* Center content on mobile */
    text-align: center;
  }
  
  .about-image {
    width: 100%;
    max-width: 400px;
  }

  .contact-info {
    text-align: left;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
  }

  .contact-form {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
  }
  
  .hero h1 { font-size: clamp(2.5rem, 12vw, 4rem); letter-spacing: -0.02em; }
  .hero p { font-size: 1.1rem; padding: 0 1rem; }
  
  .section-header h2 { font-size: 2.25rem; }
  
  nav {
    flex-direction: row;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    gap: 0;
  }

  /* Firmness for Mobile Only */
  html, body {
    overscroll-behavior: none;
    touch-action: pan-y;
  }

  .nav-cta a.btn { display: none; } /* Hide 'Hire Me' on small mobile if needed, or keep smaller */
  .switch { width: 48px; height: 26px; }
  .slider:before { height: 18px; width: 18px; bottom: 4px; left: 4px; }
  input:checked + .slider:before { transform: translateX(22px); }
}


/* Contact Form Animations */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.spin {
  animation: spin 1s linear infinite;
  display: inline-block;
  vertical-align: middle;
}
