/* ===========================
   CSS Custom Properties
   =========================== */
:root {
  --primary: #6c63ff;
  --primary-dark: #5a52d5;
  --secondary: #f50057;
  --bg: #0a0a0f;
  --bg-card: #12121a;
  --bg-card-hover: #1a1a28;
  --text: #e8e8f0;
  --text-muted: #8888aa;
  --border: rgba(108, 99, 255, 0.2);
  --gradient: linear-gradient(135deg, #6c63ff, #f50057);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  --radius: 16px;
  --transition: 0.3s ease;
  --nav-height: 70px;
}

/* ===========================
   Reset & Base
   =========================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ===========================
   Typography
   =========================== */
h1, h2, h3, h4 {
  line-height: 1.2;
  font-weight: 700;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ===========================
   Layout Utilities
   =========================== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 100px 0;
}

/* ===========================
   Section Titles
   =========================== */
.section-title {
  font-size: clamp(2rem, 4vw, 2.8rem);
  text-align: center;
  margin-bottom: 12px;
}

.section-title span {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 60px;
}

/* ===========================
   Buttons
   =========================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 8px 24px rgba(108, 99, 255, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 12px 32px rgba(108, 99, 255, 0.5);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 2px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-full {
  width: 100%;
  justify-content: center;
}

/* ===========================
   Navigation
   =========================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  transition: background var(--transition), box-shadow var(--transition);
}

.navbar.scrolled {
  background: rgba(10, 10, 15, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.4rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 36px;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
  position: relative;
  padding-bottom: 4px;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient);
  transition: width var(--transition);
  border-radius: 2px;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}

.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===========================
   Hero Section
   =========================== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  text-align: center;
  padding: calc(var(--nav-height) + 40px) 24px 80px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(108, 99, 255, 0.15) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 80% 60%, rgba(245, 0, 87, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(108,99,255,0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.hero-greeting {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.hero-name {
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 800;
  line-height: 1.05;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #ffffff 0%, #c8c0ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-title {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 500;
  color: var(--primary);
  margin-bottom: 24px;
  min-height: 2.4rem;
}

.cursor {
  display: inline-block;
  width: 2px;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero-description {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 52px;
}

.hero-socials {
  display: flex;
  gap: 20px;
  justify-content: center;
}

.social-link {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all var(--transition);
}

.social-link svg {
  width: 18px;
  height: 18px;
}

.social-link:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(108, 99, 255, 0.1);
  transform: translateY(-3px);
}

.scroll-indicator {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 40px;
  border: 2px solid var(--border);
  border-radius: 12px;
  display: flex;
  justify-content: center;
  padding-top: 6px;
}

.scroll-dot {
  width: 4px;
  height: 8px;
  background: var(--primary);
  border-radius: 2px;
  animation: scrollDown 1.8s ease-in-out infinite;
}

@keyframes scrollDown {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(16px); opacity: 0; }
}

/* ===========================
   About Section
   =========================== */
.about {
  background: var(--bg);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 72px;
  align-items: center;
}

.about-image {
  display: flex;
  justify-content: center;
}

.image-wrapper {
  width: 280px;
  height: 280px;
  border-radius: 30px;
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  overflow: hidden;
}

.image-wrapper::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: var(--gradient);
  border-radius: 32px;
  z-index: -1;
}

.image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-card), var(--bg-card-hover));
}

.image-placeholder svg {
  width: 100px;
  height: 100px;
  color: var(--text-muted);
  opacity: 0.4;
}

.profile-pic {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.about-text h3 {
  font-size: 1.6rem;
  margin-bottom: 16px;
  color: var(--text);
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.8;
}

.about-stats {
  display: flex;
  gap: 40px;
  margin: 36px 0;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-number {
  font-size: 2.2rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

/* ===========================
   Skills Section
   =========================== */
.skills {
  background: linear-gradient(180deg, var(--bg) 0%, #0d0d16 100%);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 24px;
}

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  opacity: 0;
  transform: translateY(30px);
}

.skill-card.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease, border-color var(--transition), box-shadow var(--transition);
}

.skill-card:hover {
  transform: translateY(-6px);
  border-color: var(--primary);
  box-shadow: 0 12px 40px rgba(108, 99, 255, 0.2);
}

.skill-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.skill-icon svg {
  width: 28px;
  height: 28px;
}

.skill-icon.php    { background: rgba(119, 123, 179, 0.15); color: #7b71d8; }
.skill-icon.python { background: rgba(55,  118, 171, 0.15); color: #3776ab; }
.skill-icon.mysql  { background: rgba(0,   117, 143, 0.15); color: #00758f; }
.skill-icon.django { background: rgba(15,  176, 115, 0.15); color: #0fb073; }
.skill-icon.figma  { background: rgba(162,  89, 255, 0.15); color: #a259ff; }
.skill-icon.html   { background: rgba(228,  77,  38, 0.15); color: #e44d26; }

.skill-card h3 {
  font-size: 0.95rem;
  margin-bottom: 14px;
  color: var(--text);
}

.skill-bar {
  height: 4px;
  background: rgba(255,255,255,0.07);
  border-radius: 4px;
  overflow: hidden;
}

.skill-fill {
  height: 100%;
  width: 0;
  border-radius: 4px;
  background: var(--gradient);
  transition: width 1.2s ease 0.3s;
}

.skill-card.visible .skill-fill {
  width: var(--w);
}

/* ===========================
   Projects Section
   =========================== */
.projects {
  background: var(--bg);
}

.projects-filter {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.filter-btn {
  padding: 9px 24px;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  opacity: 0;
  transform: translateY(30px);
}

.project-card.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease, border-color var(--transition), box-shadow var(--transition);
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
  border-color: rgba(108, 99, 255, 0.4);
}

.project-card.hidden {
  display: none;
}

.project-image {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.project-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  filter: saturate(0.9);
  transition: transform var(--transition);
}

.project-card:hover .project-placeholder {
  transform: scale(1.05);
}

.project-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  opacity: 0;
  transition: opacity var(--transition);
  backdrop-filter: blur(4px);
}

.project-card:hover .project-overlay {
  opacity: 1;
}

.project-link {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: background var(--transition), transform var(--transition);
}

.project-link:hover {
  background: var(--primary);
  transform: scale(1.1);
}

.project-link svg {
  width: 18px;
  height: 18px;
}

.project-info {
  padding: 24px;
}

.project-info h3 {
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.project-info p {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.7;
  margin-bottom: 16px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-tags span {
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(108, 99, 255, 0.12);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 500;
  border: 1px solid rgba(108, 99, 255, 0.2);
}

/* ===========================
   Contact Section
   =========================== */
.contact {
  background: linear-gradient(180deg, var(--bg) 0%, #0d0d16 100%);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 72px;
  align-items: start;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 36px;
}

.contact-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(108, 99, 255, 0.12);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-icon svg {
  width: 22px;
  height: 22px;
  color: var(--primary);
}

.contact-item h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.contact-item p {
  color: var(--text);
  font-size: 0.95rem;
}

/* Contact Form */
.contact-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(136, 136, 170, 0.5);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

.form-group input.error,
.form-group textarea.error {
  border-color: #f50057;
}

.form-error {
  display: block;
  font-size: 0.8rem;
  color: #f50057;
  margin-top: 6px;
  min-height: 1.2em;
}

.form-success {
  margin-top: 16px;
  padding: 14px 20px;
  background: rgba(67, 233, 123, 0.1);
  border: 1px solid rgba(67, 233, 123, 0.3);
  border-radius: 10px;
  color: #43e97b;
  font-size: 0.9rem;
  text-align: center;
}

/* ===========================
   Footer
   =========================== */
.footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 32px 0;
}

.footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer p {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.footer-socials {
  display: flex;
  gap: 12px;
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 48px;
    text-align: center;
  }

  .about-stats {
    justify-content: center;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(10, 10, 15, 0.97);
    backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: center;
    padding: 32px 24px;
    gap: 24px;
    transform: translateY(-110%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border-bottom: 1px solid var(--border);
  }

  .nav-menu.open {
    transform: translateY(0);
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .contact-form {
    padding: 28px 20px;
  }

  .section {
    padding: 72px 0;
  }
}

@media (max-width: 480px) {
  .hero-cta {
    flex-direction: column;
    align-items: center;
  }

  .about-stats {
    gap: 24px;
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer .container {
    flex-direction: column;
    text-align: center;
  }
}
