:root {
  --bg: #f8f9fc;
  --bg-secondary: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #6b7280;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent2: #06b6d4;
  --accent-light: rgba(99, 102, 241, 0.10);
  --accent-glow: rgba(99, 102, 241, 0.25);
  --border: #e5e7eb;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --card-shadow-hover: 0 10px 40px rgba(0,0,0,0.08);
  --nav-bg: rgba(248, 249, 252, 0.80);
  --timeline-line: #d1d5db;
  --card-bg: #ffffff;
  --footer-bg: #f1f2f6;
  --tag-bg: #eef2ff;
  --section-alt: #f1f2f6;
  --orb-1: rgba(99, 102, 241, 0.15);
  --orb-2: rgba(6, 182, 212, 0.12);
  --orb-3: rgba(236, 72, 153, 0.10);
  --scrollbar-bg: #f1f2f6;
  --scrollbar-thumb: #c4c7d0;
  --input-bg: #ffffff;
}

[data-theme="dark"] {
  --bg: #0b0b14;
  --bg-secondary: #13131f;
  --text: #e8e8f0;
  --text-secondary: #8b8fa0;
  --accent: #818cf8;
  --accent-hover: #6366f1;
  --accent-light: rgba(129, 140, 248, 0.12);
  --accent-glow: rgba(129, 140, 248, 0.20);
  --border: #1e1e30;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --card-shadow-hover: 0 10px 40px rgba(0,0,0,0.4);
  --nav-bg: rgba(11, 11, 20, 0.85);
  --timeline-line: #2a2a40;
  --card-bg: #13131f;
  --footer-bg: #09090f;
  --tag-bg: #1c1c30;
  --section-alt: #0f0f1a;
  --orb-1: rgba(99, 102, 241, 0.10);
  --orb-2: rgba(6, 182, 212, 0.08);
  --orb-3: rgba(236, 72, 153, 0.06);
  --scrollbar-bg: #13131f;
  --scrollbar-thumb: #2a2a40;
  --input-bg: #13131f;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--scrollbar-bg); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

/* ===== Particles ===== */
#particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0.3;
  animation: particleFloat linear infinite;
}

@keyframes particleFloat {
  0% { transform: translateY(100vh) scale(0); opacity: 0; }
  10% { opacity: 0.4; }
  90% { opacity: 0.4; }
  100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

/* ===== Navbar ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--nav-bg);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid transparent;
  transition: background 0.4s, border-color 0.4s, box-shadow 0.4s;
}

.navbar.scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}

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

.logo {
  font-size: 1.4rem;
  font-weight: 900;
  text-decoration: none;
  color: var(--text);
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.2s;
  position: relative;
  padding: 4px 0;
}

.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 cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

.theme-toggle {
  background: var(--accent-light);
  border: none;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--accent);
  transition: all 0.2s;
}

.theme-toggle:hover { background: var(--accent); color: #fff; }

[data-theme="dark"] .sun-icon,
.moon-icon { display: block; }
[data-theme="dark"] .moon-icon,
.sun-icon { display: none; }

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

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: 0.3s;
}

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

.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  animation: orbFloat 25s infinite ease-in-out;
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: var(--orb-1);
  top: -200px;
  right: -150px;
}

.orb-2 {
  width: 450px;
  height: 450px;
  background: var(--orb-2);
  bottom: -150px;
  left: -100px;
  animation-delay: -8s;
}

.orb-3 {
  width: 300px;
  height: 300px;
  background: var(--orb-3);
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -16s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(60px, -40px) scale(1.1); }
  50% { transform: translate(-30px, 50px) scale(0.95); }
  75% { transform: translate(40px, 30px) scale(1.05); }
}

.hero-content {
  text-align: center;
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.hero-badge {
  display: inline-block;
  padding: 8px 20px;
  border-radius: 100px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 28px;
  border: 1px solid var(--accent-light);
}

.hero-content h1 {
  font-size: 4.5rem;
  font-weight: 900;
  letter-spacing: -3px;
  line-height: 1.05;
  margin-bottom: 16px;
  min-height: 5rem;
}

.hero-content h1 .cursor {
  display: inline-block;
  font-weight: 100;
  color: var(--accent);
  animation: blink 0.8s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  font-weight: 400;
  letter-spacing: 1px;
}

.hero-desc {
  color: var(--text-secondary);
  font-size: 1.02rem;
  margin-bottom: 36px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-bottom: 56px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #4f46e5);
  color: #fff;
  border: none;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

.btn-primary:active { transform: translateY(-1px); }

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

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

.hero-stats {
  display: flex;
  gap: 56px;
  justify-content: center;
}

.stat { display: flex; flex-direction: column; gap: 6px; }

.stat-num {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0.5;
  animation: scrollBounce 2s infinite;
}

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

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

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

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

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

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

.section-tag {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 6px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.section-header h2 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -1.5px;
  margin-bottom: 18px;
  line-height: 1.2;
}

.divider {
  width: 44px;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  margin: 0 auto;
  border-radius: 2px;
}

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

.about-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.3s, transform 0.3s;
}

.about-card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-2px);
}

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

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

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

.about-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.about-tags span {
  padding: 6px 14px;
  border-radius: 8px;
  background: var(--tag-bg);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s;
  cursor: default;
}

.about-tags span:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.info-grid { display: flex; flex-direction: column; }

.info-item {
  display: flex;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}

.info-item:last-child { border-bottom: none; }

.info-label {
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
}

.info-item span:last-child {
  font-weight: 500;
  text-align: right;
}

/* ===== Education ===== */
.edu-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px;
  box-shadow: var(--card-shadow);
  display: flex;
  gap: 28px;
  align-items: flex-start;
  transition: box-shadow 0.3s;
}

.edu-card:hover { box-shadow: var(--card-shadow-hover); }

.edu-icon {
  width: 56px;
  height: 56px;
  min-width: 56px;
  border-radius: 14px;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.edu-info { flex: 1; }

.edu-info h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.edu-major {
  display: block;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 4px;
}

.edu-date {
  display: inline-block;
  color: var(--text-secondary);
  font-size: 0.85rem;
  padding: 2px 10px;
  border-radius: 4px;
  background: var(--tag-bg);
}

.edu-courses {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  flex: 1;
  align-content: flex-start;
}

.course-tag {
  padding: 5px 12px;
  border-radius: 6px;
  background: var(--tag-bg);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.2s;
  cursor: default;
}

.course-tag:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
}

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

.timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent2), transparent);
  border-radius: 1px;
}

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

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

.timeline-dot {
  position: absolute;
  left: -32px;
  top: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 4px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent), 0 0 20px var(--accent-glow);
  z-index: 2;
}

.timeline-content {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  box-shadow: var(--card-shadow);
  transition: all 0.3s;
}

.timeline-content:hover {
  transform: translateX(6px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--accent);
}

.tl-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  gap: 16px;
  flex-wrap: wrap;
}

.tl-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.tl-company {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
}

.tl-date {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.tl-duties {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tl-duties li {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
  padding-left: 20px;
  position: relative;
}

.tl-duties li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.6;
}

/* ===== Skills ===== */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  max-width: 850px;
  margin: 0 auto;
}

.skill-group {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.3s;
}

.skill-group:hover { box-shadow: var(--card-shadow-hover); }

.skill-group h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text);
}

.skill-items { display: flex; flex-direction: column; gap: 20px; }

.skill-bar { display: flex; flex-direction: column; gap: 6px; }

.skill-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 500;
}

.skill-info span:first-child { color: var(--text); }
.skill-info span:last-child { color: var(--accent); font-weight: 700; }

.skill-track {
  height: 6px;
  background: var(--tag-bg);
  border-radius: 3px;
  overflow: hidden;
}

.skill-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  width: 0;
  transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.skill-fill.animate { width: var(--final-width); }

/* ===== Contact ===== */
.contact-desc {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 44px;
  font-size: 1.05rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  max-width: 850px;
  margin: 0 auto;
}

.contact-card {
  text-decoration: none;
  color: var(--text);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px 20px;
  text-align: center;
  box-shadow: var(--card-shadow);
  transition: all 0.3s;
}

.contact-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: 0 12px 36px var(--accent-glow);
}

.contact-icon-circle {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  transition: all 0.3s;
}

.contact-card:hover .contact-icon-circle {
  background: var(--accent);
  color: #fff;
  transform: scale(1.1);
}

.contact-card h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 8px;
}

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

/* ===== Footer ===== */
.footer {
  background: var(--footer-bg);
  border-top: 1px solid var(--border);
  padding: 28px 0;
  position: relative;
  z-index: 1;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.footer-tagline {
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* ===== Fade-in animations ===== */
.fade-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .menu-toggle { display: flex; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    gap: 18px;
  }

  .hero-content h1 { font-size: 2.8rem; letter-spacing: -2px; }
  .hero-subtitle { font-size: 1rem; }
  .hero-stats { gap: 28px; }
  .stat-num { font-size: 1.5rem; }

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

  .edu-card { flex-direction: column; }
  .edu-icon { display: none; }

  .section-header h2 { font-size: 1.8rem; }
  .section { padding: 64px 0; }

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

  .footer-content {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .scroll-indicator { display: none; }
}

@media (max-width: 480px) {
  .hero-content h1 { font-size: 2.2rem; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; }
  .hero-stats { flex-direction: column; gap: 16px; }
  .contact-grid { grid-template-columns: 1fr; }
  .tl-header { flex-direction: column; }
}
