/* ================================
   CSS VARIABLES & RESET
   ================================ */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a2e;
  --bg-card-hover: #1f1f35;
  --text-primary: #e8e8f0;
  --text-secondary: #9494a8;
  --text-muted: #6b6b80;
  --accent: #7c3aed;
  --accent-light: #a78bfa;
  --accent-glow: rgba(124, 58, 237, 0.35);
  --gradient-1: linear-gradient(135deg, #7c3aed, #2563eb);
  --gradient-2: linear-gradient(135deg, #ec4899, #7c3aed);
  --border: rgba(255, 255, 255, 0.06);
  --radius: 16px;
  --radius-sm: 10px;
  --nav-height: 72px;
  --container-max: 1140px;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-height); }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }

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

/* ================================
   NAVIGATION
   ================================ */
.navbar {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
  background: rgba(10, 10, 15, 0.7);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.navbar.scrolled { background: rgba(10, 10, 15, 0.95); box-shadow: 0 4px 30px rgba(0,0,0,0.3); }
.nav-container { display: flex; align-items: center; justify-content: space-between; height: var(--nav-height); width: 90%; max-width: var(--container-max); margin: 0 auto; }
.nav-logo { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.5px; }
.logo-bracket { color: var(--accent); }
.nav-links { display: flex; gap: 8px; }
.nav-link {
  padding: 8px 18px; border-radius: 8px; font-size: 0.9rem; font-weight: 500;
  color: var(--text-secondary); transition: var(--transition); position: relative;
}
.nav-link:hover, .nav-link.active { color: var(--text-primary); background: rgba(124, 58, 237, 0.1); }
.nav-link.active { color: var(--accent-light); }

.nav-toggle { display: none; width: 32px; height: 32px; position: relative; }
.hamburger, .hamburger::before, .hamburger::after {
  display: block; width: 24px; height: 2px; background: var(--text-primary);
  border-radius: 2px; transition: var(--transition); position: absolute; left: 4px;
}
.hamburger { top: 15px; }
.hamburger::before { content: ''; top: -7px; }
.hamburger::after { content: ''; top: 7px; }
.nav-toggle.active .hamburger { background: transparent; }
.nav-toggle.active .hamburger::before { transform: rotate(45deg); top: 0; }
.nav-toggle.active .hamburger::after { transform: rotate(-45deg); top: 0; }

/* ================================
   HERO
   ================================ */
.hero {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  gap: 60px; padding: calc(var(--nav-height) + 40px) 5% 60px;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(124,58,237,0.12) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 30%, rgba(37,99,235,0.08) 0%, transparent 50%);
}
.hero-particles { position: absolute; inset: 0; pointer-events: none; }
.particle {
  position: absolute; width: 3px; height: 3px; border-radius: 50%;
  background: var(--accent-light); opacity: 0;
  animation: floatParticle 6s infinite ease-in-out;
}
@keyframes floatParticle {
  0%, 100% { opacity: 0; transform: translateY(0) scale(0.5); }
  50% { opacity: 0.6; transform: translateY(-80px) scale(1); }
}
.hero-content { position: relative; z-index: 1; max-width: 560px; }
.hero-greeting {
  font-size: 1.1rem; font-weight: 500; color: var(--accent-light);
  margin-bottom: 8px; letter-spacing: 1px;
  animation: fadeInUp 0.8s ease-out;
}
.hero-name {
  font-size: clamp(3rem, 6vw, 4.5rem); font-weight: 800; line-height: 1.1;
  margin-bottom: 16px; letter-spacing: -2px;
  animation: fadeInUp 0.8s ease-out 0.15s both;
}
.hero-highlight { color: var(--accent); }
.hero-typing-wrapper {
  display: flex; align-items: center; font-size: 1.25rem; color: var(--text-secondary);
  margin-bottom: 20px; min-height: 32px;
  animation: fadeInUp 0.8s ease-out 0.3s both;
}
.hero-typing { color: var(--accent-light); font-weight: 600; }
.hero-cursor { color: var(--accent); animation: blink 0.8s infinite; margin-left: 2px; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.hero-description {
  color: var(--text-secondary); font-size: 1.05rem; line-height: 1.8;
  margin-bottom: 32px; max-width: 480px;
  animation: fadeInUp 0.8s ease-out 0.45s both;
}
.hero-cta { display: flex; gap: 16px; margin-bottom: 32px; animation: fadeInUp 0.8s ease-out 0.6s both; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 32px; border-radius: 12px; font-weight: 600; font-size: 0.95rem;
  transition: var(--transition); position: relative; overflow: hidden;
}
.btn-primary {
  background: var(--gradient-1); color: #fff;
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px var(--accent-glow); }
.btn-outline {
  border: 2px solid rgba(124, 58, 237, 0.4); color: var(--accent-light);
  background: transparent;
}
.btn-outline:hover { background: rgba(124, 58, 237, 0.1); border-color: var(--accent); transform: translateY(-2px); }

.hero-socials { display: flex; gap: 16px; animation: fadeInUp 0.8s ease-out 0.75s both; }
.social-link {
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  border-radius: 12px; border: 1px solid var(--border); color: var(--text-secondary);
  transition: var(--transition);
}
.social-link svg { width: 20px; height: 20px; }
.social-link:hover { color: var(--accent-light); border-color: var(--accent); background: rgba(124,58,237,0.1); transform: translateY(-3px); }

/* Hero Image */
.hero-image-wrapper {
  position: relative; z-index: 1; flex-shrink: 0;
  animation: fadeInUp 1s ease-out 0.3s both;
}
.hero-image {
  width: 320px; height: 320px; object-fit: cover; border-radius: 50%;
  border: 3px solid rgba(124,58,237,0.3); position: relative; z-index: 2;
}
.hero-image-glow {
  position: absolute; inset: -20px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  animation: pulse 3s ease-in-out infinite;
}
.hero-image-ring {
  position: absolute; inset: -10px; border-radius: 50%;
  border: 2px dashed rgba(124,58,237,0.2);
  animation: spin 20s linear infinite;
}
@keyframes pulse { 0%, 100% { opacity: 0.5; transform: scale(1); } 50% { opacity: 1; transform: scale(1.05); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* Scroll Indicator */
.scroll-indicator {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--text-muted); font-size: 0.75rem; letter-spacing: 2px;
  animation: fadeInUp 0.8s ease-out 1s both;
}
.scroll-mouse {
  width: 24px; height: 38px; border: 2px solid var(--text-muted);
  border-radius: 12px; position: relative;
}
.scroll-wheel {
  width: 3px; height: 8px; background: var(--accent-light);
  border-radius: 2px; position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
  animation: scrollAnim 1.5s ease-in-out infinite;
}
@keyframes scrollAnim { 0% { opacity: 1; top: 6px; } 100% { opacity: 0; top: 22px; } }

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

/* ================================
   SECTIONS
   ================================ */
.section { padding: 100px 0; position: relative; }
.section-title {
  font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 700; margin-bottom: 56px;
  letter-spacing: -1px;
}
.section-number { color: var(--accent); font-family: 'Inter', monospace; font-size: 1rem; margin-right: 12px; font-weight: 600; }

/* AOS animation */
[data-aos] { opacity: 0; transform: translateY(30px); transition: opacity 0.7s ease, transform 0.7s ease; }
[data-aos].visible { opacity: 1; transform: translateY(0); }

/* ================================
   ABOUT
   ================================ */
.about { background: var(--bg-secondary); }
.about-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 60px; align-items: start; }
.about-text p { color: var(--text-secondary); margin-bottom: 18px; font-size: 1.05rem; }
.about-text strong { color: var(--text-primary); }
.about-details { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.detail-card {
  display: flex; align-items: center; gap: 16px; padding: 20px;
  background: var(--bg-card); border-radius: var(--radius-sm);
  border: 1px solid var(--border); transition: var(--transition);
}
.detail-card:hover { border-color: rgba(124,58,237,0.3); transform: translateY(-3px); background: var(--bg-card-hover); }
.detail-icon { font-size: 1.8rem; }
.detail-info h3 { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 2px; }
.detail-info p { font-size: 0.95rem; font-weight: 500; }

/* ================================
   SKILLS
   ================================ */
.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.skill-card {
  padding: 32px; background: var(--bg-card); border-radius: var(--radius);
  border: 1px solid var(--border); text-align: center; transition: var(--transition);
}
.skill-card:hover { border-color: rgba(124,58,237,0.3); transform: translateY(-5px); background: var(--bg-card-hover); box-shadow: 0 20px 40px rgba(0,0,0,0.2); }
.skill-icon-wrapper {
  width: 56px; height: 56px; margin: 0 auto 16px; display: flex; align-items: center; justify-content: center;
  background: rgba(124,58,237,0.1); border-radius: 14px; color: var(--accent-light); transition: var(--transition);
}
.skill-card:hover .skill-icon-wrapper { background: rgba(124,58,237,0.2); }
.skill-icon { width: 28px; height: 28px; }
.skill-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 16px; }
.skill-bar { width: 100%; height: 6px; background: rgba(255,255,255,0.06); border-radius: 3px; overflow: hidden; }
.skill-fill {
  height: 100%; width: 0; background: var(--gradient-1); border-radius: 3px;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ================================
   PORTFOLIO
   ================================ */
.portfolio { background: var(--bg-secondary); }
.portfolio-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 32px; }
.project-card {
  background: var(--bg-card); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); transition: var(--transition);
}
.project-card:hover { transform: translateY(-6px); border-color: rgba(124,58,237,0.3); box-shadow: 0 24px 48px rgba(0,0,0,0.25); }
.project-image-wrapper { position: relative; overflow: hidden; aspect-ratio: 16/10; }
.project-image { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.project-card:hover .project-image { transform: scale(1.08); }
.project-overlay {
  position: absolute; inset: 0; background: rgba(10,10,15,0.75);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: var(--transition);
}
.project-card:hover .project-overlay { opacity: 1; }
.project-overlay-links { display: flex; gap: 16px; }
.project-link {
  width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
  border-radius: 12px; background: rgba(255,255,255,0.1); color: #fff;
  backdrop-filter: blur(8px); transition: var(--transition);
}
.project-link svg { width: 20px; height: 20px; }
.project-link:hover { background: var(--accent); transform: scale(1.1); }
.project-info { padding: 24px; }
.project-label { font-size: 0.75rem; color: var(--accent-light); font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; }
.project-title { font-size: 1.25rem; font-weight: 700; margin: 8px 0 12px; }
.project-description { color: var(--text-secondary); font-size: 0.92rem; line-height: 1.7; margin-bottom: 16px; }
.project-tech { display: flex; flex-wrap: wrap; gap: 8px; }
.project-tech span {
  padding: 4px 14px; font-size: 0.78rem; border-radius: 6px; font-weight: 500;
  background: rgba(124,58,237,0.1); color: var(--accent-light); border: 1px solid rgba(124,58,237,0.15);
}

/* ================================
   CONTACT
   ================================ */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: start; }
.contact-subtitle { font-size: 1.5rem; font-weight: 700; margin-bottom: 12px; }
.contact-description { color: var(--text-secondary); margin-bottom: 32px; font-size: 1.05rem; }
.contact-details { display: flex; flex-direction: column; gap: 20px; }
.contact-item { display: flex; gap: 16px; align-items: center; }
.contact-item-icon {
  width: 48px; height: 48px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(124,58,237,0.1); border-radius: 12px; color: var(--accent-light);
}
.contact-item-icon svg { width: 22px; height: 22px; }
.contact-item h4 { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 2px; }
.contact-item a, .contact-item p { font-size: 0.95rem; color: var(--text-secondary); }
.contact-item a:hover { color: var(--accent-light); }

/* Form */
.contact-form { display: flex; flex-direction: column; gap: 24px; }
.form-group { position: relative; }
.form-group input, .form-group textarea {
  width: 100%; padding: 16px 0 8px; background: transparent; border: none;
  border-bottom: 2px solid var(--border); color: var(--text-primary);
  font-size: 1rem; font-family: inherit; outline: none; transition: var(--transition);
}
.form-group textarea { resize: vertical; min-height: 100px; }
.form-group label {
  position: absolute; left: 0; top: 16px; font-size: 0.95rem; color: var(--text-muted);
  pointer-events: none; transition: var(--transition);
}
.form-group input:focus ~ label, .form-group input:not(:placeholder-shown) ~ label,
.form-group textarea:focus ~ label, .form-group textarea:not(:placeholder-shown) ~ label {
  top: -6px; font-size: 0.75rem; color: var(--accent-light);
}
.form-line {
  position: absolute; bottom: 0; left: 0; width: 0; height: 2px;
  background: var(--gradient-1); transition: width 0.4s ease;
}
.form-group input:focus ~ .form-line, .form-group textarea:focus ~ .form-line { width: 100%; }

.btn-submit { align-self: flex-start; min-width: 180px; justify-content: center; }
.form-status { font-size: 0.9rem; min-height: 24px; }
.form-status.success { color: #34d399; }
.form-status.error { color: #f87171; }

/* ================================
   FOOTER
   ================================ */
.footer { padding: 40px 0; border-top: 1px solid var(--border); background: var(--bg-secondary); }
.footer-content { text-align: center; }
.footer-logo { font-size: 1.3rem; font-weight: 700; display: inline-block; margin-bottom: 12px; }
.footer-text { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 8px; }
.footer-copy { color: var(--text-muted); font-size: 0.8rem; }

/* ================================
   RESPONSIVE
   ================================ */
@media (max-width: 900px) {
  .hero { flex-direction: column-reverse; text-align: center; gap: 40px; }
  .hero-content { align-items: center; }
  .hero-typing-wrapper { justify-content: center; }
  .hero-cta { justify-content: center; }
  .hero-socials { justify-content: center; }
  .hero-description { margin-left: auto; margin-right: auto; }
  .hero-image { width: 240px; height: 240px; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .nav-links {
    position: fixed; top: var(--nav-height); left: 0; width: 100%; background: rgba(10,10,15,0.98);
    backdrop-filter: blur(20px); flex-direction: column; padding: 24px 0; align-items: center;
    transform: translateY(-10px); opacity: 0; pointer-events: none; transition: var(--transition);
  }
  .nav-links.open { transform: translateY(0); opacity: 1; pointer-events: all; }
  .nav-toggle { display: block; }
}
@media (max-width: 600px) {
  .skills-grid { grid-template-columns: 1fr; }
  .about-details { grid-template-columns: 1fr; }
  .portfolio-grid { grid-template-columns: 1fr; }
  .hero-name { font-size: 2.8rem; }
}
