/* Cosmic Color Scheme */
:root {
  --cosmic-primary: #7b2cbf;
  --cosmic-secondary: #9d4edd;
  --cosmic-tertiary: #c77dff;
  --cosmic-accent: #ff9e00;
  --cosmic-dark: #10002b;
  --cosmic-darker: #030014;
  --cosmic-light: #e0aaff;
  --cosmic-glass: rgba(123, 44, 191, 0.15);
  --cosmic-glow: 0 0 15px rgba(157, 78, 221, 0.7),
    0 0 30px rgba(157, 78, 221, 0.4);
  --neon-text-glow: 0 0 3px #fff, 0 0 6px #9d4edd, 0 0 8px #7b2cbf,
    0 0 10px #5a189a;
}

/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Montserrat", "Segoe UI", sans-serif;
}

body {
  background: radial-gradient(
    ellipse at bottom,
    var(--cosmic-darker) 0%,
    var(--cosmic-dark) 100%
  );
  color: var(--cosmic-light);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

@font-face {
  font-family: "Montserrat";
  src: url("https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600;700&display=swap");
}

/* Cosmic Particles Background */
#cosmic-particles {
  position: fixed;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: transparent;
}

/* Cosmic Grid Overlay */
.cosmic-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(
      rgba(123, 44, 191, 0.1) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(123, 44, 191, 0.1) 1px, transparent 1px);
  background-size: 50px 50px;
  z-index: -1;
  opacity: 0.3;
}

/* Layout */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 30px;
}

section {
  padding: 100px 0;
  position: relative;
}

/* Typography */
h1,
h2,
h3 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 25px;
}

h1 {
  font-size: clamp(3rem, 6vw, 5rem);
  background: linear-gradient(
    90deg,
    var(--cosmic-primary),
    var(--cosmic-tertiary),
    var(--cosmic-secondary)
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: cosmicGlow 4s ease-in-out infinite alternate;
  letter-spacing: 2px;
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--cosmic-tertiary);
  text-shadow: var(--neon-text-glow);
  position: relative;
  display: inline-block;
}

h2::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--cosmic-primary), transparent);
  border-radius: 3px;
}

p {
  font-size: 1.2rem;
  margin-bottom: 25px;
  opacity: 0.9;
  font-weight: 300;
}

@keyframes cosmicGlow {
  0% {
    text-shadow: 0 0 5px var(--cosmic-primary);
  }
  100% {
    text-shadow: 0 0 20px var(--cosmic-primary), 0 0 30px var(--cosmic-tertiary);
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 35px;
  background: linear-gradient(
    135deg,
    var(--cosmic-glass),
    rgba(157, 78, 221, 0.2)
  );
  color: var(--cosmic-light);
  border: none;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
  z-index: 1;
  backdrop-filter: blur(5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  margin: 10px;
}

.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    45deg,
    var(--cosmic-primary),
    var(--cosmic-accent),
    var(--cosmic-secondary)
  );
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(157, 78, 221, 0.4);
}

.btn:hover::before {
  opacity: 1;
}

.btn i {
  margin-right: 10px;
  font-size: 1.2rem;
}

.btn-github {
  background: linear-gradient(
    135deg,
    rgba(123, 44, 191, 0.3),
    rgba(157, 78, 221, 0.2)
  );
  border: 1px solid var(--cosmic-tertiary);
}

/* Hero Section */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

.hero-content {
  max-width: 900px;
  animation: cosmicFadeIn 1.5s ease-out;
  position: relative;
  z-index: 2;
}

.hero p {
  font-size: 1.4rem;
  margin-bottom: 40px;
  color: var(--cosmic-tertiary);
  text-shadow: 0 0 10px rgba(157, 78, 221, 0.5);
}

.profile-container {
  position: relative;
  margin-bottom: 40px;
}

.profile-image {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid var(--cosmic-tertiary);
  box-shadow: var(--cosmic-glow);
  transition: all 0.5s ease;
  animation: cosmicFloat 8s ease-in-out infinite;
  position: relative;
  z-index: 1;
}

.profile-image::after {
  content: "";
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  border-radius: 50%;
  border: 2px dashed var(--cosmic-accent);
  animation: cosmicRotate 20s linear infinite;
  z-index: -1;
}

.profile-image:hover {
  transform: scale(1.05) rotate(5deg);
  box-shadow: 0 0 30px var(--cosmic-tertiary);
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

@keyframes cosmicFadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cosmicFloat {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(5deg);
  }
}

@keyframes cosmicRotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Repositories Section */
.repos {
  background: rgba(16, 0, 43, 0.7);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(157, 78, 221, 0.2);
  border-bottom: 1px solid rgba(157, 78, 221, 0.2);
  position: relative;
}

.repos::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle at center,
    rgba(123, 44, 191, 0.1) 0%,
    transparent 70%
  );
  pointer-events: none;
  z-index: -1;
}

.repos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 40px;
  margin-top: 50px;
}

.repo-card {
  background: linear-gradient(
    135deg,
    var(--cosmic-glass),
    rgba(16, 0, 43, 0.5)
  );
  border-radius: 20px;
  padding: 30px;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(157, 78, 221, 0.2);
  position: relative;
  overflow: hidden;
  z-index: 1;
  opacity: 0;
  transform: translateY(30px);
  animation: cosmicFadeIn 0.5s forwards;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.repo-card:nth-child(1) {
  animation-delay: 0.1s;
}
.repo-card:nth-child(2) {
  animation-delay: 0.2s;
}
.repo-card:nth-child(3) {
  animation-delay: 0.3s;
}
.repo-card:nth-child(4) {
  animation-delay: 0.4s;
}
.repo-card:nth-child(5) {
  animation-delay: 0.5s;
}
.repo-card:nth-child(6) {
  animation-delay: 0.6s;
}

.repo-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    45deg,
    var(--cosmic-primary),
    var(--cosmic-accent)
  );
  z-index: -1;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.repo-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 15px 40px rgba(157, 78, 221, 0.3);
  border-color: var(--cosmic-tertiary);
}

.repo-card:hover::before {
  opacity: 0.2;
}

.repo-card h3 {
  color: var(--cosmic-light);
  font-size: 1.5rem;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.repo-card h3 i {
  color: var(--cosmic-accent);
  font-size: 1.2rem;
}

.repo-card p {
  font-size: 1rem;
  margin-bottom: 25px;
  min-height: 60px;
  color: rgba(224, 170, 255, 0.8);
}

.repo-stat i {
  font-size: 0.9rem;
}

.repo-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 25px;
  background: linear-gradient(
    to right,
    var(--cosmic-primary),
    var(--cosmic-secondary)
  );
  color: white;
  border-radius: 50px;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(123, 44, 191, 0.3);
}

.repo-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(123, 44, 191, 0.4);
  background: linear-gradient(
    to right,
    var(--cosmic-secondary),
    var(--cosmic-primary)
  );
}

/* Loading Animation */
.loader {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 300px;
}

.loader-circle {
  width: 25px;
  height: 25px;
  margin: 0 15px;
  background-color: var(--cosmic-tertiary);
  border-radius: 50%;
  animation: cosmicBounce 1.5s infinite ease-in-out;
  box-shadow: 0 0 10px var(--cosmic-tertiary);
}

.loader-circle:nth-child(1) {
  animation-delay: 0s;
}

.loader-circle:nth-child(2) {
  animation-delay: 0.2s;
}

.loader-circle:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes cosmicBounce {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-40px) scale(1.2);
    background-color: var(--cosmic-accent);
    box-shadow: 0 0 20px var(--cosmic-accent);
  }
}

/* Footer */
footer {
  text-align: center;
  padding: 40px 0;
  background: rgba(16, 0, 43, 0.8);
  font-size: 1rem;
  color: var(--cosmic-tertiary);
  position: relative;
}

footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--cosmic-tertiary),
    transparent
  );
}

footer p {
  margin-bottom: 0;
}

/* GitHub Corner */
.github-corner {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 100;
  opacity: 0.9;
  transition: all 0.3s;
  transform-origin: top right;
}

.github-corner:hover {
  opacity: 1;
  transform: scale(1.1);
}

.github-corner svg {
  fill: var(--cosmic-primary);
  color: var(--cosmic-dark);
  width: 80px;
  height: 80px;
}

.github-corner .octo-arm {
  transform-origin: 130px 106px;
}

.github-corner:hover .octo-arm {
  animation: octocat-wave 560ms ease-in-out;
}

@keyframes octocat-wave {
  0%,
  100% {
    transform: rotate(0);
  }
  20%,
  60% {
    transform: rotate(-25deg);
  }
  40%,
  80% {
    transform: rotate(10deg);
  }
}

/* Floating Cosmic Elements */
.cosmic-element {
  position: absolute;
  border-radius: 50%;
  filter: blur(1px);
  z-index: -1;
}

.cosmic-element-2 {
  width: 200px;
  height: 200px;
  background: radial-gradient(
    circle,
    rgba(255, 158, 0, 0.15) 0%,
    transparent 70%
  );
  bottom: 100px;
  left: -100px;
  animation: cosmicFloat 12s ease-in-out infinite alternate-reverse;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .container {
    padding: 0 40px;
  }
}

@media (max-width: 992px) {
  section {
    padding: 80px 0;
  }

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

@media (max-width: 768px) {
  .container {
    padding: 0 30px;
  }

  section {
    padding: 60px 0;
  }

  h1 {
    font-size: clamp(2.5rem, 7vw, 4rem);
  }

  h2 {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
  }

  .hero {
    padding-top: 100px;
    min-height: auto;
  }

  .profile-image {
    width: 180px;
    height: 180px;
  }

  .hero p {
    font-size: 1.2rem;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 300px;
  }
}

@media (max-width: 576px) {
  .container {
    padding: 0 20px;
  }

  .repos-grid {
    grid-template-columns: 1fr;
  }

  .github-corner svg {
    width: 60px;
    height: 60px;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--cosmic-darker);
}

::-webkit-scrollbar-thumb {
  background: var(--cosmic-secondary);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--cosmic-primary);
}
