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

:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --surface-light: #1a1a2e;
  --border: #2a2a3e;
  --text: #e4e4e7;
  --text-muted: #9ca3af;
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-glow: rgba(99, 102, 241, 0.15);
  --accent: #22d3ee;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

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

#loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.loader-text {
  font-family: var(--font-mono);
  font-size: 3rem;
  font-weight: 700;
  color: var(--primary-light);
  letter-spacing: -0.02em;
}

.loader-bar {
  width: 80px;
  height: 2px;
  background: var(--border);
  border-radius: 1px;
  overflow: hidden;
}

.loader-bar-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  animation: loader-fill 1.5s ease forwards;
}

@keyframes loader-fill {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  z-index: 10001;
  transform-origin: left;
  transform: scaleX(0);
}

#cursor-dot {
  position: fixed;
  width: 8px;
  height: 8px;
  background: var(--primary-light);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  mix-blend-mode: difference;
  will-change: transform;
}

#cursor-ring {
  position: fixed;
  width: 36px;
  height: 36px;
  border: 1.5px solid rgba(99, 102, 241, 0.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  transition: width 0.25s ease, height 0.25s ease, border-color 0.25s ease;
  will-change: transform;
}

#cursor-ring.hover {
  width: 52px;
  height: 52px;
  border-color: var(--accent);
}

@media (hover: none), (pointer: coarse) {
  #cursor-dot, #cursor-ring {
    display: none !important;
  }
  body {
    cursor: auto;
  }
}

#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  backdrop-filter: blur(12px);
  background: rgba(10, 10, 15, 0.7);
  border-bottom: 1px solid var(--border);
  transition: transform 0.3s ease;
}

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

.nav-logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary-light);
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s;
  letter-spacing: -0.01em;
}

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

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-github {
  color: var(--text-muted);
  transition: color 0.2s;
  display: flex;
  align-items: center;
}

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

.nav-cv {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 1rem;
  border: 1px solid var(--primary);
  color: var(--primary-light);
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s;
}

.nav-cv:hover {
  background: var(--primary);
  color: white;
}

#hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: none;
  padding: 5px;
  z-index: 101;
}

#hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: all 0.3s ease;
  border-radius: 1px;
}

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

#hamburger.active span:nth-child(2) {
  opacity: 0;
}

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

.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 70%;
  max-width: 300px;
  height: 100vh;
  background: rgba(18, 18, 26, 0.95);
  backdrop-filter: blur(20px);
  border-left: 1px solid var(--border);
  z-index: 99;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 5rem 2rem 2rem;
}

.mobile-menu.open {
  right: 0;
}

.mobile-menu ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.mobile-menu a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 500;
  transition: color 0.2s;
  display: block;
  padding: 0.25rem 0;
}

.mobile-menu a:hover {
  color: var(--primary-light);
}

.section {
  position: relative;
  z-index: 1;
  padding: 6rem 2rem;
  max-width: 900px;
  margin: 0 auto;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 3rem;
  letter-spacing: -0.03em;
  color: var(--text);
}

.section-title::after {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: var(--primary);
  margin-top: 0.75rem;
  border-radius: 2px;
}

#hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

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

.hero-greeting {
  font-family: var(--font-mono);
  color: var(--primary-light);
  font-size: 1rem;
  margin-bottom: 0.5rem;
  min-height: 1.5em;
}

.hero-name {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--text) 0%, var(--primary-light) 50%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.hero-name.visible {
  opacity: 1;
  transform: translateY(0);
}

.hero-title {
  font-size: 1.25rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: 1.5rem;
  min-height: 1.8em;
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 550px;
  margin: 0 auto 2rem;
  line-height: 1.8;
  min-height: 3.6em;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.hero-actions.visible {
  opacity: 1;
  transform: translateY(0);
}

.hero-links {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.5s ease 0.1s, transform 0.5s ease 0.1s;
}

.hero-links.visible {
  opacity: 1;
  transform: translateY(0);
}

.typing-cursor::after {
  content: '|';
  animation: blink 0.7s step-end infinite;
  color: var(--primary-light);
  font-weight: 300;
}

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

.glitch {
  animation: glitch-text 0.4s ease;
}

@keyframes glitch-text {
  0% { transform: translate(0); filter: hue-rotate(0deg); }
  10% { transform: translate(-2px, 1px); filter: hue-rotate(90deg); }
  20% { transform: translate(2px, -1px); filter: hue-rotate(180deg); }
  30% { transform: translate(-1px, -1px); filter: hue-rotate(270deg); }
  40% { transform: translate(1px, 2px); filter: hue-rotate(360deg); }
  50% { transform: translate(-1px, 0); }
  60% { transform: translate(2px, 1px); filter: hue-rotate(90deg); }
  70% { transform: translate(-2px, -1px); filter: hue-rotate(180deg); }
  80% { transform: translate(0, 1px); }
  90% { transform: translate(1px, -1px); }
  100% { transform: translate(0); filter: hue-rotate(0deg); }
}

.scroll-indicator {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.scroll-indicator.visible {
  opacity: 1;
}

.scroll-indicator span {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: var(--border);
  position: relative;
  overflow: hidden;
  border-radius: 1px;
}

.scroll-line::after {
  content: '';
  position: absolute;
  top: -50%;
  left: 0;
  width: 100%;
  height: 50%;
  background: linear-gradient(to bottom, transparent, var(--primary));
  animation: scroll-pulse 2s ease infinite;
}

@keyframes scroll-pulse {
  0% { top: -50%; }
  100% { top: 100%; }
}

.about-content {
  display: grid;
  gap: 3rem;
}

.about-text p {
  margin-bottom: 1rem;
  color: var(--text-muted);
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.about-text p.visible {
  opacity: 1;
  transform: translateY(0);
}

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

.about-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  transition: border-color 0.2s, transform 0.2s;
}

.stat-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.stat-number {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-light);
  margin-bottom: 0.25rem;
  font-family: var(--font-mono);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.timeline {
  position: relative;
  padding-left: 2rem;
}

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

.timeline-progress {
  position: absolute;
  left: 0;
  top: 0;
  width: 2px;
  height: 0;
  background: linear-gradient(to bottom, var(--primary), var(--accent));
  border-radius: 1px;
  z-index: 1;
}

.timeline-item {
  position: relative;
  margin-bottom: 3rem;
}

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

.timeline-chapter {
  position: absolute;
  right: 0;
  top: -0.5rem;
  font-family: var(--font-mono);
  font-size: 3rem;
  font-weight: 700;
  color: var(--surface-light);
  opacity: 0.3;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.timeline-marker {
  position: absolute;
  left: -2rem;
  top: 0.5rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--bg);
  transform: translateX(-5px);
  z-index: 2;
}

.timeline-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color 0.2s;
}

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

.timeline-header {
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: baseline;
}

.timeline-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  width: 100%;
}

.timeline-company {
  font-size: 0.85rem;
  color: var(--primary-light);
  font-weight: 500;
}

.timeline-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-left: auto;
}

.timeline-content ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.timeline-content li {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding-left: 1rem;
  position: relative;
}

.timeline-content li::before {
  content: '>';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.projects-section {
  margin-bottom: 4rem;
}

.projects-section:last-child {
  margin-bottom: 0;
}

.projects-subtitle {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.projects-subtitle-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.project-filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.filter-btn {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.4rem 1rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: none;
  transition: all 0.2s;
}

.filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary-light);
}

.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.projects-featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color 0.2s, transform 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;
  will-change: transform;
}

.project-card:hover {
  border-color: var(--primary);
}

.project-card.filter-hide {
  display: none;
}

.project-tag {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.project-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.project-card h3 a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}

.project-card h3 a:hover {
  color: var(--primary-light);
}

.project-card.featured {
  border-color: rgba(99, 102, 241, 0.3);
  background: linear-gradient(135deg, var(--surface) 0%, rgba(99, 102, 241, 0.05) 100%);
}

.project-card.featured:hover {
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.1);
}

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

.project-card-header .project-tag {
  margin-bottom: 0;
}

.project-github {
  color: var(--text-muted);
  transition: color 0.2s;
  display: flex;
  align-items: center;
}

.project-github:hover {
  color: var(--primary-light);
}

.project-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-tech span {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: var(--surface-light);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.skill-category h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tag {
  font-size: 0.8rem;
  color: var(--primary-light);
  background: var(--primary-glow);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  border: 1px solid rgba(99, 102, 241, 0.2);
  transition: all 0.2s;
}

.skill-tag:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.awards-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.award-item {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color 0.2s, transform 0.2s;
}

.award-item:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.award-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  animation: award-glow 3s ease-in-out infinite;
}

@keyframes award-glow {
  0%, 100% { filter: drop-shadow(0 0 0px transparent); }
  50% { filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.4)); }
}

.award-content h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

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

.contact-content {
  text-align: center;
}

.contact-text {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.contact-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s ease, box-shadow 0.3s ease;
}

.contact-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.08);
}

.contact-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.contact-value {
  font-size: 0.95rem;
  color: var(--primary-light);
  font-weight: 500;
}

footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  cursor: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-light);
  box-shadow: 0 0 20px var(--primary-glow);
}

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

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary-light);
}

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 768px) {
  nav {
    padding: 0.75rem 1rem;
  }

  .nav-links {
    display: none;
  }

  .nav-cv {
    display: none;
  }

  #hamburger {
    display: flex;
  }

  .section {
    padding: 4rem 1.25rem;
  }

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

  .timeline {
    padding-left: 1.5rem;
  }

  .timeline-header {
    flex-direction: column;
  }

  .timeline-date {
    margin-left: 0;
  }

  .timeline-chapter {
    font-size: 2rem;
    opacity: 0.15;
  }

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

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

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

  .scroll-indicator {
    bottom: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
