/* ===== CSS Variables / Theme ===== */
:root[data-theme="dark"] {
  --bg: #0a0d14;
  --bg-alt: #0f1320;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);
  --text: #e4e7ec;
  --text-secondary: #9aa4b2;
  --text-muted: #6b7280;
  --accent: #3b82f6;
  --accent-light: #60a5fa;
  --accent-bg: rgba(59, 130, 246, 0.1);
  --accent-border: rgba(59, 130, 246, 0.3);
  --accent-text: #60a5fa;
  --glow: rgba(59, 130, 246, 0.08);
  --glow-2: rgba(96, 165, 250, 0.05);
  --shadow: rgba(0, 0, 0, 0.3);
  --nav-bg: rgba(10, 13, 20, 0.8);
}

:root[data-theme="light"] {
  --bg: #f8fafc;
  --bg-alt: #ffffff;
  --surface: rgba(0, 0, 0, 0.02);
  --surface-hover: rgba(0, 0, 0, 0.04);
  --border: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.15);
  --text: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent: #2563eb;
  --accent-light: #3b82f6;
  --accent-bg: rgba(37, 99, 235, 0.08);
  --accent-border: rgba(37, 99, 235, 0.25);
  --accent-text: #2563eb;
  --glow: rgba(37, 99, 235, 0.06);
  --glow-2: rgba(59, 130, 246, 0.04);
  --shadow: rgba(0, 0, 0, 0.08);
  --nav-bg: rgba(248, 250, 252, 0.85);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ===== Layout ===== */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 64px 0;
}

.divider {
  max-width: 960px;
  margin: 0 auto;
  height: 1px;
  background: var(--border);
}

/* ===== Navbar ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}

.navbar.scrolled {
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

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

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

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

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

.nav-links a {
  padding: 8px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 8px;
  transition: all 0.2s ease;
}

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

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

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  border-color: var(--accent-border);
  background: var(--accent-bg);
  color: var(--accent-text);
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

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

/* Hamburger */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s ease;
  margin: 0 auto;
}

.menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

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

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

.hero-glow::after {
  content: '';
  position: absolute;
  bottom: -100px;
  right: -150px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow-2) 0%, transparent 70%);
}

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

.profile-img-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 32px;
}

.profile-img-glow {
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  opacity: 0.3;
  filter: blur(8px);
}

.profile-img {
  position: relative;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  border: 3px solid var(--border);
  object-fit: cover;
}

@media (min-width: 640px) {
  .profile-img { width: 144px; height: 144px; }
}

.hero-name {
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

@media (min-width: 640px) {
  .hero-name { font-size: 2.5rem; }
}

.hero-location {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.hero-bio {
  margin-top: 24px;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

@media (min-width: 640px) {
  .hero-bio { font-size: 1.125rem; }
}

.wave {
  display: inline-block;
  transform-origin: 70% 70%;
  animation: wave 2.5s infinite;
}

@keyframes wave {
  0%, 60%, 100% { transform: rotate(0deg); }
  10%, 30% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
}

/* ===== Section Header ===== */
.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}

.section-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-bg);
  color: var(--accent-text);
}

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

@media (min-width: 640px) {
  .section-title { font-size: 1.875rem; }
}

/* ===== Timeline / Experience ===== */
.timeline {
  position: relative;
}

.timeline-line {
  position: absolute;
  left: 24px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
}

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

.timeline-avatar {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--accent-text);
  z-index: 1;
}

.timeline-card {
  flex: 1;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 20px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.timeline-card:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
}

.timeline-card-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

@media (min-width: 640px) {
  .timeline-card-head {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.timeline-role-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeline-role {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.badge-latest {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-bg);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent-text);
}

.timeline-period {
  font-size: 0.875rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.timeline-company {
  margin-top: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent-text);
}

.bullet-list {
  margin-top: 16px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bullet-list li {
  position: relative;
  padding-left: 16px;
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.bullet-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
}

/* ===== Expertise ===== */
.subsection-title {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.expertise-group + .expertise-group { margin-top: 40px; }

.highlights-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 40px;
}

.highlights-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--text-secondary);
  transition: border-color 0.2s ease;
}

.highlights-list li:hover {
  border-color: var(--border-hover);
}

.highlight-num {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-bg);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--accent-text);
}

.tech-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tech-tag {
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  cursor: default;
}

.tech-tag:hover {
  border-color: var(--accent-border);
  background: var(--accent-bg);
  color: var(--accent-text);
}

/* ===== Projects ===== */
.projects-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .projects-grid { grid-template-columns: repeat(3, 1fr); }
}

.project-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all 0.3s ease;
}

.project-card:hover {
  border-color: var(--accent-border);
  background: var(--surface-hover);
  box-shadow: 0 4px 20px var(--shadow);
  transform: translateY(-2px);
}

.project-card-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 20px 12px;
}

.project-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  border: 1px solid var(--border);
  object-fit: cover;
  flex-shrink: 0;
}

.project-info {
  flex: 1;
  min-width: 0;
}

.project-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-links {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}

.project-store-link {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.project-store-link:hover { color: var(--accent-text); }

.project-external-link {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.project-external-link:hover { color: var(--accent-text); }

.project-desc {
  flex: 1;
  padding: 0 20px 20px;
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* ===== Education ===== */
.education-card {
  display: flex;
  gap: 20px;
  padding: 24px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.2s ease;
  align-items: flex-start;
}

@media (min-width: 640px) {
  .education-card { align-items: center; }
}

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

.education-logo {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--accent-text);
}

.education-school {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
}

.education-degree {
  margin-top: 4px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.education-scholar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 0.875rem;
  color: var(--accent-text);
}

.education-period {
  margin-top: 8px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ===== Contact ===== */
.contact-card {
  text-align: center;
  padding: 32px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.contact-text {
  max-width: 520px;
  margin: 0 auto;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding: 12px 24px;
  border-radius: 12px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.contact-btn:hover {
  background: var(--accent-light);
  box-shadow: 0 4px 20px var(--accent-bg);
  transform: translateY(-1px);
}

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

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.social-link:hover {
  border-color: var(--accent-border);
  background: var(--accent-bg);
  color: var(--accent-text);
}

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

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

@media (min-width: 640px) {
  .footer-inner { flex-direction: row; }
}

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

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

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

/* ===== Mobile Nav ===== */
@media (max-width: 767px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 12px 16px;
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    width: 100%;
    padding: 12px 14px;
  }

  .menu-toggle { display: flex; }

  .timeline-line { left: 24px; }
  .timeline-avatar { width: 48px; height: 48px; }

  .section { padding: 48px 0; }

  .section-header { margin-bottom: 28px; }
}
