:root {
  --navy: #1e3a5f;
  --blue: #2563eb;
  --blue-light: #dbeafe;
  --blue-mid: #1e40af;
  --blue-pale: #eff6ff;
  --slate-900: #0f172a;
  --slate-600: #475569;
  --slate-400: #94a3b8;
  --slate-200: #e2e8f0;
  --bg: #f8fafc;
  --white: #fff;
  --sidebar-width: 240px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--slate-900);
  line-height: 1.5;
}

.page {
  display: flex;
  min-height: 100vh;
  max-width: 960px;
  margin: 24px auto;
  background: var(--white);
  border-radius: 10px;
  box-shadow: 0 4px 24px rgb(0 0 0 / 10%);
  overflow: hidden;
}

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--slate-200);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.main {
  flex: 1;
  padding: 36px 40px;
}

/* ---- Sidebar identity ---- */
.sidebar-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--slate-900);
  line-height: 1.2;
}

.sidebar-title {
  font-size: 13px;
  color: var(--blue);
  font-weight: 600;
  margin-top: 4px;
}

.sidebar-location {
  font-size: 12px;
  color: var(--slate-400);
  margin-top: 2px;
}

/* ---- ToC ---- */
.toc-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--slate-400);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toc-link {
  display: block;
  font-size: 13px;
  color: var(--slate-600);
  text-decoration: none;
  padding: 5px 8px;
  border-radius: 5px;
  transition: background-color 0.15s;
}

.toc-link:hover {
  background-color: var(--bg);
  color: var(--slate-900);
}

.toc-link.active {
  background-color: var(--blue-pale);
  color: var(--blue);
  font-weight: 600;
}

/* ---- Links ---- */
.links-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--slate-400);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 6px;
}

.sidebar-link {
  display: block;
  font-size: 12px;
  color: var(--blue);
  text-decoration: none;
  margin-bottom: 3px;
}

.sidebar-link:hover {
  text-decoration: underline;
}

/* ---- Visitor counter ---- */
.visitor-counter {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--slate-200);
  font-size: 12px;
  color: var(--slate-400);
}

#visitor-count {
  color: var(--blue);
  font-weight: 700;
}

/* ---- Sections (shared) ---- */
section {
  margin-bottom: 36px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--slate-900);
  border-bottom: 2px solid var(--blue);
  padding-bottom: 6px;
  margin-bottom: 16px;
}

/* ---- About ---- */
.about-text {
  font-size: 14px;
  color: var(--slate-600);
  line-height: 1.7;
}

/* ---- Experience ---- */
.job {
  margin-bottom: 20px;
}

.job-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.job-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--slate-900);
}

.job-dates {
  font-size: 12px;
  color: var(--slate-400);
}

.job-company {
  font-size: 13px;
  color: var(--blue);
  margin: 2px 0 8px;
}

.job-bullets {
  padding-left: 16px;
}

.job-bullets li {
  font-size: 13px;
  color: var(--slate-600);
  margin-bottom: 4px;
  line-height: 1.6;
}

/* ---- Skills ---- */
.skill-group {
  margin-bottom: 14px;
}

.skill-group-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--slate-400);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

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

.pill {
  background: var(--blue-light);
  color: var(--blue-mid);
  border-radius: 9999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
}

/* ---- Education ---- */
.edu-degree {
  font-size: 14px;
  font-weight: 700;
  color: var(--slate-900);
}

.edu-school {
  font-size: 13px;
  color: var(--blue);
  margin-top: 2px;
}

.edu-dates {
  font-size: 12px;
  color: var(--slate-400);
  margin-top: 2px;
}

/* ---- Certifications ---- */
.cert-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cert-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cert-badge {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--navy), var(--blue));
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.cert-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-900);
}

.cert-meta {
  font-size: 11px;
  color: var(--slate-400);
  margin-top: 1px;
}

/* ---- Responsive (≤ 768px) ---- */
@media (width <= 768px) {
  .page {
    flex-direction: column;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--slate-200);
    padding: 20px 16px;
    gap: 16px;
  }

  .visitor-counter {
    margin-top: 0;
  }

  .toc-list {
    flex-flow: row wrap;
    gap: 4px;
  }

  .main {
    padding: 24px 16px;
  }
}
