:root {
  --bg-color: #050510;
  --text-color: #ffffff;
  --accent-cyan: #00f3ff;
  --accent-purple: #bc13fe;
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.05);
  --font-main: 'Outfit', sans-serif;
  --font-display: 'Rajdhani', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-main);
  overflow-x: hidden;
  /* Re-enabled vertical scroll */
  min-height: 100vh;
  line-height: 1.6;
}

canvas#bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

/* Typography */
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.gradient-text {
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Glassmorphism */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  transform-style: preserve-3d;
  transition: transform 0.1s ease-out;
  /* Smooth return, overridden by JS for movement */
}

/* Navigation */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 5%;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  transition: 0.3s;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
}

nav a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 1px;
  transition: color 0.3s;
}

nav a:hover {
  color: var(--accent-cyan);
}

.logo {
  font-size: 1.8rem;
  color: var(--accent-cyan);
}

/* Layout */
section {
  min-height: 100vh;
  padding: 6rem 5% 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* Hero */
.hero-content {
  text-align: center;
  z-index: 1;
  max-width: 800px;
}

.hero-content h2 {
  font-size: 5rem;
  margin: 1rem 0;
  line-height: 1;
}

.subtitle {
  color: var(--accent-cyan);
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.8rem 2rem;
  margin: 0.5rem;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 600;
  transition: 0.3s;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn.primary {
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  color: #000;
}

.btn.primary:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(0, 243, 255, 0.5);
}

.btn.secondary {
  border: 2px solid var(--accent-cyan);
  color: var(--accent-cyan);
}

.btn.secondary:hover {
  background: rgba(0, 243, 255, 0.1);
}

/* About & Skills */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

.about-text,
.skills-wrapper {
  padding: 2rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1rem;
  margin-bottom: 2rem;
  /* Added spacing to resolve layout crowding */
}

.tags span {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  border: 1px solid transparent;
  transition: 0.3s;
}

.tags span:hover {
  border-color: var(--accent-cyan);
  background: rgba(0, 243, 255, 0.1);
}

/* Timeline/Projects */
.section-title {
  font-size: 2.5rem;
  margin-bottom: 3rem;
  text-align: center;
  position: relative;
  display: inline-block;
  left: 50%;
  transform: translateX(-50%);
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.timeline-item {
  padding: 2rem;
  border-left: 3px solid var(--accent-purple);
  position: relative;
}

.date {
  font-size: 0.8rem;
  color: var(--accent-cyan);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  display: block;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.project-card {
  padding: 2rem;
  transition: 0.3s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text-color);
}

.project-card:hover {
  transform: translateY(-10px);
  border-color: var(--accent-cyan);
}

.project-card h3 {
  color: var(--accent-cyan);
  margin-bottom: 0.5rem;
}

.project-card .tags {
  margin-top: auto;
}

.tags.small span {
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
}


/* Contact Refined */
.contact-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 2rem;
  height: 100%;
  align-items: center;
  justify-content: center;
}

.contact-link {
  width: 100%;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: white;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  transition: 0.3s;
  border: 1px solid transparent;
}

.contact-link:hover {
  background: rgba(0, 243, 255, 0.1);
  border-color: var(--accent-cyan);
  transform: translateX(10px);
}

.contact-form {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-form h3,
.contact-links h3 {
  margin-bottom: 1rem;
  color: var(--accent-cyan);
  text-align: center;
}

.input-group {
  display: flex;
  gap: 1rem;
}

input,
select,
textarea {
  width: 100%;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: white;
  font-family: var(--font-main);
  font-size: 0.95rem;
  outline: none;
  transition: 0.3s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-cyan);
  background: rgba(0, 243, 255, 0.05);
}

/* Fix for Browser Autofill White Background */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px #050510 inset !important;
  -webkit-text-fill-color: white !important;
  transition: background-color 5000s ease-in-out 0s;
}

select option {
  background-color: var(--bg-color);
  color: white;
}

textarea {
  resize: vertical;
}

@media (max-width: 768px) {
  .contact-content {
    grid-template-columns: 1fr;
  }

  .input-group {
    flex-direction: column;
  }
}

footer {
  text-align: center;
  padding: 2rem;
  opacity: 0.6;
  font-size: 0.8rem;
  margin-top: 4rem;
}

/* Loader */
#loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-color);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: opacity 1s;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 1s ease-out forwards;
}

@media (max-width: 768px) {
  .hero-content h2 {
    font-size: 3rem;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  nav {
    flex-direction: column;
    padding: 1rem;
    background: rgba(5, 5, 16, 0.95);
    backdrop-filter: blur(20px);
  }

  nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.5rem;
  }

  nav a {
    font-size: 0.85rem;
  }

  section {
    padding: 8rem 5% 2rem;
    /* Reduce top padding on mobile */
  }

  .timeline {
    padding-left: 0;
  }
}