/* ===== CSS Variables ===== */
:root {
  --bg: #0b0f19;
  --bg-elevated: #121826;
  --bg-card: #161f2e;
  --border: #1e2a3a;
  --text: #e8eef7;
  --text-muted: #94a3b8;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.25);
  --success: #22c55e;
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --transition: 0.25s ease;
  --header-h: 72px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.hero {
  position: relative;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#three-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: white;
  pointer-events: none; /* so mouse events go to the 3D scene if you want */
}

.hero-content a,
.hero-content button {
  pointer-events: auto;
}

a {
  color: var(--accent-hover);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: #a5b4fc;
}

img {
  max-width: 100%;
  display: block;
}

ul {
  list-style: none;
}

.container {
  width: min(1100px, 92%);
  margin-inline: auto;
}

/* ===== Header / Nav ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.logo span {
  color: var(--accent);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-menu a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.nav-menu a:hover,
.nav-menu a.active {
  color: var(--text);
}

.btn-nav {
  background: var(--accent);
  color: #fff !important;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  font-weight: 600;
}

.btn-nav:hover {
  background: var(--accent-hover);
  color: #fff !important;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition);
  border: 2px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
  box-shadow: 0 0 24px var(--accent-glow);
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent-hover);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--header-h);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, var(--accent-glow), transparent),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(99, 102, 241, 0.08), transparent);
  pointer-events: none;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 4rem 0 5rem;
}

.hero-greeting {
  color: var(--accent);
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
}

.hero-title {
  font-size: clamp(2.4rem, 6vw, 3.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.hero-subtitle {
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
  color: var(--text-muted);
  font-weight: 500;
  min-height: 1.6em;
  margin-bottom: 1.25rem;
}

.hero-subtitle .cursor {
  color: var(--accent);
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.hero-desc {
  max-width: 540px;
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 3.5rem;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* ===== Sections ===== */
.section {
  padding: 5rem 0;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 48px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

.section-subtitle {
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  max-width: 520px;
}

/* ===== About ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 3rem;
  margin-top: 2.5rem;
  align-items: start;
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 1.1rem;
  font-size: 1.02rem;
}

.about-text strong {
  color: var(--text);
}

.about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.social-link svg {
  width: 18px;
  height: 18px;
}

.social-link:hover {
  border-color: var(--accent);
  color: var(--accent-hover);
  background: rgba(99, 102, 241, 0.08);
}

.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.card-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.card-icon {
  font-size: 1.35rem;
  line-height: 1.4;
}

.card-item strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
}

.card-item p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ===== Skills ===== */
.skills {
  background: var(--bg-elevated);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.skill-category {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color var(--transition), transform var(--transition);
}

.skill-category:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.skill-category h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--accent-hover);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tags span {
  background: rgba(99, 102, 241, 0.12);
  color: #c7d2fe;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

/* ===== Projects ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  height: 100%;
}

.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.project-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.35;
}

.project-card h3 a {
  color: var(--text);
}

.project-card h3 a:hover {
  color: var(--accent-hover);
}

.project-desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  flex-grow: 1;
  margin-bottom: 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.project-lang {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.lang-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.project-stars {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.projects-cta {
  text-align: center;
  margin-top: 2.5rem;
}

/* ===== Mentorship ===== */
.mentorship {
  background: var(--bg-elevated);
}

.mentorship-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.mentorship-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}

.mentorship-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
  color: var(--accent-hover);
}

.mentorship-card p {
  color: var(--text-muted);
  font-size: 0.98rem;
}

/* ===== Contact ===== */
.contact {
  text-align: center;
}

.contact .section-subtitle {
  margin-inline: auto;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.4rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  transition: all var(--transition);
}

.contact-btn svg {
  width: 20px;
  height: 20px;
}

.contact-btn:hover {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-hover);
  transform: translateY(-2px);
}

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer a {
  color: var(--accent-hover);
}

.footer-note {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  opacity: 0.8;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1rem;
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  .nav-menu.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero-stats {
    gap: 1.75rem;
  }

  .section {
    padding: 3.5rem 0;
  }
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Scroll reveal helper ===== */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}