/* Modern CSS Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Custom Properties */
:root {
  /* Colors - Dark Purple Theme */
  --color-background: #000000;
  --color-surface: #13121a;
  --color-surface-alt: #1a1824;
  --color-primary: #6e22c5;
  --color-primary-transparent: rgba(110, 34, 197, 0.15);
  --color-secondary: #9364e8;
  --color-text: #ffffff;
  --color-text-muted: rgba(255, 255, 255, 0.7);
  --color-text-subtle: rgba(255, 255, 255, 0.5);
  --color-border: rgba(255, 255, 255, 0.08);

  /* Typography */
  --font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-md: 1.125rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 2rem;
  --font-size-3xl: 2.5rem;
  --font-size-4xl: 3rem;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 2.5rem;
  --space-8: 3rem;
  --space-9: 4rem;
  --space-10: 5rem;

  /* Borders */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;

  /* Effects */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);

  /* Animations */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --container-max-width: 1280px;
  --header-height: 5rem;
}

/* Base Styles */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--color-background);
  color: var(--color-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

a:hover {
  color: var(--color-primary);
}

button {
  font-family: inherit;
  cursor: pointer;
  background: none;
  border: none;
  color: inherit;
}

.container {
  width: 90%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  position: relative;
}

/* Noise overlay */
.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 250 250' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  font-weight: 600;
  margin-bottom: var(--space-4);
}

p {
  margin-bottom: var(--space-4);
}

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-lg);
  font-weight: 500;
  transition: all var(--transition-fast);
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.1);
  z-index: -1;
  transition: opacity var(--transition-fast);
  opacity: 0;
  border-radius: inherit;
}

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

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

.btn-primary:hover {
  background-color: #5a16ab;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(110, 34, 197, 0.3);
}

.btn-text {
  color: var(--color-text);
  padding: var(--space-2) var(--space-3);
}

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

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

.btn-outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-large {
  padding: var(--space-3) var(--space-6);
  font-size: var(--font-size-md);
}

/* Social Media Links */
.social-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.social-icon {
  width: 20px;
  height: 20px;
}

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

/* Navigation */
.main-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: rgba(10, 9, 14, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  height: var(--header-height);
  border-bottom: 1px solid var(--color-border);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.logo {
  font-size: var(--font-size-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text);
  position: relative;
}

.logo::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background-color: var(--color-primary);
  transform: scaleX(0.3);
  transform-origin: left;
  transition: transform var(--transition-normal);
}

.logo:hover::after {
  transform: scaleX(1);
}

.nav-links {
  display: flex;
  gap: var(--space-5);
}

.nav-link {
  font-weight: 500;
  position: relative;
  padding: var(--space-2) 0;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-primary);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--transition-normal);
}

.nav-link:hover::after {
  transform: scaleX(1);
}

/* Hero Section */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  padding-top: var(--header-height);
  overflow: hidden;
}

.hero-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: linear-gradient(
      to right,
      rgba(0, 0, 0, 0.9),
      rgba(0, 0, 0, 0.7)
    );
  background-size: cover;
  background-position: center;
  z-index: -1;
}

.hero-content {
  max-width: 650px;
  animation: fadeInUp 1s ease-out;
}

.hero-title {
  font-size: var(--font-size-4xl);
  font-weight: 700;
  margin-bottom: var(--space-3);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.hero-subtitle {
  font-size: var(--font-size-xl);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
}

.hero-actions {
  display: flex;
  gap: var(--space-4);
}

/* Section Styles */
section {
  padding: var(--space-9) 0;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-7);
}

.section-label {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  background-color: var(--color-primary-transparent);
  color: var(--color-primary);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  margin-bottom: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.section-title {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-3);
}

/* About Section */
.about-section {
  background-color: var(--color-surface-alt);
  position: relative;
  overflow: hidden;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr auto; /* Text left, widget right */
  gap: var(--space-8);             /* Space between columns */
  align-items: start;
  margin-left: auto;
  margin-right: auto;
  max-width: 900px;
}

.about-content {
  padding-right: var(--space-6);
}

.about-text {
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

.about-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.meta-item {
  min-width: 150px;
}

.meta-label {
  display: block;
  color: var(--color-text-subtle);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-1);
}

.meta-value {
  font-weight: 500;
}

.about-music {
  background-color: transparent;
  border-radius: 0;
  box-shadow: none;
  border: none;
  height: auto;
}

.music-title {
  display: none;
}

/* Fix the duplicate album-art-large class by removing the second one and updating the first */
.album-art-large {
  width: 100%;
  max-width: 220px; /* Even smaller to fit in the red box area */
  margin: 0 auto var(--space-3); /* Less margin at bottom */
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
  transition: transform var(--transition-normal);
}

/* Adjust the spotify container to have padding and better alignment */
.spotify-now-playing-container {
  width: 100%;
  max-width: 280px; /* Fix a maximum width */
  margin-left: 0; /* Remove auto-centering */
}

/* Make the music title much smaller */
.music-title-floating {
  font-size: var(--font-size-md); /* Make this smaller */
  margin-bottom: var(--space-2); /* Reduce the margin */
  text-align: center;
}

/* Reduce padding in track details */
.track-details-floating {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center; /* Center horizontally */
  text-align: center;
  margin-top: var(--space-2);
}

.progress-container {
  width: 180px;
  margin: var(--space-2) 0 var(--space-3) 0;
  display: flex;
  flex-direction: column;
  align-items: center; /* Center bar and times */
}

.progress-bar {
  width: 100%;
  height: 8px; /* Thicker bar */
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
  overflow: hidden;
  margin: 0.5rem 0;
  position: relative;
}

.progress-bar .progress {
  height: 100%;
  background: linear-gradient(90deg, #6e22c5 0%, #6e22c5 100%);
  border-radius: 4px;
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
}



.track-time {
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  margin-top: 0.2rem;
}

.spotify-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-2);
}

/* Standalone Spotify Section */
.spotify-section {
  padding: 0 0 var(--space-9);
  background-color: var(--color-surface-alt);
  margin-top: -2rem; /* Connect it with the about section */
}

/* Projects Section */
.projects-section {
  background-color: var(--color-background);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, 350px); /* Fixed width columns */
  gap: var(--space-6);
  justify-content: center;         /* Center the grid items horizontally */
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.project-card {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-normal);
  position: relative;
  isolation: isolate;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    to bottom right,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  z-index: -1;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.project-card:hover::before {
  opacity: 1;
}

.project-image {
  height: 200px;
  overflow: hidden;
  position: relative;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.project-card:hover .project-image img {
  transform: scale(1.05);
}

.project-content {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.project-title {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-3);
}

.project-description {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-4);
  flex-grow: 1;
}

.project-footer {
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
}

.project-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  transition: transform 0.3s ease;
}

.project-card:hover .project-img {
  transform: scale(1.05);
}

/* Hide placeholder when image is loaded */
.project-image img:not([src=""]) + .image-placeholder {
  display: none;
}

/* Contact Section */
.contact-section {
  background-color: var(--color-surface-alt);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-6);
  max-width: 800px;
  margin: 0 auto;
}

.contact-card {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  text-align: center;
  transition: all var(--transition-normal);
}

.contact-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.contact-icon {
  width: 60px;
  height: 60px;
  background-color: var(--color-primary-transparent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
}

.contact-icon svg {
  width: 30px;
  height: 30px;
  color: var(--color-primary);
}

.contact-link {
  display: inline-block;
  margin-top: var(--space-2);
  color: var(--color-primary);
  font-weight: 500;
}

.contact-link:hover {
  text-decoration: underline;
}

/* Bonus Section */
.bonus-section {
  background-color: var(--color-background);
}

.bonus-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.acknowledgment {
  margin-bottom: var(--space-6);
  padding: var(--space-4);
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
}

.playlist-section {
  padding: var(--space-6);
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
}

.playlist-section h3 {
  margin-bottom: var(--space-5);
}

.playlist-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: center;
}

.underline {
  text-decoration: underline;
}

/* Footer */
.main-footer {
  background-color: var(--color-surface);
  padding: var(--space-8) 0;
  border-top: 1px solid var(--color-border);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-logo {
  font-size: var(--font-size-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.footer-copyright {
  color: var(--color-text-subtle);
  font-size: var(--font-size-sm);
}

/* Loading Spinner */
.loading-spinner {
  width: 40px;
  height: 40px;
  margin: 40px auto;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--color-primary);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Media Queries */
@media (max-width: 1024px) {
  :root {
    --font-size-4xl: 2.5rem;
    --font-size-3xl: 2rem;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .about-content {
    padding-right: 0;
    order: 1;
  }

  .music-player { /* Changed from .about-music to .music-player */
    order: 2;
    min-height: 300px;
  }
}

@media (max-width: 992px) {
  .about-content {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    
  }
}

@media (max-width: 768px) {
  :root {
    --font-size-4xl: 2rem;
    --font-size-3xl: 1.75rem;
    --font-size-2xl: 1.5rem;
  }

  .hero {
    min-height: 500px;
  }

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

  .nav-links {
    display: none;
  }

  .footer-content {
    flex-direction: column;
    gap: var(--space-4);
    text-align: center;
  }

  .spotify-now-playing-container {
    max-width: 100%;
  }

  .album-art-large {
    max-width: 250px;
  }
}

@media (max-width: 480px) {
  .hero-content {
    text-align: center;
  }

  .hero-actions {
    justify-content: center;
  }

  .playlist-buttons {
    flex-direction: column;
    gap: var(--space-3);
  }

  .spotify-now-playing-container {
    max-width: 100%;
  }
}

@media (max-width: 992px) {
  .about-meta {
    justify-content: center;
    text-align: center;
  }
}