/* ===========================
   CSS Custom Properties
   =========================== */
:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #0f1424;
  --bg-card: #121832;
  --bg-card-hover: #182040;

  --text-primary: #e2e8f0;
  --text-secondary: #8892b0;
  --text-muted: #5a6380;

  --accent: #60a5fa;
  --accent-light: #93c5fd;
  --accent-glow: rgba(96, 165, 250, 0.15);
  --accent-glow-strong: rgba(96, 165, 250, 0.35);

  --border: rgba(96, 165, 250, 0.08);
  --border-hover: rgba(96, 165, 250, 0.2);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --nav-height: 72px;
  --section-padding: 120px;
  --container-width: 1100px;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* Subtle background grid pattern */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(96, 165, 250, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96, 165, 250, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

/* Radial vignette overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 0%, var(--bg-primary) 75%);
  pointer-events: none;
  z-index: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--accent-light);
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

::selection {
  background: var(--accent);
  color: var(--bg-primary);
}

/* ===========================
   Mouse Glow Effect
   =========================== */
.glow {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 1;
  opacity: 0;
  transition: opacity 0.4s ease;
  will-change: transform;
}

.glow.active {
  opacity: 1;
}

/* ===========================
   Container
   =========================== */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 2;
}

/* ===========================
   Navigation
   =========================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  z-index: 100;
  background: rgba(10, 14, 26, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: transform 0.4s var(--ease-out-expo), box-shadow 0.4s ease;
}

.nav.scrolled {
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav.hidden {
  transform: translateY(-100%);
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.nav-logo:hover {
  color: var(--text-primary);
}

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

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
  position: relative;
  padding: 4px 0;
  transition: color 0.3s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  transition: width 0.3s var(--ease-out-expo);
}

.nav-links a:hover {
  color: var(--accent);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-socials {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-left: 32px;
}

.nav-social-link {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
  transition: color 0.3s ease, transform 0.3s ease;
  display: flex;
  align-items: center;
}

.nav-social-link:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

.nav-social-link svg {
  width: 100%;
  height: 100%;
}

/* ===========================
   Accent Color
   =========================== */
.accent {
  color: var(--accent);
}

/* ===========================
   Button
   =========================== */
.btn {
  display: inline-block;
  padding: 14px 36px;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.4s var(--ease-out-expo);
  z-index: 2;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-glow);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: -1;
}

.btn:hover {
  color: var(--accent-light);
  border-color: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 0 30px var(--accent-glow);
}

.btn:hover::before {
  opacity: 1;
}

.btn-lg {
  padding: 18px 48px;
  font-size: 1rem;
}


/* ===========================
   Language Toggle & Learning Tag
   =========================== */
.nav-lang-toggle {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  border: 1px solid var(--border-hover);
  border-radius: 4px;
  padding: 3px 8px;
  transition: color 0.3s ease, border-color 0.3s ease;
  margin-right: 8px;
}

.nav-lang-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.tag-learning {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--accent);
  border: 1px solid rgba(96, 165, 250, 0.4);
  border-radius: 3px;
  padding: 1px 5px;
  vertical-align: middle;
  margin-left: 4px;
  letter-spacing: 0.04em;
}

/* ===========================
   Hero Section
   =========================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 48px;
  position: relative;
  z-index: 2;
}

.hero-content {
  max-width: 720px;
}

.hero-greeting {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 20px;
  font-weight: 400;
}

.hero-name {
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.hero-tagline {
  font-size: clamp(1.5rem, 4vw, 3rem);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-secondary);
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

.hero-description {
  max-width: 520px;
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 40px;
  line-height: 1.8;
}

.hero-scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  animation: float 3s ease-in-out infinite;
}

.hero-scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--accent), transparent);
}

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

/* ===========================
   Section
   =========================== */
.section {
  padding: var(--section-padding) 0;
  position: relative;
  z-index: 2;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 60px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title .accent {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 400;
}

.section-title::after {
  content: '';
  flex: 1;
  max-width: 300px;
  height: 1px;
  background: linear-gradient(to right, var(--border-hover), transparent);
  margin-left: 16px;
}

/* ===========================
   About Section
   =========================== */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 60px;
  align-items: start;
}

.about-text p {
  color: var(--text-secondary);
  margin-bottom: 18px;
  font-size: 1rem;
  line-height: 1.8;
}

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px;
  text-align: center;
  transition: all 0.4s var(--ease-out-expo);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 8px 40px rgba(96, 165, 250, 0.08);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card-number {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-card-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

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

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 28px;
  transition: all 0.4s var(--ease-out-expo);
  position: relative;
  overflow: hidden;
}

.skill-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.skill-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(96, 165, 250, 0.08);
  background: var(--bg-card-hover);
}

.skill-card:hover::before {
  opacity: 1;
}

.skill-card-icon {
  width: 40px;
  height: 40px;
  color: var(--accent);
  margin-bottom: 20px;
}

.skill-card-icon svg {
  width: 100%;
  height: 100%;
}

.skill-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.skill-card ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skill-card li {
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding-left: 16px;
  position: relative;
}

.skill-card li::before {
  content: '▹';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.75rem;
}

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

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  transition: all 0.4s var(--ease-out-expo);
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.04), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.project-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-8px);
  box-shadow: 0 20px 60px rgba(96, 165, 250, 0.08);
  background: var(--bg-card-hover);
}

.project-card:hover::before {
  opacity: 1;
}

.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.project-card-folder {
  width: 40px;
  height: 40px;
  color: var(--accent);
}

.project-card-links {
  display: flex;
  gap: 14px;
}

.project-card-links a {
  width: 22px;
  height: 22px;
  color: var(--text-secondary);
  transition: color 0.3s ease, transform 0.3s ease;
}

.project-card-links a:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

.project-card-links svg {
  width: 100%;
  height: 100%;
}

.project-card-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
  transition: color 0.3s ease;
  position: relative;
  z-index: 1;
}

.project-card:hover .project-card-title {
  color: var(--accent);
}

.project-card-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  flex: 1;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.project-card-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.project-card-tech li {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(96, 165, 250, 0.06);
  padding: 4px 10px;
  border-radius: 4px;
}

/* ===========================
   Contact Section
   =========================== */
.contact-container {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
  padding: 0 24px;
}

.contact-overline {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--accent);
  margin-bottom: 16px;
}

.contact-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: -0.03em;
}

.contact-text {
  color: var(--text-secondary);
  margin-bottom: 40px;
  font-size: 1.05rem;
  line-height: 1.8;
}

.contact-socials {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 40px;
}

.social-link {
  width: 24px;
  height: 24px;
  color: var(--text-secondary);
  transition: color 0.3s ease, transform 0.3s ease;
}

.social-link:hover {
  color: var(--accent);
  transform: translateY(-3px);
}

.social-link svg {
  width: 100%;
  height: 100%;
}

/* ===========================
   Footer
   =========================== */
.footer {
  text-align: center;
  padding: 40px 24px;
  font-size: 0.85rem;
  color: var(--text-muted);
  position: relative;
  z-index: 2;
}

.footer-sub {
  margin-top: 4px;
  font-size: 0.75rem;
}

/* ===========================
   Reveal Animations
   =========================== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* No-JS fallback: show all content immediately */
.no-js .reveal {
  opacity: 1;
  transform: none;
}

/* Staggered children animation */
.reveal.visible .project-card,
.reveal.visible .skill-card,
.reveal.visible .stat-card {
  opacity: 0;
  animation: fadeInUp 0.6s var(--ease-out-expo) forwards;
}

.reveal.visible .project-card:nth-child(1),
.reveal.visible .skill-card:nth-child(1),
.reveal.visible .stat-card:nth-child(1) { animation-delay: 0.05s; }
.reveal.visible .project-card:nth-child(2),
.reveal.visible .skill-card:nth-child(2),
.reveal.visible .stat-card:nth-child(2) { animation-delay: 0.1s; }
.reveal.visible .project-card:nth-child(3),
.reveal.visible .skill-card:nth-child(3),
.reveal.visible .stat-card:nth-child(3) { animation-delay: 0.15s; }
.reveal.visible .project-card:nth-child(4),
.reveal.visible .skill-card:nth-child(4),
.reveal.visible .stat-card:nth-child(4) { animation-delay: 0.2s; }
.reveal.visible .project-card:nth-child(5) { animation-delay: 0.25s; }
.reveal.visible .project-card:nth-child(6) { animation-delay: 0.3s; }

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hero staggered entrance */
.hero-content.visible .hero-greeting {
  animation: fadeInUp 0.8s var(--ease-out-expo) 0.1s both;
}

.hero-content.visible .hero-name {
  animation: fadeInUp 0.8s var(--ease-out-expo) 0.2s both;
}

.hero-content.visible .hero-tagline {
  animation: fadeInUp 0.8s var(--ease-out-expo) 0.35s both;
}

.hero-content.visible .hero-description {
  animation: fadeInUp 0.8s var(--ease-out-expo) 0.5s both;
}

.hero-content.visible .btn {
  animation: fadeInUp 0.8s var(--ease-out-expo) 0.65s both;
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 1024px) {
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --section-padding: 80px;
  }

  .nav {
    padding: 0 24px;
  }

  .nav-links {
    gap: 20px;
  }

  .nav-links a {
    font-size: 0.8rem;
  }

  .hero {
    padding: 0 24px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .skills-grid {
    grid-template-columns: 1fr 1fr;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .nav-links {
    display: none;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .about-stats {
    grid-template-columns: 1fr 1fr;
  }
}
