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

:root {
  --bg: #0a0a0f;
  --bg2: #12121a;
  --surface: rgba(255,255,255,0.04);
  --surface2: rgba(255,255,255,0.07);
  --border: rgba(255,255,255,0.08);
  --text: #e8e8ed;
  --text2: #9a9aaa;
  --accent: #6c5ce7;
  --accent2: #a29bfe;
  --accent3: #00cec9;
  --gradient: linear-gradient(135deg, var(--accent), var(--accent3));
  --radius: 16px;
  --radius-sm: 10px;
}

html { scroll-behavior: smooth; font-size: 16px; }

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

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ========== PARTICLES CANVAS ========== */
#particles {
  position: fixed; inset: 0;
  z-index: 0; pointer-events: none;
}

/* ========== NAVBAR ========== */
#navbar {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1000; padding: 16px 0;
  transition: background 0.4s, backdrop-filter 0.4s, box-shadow 0.4s;
}
#navbar.scrolled {
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(20px);
  box-shadow: 0 2px 30px rgba(0,0,0,0.4);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.3rem; font-weight: 700;
  background: var(--gradient); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text;
}
.nav-links { display: flex; gap: 32px; }
.nav-links a {
  font-size: 0.9rem; font-weight: 500; color: var(--text2);
  transition: color 0.3s; position: relative;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -4px; left: 0;
  width: 0; height: 2px; background: var(--gradient);
  transition: width 0.3s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

.nav-toggle {
  display: none; background: none; border: none; cursor: pointer;
  width: 32px; height: 24px; position: relative; z-index: 1001;
}
.nav-toggle span {
  display: block; width: 100%; height: 2px; background: var(--text);
  position: absolute; left: 0; transition: 0.3s;
}
.nav-toggle span:nth-child(1) { top: 0; }
.nav-toggle span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.nav-toggle span:nth-child(3) { bottom: 0; }

/* ========== HERO ========== */
#hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0; z-index: 1;
}
.hero-bg img {
  width: 100%; height: 100%; object-fit: cover;
  filter: brightness(0.3) saturate(1.2);
  transform: scale(1.1);
  animation: heroZoom 20s ease-in-out infinite alternate;
}
@keyframes heroZoom {
  from { transform: scale(1.1); }
  to { transform: scale(1.2); }
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(10,10,15,0.4) 0%,
    rgba(10,10,15,0.7) 60%,
    var(--bg) 100%
  );
}
.hero-content {
  position: relative; z-index: 2;
  text-align: center; padding: 0 24px;
}
.hero-greeting {
  font-size: 1.1rem; color: var(--accent2);
  font-weight: 500; margin-bottom: 16px;
  letter-spacing: 2px; text-transform: uppercase;
  opacity: 0; transform: translateY(-20px);
  animation: fadeDown 0.8s 0.3s forwards;
}
.hero-name {
  font-size: clamp(2.8rem, 8vw, 6rem);
  font-weight: 900; line-height: 1.1;
  margin-bottom: 20px;
  opacity: 0; transform: translateY(30px);
  animation: fadeUp 0.8s 0.5s forwards;
}
.name-first {
  display: block;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.name-last { display: block; color: var(--text); }

.hero-typing {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  color: var(--accent3);
  margin-bottom: 20px;
  min-height: 2em;
  opacity: 0; transform: translateY(20px);
  animation: fadeUp 0.8s 0.7s forwards;
}
.cursor {
  animation: blink 1s step-end infinite;
  color: var(--accent2);
}
@keyframes blink { 50% { opacity: 0; } }

.hero-desc {
  font-size: 1.15rem; color: var(--text2);
  max-width: 540px; margin: 0 auto 32px;
  opacity: 0; transform: translateY(20px);
  animation: fadeUp 0.8s 0.9s forwards;
}
.hero-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 36px; border-radius: 50px;
  background: var(--gradient); color: #fff;
  font-weight: 600; font-size: 1rem;
  transition: transform 0.3s, box-shadow 0.3s;
  opacity: 0; transform: translateY(20px);
  animation: fadeUp 0.8s 1.1s forwards;
}
.hero-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(108,92,231,0.4);
}

.scroll-indicator {
  position: absolute; bottom: 40px; left: 50%;
  transform: translateX(-50%); z-index: 2;
  animation: bounce 2s infinite;
}
.mouse {
  width: 26px; height: 40px; border: 2px solid var(--text2);
  border-radius: 14px; display: flex; justify-content: center;
  padding-top: 8px;
}
.wheel {
  width: 4px; height: 8px; background: var(--accent2);
  border-radius: 2px; animation: scroll 1.5s infinite;
}
@keyframes scroll {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(10px); }
}
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
  40% { transform: translateX(-50%) translateY(-10px); }
  60% { transform: translateX(-50%) translateY(-5px); }
}

/* ========== ANIMATIONS ========== */
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeDown {
  to { opacity: 1; transform: translateY(0); }
}

/* ========== SECTION COMMON ========== */
section {
  position: relative; z-index: 1;
  padding: 120px 0;
}
.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800; margin-bottom: 60px;
  position: relative; display: inline-block;
}
.section-title::after {
  content: '';
  position: absolute; bottom: -12px; left: 0;
  width: 60px; height: 4px;
  background: var(--gradient); border-radius: 2px;
}

/* ========== ABOUT ========== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 60px; align-items: center;
}
.about-img-wrapper {
  position: relative; border-radius: var(--radius);
  overflow: hidden;
}
.about-img-wrapper img {
  width: 100%; height: 400px;
  object-fit: cover; border-radius: var(--radius);
  transition: transform 0.5s;
}
.about-img-wrapper:hover img { transform: scale(1.05); }
.about-img-border {
  position: absolute; inset: -6px;
  border: 2px solid var(--accent);
  border-radius: calc(var(--radius) + 6px);
  opacity: 0.4;
}
.about-stats {
  display: flex; gap: 32px; margin-bottom: 32px;
}
.stat {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  padding: 20px 28px; border-radius: var(--radius-sm);
  transition: border-color 0.3s, transform 0.3s;
}
.stat:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
}
.stat-num {
  font-size: 2.2rem; font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-plus {
  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.85rem; color: var(--text2); margin-top: 4px; }

.about-text p {
  color: var(--text2); margin-bottom: 16px; font-size: 1.05rem;
}
.about-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.tag {
  padding: 6px 16px; border-radius: 50px;
  background: var(--surface2); border: 1px solid var(--border);
  font-size: 0.85rem; color: var(--accent2);
  transition: 0.3s;
}
.tag:hover {
  background: rgba(108,92,231,0.15);
  border-color: var(--accent);
}

/* ========== SKILLS ========== */
#skills { background: var(--bg2); }
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: transform 0.4s, border-color 0.4s, box-shadow 0.4s;
}
.skill-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent);
  box-shadow: 0 12px 40px rgba(108,92,231,0.15);
}
.skill-icon {
  font-size: 2.5rem; margin-bottom: 16px;
}
.skill-card h3 {
  font-size: 1.2rem; font-weight: 700; margin-bottom: 20px;
}
.bar-item {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 14px;
}
.bar-item span {
  font-size: 0.82rem; color: var(--text2);
  display: flex; justify-content: space-between;
}
.bar {
  height: 6px; background: var(--surface2);
  border-radius: 3px; overflow: hidden;
}
.bar-fill {
  height: 100%; width: 0;
  background: var(--gradient);
  border-radius: 3px;
  transition: width 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.bar-fill.animated {
  /* width is set by JS inline */
}

/* ========== PROJECTS ========== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.4s, border-color 0.4s, box-shadow 0.4s;
}
.project-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent);
  box-shadow: 0 16px 50px rgba(108,92,231,0.15);
}
.project-img {
  position: relative; height: 200px; overflow: hidden;
}
.project-img img {
  width: 100%; height: 100%;
  object-fit: cover; transition: transform 0.5s;
}
.project-card:hover .project-img img { transform: scale(1.08); }
.project-overlay {
  position: absolute; inset: 0;
  background: rgba(108,92,231,0.85);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.4s;
}
.project-card:hover .project-overlay { opacity: 1; }
.project-link {
  padding: 12px 28px; border: 2px solid #fff;
  border-radius: 50px; color: #fff;
  font-weight: 600; transition: 0.3s;
}
.project-link:hover { background: #fff; color: var(--accent); }

.project-info { padding: 24px; }
.project-info h3 {
  font-size: 1.15rem; font-weight: 700; margin-bottom: 8px;
}
.project-info p {
  font-size: 0.9rem; color: var(--text2); margin-bottom: 16px;
  line-height: 1.6;
}
.project-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.project-tags span {
  padding: 4px 12px; border-radius: 50px;
  background: var(--surface2); font-size: 0.78rem;
  color: var(--accent3); border: 1px solid var(--border);
}

/* ========== CONTACT ========== */
#contact { background: var(--bg2); }
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 60px; align-items: start;
}
.contact-info p {
  font-size: 1.1rem; color: var(--text2);
  margin-bottom: 32px;
}
.contact-links { display: flex; flex-direction: column; gap: 16px; }
.contact-item {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  font-size: 0.95rem; transition: 0.3s;
}
.contact-item:hover {
  border-color: var(--accent);
  transform: translateX(6px);
}
.contact-icon { font-size: 1.4rem; }

.contact-form {
  display: flex; flex-direction: column; gap: 20px;
}
.form-group {
  position: relative;
}
.form-group input,
.form-group textarea {
  width: 100%; padding: 16px 20px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text); font-family: inherit;
  font-size: 1rem; outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108,92,231,0.15);
}
.form-group label {
  position: absolute; left: 20px; top: 16px;
  color: var(--text2); font-size: 1rem;
  pointer-events: none;
  transition: 0.25s;
}
.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: -10px; left: 14px;
  font-size: 0.78rem;
  background: var(--bg2);
  padding: 0 6px; color: var(--accent2);
}
.form-group textarea { resize: vertical; min-height: 120px; }

.submit-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 36px; border: none; border-radius: 50px;
  background: var(--gradient); color: #fff;
  font-family: inherit; font-size: 1rem;
  font-weight: 600; cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
  align-self: flex-start;
}
.submit-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(108,92,231,0.4);
}
.submit-btn.sent {
  background: var(--accent3);
}

/* ========== FOOTER ========== */
footer {
  position: relative; z-index: 1;
  padding: 40px 0; text-align: center;
  border-top: 1px solid var(--border);
  color: var(--text2); font-size: 0.9rem;
}

/* ========== SCROLL ANIMATIONS ========== */
[data-anim] {
  opacity: 0;
  transition: opacity 0.7s, transform 0.7s;
  transition-delay: var(--delay, 0s);
}
[data-anim="fade-up"]    { transform: translateY(40px); }
[data-anim="fade-down"]  { transform: translateY(-40px); }
[data-anim="fade-left"]  { transform: translateX(-40px); }
[data-anim="fade-right"] { transform: translateX(40px); }
[data-anim="slide-right"] { transform: translateX(-40px); }

[data-anim].visible {
  opacity: 1;
  transform: translate(0, 0);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .about-img-wrapper img { height: 280px; }
  .about-stats { justify-content: center; }
}
@media (max-width: 700px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .nav-links.open {
    display: flex; flex-direction: column;
    position: fixed; inset: 0;
    background: rgba(10,10,15,0.95);
    backdrop-filter: blur(20px);
    align-items: center; justify-content: center; gap: 28px;
    z-index: 1000;
  }
  .nav-links.open a {
    font-size: 1.3rem; color: var(--text);
  }
  .nav-toggle.active span:nth-child(1) { top: 50%; transform: translateY(-50%) rotate(45deg); }
  .nav-toggle.active span:nth-child(2) { opacity: 0; }
  .nav-toggle.active span:nth-child(3) { bottom: 50%; transform: translateY(50%) rotate(-45deg); }

  section { padding: 80px 0; }
  .section-title { margin-bottom: 40px; }
  .about-stats { gap: 16px; }
  .stat { padding: 14px 18px; }
  .stat-num, .stat-plus { font-size: 1.6rem; }
}

/* ========== GLITCH EFFECT ON NAME ========== */
.hero-name:hover .name-first {
  animation: glitch 0.3s linear;
}
@keyframes glitch {
  0% { transform: translate(0); }
  20% { transform: translate(-3px, 3px); }
  40% { transform: translate(-3px, -3px); }
  60% { transform: translate(3px, 3px); }
  80% { transform: translate(3px, -3px); }
  100% { transform: translate(0); }
}

/* ========== GLOW DOT CURSOR ========== */
.glow-dot {
  position: fixed;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(108,92,231,0.35), transparent 70%);
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s;
  mix-blend-mode: screen;
}
