:root {
  color-scheme: dark;
  --background: #0d0f11;
  --foreground: #c9d1d9;
  --muted: #8b949e;
  --dim: #6e7681;
  --border: #21262d;
  --accent: #58a6ff;
  --num: #d29922;
}

:root[data-theme="light"] {
  color-scheme: light;
  --background: #ffffff;
  --foreground: #1f2328;
  --muted: #57606a;
  --dim: #8c959f;
  --border: #d0d7de;
  --accent: #0969da;
  --num: #9a6700;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  /* keep the terminal font */
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 24px 96px;
}

/* ── top bar ────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0 16px;
}
.topbar-home {
  justify-content: flex-end;
}
.brand {
  color: var(--foreground);
  text-decoration: none;
  font-weight: 700;
}
.theme-btn {
  font: inherit;
  font-size: 12px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
}
.theme-btn:hover {
  color: var(--foreground);
}

/* ── tabs ───────────────────────────────────────────── */
.tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar {
  display: none;
}
.tab {
  flex: none;
  white-space: nowrap;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 8px 9px;
}
.tab:hover {
  color: var(--foreground);
}
.tab.active {
  color: var(--foreground);
  border-bottom-color: var(--accent);
}

/* ── page ───────────────────────────────────────────── */
.page {
  padding-top: 40px;
}
.page-home {
  padding-top: 48px;
}

h2 {
  margin: 0 0 20px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}

/* ── home / intro ───────────────────────────────────── */
.name {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.role {
  margin: 4px 0 0;
}
.tagline {
  margin: 14px 0 0;
}
.para {
  margin: 18px 0 0;
}
.know-more {
  display: inline-block;
  margin-top: 34px;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 18px;
  transition: border-color 0.2s;
}
.know-more:hover {
  border-color: var(--accent);
}

/* ── text roles ─────────────────────────────────────── */
.bold {
  font-weight: 700;
}
.muted {
  color: var(--muted);
}
.dim {
  color: var(--dim);
}
.num {
  color: var(--num);
  font-weight: 700;
}
.link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.link:hover {
  border-bottom-color: var(--accent);
}

/* ── journey timeline ───────────────────────────────── */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}
.timeline li {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 2px 16px;
  padding: 10px 0;
  border-left: 2px solid var(--border);
  padding-left: 18px;
  position: relative;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 16px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.timeline .when {
  grid-row: span 2;
  font-size: 13px;
}
.timeline .what {
  color: var(--foreground);
}
.timeline .detail {
  grid-column: 2;
  font-size: 13px;
}

/* ── experience ─────────────────────────────────────── */
.job {
  margin-bottom: 24px;
}
.job:last-child {
  margin-bottom: 0;
}
.meta {
  font-size: 13px;
  margin-top: 2px;
}
.dots {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}
.dots li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 6px;
}
.dots li::before {
  content: "•";
  position: absolute;
  left: 2px;
  color: var(--muted);
}

/* ── projects ───────────────────────────────────────── */
.proj {
  margin-bottom: 18px;
}
.proj:last-child {
  margin-bottom: 0;
}
.more-link {
  margin: 22px 0 0;
}

/* ── skills ─────────────────────────────────────────── */
.skills {
  list-style: none;
  margin: 0;
  padding: 0;
}
.skills li {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  padding: 5px 0;
}
.skills .group {
  color: var(--muted);
}

/* ── ratings ────────────────────────────────────────── */
.rating {
  margin-bottom: 20px;
}
.rating:last-child {
  margin-bottom: 0;
}
.rating-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.bar {
  color: var(--accent);
  letter-spacing: 1px;
  margin: 4px 0;
}
.sub {
  font-size: 13px;
}

/* ── contact / footer ───────────────────────────────── */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 4px;
}
.foot {
  margin-top: 28px;
  font-size: 12px;
}

@media (max-width: 520px) {
  .timeline li,
  .skills li {
    grid-template-columns: 1fr;
  }
  .timeline .when {
    grid-row: auto;
  }
  .timeline .detail {
    grid-column: 1;
  }
}
