/* ── Variables ── */
:root {
  --bg: #0f0f13;
  --surface: #1a1a24;
  --surface-alt: #22222e;
  --border: #2d2d3d;
  --accent: #818cf8;
  --accent-dim: #4338ca;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --nav-h: 64px;
  --radius: 12px;
  --transition: 0.25s ease;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { display: block; max-width: 100%; }

/* ── Utility ── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.accent { color: var(--accent); }

/* ── Scroll animations ── */
.fade-in {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Nav ── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  transition: background var(--transition), border-bottom-color var(--transition);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(15, 15, 19, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.nav-links {
  display: flex;
  gap: 36px;
}
.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
  position: relative;
  padding-bottom: 2px;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width var(--transition);
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); }
.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: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--transition), opacity 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); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: #6366f1;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(129, 140, 248, 0.35);
}
.btn-outline {
  border: 1.5px solid var(--border);
  color: var(--text);
  background: transparent;
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}
.btn-lg { padding: 16px 40px; font-size: 1rem; }

/* ── Section base ── */
.section { padding: 96px 0; }
.section-alt { background: var(--surface); }
.section-title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 56px;
}

/* ── Hero ── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--nav-h) 24px 0;
  position: relative;
  background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(129,140,248,0.12), transparent);
}
.hero-content { max-width: 680px; }
.hero-greeting {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}
.hero-name {
  font-size: clamp(2.8rem, 8vw, 5rem);
  font-weight: 700;
  letter-spacing: -2px;
  line-height: 1.05;
  margin-bottom: 16px;
}
.hero-title {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.hero-tagline {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 540px;
  margin-bottom: 40px;
  line-height: 1.75;
}
.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; }

.hero-scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0.4;
}
.hero-scroll-hint span { font-size: 0.7rem; letter-spacing: 2px; text-transform: uppercase; }
.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--text), transparent);
  animation: scrollPulse 1.8s ease infinite;
}
@keyframes scrollPulse {
  0%, 100% { transform: scaleY(1); opacity: 0.4; }
  50% { transform: scaleY(0.6); opacity: 0.8; }
}

/* ── About ── */
.about-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 56px;
  align-items: start;
}
.avatar-placeholder {
  width: 220px;
  height: 220px;
  border-radius: var(--radius);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.avatar-placeholder svg { width: 80%; height: 80%; opacity: 0.4; }
.avatar-placeholder img { width: 100%; height: 100%; object-fit: cover; }
.about-text p {
  color: var(--text-muted);
  margin-bottom: 16px;
  font-size: 1rem;
  line-height: 1.8;
}
.about-stats {
  display: flex;
  gap: 40px;
  margin-top: 32px;
}
.stat { display: flex; flex-direction: column; }
.stat-number { font-size: 1.75rem; font-weight: 700; letter-spacing: -1px; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

/* ── Skills ── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 28px;
}
.skill-category {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.skill-cat-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  margin-bottom: 16px;
}
.skill-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-block;
  padding: 6px 14px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--transition);
}
.tag:hover { border-color: var(--accent); color: var(--accent); }
.tag-sm { padding: 4px 10px; font-size: 0.72rem; }

/* ── Projects ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.project-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: 0 16px 40px rgba(129, 140, 248, 0.12);
}
.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.project-icon {
  width: 44px;
  height: 44px;
  background: rgba(129, 140, 248, 0.12);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.project-links {
  display: flex;
  gap: 12px;
  opacity: 0.5;
  transition: opacity var(--transition);
}
.project-card:hover .project-links { opacity: 1; }
.project-links a {
  color: var(--text-muted);
  transition: color var(--transition);
}
.project-links a:hover { color: var(--accent); }
.project-title {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.3px;
}
.project-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.7;
  flex: 1;
}
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

/* ── Contact ── */
.contact-wrapper {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}
.contact-intro {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.8;
}
.social-links { display: flex; gap: 20px; }
.social-link {
  width: 44px;
  height: 44px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition);
}
.social-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(129, 140, 248, 0.2);
}

/* ── Footer ── */
.footer {
  padding: 28px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: rgba(15, 15, 19, 0.97);
    backdrop-filter: blur(12px);
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 24px 0;
    border-bottom: 1px solid var(--border);
    transform: translateY(-110%);
    transition: transform var(--transition);
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links li { width: 100%; text-align: center; }
  .nav-links a { display: block; padding: 14px; }
  .hamburger { display: flex; }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .avatar-placeholder {
    width: 160px;
    height: 160px;
    margin: 0 auto;
  }
  .about-stats { gap: 28px; }

  .section { padding: 64px 0; }
  .hero { justify-content: flex-start; padding-top: calc(var(--nav-h) + 48px); }
  .hero-content { text-align: left; }
}

@media (max-width: 480px) {
  .hero-name { letter-spacing: -1px; }
  .projects-grid { grid-template-columns: 1fr; }
}
