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

:root {
  --bg: #fafafa;
  --bg-alt: #f0f2f5;
  --text: #1a1a1a;
  --text-muted: #5c5c5c;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --border: #e2e5ea;
  --card-bg: #ffffff;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
  --radius: 10px;
  --max-width: 960px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 250, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 1.5rem;
}

.logo {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.logo:hover {
  color: var(--accent);
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
}

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

.lang-toggle {
  flex-shrink: 0;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card-bg);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.lang-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Sections */

.section {
  padding: 4rem 0;
}

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

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

/* Hero */

.hero-inner {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 2rem;
  align-items: center;
}

.hero-photo {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--card-bg);
  box-shadow: var(--shadow);
}

.hero-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.25rem;
}

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

.hero-tagline {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  max-width: 540px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  text-decoration: none;
  color: #fff;
}

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

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

/* About */

.about-text {
  color: var(--text-muted);
  max-width: 680px;
  font-size: 1.05rem;
}

/* Timeline (experience & education) */

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1.5rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--border);
}

.timeline-item:first-child {
  padding-top: 0;
}

.timeline-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.timeline-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.timeline-period {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

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

.timeline-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.timeline-org {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.timeline-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.timeline-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.timeline-stack span {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Skills */

.skills-grid {
  display: grid;
  gap: 1.5rem;
}

.skill-group-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

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

.skill-tag {
  padding: 0.35rem 0.85rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Projects */

.projects-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.project-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform 0.15s, box-shadow 0.15s;
}

.project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.project-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.project-summary {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.project-context {
  padding: 0.85rem 1rem;
  background: var(--bg-alt);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
}

.project-context-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.project-context p {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.65;
  font-style: italic;
}

.project-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.project-stack span {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  background: var(--bg-alt);
  border-radius: 4px;
  color: var(--text-muted);
  font-weight: 500;
}

.project-links {
  display: flex;
  gap: 1rem;
  margin-top: 0.25rem;
}

.project-links a {
  font-size: 0.85rem;
  font-weight: 500;
}

.projects-subtitle {
  margin: 2.5rem 0 1.25rem;
  font-size: 1.15rem;
  font-weight: 600;
}

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

.project-card-compact {
  padding: 1.1rem 1.25rem;
  gap: 0.5rem;
}

/* Contact */

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1rem;
}

.contact-label {
  font-weight: 600;
  min-width: 5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Footer */

.footer {
  padding: 2rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

/* Error */

.error-banner {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9rem;
  z-index: 200;
}

.hidden {
  display: none;
}

/* Responsive */

@media (max-width: 640px) {
  .header-inner {
    flex-wrap: wrap;
  }

  .nav {
    order: 3;
    width: 100%;
    gap: 1rem;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-photo {
    margin: 0 auto;
  }

  .hero-tagline {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-title {
    font-size: 1.6rem;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}