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

:root {
  --sidebar-width: 280px;
  --color-bg: #fafafa;
  --color-surface: #ffffff;
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-primary-light: #eff6ff;
  --color-text: #1e293b;
  --color-text-secondary: #64748b;
  --color-border: #e2e8f0;
  --color-tag-bg: #f1f5f9;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  font-size: 16px;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--color-primary-dark);
}

ul {
  list-style: disc;
  padding-left: 1.4rem;
}

/* =========================================================
   Sidebar
   ========================================================= */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
  z-index: 10;
}

.sidebar-sticky {
  padding: 2.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Avatar */
.avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-md);
  background: var(--color-border);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Identity */
.name {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  text-align: center;
}

.nickname {
  font-weight: 400;
  color: var(--color-text-secondary);
  font-size: 1.1rem;
}

.title {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  margin-top: 0.2rem;
}

.location {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-top: 0.5rem;
}

.location i {
  margin-right: 0.3rem;
  color: var(--color-primary);
}

.email {
  font-size: 0.85rem;
  margin-top: 0.3rem;
}

/* Social Links */
.social-links {
  display: flex;
  gap: 0.9rem;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

.social-links a {
  color: var(--color-text-secondary);
  font-size: 1.25rem;
  transition: color 0.2s, transform 0.2s;
}

.social-links a:hover {
  color: var(--color-primary);
  transform: translateY(-1px);
}

/* Navigation */
nav {
  width: 100%;
  border-top: 1px solid var(--color-border);
  padding-top: 1.25rem;
}

nav ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: background 0.2s, color 0.2s;
}

nav a:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
  text-decoration: none;
}

nav a.active {
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: 600;
}

nav a i {
  width: 18px;
  text-align: center;
  font-size: 0.85rem;
}

/* =========================================================
   Main Content
   ========================================================= */
.content {
  margin-left: var(--sidebar-width);
  max-width: 780px;
  padding: 2.5rem 3rem 4rem;
}

section {
  margin-bottom: 2.5rem;
}

section h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-text);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-primary);
  margin-bottom: 1.25rem;
}

section > p {
  margin-bottom: 0.75rem;
  color: var(--color-text);
}

.cv-link {
  margin-top: 0.5rem;
}

.cv-link i {
  color: #dc2626;
  margin-right: 0.3rem;
}

/* =========================================================
   Experience & Education Entries
   ========================================================= */
.entry {
  margin-bottom: 1.75rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--color-border);
}

.entry:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.entry-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.entry-date {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary);
  white-space: nowrap;
}

.entry-org {
  font-size: 0.92rem;
  color: var(--color-text-secondary);
  margin: 0.15rem 0 0.2rem;
}

.entry-org i {
  margin-right: 0.3rem;
  font-size: 0.8rem;
}

.entry-team {
  font-size: 0.85rem;
  color: var(--color-primary);
  font-weight: 500;
  font-style: italic;
  margin-bottom: 0.6rem;
}

.entry ul {
  margin-top: 0.4rem;
}

.entry li {
  margin-bottom: 0.3rem;
  color: var(--color-text);
}

/* =========================================================
   Projects
   ========================================================= */
.project {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  transition: box-shadow 0.2s;
}

.project:hover {
  box-shadow: var(--shadow-md);
}

.project h3 {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.project-tag {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.project p {
  margin-top: 0.5rem;
  color: var(--color-text-secondary);
  font-size: 0.95rem;
}

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

.project-links a {
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* =========================================================
   Skills
   ========================================================= */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.skill-group h3 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-secondary);
  margin-bottom: 0.6rem;
}

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

.skill-tags span {
  background: var(--color-tag-bg);
  color: var(--color-text);
  padding: 0.3rem 0.7rem;
  border-radius: 5px;
  font-size: 0.85rem;
  font-weight: 500;
}

.skill-tags span.expert {
  background: var(--color-primary);
  color: #fff;
}

.skill-tags span.expert em {
  font-style: normal;
  opacity: 0.85;
  font-size: 0.75rem;
}

/* =========================================================
   Footer
   ========================================================= */
footer {
  margin-left: var(--sidebar-width);
  text-align: center;
  padding: 1.5rem;
  color: var(--color-text-secondary);
  font-size: 0.8rem;
  border-top: 1px solid var(--color-border);
}

/* =========================================================
   Responsive — Tablet & Mobile
   ========================================================= */
@media (max-width: 900px) {
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }

  .sidebar-sticky {
    padding: 2rem 1.5rem 1.5rem;
  }

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

  nav ul {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem 0.5rem;
  }

  nav a {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
  }

  .content {
    margin-left: 0;
    padding: 2rem 1.5rem 3rem;
  }

  footer {
    margin-left: 0;
  }
}

@media (max-width: 480px) {
  .content {
    padding: 1.5rem 1rem 2.5rem;
  }

  .entry-header {
    flex-direction: column;
    gap: 0.15rem;
  }

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