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

:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #21262d;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-link: #58a6ff;
  --border-color: #30363d;
  --accent: #58a6ff;
  --accent-emphasis: #1f6feb;
  --success: #3fb950;
  --warning: #d29922;
  --radius: 8px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg-primary: #ffffff;
    --bg-secondary: #f6f8fa;
    --bg-tertiary: #eaeef2;
    --text-primary: #1f2328;
    --text-secondary: #656d76;
    --text-link: #0969da;
    --border-color: #d0d7de;
    --accent: #0969da;
    --accent-emphasis: #0550ae;
    --success: #1a7f37;
    --warning: #9a6700;
  }
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* === Layout === */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* === Hero === */
.hero {
  text-align: center;
  padding: 4rem 0 3rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.bio {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 1.5rem;
}

.social-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.social-links a {
  color: var(--text-link);
  text-decoration: none;
  padding: 0.4rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 0.9rem;
  transition: all 0.2s;
}

.social-links a:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* === Sections === */
main section {
  padding: 3rem 0;
  border-bottom: 1px solid var(--border-color);
}

main section:last-child {
  border-bottom: none;
}

section h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

/* === Skills === */
.skills-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.skill-category h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.skill-tag {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 2rem;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

/* === Career === */
.career-timeline {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.career-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  border-left: 3px solid var(--accent);
}

.career-item h3 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.career-period {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.career-role {
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.career-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.career-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.career-tech .skill-tag {
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
}

/* === Stats === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-mono);
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

/* === Language Bar === */
.language-bar {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.language-bar-segment {
  transition: width 0.3s;
}

.language-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
}

.language-legend-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* === Footer === */
footer {
  text-align: center;
  padding: 2rem 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
  border-top: 1px solid var(--border-color);
}

footer p {
  margin-bottom: 0.25rem;
}

/* === Responsive === */
@media (max-width: 640px) {
  .hero {
    padding: 2.5rem 0 2rem;
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  .avatar {
    width: 90px;
    height: 90px;
  }

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

  main section {
    padding: 2rem 0;
  }
}
