/* ==========================================================================
   CSS Variables & Reset
   ========================================================================== */

:root {
  /* Elegant Neutral Palette */
  --primary-color: #d4af37; /* Champagne Gold */
  --secondary-color: #c9a961; /* Soft Gold */
  --accent-color: #ffffff;
  --text-primary: #ffffff;
  --text-secondary: #999999;
  --text-muted: #666666;
  --bg-primary: #0f0f0f;
  --bg-secondary: #1a1a1a;
  --bg-tertiary: #252525;
  --bg-card: rgba(255, 255, 255, 0.03);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(212, 175, 55, 0.3);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  --shadow-gold: 0 8px 24px rgba(212, 175, 55, 0.15);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  line-height: 1.6;
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 1.5rem 2rem;
  background: rgba(15, 15, 15, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar:hover {
  background: rgba(15, 15, 15, 0.95);
  border-bottom-color: var(--border-hover);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  position: relative;
  transition: all 0.3s ease;
}

.logo::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 20px;
  height: 2px;
  background: var(--primary-color);
  transition: width 0.3s ease;
}

.logo:hover::after {
  width: 100%;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 3rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  text-transform: uppercase;
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 1px;
  background: var(--primary-color);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover::after {
  width: 100%;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(
    to bottom,
    var(--bg-primary) 0%,
    var(--bg-secondary) 100%
  );
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    ellipse at top,
    rgba(212, 175, 55, 0.03) 0%,
    transparent 50%
  );
  z-index: -1;
}

.hero-content {
  text-align: center;
  max-width: 900px;
  padding: 0 2rem;
}

.hero-title {
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 300;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 1s cubic-bezier(0.4, 0, 0.2, 1) 0.3s forwards;
}

.hero-subtitle {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  color: var(--primary-color);
  margin-bottom: 2rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 1s cubic-bezier(0.4, 0, 0.2, 1) 0.5s forwards;
}

.hero-description {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 3rem;
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.8;
  font-weight: 300;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 1s cubic-bezier(0.4, 0, 0.2, 1) 0.7s forwards;
}

.cta-buttons {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 1s cubic-bezier(0.4, 0, 0.2, 1) 0.9s forwards;
}

.btn {
  padding: 1rem 2.5rem;
  border: none;
  border-radius: 2px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--primary-color);
  color: var(--bg-primary);
  box-shadow: var(--shadow-gold);
}

.btn-primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s ease;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(212, 175, 55, 0.25);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  border-color: var(--primary-color);
  background: rgba(212, 175, 55, 0.05);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.floating-elements {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.4;
}

.floating-element {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--primary-color);
  border-radius: 50%;
  opacity: 0.2;
  animation: float 8s ease-in-out infinite;
}

/* ==========================================================================
   Section Layouts
   ========================================================================== */

.section {
  padding: 8rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

.section-title {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 300;
  text-align: center;
  margin-bottom: 4rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  position: relative;
  padding-bottom: 1rem;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 1px;
  background: var(--primary-color);
}

/* ==========================================================================
   About Section
   ========================================================================== */

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: start;
  margin-bottom: 4rem;
}

.about-text {
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--text-secondary);
  font-weight: 300;
}

.about-text p {
  margin-bottom: 1.5rem;
}

.about-text strong {
  color: var(--text-primary);
  font-weight: 500;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.service-card {
  background: var(--bg-card);
  padding: 3rem 2.5rem;
  border-radius: 0;
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  height: 0;
  background: var(--primary-color);
  transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

.service-card:hover::before {
  height: 100%;
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-hover);
  background: var(--bg-secondary);
}

.service-icon {
  width: 50px;
  height: 50px;
  background: transparent;
  border: 1px solid var(--primary-color);
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  font-size: 1.3rem;
  color: var(--primary-color);
  transition: all 0.3s ease;
}

.service-card:hover .service-icon {
  background: var(--primary-color);
  color: var(--bg-primary);
  transform: scale(1.1);
}

.service-title {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
}

.service-description {
  color: var(--text-secondary);
  line-height: 1.7;
  font-weight: 300;
}

/* ==========================================================================
   Skills Section
   ========================================================================== */

.skills-container {
  margin-top: 3rem;
}

.skills-category {
  margin-bottom: 4rem;
}

.skills-category h3 {
  font-size: 1.3rem;
  font-weight: 500;
  margin-bottom: 2rem;
  color: var(--text-primary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1.5rem;
}

.skill-item {
  background: var(--bg-card);
  padding: 2rem 1.5rem;
  border-radius: 0;
  border: 1px solid var(--border-color);
  text-align: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  position: relative;
}

.skill-item::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 1px;
  background: var(--primary-color);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.skill-item:hover::after {
  width: 80%;
}

.skill-item:hover {
  transform: translateY(-8px);
  background: var(--bg-secondary);
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

.skill-icon-img {
  width: 40px;
  height: 40px;
  margin-bottom: 1rem;
  object-fit: contain;
  filter: grayscale(0.3);
  transition: filter 0.3s ease;
}

.skill-item:hover .skill-icon-img {
  filter: grayscale(0);
}

.skill-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ==========================================================================
   Portfolio Section
   ========================================================================== */

.portfolio-category {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 5rem;
}

.category-header {
  width: 100%;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.category-icon {
  width: 50px;
  height: 50px;
  border: 1px solid var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  font-size: 1.3rem;
  color: var(--primary-color);
}

.category-title {
  font-size: 1.8rem;
  font-weight: 400;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.category-description {
  color: var(--text-secondary);
  font-weight: 300;
  font-size: 1.05rem;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  width: 100%;
}

.project-card {
  background: var(--bg-card);
  border-radius: 0;
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  position: relative;
}

.project-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary-color);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

.project-card:hover::before {
  transform: scaleX(1);
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-hover);
  background: var(--bg-secondary);
}

.project-content {
  padding: 2.5rem;
  position: relative;
  z-index: 2;
}

.project-title {
  font-size: 1.4rem;
  font-weight: 500;
  margin-bottom: 1rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.project-description {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.5rem;
  font-weight: 300;
}

.project-tech {
  margin-bottom: 1.5rem;
}

.tech-tag {
  display: inline-block;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 0.4rem 1rem;
  border-radius: 0;
  font-size: 0.7rem;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.3s ease;
}

.project-card:hover .tech-tag {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.project-link::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--primary-color);
  transition: width 0.3s ease;
}

.project-link:hover::after {
  width: 100%;
}

.project-link:hover {
  color: var(--primary-color);
}

.btn-more-container {
  display: flex;
  justify-content: center;
  margin-top: 3rem;
}

/* ==========================================================================
   Contact Section
   ========================================================================== */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.contact-card {
  background: var(--bg-card);
  padding: 3rem 2rem;
  border-radius: 0;
  border: 1px solid var(--border-color);
  text-align: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  position: relative;
}

.contact-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary-color);
  transform: scaleX(0);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.contact-card:hover::before {
  transform: scaleX(1);
}

.contact-card:hover {
  transform: translateY(-8px);
  background: var(--bg-secondary);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.contact-icon {
  width: 50px;
  height: 50px;
  background: transparent;
  border: 1px solid var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 1.2rem;
  color: var(--primary-color);
  transition: all 0.3s ease;
}

.contact-card:hover .contact-icon {
  background: var(--primary-color);
  color: var(--bg-primary);
  transform: scale(1.1);
}

.contact-title {
  font-weight: 500;
  margin-bottom: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.contact-info {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 300;
  transition: color 0.3s ease;
}

.contact-info:hover {
  color: var(--primary-color);
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.social-link {
  width: 45px;
  height: 45px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-link:hover {
  transform: translateY(-4px);
  border-color: var(--primary-color);
  background: var(--primary-color);
  color: var(--bg-primary);
  box-shadow: var(--shadow-gold);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  font-weight: 300;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px) translateX(0px);
  }
  33% {
    transform: translateY(-15px) translateX(10px);
  }
  66% {
    transform: translateY(15px) translateX(-10px);
  }
}

/* Scroll animations */
.fade-in {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Fallback: ensure content is visible on mobile even if IntersectionObserver fails */
@media (max-width: 768px) {
  .fade-in {
    animation: fallbackReveal 0s 2s forwards;
  }
  .fade-in.visible {
    animation: none;
  }
}

@keyframes fallbackReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-secondary);
    flex-direction: column;
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
    gap: 0;
  }

  .nav-menu li {
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
  }

  .nav-menu.active {
    display: flex;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 280px;
  }

  .section {
    padding: 5rem 1.5rem;
  }

  .skills-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .category-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .navbar {
    padding: 1rem;
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .section-title {
    font-size: 2rem;
  }
}
