:root {
  --bg: #F6F7FA;
  --panel: #FFFFFF;
  --panel-border: #E3E7EE;
  --text: #1B2233;
  --text-muted: #6B7385;
  --accent: #147D82;
  --accent-soft: rgba(20, 125, 130, 0.08);
  --live: #15803D;
  --radius: 10px;
  --sidebar-w: 240px;
  --font-display: 'Sora', sans-serif;
  --font-body: 'IBM Plex Sans', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
}

h1, h2, h3 { font-family: var(--font-display); margin: 0; color: var(--text); }

a { color: inherit; text-decoration: none; }

ul { margin: 0; padding: 0; list-style: none; }

code {
  font-family: var(--font-mono);
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

/* ---------- Sidebar ---------- */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--panel-border);
  background: var(--panel);
}

.sidebar-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 40px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
}

.nav-list { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.nav-link {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link:hover { color: var(--text); background: rgba(0,0,0,0.035); }

.nav-link.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.sidebar-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  padding-top: 16px;
  border-top: 1px solid var(--panel-border);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.16);
  flex-shrink: 0;
}

.nav-toggle {
  display: none;
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 50;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
}

.nav-toggle span {
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* ---------- Content ---------- */

.content {
  margin-left: var(--sidebar-w);
  padding: 40px 48px 60px;
  max-width: 900px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 24px;
}

.panel-head { margin-bottom: 18px; }
.panel-head h2 { font-size: 19px; font-weight: 600; }

/* Hero */

.hero-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.hero-kicker {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  margin: 0 0 10px;
}

.hero-text h1 {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.hero-tagline {
  color: var(--text-muted);
  font-size: 16px;
  max-width: 46ch;
  margin: 14px 0 22px;
}

.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.hero-chart { width: 260px; flex-shrink: 0; }

.sparkline { width: 100%; height: auto; }

.sparkline-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 480;
  stroke-dashoffset: 480;
  animation: draw 1.6s ease forwards 0.2s;
}

.sparkline-fill {
  fill: var(--accent-soft);
  stroke: none;
  opacity: 0;
  animation: fadeIn 1s ease forwards 1.1s;
}

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fadeIn { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .sparkline-line, .sparkline-fill { animation: none; stroke-dashoffset: 0; opacity: 1; }
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}

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

.btn-primary:hover { opacity: 0.88; }

.btn-ghost {
  border-color: var(--panel-border);
  color: var(--text);
}

.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-small { padding: 7px 14px; font-size: 13px; }

/* Stats */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.stat-tile {
  padding: 22px 24px;
  border-right: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-tile:last-child { border-right: none; }

.stat-value {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 500;
  color: var(--accent);
}

.stat-label {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* Timeline */

.timeline-item { display: flex; gap: 18px; }

.timeline-marker {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 7px;
  flex-shrink: 0;
}

.timeline-heading { margin-bottom: 10px; }
.timeline-heading h3 { font-size: 17px; font-weight: 600; margin-bottom: 4px; }

.timeline-meta {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-muted);
}

.bullet-list { display: flex; flex-direction: column; gap: 8px; }

.bullet-list li {
  position: relative;
  padding-left: 16px;
  font-size: 14.5px;
  color: var(--text);
}

.bullet-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
}

.bullet-list.compact li { font-size: 14px; color: var(--text-muted); }

/* Projects */

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.project-card {
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-card-media {
  width: 100%;
  aspect-ratio: 16 / 8.5;
  object-fit: cover;
  object-position: top;
  display: block;
  border-bottom: 1px solid var(--panel-border);
  background: var(--bg);
}

.project-card-top,
.project-card > p,
.project-card > .bullet-list,
.project-card > .tag-row,
.project-card > .btn {
  margin-left: 20px;
  margin-right: 20px;
}

.project-card > .btn { margin-bottom: 20px; align-self: flex-start; }

.project-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-card-top h3 { font-size: 16px; font-weight: 600; }

.project-card p { margin: 0; font-size: 14px; color: var(--text-muted); }

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--live);
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--live);
}

.code-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  border: 1px solid var(--panel-border);
  padding: 2px 8px;
  border-radius: 5px;
}

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(0,0,0,0.03);
  border: 1px solid var(--panel-border);
  color: var(--text-muted);
}

/* Skills */

.skill-groups { display: flex; flex-direction: column; gap: 18px; }

.skill-group-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* Education */

.edu-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--panel-border);
}

.edu-row:last-child { border-bottom: none; }

.edu-row h3 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }

/* Contact */

.contact-lead {
  color: var(--text-muted);
  font-size: 15px;
  max-width: 55ch;
  margin: 0 0 20px;
}

.contact-grid {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.contact-detail { display: flex; flex-direction: column; gap: 4px; }

.contact-detail-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.contact-detail a { font-size: 14.5px; color: var(--text); }
.contact-detail a:hover { color: var(--accent); }

.contact-links { display: flex; gap: 10px; flex-wrap: wrap; }

.site-footer {
  display: flex;
  justify-content: space-between;
  padding: 20px 4px 0;
  font-size: 12.5px;
  color: var(--text-muted);
  border-top: 1px solid var(--panel-border);
  margin-top: 8px;
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 40;
  }
  .sidebar.open { transform: translateX(0); }
  .nav-toggle { display: flex; }
  .content { margin-left: 0; padding: 84px 20px 48px; }
  .hero-panel { flex-direction: column; align-items: flex-start; }
  .hero-chart { width: 100%; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-tile:nth-child(2) { border-right: none; }
  .stat-tile { border-bottom: 1px solid var(--panel-border); }
  .project-grid { grid-template-columns: 1fr; }
  .site-footer { flex-direction: column; gap: 4px; }
}
