:root {
  --bg: oklch(96% 0.006 80);
  --panel: oklch(98% 0.006 80);
  --panel-alt: oklch(94% 0.008 80);
  --border: oklch(85% 0.01 70);
  --text: oklch(24% 0.01 80);
  --text-muted: oklch(42% 0.01 80);
  --text-faint: oklch(50% 0.01 80);
  --bar: oklch(25% 0.01 80);
  --accent: oklch(60% 0.15 70);
  --accent-dim: oklch(85% 0.06 70);
  --category-gray: oklch(45% 0.01 80);
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  font-family: var(--mono);
  color: var(--text);
}

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

.page {
  width: min(1200px, calc(100% - 32px));
  margin: 48px auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.term-bar {
  padding: 8px 16px;
  background: var(--bar);
  font-size: 12px;
  color: var(--accent);
}
.term-bar .back { color: var(--accent); opacity: 0.75; }
.term-bar .back:hover { opacity: 1; text-decoration: underline; }

.cursor {
  display: inline-block;
  width: 8px;
  height: 1.05em;
  background: var(--accent);
  margin-left: 6px;
  vertical-align: -2px;
  animation: blink-cursor 1s step-end infinite;
}
.cursor-inline { width: 10px; height: 0.85em; margin-left: 8px; vertical-align: -1px; }

@keyframes blink-cursor {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.content { padding: 44px 48px; }

/* Home */
.home .avatar {
  width: 80px;
  height: 80px;
  border: 1px solid var(--border);
  background: repeating-linear-gradient(45deg, oklch(93% 0.01 80), oklch(93% 0.01 80) 4px, var(--panel) 4px, var(--panel) 8px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.home .prompt { font-size: 13px; color: var(--accent); }
.home .name { font-weight: 700; font-size: 27px; margin: 4px 0 0; }
.home .role { font-size: 13.5px; color: var(--text-muted); margin-top: 4px; }
.home .hire-badge { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 11.5px; }
.home .hire-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.home .hire-badge span:nth-child(2) { color: var(--accent); }
.home .hire-note { font-size: 10px; color: oklch(60% 0.01 80); }
.home .bio {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text);
  background: var(--panel-alt);
  padding: 14px 16px;
  border-radius: 3px;
  margin-top: 20px;
}
.home .cta-row { display: flex; gap: 10px; margin-top: 20px; }
.btn-primary, .btn-outline {
  font-weight: 700;
  font-size: 14px;
  padding: 9px 18px;
  border-radius: 3px;
}
.btn-primary { color: white; background: var(--accent); }
.btn-outline { color: var(--accent); border: 1px solid var(--accent); padding: 8px 18px; }
.home .external-row { display: flex; gap: 18px; margin-top: 14px; font-size: 12px; color: var(--text-faint); }

/* CV */
.section-label { font-weight: 700; font-size: 13px; letter-spacing: 0.05em; color: var(--accent); margin: 22px 0 14px; }
.section-label:first-child { margin-top: 0; }
.cv-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.cv-name {
  font-size: 27px;
  margin: 4px 0 0;
}
.cv-title {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 4px;
}
.cv-download {
  flex-shrink: 0;
  white-space: nowrap;
}
.cv-bio {
  max-width: 82ch;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text);
  background: var(--panel-alt);
  padding: 14px 16px;
  border-radius: 3px;
  margin-top: 20px;
}
.cv-bio p {
  margin: 0 0 12px;
}
.cv-bio p:last-child {
  margin-bottom: 0;
}
.cv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}
.cv-bio + .cv-grid {
  margin-top: 18px;
}
.meta-list {
  border-top: 1px dashed var(--border);
}
.meta-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 12px;
  line-height: 1.5;
}
.meta-row span:first-child {
  color: var(--text-faint);
}
.meta-row a,
.meta-row span:last-child {
  color: var(--text-muted);
  overflow-wrap: anywhere;
}
.meta-row a:hover {
  color: var(--accent);
  text-decoration: underline;
}
.timeline .entry {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px dashed var(--border);
}
.timeline .entry:last-child { border-bottom: 1px dashed var(--border); }
.timeline .entry:not(.current) { opacity: 0.75; }
.timeline .period { font-size: 11.5px; color: var(--text-faint); width: 92px; flex-shrink: 0; padding-top: 2px; }
.timeline .company { font-weight: 700; font-size: 14.5px; }
.timeline .role { font-weight: 400; color: var(--text-faint); font-size: 14.5px; }
.timeline ul { margin: 8px 0 0; padding-left: 16px; font-size: 12px; line-height: 1.7; color: var(--text-muted); }
.skills-box {
  font-size: 12px;
  line-height: 1.8;
  color: var(--text-muted);
  background: var(--panel-alt);
  padding: 14px 16px;
  border-radius: 3px;
}

/* Posts feed */
.category-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}
.category-link {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 5px 8px;
  line-height: 1;
}
.category-link:hover {
  color: var(--text);
  border-color: var(--accent);
}
.category-link.active {
  box-shadow: 0 2px 0 var(--accent);
}
.tag-nav,
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag-nav {
  margin: -8px 0 18px;
}
.post-tags {
  margin-top: 10px;
}
.tag-link {
  font-size: 11px;
  color: var(--text-faint);
}
.tag-link:hover,
.tag-link.active {
  color: var(--accent);
  text-decoration: underline;
}
.feed { display: flex; flex-direction: column; gap: 2px; }
.feed-item {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 12px 10px;
  border-radius: 3px;
}
.feed-item:nth-child(odd) { background: var(--panel-alt); }
.feed-item:hover { background: var(--accent-dim); }
.feed-item .date { font-size: 11px; color: var(--text-faint); width: 70px; flex-shrink: 0; }
.feed-item .title { font-size: 13px; }

.category {
  font-size: 10.5px;
  color: white;
  background: var(--category-gray);
  padding: 2px 7px;
  border-radius: 2px;
  flex-shrink: 0;
  line-height: 1.2;
}
.category-link.category {
  font-size: 11px;
  padding: 5px 8px;
  border-radius: 3px;
  line-height: 1;
}
.category-talk { background: var(--accent); }
.category-notes { background: var(--accent-dim); color: var(--text); }
.category-engineering, .category-thoughts { background: var(--category-gray); }

/* Single post */
.post-title { font-size: 24px; margin: 14px 0 4px; }
.post .date { font-size: 12px; color: var(--text-faint); }
.post .body {
  max-width: 74ch;
  margin-top: 24px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
}
.post .body p { margin: 0 0 16px; }

@media (max-width: 640px) {
  .page {
    width: min(100% - 16px, 960px);
    margin: 8px auto;
  }

  .content { padding: 28px 20px; }
  .cv-header {
    display: block;
  }
  .cv-download {
    display: inline-block;
    margin-top: 18px;
  }
  .cv-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .meta-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .timeline .entry {
    display: block;
  }
  .timeline .period {
    width: auto;
    margin-bottom: 4px;
  }
}
