/* ===========================
   ROOT & RESET
=========================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:    #6c63ff;
  --primary-d:  #574fd6;
  --accent:     #ff6584;
  --bg:         #0d0d14;
  --bg-2:       #13131f;
  --bg-card:    #1a1a2e;
  --border:     rgba(108, 99, 255, 0.18);
  --text:       #e8e8f0;
  --text-muted: #8888aa;
  --white:      #ffffff;
  --radius:     14px;
  --shadow:     0 8px 32px rgba(0,0,0,0.4);
  --transition: 0.3s ease;
  --font:       'Inter', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* ===========================
   SCROLLBAR
=========================== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

/* ===========================
   UTILITIES
=========================== */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

.section { padding: 100px 0; }

.section-header { text-align: center; margin-bottom: 60px; }

.section-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--primary);
  background: rgba(108,99,255,0.12);
  padding: 6px 16px;
  border-radius: 50px;
  margin-bottom: 14px;
}

.section-title {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 800;
  color: var(--white);
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
  margin: 14px auto 0;
}

/* ===========================
   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;
  transition: var(--transition);
  border: 2px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-d));
  color: var(--white);
  box-shadow: 0 4px 20px rgba(108,99,255,0.4);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(108,99,255,0.55);
}

.btn-outline {
  border-color: var(--primary);
  color: var(--primary);
  background: transparent;
}
.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
  transform: translateY(-2px);
}

.btn-full { width: 100%; justify-content: center; }

/* ===========================
   NAVBAR
=========================== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 18px 0;
  transition: background var(--transition), box-shadow var(--transition), padding var(--transition);
}

.navbar.scrolled {
  background: rgba(13,13,20,0.92);
  backdrop-filter: blur(16px);
  box-shadow: 0 2px 20px rgba(0,0,0,0.4);
  padding: 12px 0;
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--white);
}

.nav-links {
  display: flex;
  gap: 36px;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  position: relative;
  transition: color var(--transition);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 2px;
  background: var(--primary);
  border-radius: 1px;
  transition: width var(--transition);
}

.nav-links a:hover,
.nav-links a.active { color: var(--white); }
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 24px; height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: var(--transition);
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===========================
   HERO
=========================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 120px 80px 80px;
  position: relative;
  overflow: hidden;
  gap: 40px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
}
.blob-1 {
  width: 500px; height: 500px;
  background: var(--primary);
  top: -100px; left: -100px;
  animation: blobMove 8s ease-in-out infinite alternate;
}
.blob-2 {
  width: 400px; height: 400px;
  background: var(--accent);
  bottom: -80px; right: -80px;
  animation: blobMove 10s ease-in-out infinite alternate-reverse;
}

@keyframes blobMove {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(40px, 30px) scale(1.1); }
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(108,99,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(108,99,255,0.04) 1px, transparent 1px);
  background-size: 50px 50px;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 580px;
}

.hero-greeting {
  font-size: 1.1rem;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.hero-name {
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  font-weight: 800;
  color: var(--white);
  line-height: 1.1;
  margin-bottom: 16px;
}

.hero-roles {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 20px;
  min-height: 2rem;
}

.cursor {
  animation: blink 0.8s step-end infinite;
  color: var(--accent);
}
@keyframes blink { 50% { opacity: 0; } }

.hero-desc {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 36px;
  max-width: 480px;
}

.hero-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.hero-socials {
  display: flex;
  gap: 16px;
}
.hero-socials a {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  font-size: 1rem;
  transition: var(--transition);
}
.hero-socials a:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-3px);
}

/* Hero Visual */
.hero-visual {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.avatar-ring {
  width: 280px; height: 280px;
  border-radius: 50%;
  background: conic-gradient(var(--primary), var(--accent), var(--primary));
  padding: 4px;
}

.avatar-inner {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
}

.avatar-initials {
  font-size: 4rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: 2px;
}

.avatar-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  border-radius: 50%;
  display: block;
}

.floating-badge {
  position: absolute;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 8px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap;
  box-shadow: var(--shadow);
}
.floating-badge i { font-size: 1rem; }

.badge-1 { top: 10px; left: -60px; animation: float 3s ease-in-out infinite; }
.badge-2 { top: 10px; right: -60px; animation: float 3.5s ease-in-out infinite 0.5s; }
.badge-3 { bottom: 40px; left: -70px; animation: float 4s ease-in-out infinite 1s; }
.badge-4 { bottom: 40px; right: -70px; animation: float 3.2s ease-in-out infinite 1.5s; }

.badge-1 i { color: #3776ab; }
.badge-2 i { color: #68a063; }
.badge-3 i { color: #f7df1e; }
.badge-4 i { color: #e34c26; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

.scroll-down {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  color: var(--text-muted);
  font-size: 1.2rem;
  animation: bounce 2s ease-in-out infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(8px); }
}

/* ===========================
   ABOUT
=========================== */
.about { background: var(--bg-2); }

.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}

.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  transition: var(--transition);
}
.about-card:hover {
  border-color: var(--primary);
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(108,99,255,0.2);
}

.about-icon {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: rgba(108,99,255,0.12);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  font-size: 1.4rem;
  color: var(--primary);
}

.about-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 10px;
}
.about-card p { color: var(--text-muted); font-size: 0.9rem; }

.about-text {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
}
.about-text p {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 36px;
  line-height: 1.9;
}
.about-text strong { color: var(--white); }

.about-stats {
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
}

.stat { text-align: center; }
.stat-num {
  display: block;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}
.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===========================
   SKILLS
=========================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: var(--transition);
  opacity: 0;
  transform: translateY(30px);
}
.skill-card.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s ease, border-color var(--transition), box-shadow var(--transition);
}
.skill-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 30px rgba(108,99,255,0.2);
  transform: translateY(-4px);
}

.skill-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 14px;
}
.skill-icon.html  { background: rgba(227,76,38,0.15);  color: #e34c26; }
.skill-icon.css   { background: rgba(38,77,228,0.15);  color: #264de4; }
.skill-icon.js    { background: rgba(247,223,30,0.15); color: #f7df1e; }
.skill-icon.python{ background: rgba(55,118,171,0.15); color: #3776ab; }
.skill-icon.node  { background: rgba(104,160,99,0.15); color: #68a063; }
.skill-icon.git   { background: rgba(240,80,50,0.15);  color: #f05032; }

.skill-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 6px;
}
.skill-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.skill-bar {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}
.skill-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 3px;
  transition: width 1.2s cubic-bezier(0.4,0,0.2,1);
}

.skill-percent {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary);
}

/* ===========================
   PROJECTS
=========================== */
.projects {
  background: var(--bg-2);
  padding: 60px 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.projects .container {
  width: 100%;
  max-width: 1400px;
  padding: 0 24px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, calc(45vh - 60px));
  gap: 16px;
}

.project-card:nth-child(1),
.project-card:nth-child(2),
.project-card:nth-child(3),
.project-card:nth-child(4) { grid-column: span 1; }

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  height: 100%;
}
.project-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(108,99,255,0.2);
}

/* Preview image area */
.project-preview {
  position: relative;
  flex: 1;
  overflow: hidden;
  background: var(--bg-2);
  min-height: 0;
}
.project-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 0.5s ease;
  display: block;
}
.project-card:hover .project-preview img {
  transform: scale(1.05);
}

.project-preview.no-img {
  display: flex;
  align-items: center;
  justify-content: center;
}
.project-preview.no-img::after {
  content: '\f121';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 2rem;
  color: var(--primary);
  opacity: 0.3;
}

.project-preview-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13,13,20,0.65);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.project-card:hover .project-preview-overlay {
  opacity: 1;
}
.preview-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--primary);
  color: var(--white);
  padding: 10px 22px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background var(--transition);
}
.preview-btn:hover { background: var(--primary-d); }
.preview-btn-code {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.4);
  color: var(--white);
}
.preview-btn-code:hover {
  background: rgba(255,255,255,0.1);
}

/* Card body */
.project-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.project-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.project-top h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.3;
}

.project-author {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 600;
}

.project-links {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.project-links a {
  color: var(--text-muted);
  font-size: 1rem;
  transition: color var(--transition);
}
.project-links a:hover { color: var(--primary); }

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.project-tags span {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(108,99,255,0.1);
  border: 1px solid rgba(108,99,255,0.2);
  padding: 3px 10px;
  border-radius: 50px;
}

@media (max-width: 1024px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto;
    gap: 16px;
  }
  .project-card:nth-child(1),
  .project-card:nth-child(2),
  .project-card:nth-child(3),
  .project-card:nth-child(4),
  .project-card:nth-child(5) { grid-column: span 1; }
  .project-preview { height: 180px; flex: none; }
}

@media (max-width: 600px) {
  .projects-grid { grid-template-columns: 1fr; }
  .project-preview { height: 200px; flex: none; }
}

/* ===========================
   GALLERY
=========================== */
.gallery { background: var(--bg); }

.gallery-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  grid-template-rows: 380px;
  gap: 16px;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
}

.gallery-item--large {
  grid-row: span 1;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.5s ease;
  display: block;
}

.gallery-item:hover img {
  transform: scale(1.06);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(108, 99, 255, 0.55) 0%,
    transparent 40%,
    transparent 60%,
    rgba(13, 13, 20, 0.7) 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding-top: 20px;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
  background: rgba(108, 99, 255, 0.25);
  backdrop-filter: blur(6px);
  padding: 8px 22px;
  border-radius: 50px;
  border: 1px solid rgba(255,255,255,0.2);
}

/* Always show name on mobile */
@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 16px;
  }
  .gallery-item {
    height: 280px;
  }
  .gallery-overlay {
    opacity: 1;
  }
}

/* ===========================
   CONTACT
=========================== */
.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 48px;
  align-items: start;
}

.contact-intro {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 36px;
  line-height: 1.8;
}

.contact-items { display: flex; flex-direction: column; gap: 20px; }

.contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
}
.contact-item-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: rgba(108,99,255,0.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  color: var(--primary);
  flex-shrink: 0;
}
.contact-item-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 2px;
}
.contact-item a {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition);
}
.contact-item a:hover { color: var(--primary); }

/* Form */
.contact-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group { display: flex; flex-direction: column; gap: 8px; }

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.form-group input,
.form-group textarea {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  transition: border-color var(--transition);
  resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.15);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-muted); }

.form-success {
  display: none;
  text-align: center;
  color: #4ade80;
  font-size: 0.9rem;
  font-weight: 500;
}
.form-success.show { display: block; }

/* ===========================
   FOOTER
=========================== */
.footer {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
}
.footer p { color: var(--text-muted); font-size: 0.88rem; }
.footer strong { color: var(--primary); }
.footer-copy { margin-top: 6px; font-size: 0.8rem; }

/* ===========================
   RESPONSIVE
=========================== */
@media (max-width: 1024px) {
  .hero { padding: 120px 40px 80px; }
  .skills-grid,
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .hero {
    flex-direction: column;
    text-align: center;
    padding: 120px 24px 80px;
  }
  .hero-desc { margin: 0 auto 36px; }
  .hero-cta { justify-content: center; }
  .hero-socials { justify-content: center; }
  .hero-visual { order: -1; }
  .floating-badge { display: none; }
  .avatar-ring { width: 200px; height: 200px; }
  .avatar-initials { font-size: 3rem; }

  .nav-links {
    position: fixed;
    top: 0; right: -100%;
    width: 260px; height: 100vh;
    background: var(--bg-card);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 32px;
    transition: right var(--transition);
    border-left: 1px solid var(--border);
  }
  .nav-links.open { right: 0; }
  .hamburger { display: flex; z-index: 1001; }

  .about-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .contact-wrapper { grid-template-columns: 1fr; }
  .about-stats { justify-content: center; }
}

@media (max-width: 480px) {
  .section { padding: 70px 0; }
  .hero-name { font-size: 2.4rem; }
  .contact-form { padding: 24px; }
  .about-text { padding: 24px; }
}
