/* ========================================
   Variables & Reset
   ======================================== */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-card: #16161f;
  --bg-card-hover: #1c1c28;
  --text-primary: #e8e8ed;
  --text-secondary: #9494a3;
  --text-muted: #5e5e6e;
  --accent: #6c63ff;
  --accent-light: #8b83ff;
  --accent-glow: rgba(108, 99, 255, 0.15);
  --accent-glow-strong: rgba(108, 99, 255, 0.3);
  --green: #22c55e;
  --border: #222233;
  --border-hover: #333348;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

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

a {
  color: inherit;
  text-decoration: none;
}

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

ul { list-style: none; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ========================================
   Navigation
   ======================================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(10, 10, 15, 0.8);
  border-bottom: 1px solid transparent;
  transition: var(--transition);
}

.nav.scrolled {
  border-bottom-color: var(--border);
  background: rgba(10, 10, 15, 0.95);
}

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

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  background: var(--accent-glow);
}

.nav-github {
  color: var(--accent) !important;
  border: 1px solid var(--accent);
  margin-left: 8px;
}

.nav-github:hover {
  background: var(--accent) !important;
  color: white !important;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 120px 24px 80px;
  overflow: hidden;
}

.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(108, 99, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(108, 99, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

.hero-glow {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-glow-strong) 0%, transparent 70%);
  pointer-events: none;
}

.hero-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  position: relative;
  z-index: 1;
}

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

.hero-name {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-title-wrapper {
  margin-bottom: 24px;
  min-height: 36px;
}

.hero-title {
  font-size: 1.25rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.cursor {
  color: var(--accent);
  animation: blink 1s infinite;
  font-weight: 300;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

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

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

.btn {
  display: inline-flex;
  align-items: center;
  padding: 14px 28px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 20px rgba(108, 99, 255, 0.3);
}

.btn-primary:hover {
  background: var(--accent-light);
  box-shadow: 0 6px 30px rgba(108, 99, 255, 0.4);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-hover);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.hero-stats {
  display: flex;
  gap: 40px;
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.stat-plus {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Hero Visual */
.hero-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.hero-avatar-wrapper {
  position: relative;
  width: 220px;
  height: 220px;
}

.hero-avatar {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
  position: relative;
  z-index: 2;
}

.avatar-ring {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0.3;
  animation: pulse-ring 3s ease-in-out infinite;
}

@keyframes pulse-ring {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50% { transform: scale(1.05); opacity: 0.1; }
}

.avatar-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  z-index: 3;
}

.avatar-dot-1 {
  background: var(--accent);
  top: 10px;
  right: 15px;
  animation: float 4s ease-in-out infinite;
}

.avatar-dot-2 {
  background: var(--green);
  bottom: 20px;
  right: 5px;
  animation: float 4s ease-in-out infinite 1s;
}

.avatar-dot-3 {
  background: #f59e0b;
  bottom: 30px;
  left: 0;
  animation: float 4s ease-in-out infinite 2s;
}

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

.hero-code-block {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.code-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--border);
}

.code-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.code-dot.red { background: #ff5f57; }
.code-dot.yellow { background: #febc2e; }
.code-dot.green { background: #28c840; }

.code-file {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: auto;
}

.code-body {
  padding: 16px 20px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.8;
  overflow-x: auto;
}

.code-body code {
  font-family: inherit;
}

.code-keyword { color: #c792ea; }
.code-var { color: #82aaff; }
.code-key { color: #89ddff; }
.code-string { color: #c3e88d; }
.code-bool { color: #f78c6c; }

.scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
  40% { transform: translateX(-50%) translateY(-10px); }
  60% { transform: translateX(-50%) translateY(-5px); }
}

/* ========================================
   Sections General
   ======================================== */
.section {
  padding: 120px 0;
  position: relative;
}

.section-title {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 800;
  text-align: center;
  margin-bottom: 60px;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--accent);
  border-radius: 2px;
  margin: 16px auto 0;
}

/* ========================================
   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: 20px;
  font-size: 1.05rem;
}

.about-text strong {
  color: var(--text-primary);
}

.about-details {
  display: grid;
  gap: 16px;
}

.detail-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.detail-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateX(4px);
}

.detail-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  color: var(--accent);
}

.detail-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.detail-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ========================================
   Experience Section
   ======================================== */
.experience {
  background: var(--bg-secondary);
}

.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding-left: 40px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--border));
}

.timeline-item {
  position: relative;
  margin-bottom: 48px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -40px;
  top: 8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg-secondary);
  box-shadow: 0 0 0 3px var(--accent-glow-strong);
  z-index: 1;
}

.timeline-content {
  background: var(--bg-card);
  padding: 28px 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.timeline-content:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow);
}

.timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 12px;
}

.timeline-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.timeline-badge {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  padding: 4px 12px;
  background: var(--accent-glow);
  border-radius: 20px;
  white-space: nowrap;
}

.timeline-company {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.timeline-list {
  list-style: none;
  margin-bottom: 16px;
}

.timeline-list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.timeline-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.timeline-tags span {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  padding: 4px 10px;
  background: var(--accent-glow);
  border-radius: 6px;
}

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

.skill-category {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 32px;
  transition: var(--transition);
}

.skill-category:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow);
}

.skill-category-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text-primary);
}

.skill-category-title svg {
  width: 22px;
  height: 22px;
  color: var(--accent);
}

.skill-items {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.skill-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--bg-primary);
  border-radius: 10px;
  border: 1px solid var(--border);
  transition: var(--transition);
  cursor: default;
}

.skill-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(108, 99, 255, 0.1);
}

.skill-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  background: var(--accent, #6c63ff);
  flex-shrink: 0;
}

.skill-item span {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ========================================
   Projects Section
   ======================================== */
.projects {
  background: var(--bg-secondary);
}

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

.project-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: var(--transition);
}

.project-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.project-image {
  height: 200px;
  overflow: hidden;
}

.project-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(108, 99, 255, 0.1) 0%, rgba(108, 99, 255, 0.03) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-placeholder svg {
  width: 64px;
  height: 64px;
  color: var(--accent);
  opacity: 0.5;
}

.project-placeholder.purple {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.1) 0%, rgba(168, 85, 247, 0.03) 100%);
}

.project-placeholder.purple svg { color: #a855f7; }

.project-placeholder.green {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(34, 197, 94, 0.03) 100%);
}

.project-placeholder.green svg { color: #22c55e; }

.project-placeholder.orange {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.03) 100%);
}

.project-placeholder.orange svg { color: #f59e0b; }

.project-info {
  padding: 24px 28px 28px;
}

.project-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.project-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
}

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

.project-links a {
  color: var(--text-muted);
  transition: var(--transition);
}

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

.project-links svg {
  width: 20px;
  height: 20px;
}

.project-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.project-description {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-tags span {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 4px 10px;
  background: var(--bg-primary);
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* ========================================
   Contact Section
   ======================================== */
.contact-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: -40px auto 48px;
  line-height: 1.8;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
}

.contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 24px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.contact-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(108, 99, 255, 0.15);
}

.contact-card svg {
  width: 36px;
  height: 36px;
  color: var(--accent);
  margin-bottom: 16px;
}

.contact-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.contact-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ========================================
   Footer
   ======================================== */
.footer {
  padding: 32px 0;
  text-align: center;
  border-top: 1px solid var(--border);
}

.footer p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ========================================
   Animations
   ======================================== */
[data-animate] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate].visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 968px) {
  .hero-container {
    grid-template-columns: 1fr;
    gap: 48px;
    text-align: center;
  }

  .hero-description {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-cta {
    justify-content: center;
  }

  .hero-stats {
    justify-content: center;
  }

  .hero-visual {
    order: -1;
  }

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

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

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

  .contact-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
  }
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background: rgba(10, 10, 15, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 24px;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    transform: translateY(-120%);
    opacity: 0;
    transition: var(--transition);
    pointer-events: none;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  .nav-links a {
    width: 100%;
    text-align: center;
    padding: 14px;
    font-size: 1rem;
  }

  .nav-github {
    margin-left: 0 !important;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .nav-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .section {
    padding: 80px 0;
  }

  .hero {
    padding: 100px 24px 60px;
  }

  .hero-name {
    font-size: 2.2rem;
  }

  .hero-stats {
    gap: 24px;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .timeline {
    padding-left: 32px;
  }

  .timeline-content {
    padding: 20px 24px;
  }

  .timeline-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .hero-avatar-wrapper {
    width: 160px;
    height: 160px;
  }

  .hero-avatar {
    width: 160px;
    height: 160px;
  }

  .hero-code-block {
    max-width: 100%;
  }

  .code-body {
    font-size: 0.72rem;
  }

  .hero-cta {
    flex-direction: column;
    align-items: center;
  }

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