/* ==========================================================================
   CSS Custom Properties (Design System)
   ========================================================================== */
:root {
  /* Colors */
  --bg-main: #0f172a; /* gray-900 */
  --bg-card: rgba(30, 41, 59, 0.4);
  --bg-card-hover: rgba(30, 41, 59, 0.6);
  --bg-footer: rgba(15, 23, 42, 0.8);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8; /* gray-400 */
  --text-dark: #334155;
  
  --color-cyan: #22d3ee;
  --color-cyan-glow: rgba(34, 211, 238, 0.5);
  --color-purple: #a855f7;
  --color-purple-glow: rgba(168, 85, 247, 0.5);
  --color-blue: #3b82f6;
  --color-green: #22c55e;
  --color-orange: #f97316;
  --color-yellow: #eab308;
  --color-red: #ef4444;

  /* Fonts */
  --font-inter: 'Inter', sans-serif;
  --font-outfit: 'Outfit', sans-serif;
  
  /* Layout */
  --container-width: 1200px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --radius-sm: 0.5rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;
}

/* ==========================================================================
   Base Styles & Resets
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-inter);
  line-height: 1.6;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

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

ul {
  list-style: none;
}

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

button {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  transition: var(--transition);
}

/* ==========================================================================
   Typography Utilities
   ========================================================================== */
.font-inter { font-family: var(--font-inter); }
.font-outfit { font-family: var(--font-outfit); }

.text-cyan { color: var(--color-cyan); }
.text-purple { color: var(--color-purple); }
.text-blue { color: var(--color-blue); }
.text-blue-muted { color: #93c5fd; }
.text-green { color: var(--color-green); }
.text-orange { color: var(--color-orange); }
.text-yellow { color: var(--color-yellow); }
.text-red { color: var(--color-red); }
.text-gray { color: var(--text-muted); }
.text-gray-dark { color: var(--text-dark); }
.text-gray-muted { color: #64748b; }

.text-gradient {
  background: linear-gradient(135deg, var(--color-cyan), var(--color-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-glow {
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

.glow-text {
  color: var(--text-main);
  font-weight: 600;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.hover-glow-cyan:hover { box-shadow: 0 0 20px var(--color-cyan-glow); border-color: var(--color-cyan); color: var(--color-cyan) !important;}
.hover-glow-green:hover { box-shadow: 0 0 20px rgba(34, 197, 94, 0.3); border-color: var(--color-green); color: var(--color-green) !important;}
.hover-glow-purple:hover { box-shadow: 0 0 20px var(--color-purple-glow); border-color: var(--color-purple); color: var(--color-purple) !important;}

/* ==========================================================================
   Layout Containers
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.pt-pb {
  padding-top: 6rem;
  padding-bottom: 6rem;
}

.section-title {
  font-family: var(--font-outfit);
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 1rem;
}

.section-subtitle {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 3rem auto;
}

/* Background Canvas & Blobs */
.bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -10;
  opacity: 0.3;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  z-index: -5;
  opacity: 0.4;
  animation: blobFloat 20s infinite alternate;
}
.blob-1 {
  width: 400px;
  height: 400px;
  background: var(--color-purple);
  top: -100px;
  left: -100px;
}
.blob-2 {
  width: 500px;
  height: 500px;
  background: var(--color-cyan);
  bottom: 10%;
  right: -200px;
  animation-delay: -10s;
}

/* Glassmorphism */
.glass-nav {
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  transition: var(--transition);
}

.glass-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
}

.bg-glass { background: var(--bg-card); backdrop-filter: blur(8px); }
.border-glass { border: 1px solid rgba(255, 255, 255, 0.1); }

/* ==========================================================================
   Navigation
   ========================================================================== */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  transition: var(--transition);
}

.navbar.scrolled {
  padding: 0.5rem 0;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  max-width: var(--container-width);
  margin: 0 auto;
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.nav-logo span { color: var(--color-cyan); }

.nav-links {
  display: flex;
  gap: 2rem;
}
.nav-links li a {
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
}
.nav-links li a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-cyan), var(--color-purple));
  transition: width 0.3s ease;
}
.nav-links li a:hover::after { width: 100%; }

.menu-toggle {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
}

.mobile-menu {
  display: none;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  padding: 1rem 1.5rem 2rem;
  gap: 1rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}
.mobile-menu.active {
  display: flex;
}
.mobile-menu a {
  font-size: 1.1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .menu-toggle { display: block; }
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.75rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 1rem;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-cyan), #0284c7);
  color: #fff;
  box-shadow: 0 4px 15px rgba(34, 211, 238, 0.3);
}
.btn-primary::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(135deg, #0284c7, var(--color-cyan));
  z-index: -1;
  transition: opacity 0.3s ease;
  opacity: 0;
}
.btn-primary:hover::before { opacity: 1; }
.btn-primary:hover i { transform: translateX(4px); }

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-main);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--color-cyan);
}

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}
.btn-icon:hover {
  background: var(--text-main);
  color: var(--bg-main);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 5rem;
  position: relative;
}

.hero-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  gap: 3rem;
  z-index: 10;
}

.hero-content {
  flex: 1;
  max-width: 600px;
}

.hero-greeting {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 1rem;
}

.hero-title {
  font-size: clamp(3rem, 5vw, 5rem);
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.hero-role {
  font-size: clamp(1.25rem, 2vw, 2rem);
  font-weight: 300;
  margin-bottom: 2rem;
  min-height: 3rem;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-image {
  flex: 1;
  display: flex;
  justify-content: center;
}

.profile-wrapper {
  position: relative;
  width: 400px;
  height: 400px;
}

.profile-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 110%;
  height: 110%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.3) 0%, rgba(168, 85, 247, 0) 70%);
  border-radius: 50%;
  z-index: -1;
  animation: pulseGlow 4s infinite alternate;
}

.profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
  border: 4px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  animation: morph 8s ease-in-out infinite both alternate;
}

@media (max-width: 992px) {
  .hero-container {
    flex-direction: column-reverse;
    text-align: center;
    justify-content: center;
  }
  .hero-buttons { justify-content: center; }
  .profile-wrapper { width: 300px; height: 300px; }
}

.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.5rem;
  opacity: 0.7;
}

/* ==========================================================================
   About Section
   ========================================================================== */
.about-section {
  position: relative;
  z-index: 10;
}

.about-card {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem;
  position: relative;
  overflow: hidden;
}

.about-card-glow {
  position: absolute;
  top: -50px; right: -50px;
  width: 200px; height: 200px;
  background: var(--color-purple);
  filter: blur(100px);
  border-radius: 50%;
  opacity: 0.3;
  z-index: -1;
}

.about-flex {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.about-icon {
  font-size: 4rem;
  min-width: 100px;
  text-align: center;
  opacity: 0.8;
}

.about-text {
  font-size: 1.125rem;
  line-height: 1.8;
  text-align: justify;
}

@media (max-width: 768px) {
  .about-flex { flex-direction: column; text-align: center; }
  .about-text { text-align: center; }
}

/* ==========================================================================
   Skills Section
   ========================================================================== */
.skills-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  max-width: 800px;
  margin: 0 auto;
}

.skill-badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
  cursor: default;
}

.skill-badge:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   Projects Section
   ========================================================================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.project-img-wrapper {
  position: relative;
  height: 220px;
  overflow: hidden;
}

.img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg-main), transparent);
  z-index: 10;
  opacity: 0.8;
}

.project-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s ease;
}

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

.project-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 20;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(4px);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid;
}

.project-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.project-desc {
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  flex: 1;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.tech-tag {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-cyan);
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(34, 211, 238, 0.2);
}

.project-actions {
  display: flex;
  gap: 0.75rem;
}
.project-actions .btn-sm.btn-primary { flex: 1; }

.border-cyan { border-color: rgba(34, 211, 238, 0.5); }
.border-blue { border-color: rgba(59, 130, 246, 0.5); }
.border-purple { border-color: rgba(168, 85, 247, 0.5); }

/* ==========================================================================
   Certificates Section
   ========================================================================== */
.cert-card {
  max-width: 900px;
  margin: 0 auto;
  padding: 0.5rem;
}

.cert-header {
  background: rgba(30, 41, 59, 0.5);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cert-title {
  font-size: 1.125rem;
}

.cert-preview {
  height: 400px;
  background: rgba(15, 23, 42, 0.4);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.cert-icon {
  font-size: 5rem;
  opacity: 0.5;
}

.cert-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cert-preview:hover .cert-overlay {
  opacity: 1;
}

/* ==========================================================================
   Contact & Footer Section
   ========================================================================== */
.contact-section {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: var(--bg-footer);
  padding-bottom: 3rem;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 4rem;
}

.contact-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.contact-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.contact-item:hover .contact-icon {
  transform: translateY(-10px);
}

/* Professional Footer */
.main-footer {
  position: relative;
  z-index: 10;
  padding-top: 5rem;
  padding-bottom: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-link {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-family: var(--font-inter);
  transition: var(--transition);
}

.footer-link:hover {
  color: var(--color-cyan);
  padding-left: 6px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: var(--font-inter);
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }
  .footer-brand p {
    margin: 1rem auto 0;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes blobFloat {
  0% { transform: translateY(0px) scale(1); }
  100% { transform: translateY(50px) scale(1.1); }
}

@keyframes pulseGlow {
  0% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
}

@keyframes morph {
  0% { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
  34% { border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%; }
  67% { border-radius: 100% 60% 60% 100% / 100% 100% 60% 60%; }
  100% { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0) translateX(-50%); }
  40% { transform: translateY(-20px) translateX(-50%); }
  60% { transform: translateY(-10px) translateX(-50%); }
}

.bounce-anim {
  animation: bounce 2s infinite;
}

/* Scroll Reveal Classes (Handled by JS Intersection Observer) */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.fade-in.appear {
  opacity: 1;
  transform: translateY(0);
}

.slide-left {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.slide-left.appear {
  opacity: 1;
  transform: translateX(0);
}

.slide-up {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.slide-up.appear {
  opacity: 1;
  transform: translateY(0);
}

.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
