:root {
  --bg:           #ffffff;
  --sidebar-bg:   #f7f7f7;
  --text:         #1a1a1a;
  --muted:        #6b6b6b;
  --border:       #e8e8e8;
  --accent:       #2563eb;
  --accent-hover: #1d4ed8;

  --sidebar-width: 240px;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;
}

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

html {
  font-size: 18px;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
}

/* ── Layout ──────────────────────────────── */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  padding: 2rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.avatar {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  display: block;
}

.sidebar .name {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 0.75rem;
}

.sidebar .title {
  font-size: 1rem;
  color: var(--muted);
  margin-top: 0.05rem;
  line-height: 1.4;
}

.sidebar .tagline {
  font-size: 0.92rem;
  color: var(--text);
  margin-top: 0.4rem;
  line-height: 1.5;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.sidebar nav a {
  display: block;
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s;
}

.sidebar nav a:hover { background: var(--border); }

.sidebar nav a.active {
  background: var(--accent);
  color: #fff;
}

.contact-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.4rem;
}

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

.contact a {
  font-size: 1.05rem;
  color: var(--muted);
  text-decoration: none;
  word-break: break-all;
  transition: color 0.15s;
}

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

.sidebar-tags {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.75rem;
}

.sidebar-tag {
  display: block;
  font-size: 0.75rem;
  background: #e2e8f0;
  color: #475569;
  padding: 3px 12px;
  border-radius: 99px;
  width: fit-content;
}

.contact-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 0.3rem;
}

/* ── Main Content ────────────────────────── */
.main-content {
  flex: 1;
  padding: 3rem 4rem;
}

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

h2 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

p { margin-bottom: 0.75rem; }

a { color: var(--accent); }

/* ── Timeline ────────────────────────────── */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.timeline-item {
  display: flex;
  gap: 1.5rem;
}

.timeline-item .year {
  min-width: 120px;
  font-size: 0.78rem;
  color: var(--muted);
  padding-top: 0.15rem;
  flex-shrink: 0;
  font-family: var(--font-mono);
}

.timeline-item .detail strong {
  font-size: 1.05rem;
  font-weight: 600;
}

.timeline-item .detail .org {
  font-size: 0.95rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

.timeline-item .detail ul {
  margin-top: 0.5rem;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.timeline-item .detail ul li {
  font-size: 0.975rem;
  line-height: 1.6;
  color: #333;
}

/* ── Skills ──────────────────────────────── */
.skills-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.skills-group {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.skills-group .group-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  min-width: 120px;
  padding-top: 3px;
  flex-shrink: 0;
}

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

.tag {
  font-size: 0.85rem;
  background: var(--border);
  color: var(--text);
  padding: 3px 12px;
  border-radius: 99px;
  line-height: 1.7;
}

/* ── Certifications ──────────────────────── */
.cert-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cert-item {
  font-size: 0.875rem;
}

.cert-item .cert-date {
  font-size: 0.78rem;
  color: var(--muted);
  font-family: var(--font-mono);
  margin-left: 0.5rem;
}

/* ── Projects Grid ───────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.project-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: border-color 0.15s;
}

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

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

.project-card p {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0;
}

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

.project-card .links a {
  font-size: 0.82rem;
  color: var(--accent);
  text-decoration: none;
}

.project-card .links a:hover { text-decoration: underline; }

/* ── Blog Post List ──────────────────────── */
.post-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.post-list li {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.5rem;
}

.post-list a {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

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

.post-date {
  font-size: 0.78rem;
  color: var(--muted);
  display: block;
  margin: 0.2rem 0;
  font-family: var(--font-mono);
}

.post-summary {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 0;
}

/* ── Blog Article ────────────────────────── */
.post-header { margin-bottom: 2rem; }
.post-header .back { font-size: 0.85rem; color: var(--muted); text-decoration: none; }
.post-header .back:hover { color: var(--accent); }
.post-header h1 { margin-top: 0.5rem; }

.post-body { line-height: 1.8; }
.post-body h2 { margin-top: 2rem; }
.post-body p { margin-bottom: 1rem; }

.post-body pre {
  background: #f4f4f4;
  border-radius: 6px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 1rem 0;
}

.post-body code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.post-body a { color: var(--accent); }

/* ── Mobile ──────────────────────────────── */
@media (max-width: 768px) {
  .layout { flex-direction: column; }

  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
    gap: 1.25rem;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .sidebar nav { flex-direction: row; flex-wrap: wrap; gap: 0.25rem; }

  .main-content { padding: 1.5rem 1.25rem; }

  .timeline-item { flex-direction: column; gap: 0.25rem; }
  .timeline-item .year { min-width: unset; }

  .skills-group { flex-direction: column; gap: 0.35rem; }
  .skills-group .group-label { min-width: unset; }
}
