/* ===== CSS VARIABLES ===== */
:root {
  --bg: #0d1117;
  --sidebar-bg: #0d1117;
  --card-bg: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #00b4d8;
  --accent-dim: rgba(0, 180, 216, 0.15);
  --tag-bg: rgba(0, 180, 216, 0.12);
  --tag-text: #00b4d8;
  --shadow: 0 2px 8px rgba(0,0,0,0.4);
  --transition: background 0.3s, color 0.3s, border-color 0.3s;
}

body.light-mode {
  --bg: #f6f8fa;
  --sidebar-bg: #eaeef2;
  --card-bg: #ffffff;
  --border: #d0d7de;
  --text: #24292f;
  --text-muted: #57606a;
  --accent: #0077a3;
  --accent-dim: rgba(0, 119, 163, 0.1);
  --tag-bg: rgba(0, 119, 163, 0.1);
  --tag-text: #0077a3;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: var(--transition);
  line-height: 1.6;
  font-size: 15px;
}

/* ===== LAYOUT ===== */
.layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  background: var(--sidebar-bg);
  border-left: 1px solid var(--border);
  transition: var(--transition);
}

.sidebar-inner {
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1px;
  flex-shrink: 0;
}

.name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.current-role {
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  margin-top: -16px;
}

/* Contact links */
.contact-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
  word-break: break-all;
}

.contact-link:hover { color: var(--accent); }

.contact-icon {
  font-size: 15px;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}

/* Sidebar sections */
.sidebar-section { display: flex; flex-direction: column; gap: 8px; }

.sidebar-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.sidebar-value {
  font-size: 13px;
  color: var(--text);
}

/* Language chips */
.lang-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.lang-level {
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

/* Tags */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid rgba(0, 180, 216, 0.2);
}

body.light-mode .tag {
  border-color: rgba(0, 119, 163, 0.2);
}

/* Controls row */
.controls-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Segmented control */
.seg-control {
  display: flex;
  background: var(--sidebar-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

#theme-control {
  flex: 1;
}

.seg-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.18s;
  white-space: nowrap;
  flex: 1;
}

.seg-btn:hover:not(.active) {
  color: var(--text);
  background: var(--border);
}

.seg-btn.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  padding: 40px 48px;
  max-width: 960px;
  margin: 0 auto;
}

/* ===== SECTION ===== */
.section {
  margin-bottom: 56px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-icon {
  color: var(--accent);
  font-size: 16px;
}

/* ===== SUMMARY ===== */
.summary-text {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.8;
}

/* ===== EXPERIENCE CARDS ===== */
.exp-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 16px;
  transition: border-color 0.2s, var(--transition);
}

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

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

.exp-role {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.exp-dates {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 3px;
}

.exp-company {
  font-size: 14px;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 12px;
}

.exp-description {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.exp-subsection-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 8px;
  margin-top: 16px;
}

.exp-responsibilities {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow: hidden;
  position: relative;
}

.exp-responsibilities.expanded {
  max-height: none;
}

.exp-responsibilities li {
  font-size: 13px;
  color: var(--text-muted);
  padding-left: 16px;
  position: relative;
}

.exp-responsibilities li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 11px;
}

.exp-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: linear-gradient(transparent, var(--card-bg));
  pointer-events: none;
}

.show-more-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  padding: 6px 0;
  margin-top: 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.show-more-btn:hover { opacity: 0.8; }

.exp-achievements {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.exp-achievements li {
  font-size: 13px;
  color: var(--text-muted);
  padding-left: 20px;
  position: relative;
}

.exp-achievements li::before {
  content: '✦';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 10px;
  top: 2px;
}

/* ===== SIDEBAR SKILLS ===== */
.sidebar-skills-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-skill-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  transition: border-color 0.2s, var(--transition);
}

.sidebar-skill-group:hover { border-color: var(--accent); }

.sidebar-skill-category {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* ===== SKILLS GRID ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.skill-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  transition: border-color 0.2s, var(--transition);
}

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

.skill-category {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
  margin-bottom: 10px;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.skill-tag {
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 12px;
}

/* ===== EDUCATION CARDS ===== */
.edu-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  transition: border-color 0.2s, var(--transition);
}

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

.edu-degree {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.edu-institution {
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
}

.edu-year {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ===== CERTIFICATIONS ===== */
.cert-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.cert-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  transition: border-color 0.2s, var(--transition);
}

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

.cert-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.cert-issuer {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.cert-link {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: opacity 0.2s;
}

.cert-link:hover { opacity: 0.75; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-inner {
    padding: 24px 20px;
  }

  .main-content {
    padding: 28px 20px;
  }

  .exp-header {
    flex-direction: column;
    gap: 4px;
  }

  .edu-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
