/* ===== Variables ===== */
:root {
  --bg: #0a0a0f;
  --bg-secondary: #12121a;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8e8f0;
  --text-muted: #8888a0;
  --accent: #00f0ff;
  --accent-2: #7b61ff;
  --accent-3: #ff6b9d;
  --gradient: linear-gradient(135deg, var(--accent), var(--accent-2), var(--accent-3));
  --glow: 0 0 40px rgba(0, 240, 255, 0.15);
  --radius: 16px;
  --nav-h: 72px;
  --font: 'Noto Sans SC', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}

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

a { color: inherit; text-decoration: none; }
ul { list-style: none; }

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

/* ===== Canvas & Effects ===== */
#particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.scanline {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  opacity: 0.4;
}

/* ===== Nav ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-h);
  background: rgba(10, 10, 15, 0.7);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}

.nav.scrolled {
  background: rgba(10, 10, 15, 0.95);
  box-shadow: var(--glow);
}

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

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

.logo-bracket { color: var(--accent); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.lang-toggle:hover {
  border-color: rgba(0, 240, 255, 0.35);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.1);
}

.lang-option {
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  transition: color 0.3s;
  user-select: none;
}

.lang-option.active {
  color: var(--accent);
  font-weight: 600;
}

.lang-divider {
  color: var(--text-muted);
  opacity: 0.35;
  user-select: none;
}

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

.nav-links a {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 0.3s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient);
  transition: width 0.3s;
}

.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

.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);
  transition: 0.3s;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 48px;
  padding: calc(var(--nav-h) + 48px) 24px 80px;
  max-width: 1200px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  background: var(--surface);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00ff88;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.4); }
  50% { opacity: 0.8; box-shadow: 0 0 0 8px rgba(0, 255, 136, 0); }
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 20px;
}

.hero-title .line { display: block; }

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 40px;
  max-width: 480px;
}

.hero-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.stat-card {
  padding: 20px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  min-width: 100px;
  transition: transform 0.3s, border-color 0.3s;
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 240, 255, 0.3);
}

.stat-num {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--mono);
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.hero-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 14px 32px;
  border-radius: 100px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.3s;
  cursor: pointer;
}

.btn-primary {
  background: var(--gradient);
  color: #0a0a0f;
  border: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 240, 255, 0.3);
}

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

.btn-ghost:hover {
  border-color: var(--accent);
  background: rgba(0, 240, 255, 0.05);
}

/* Code Window */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.code-window {
  width: 100%;
  max-width: 480px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(18, 18, 26, 0.9);
  box-shadow: var(--glow), 0 24px 64px rgba(0, 0, 0, 0.5);
  animation: float 6s ease-in-out infinite;
}

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

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

.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }

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

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

.code-body .kw { color: #c678dd; }
.code-body .cls { color: #e5c07b; }
.code-body .str { color: #98c379; }
.code-body .num { color: #d19a66; }
.code-body .fn { color: #61afef; }

.scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.75rem;
  animation: bounce 2s infinite;
}

.scroll-arrow {
  width: 20px;
  height: 20px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
}

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

/* ===== Sections ===== */
.section {
  position: relative;
  z-index: 1;
  padding: 100px 0;
}

.section-dark {
  background: var(--bg-secondary);
}

.section-header {
  margin-bottom: 64px;
  text-align: center;
}

.section-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 3px;
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
}

.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.glass:hover {
  border-color: rgba(0, 240, 255, 0.2);
  box-shadow: var(--glow);
}

/* ===== About ===== */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.about-card {
  padding: 32px;
}

.about-icon {
  font-size: 2rem;
  margin-bottom: 16px;
}

.about-card h3 {
  font-size: 1.15rem;
  margin-bottom: 12px;
}

.about-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ===== Skills Orbit ===== */
.skills-orbit {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 0 auto 64px;
}

.orbit-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.85rem;
  color: #0a0a0f;
  z-index: 2;
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.4);
}

.orbit-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1px dashed rgba(0, 240, 255, 0.15);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.ring-1 { width: 180px; height: 180px; animation: spin 20s linear infinite; }
.ring-2 { width: 260px; height: 260px; animation: spin 30s linear infinite reverse; }

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.orbit-item {
  position: absolute;
  top: 50%;
  left: 50%;
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.75rem;
  font-family: var(--mono);
  white-space: nowrap;
  transform: rotate(calc(var(--i) * 60deg)) translateX(130px) rotate(calc(var(--i) * -60deg));
  animation: orbit 20s linear infinite;
  animation-delay: calc(var(--i) * -3.33s);
}

@keyframes orbit {
  to { transform: rotate(calc(var(--i) * 60deg + 360deg)) translateX(130px) rotate(calc(var(--i) * -60deg - 360deg)); }
}

/* ===== Skills Grid ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 64px;
}

.skill-category {
  padding: 28px;
}

.skill-category h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.cat-icon { font-size: 1.25rem; }

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag {
  padding: 6px 14px;
  background: rgba(0, 240, 255, 0.06);
  border: 1px solid rgba(0, 240, 255, 0.15);
  border-radius: 100px;
  font-size: 0.8rem;
  font-family: var(--mono);
  transition: all 0.3s;
  cursor: default;
}

.tag:hover {
  background: rgba(0, 240, 255, 0.15);
  transform: scale(1.05);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.2);
}

/* ===== Skill Bars ===== */
.skill-bars {
  max-width: 700px;
  margin: 0 auto;
}

.bars-title {
  text-align: center;
  margin-bottom: 32px;
  font-size: 1.1rem;
  color: var(--text-muted);
}

.bar-item { margin-bottom: 24px; }

.bar-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.bar-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 100px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0;
  background: var(--gradient);
  border-radius: 100px;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Timeline ===== */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding-left: 32px;
}

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

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

.timeline-dot {
  position: absolute;
  left: -32px;
  top: 24px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
}

.timeline-content {
  padding: 28px 32px;
}

.timeline-date {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
}

.timeline-content h3 {
  font-size: 1.15rem;
  margin: 8px 0;
}

.timeline-company {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.timeline-content ul {
  list-style: disc;
  padding-left: 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.timeline-content li { margin-bottom: 6px; }

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

.project-card {
  position: relative;
  padding: 32px;
  overflow: hidden;
}

.project-glow {
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.08), transparent 70%);
  pointer-events: none;
  transition: opacity 0.3s;
}

.project-card:hover .project-glow { opacity: 2; }

.project-domain {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(123, 97, 255, 0.15);
  border: 1px solid rgba(123, 97, 255, 0.3);
  border-radius: 100px;
  font-size: 0.7rem;
  font-family: var(--mono);
  color: var(--accent-2);
  margin-bottom: 16px;
}

.project-card h3 {
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.project-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.project-tech span {
  padding: 3px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  font-size: 0.7rem;
  font-family: var(--mono);
  color: var(--text-muted);
}

.project-role {
  font-size: 0.8rem;
  color: var(--accent);
  font-family: var(--mono);
}

/* ===== Certs ===== */
.certs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.cert-card {
  padding: 32px;
  text-align: center;
}

.cert-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.cert-card h3 {
  font-size: 1rem;
}

.edu-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 28px 32px;
  max-width: 500px;
  margin: 0 auto;
}

.edu-icon { font-size: 2rem; }

.edu-card h3 { font-size: 1.05rem; margin-bottom: 4px; }
.edu-card p { color: var(--text-muted); font-size: 0.9rem; }

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

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

.footer-note {
  margin-top: 8px;
  font-size: 0.75rem !important;
  opacity: 0.6;
}

/* ===== Reveal Animation ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding-top: calc(var(--nav-h) + 32px);
  }

  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-stats { justify-content: center; }
  .hero-cta { justify-content: center; }
  .hero-visual { order: -1; }
  .code-window { max-width: 100%; }

  .skills-orbit { width: 240px; height: 240px; }
  .orbit-item { transform: rotate(calc(var(--i) * 60deg)) translateX(100px) rotate(calc(var(--i) * -60deg)); }
  @keyframes orbit {
    to { transform: rotate(calc(var(--i) * 60deg + 360deg)) translateX(100px) rotate(calc(var(--i) * -60deg - 360deg)); }
  }

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

@media (max-width: 768px) {
  .nav-toggle { display: flex; }

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

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

  .nav-links li {
    border-bottom: 1px solid var(--border);
  }

  .nav-links a {
    display: block;
    padding: 16px 0;
    font-size: 1rem;
  }

  .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: 64px 0; }
  .scroll-hint { display: none; }

  .hero-title { font-size: 2.2rem; }
  .stat-card { padding: 16px 20px; min-width: 80px; }
  .stat-num { font-size: 1.5rem; }

  .timeline { padding-left: 24px; }
  .timeline-dot { left: -24px; }

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

@media (max-width: 400px) {
  .certs-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 10px; }
  .btn { padding: 12px 24px; font-size: 0.85rem; }
}
