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

body {
  min-height: 100vh;
  background: #0a0e1a;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  color: #e2e8f0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 16px;
  line-height: 1.65;
}

a { color: #60a5fa; text-decoration: none; }
a:hover { color: #93c5fd; text-decoration: underline; }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 32px; }

/* ---- Site header ---- */
.site-header {
  background: linear-gradient(135deg, #0f1629 0%, #1a2744 100%);
  border-bottom: 1px solid #1e3a5f;
  padding: 22px 0;
  margin-bottom: 40px;
}
.site-header .wrap { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.site-name { font-size: 17px; font-weight: 700; color: #f8fafc; letter-spacing: -0.01em; display: inline-flex; align-items: center; gap: 9px; }
.site-logo { width: 24px; height: 24px; border-radius: 6px; display: block; }
.site-name:hover { color: #f8fafc; text-decoration: none; }
.site-name span { color: #f59e0b; }
.site-nav { margin-left: auto; display: flex; gap: 18px; font-size: 14px; }
.site-nav a { color: #8b9cb2; }
.site-nav a:hover { color: #93c5fd; text-decoration: none; }
.site-nav a.nav-cv { color: #fbbf24; font-weight: 600; }
.site-nav a.nav-cv:hover { color: #fcd34d; }

/* ---- Index ---- */
.page-intro { margin-bottom: 36px; }
.page-intro h1 { font-size: 30px; font-weight: 700; color: #f8fafc; letter-spacing: -0.02em; line-height: 1.25; margin-bottom: 10px; }
.page-intro p { color: #94a3b8; font-size: 16px; }
.page-intro p + p { margin-top: 10px; }
.intro-cv { font-size: 15px; }

.article-list { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.article-card {
  background: #0d1424;
  border: 1px solid #1e3a5f;
  border-left: 3px solid #f59e0b;
  border-radius: 6px;
  padding: 18px 22px;
  transition: border-color 0.15s, background 0.15s;
}
.article-card:hover { background: #0f1e38; border-color: #3b82f6; border-left-color: #f59e0b; }
.article-card h2 { font-size: 19px; font-weight: 600; line-height: 1.35; margin-bottom: 6px; }
.article-card h2 a { color: #f1f5f9; }
.article-card h2 a:hover { color: #93c5fd; text-decoration: none; }
.article-card .summary { color: #94a3b8; font-size: 15px; margin-bottom: 10px; }
.article-meta {
  color: #8494a7;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.tag {
  background: #1e3a5f;
  color: #93c5fd;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

/* ---- Post ---- */
.post-header { margin-bottom: 34px; padding-bottom: 24px; border-bottom: 1px solid #1e3a5f; }
.post-header h1 { font-size: 33px; font-weight: 700; color: #f8fafc; letter-spacing: -0.02em; line-height: 1.22; margin-bottom: 12px; }
.post-header .subtitle { color: #fbbf24; font-size: 17px; font-style: italic; line-height: 1.5; margin-bottom: 14px; }

.post-content { font-size: 17px; line-height: 1.75; color: #cbd5e1; }
.post-content > * + * { margin-top: 20px; }
.post-content h2 {
  font-size: 23px;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin-top: 44px;
}
.post-content h3 {
  font-size: 15px;
  font-weight: 600;
  color: #f59e0b;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 30px;
}
.post-content strong { color: #f8fafc; font-weight: 600; }
.post-content em { color: #cbd5e1; }
.post-content ul, .post-content ol { padding-left: 24px; }
.post-content li { margin-top: 8px; }
.post-content li::marker { color: #f59e0b; }
.post-content hr { border: 0; border-top: 1px solid #1e3a5f; margin-top: 40px; }
.post-content hr + * { margin-top: 40px; }
.post-content blockquote {
  border-left: 3px solid #f59e0b;
  background: #0d1424;
  padding: 12px 20px;
  border-radius: 0 6px 6px 0;
  color: #94a3b8;
  font-style: italic;
}
.post-content code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.88em;
  background: #0f1e38;
  border: 1px solid #1e3a5f;
  border-radius: 4px;
  padding: 2px 6px;
  color: #93c5fd;
}
.post-content pre {
  background: #080d1a;
  border: 1px solid #1e3a5f;
  border-radius: 6px;
  padding: 16px 18px;
  overflow-x: auto;
}
.post-content pre code { background: none; border: 0; padding: 0; font-size: 13px; }

/* ---- CV ----
   A standalone page, not a post: no date, no comments, and its own typography
   because a CV is scanned in columns rather than read in sequence. */
.cv-head { padding-bottom: 28px; margin-bottom: 8px; border-bottom: 1px solid #1e3a5f; }
.cv-kicker {
  color: #f59e0b;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.cv-head h1 { font-size: 38px; font-weight: 700; color: #f8fafc; letter-spacing: -0.025em; line-height: 1.1; }
.cv-head h1 span { color: #8b9cb2; font-weight: 500; }
.cv-role { color: #fbbf24; font-size: 18px; font-weight: 500; margin-top: 8px; }
.cv-lede { color: #cbd5e1; font-size: 17px; line-height: 1.7; margin-top: 16px; }

.cv-facts {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 18px;
  color: #8494a7;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.cv-facts li + li::before { content: "·"; color: #475a74; margin-right: 18px; }

.cv-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.cv-btn {
  display: inline-block;
  padding: 9px 16px;
  border: 1px solid #1e3a5f;
  border-radius: 6px;
  background: #0d1424;
  color: #93c5fd;
  font-size: 14px;
  font-weight: 500;
}
.cv-btn:hover { background: #0f1e38; border-color: #3b82f6; text-decoration: none; }
.cv-btn-primary { background: #f59e0b; border-color: #f59e0b; color: #0a0e1a; font-weight: 600; }
.cv-btn-primary:hover { background: #fbbf24; border-color: #fbbf24; color: #0a0e1a; }

.cv-section { margin-top: 44px; }
.cv-section > h2 {
  font-size: 13px;
  font-weight: 600;
  color: #f59e0b;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding-bottom: 8px;
  border-bottom: 1px solid #1e3a5f;
  margin-bottom: 22px;
}

.cv-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.cv-chips li {
  background: #0f1e38;
  border: 1px solid #1e3a5f;
  border-radius: 999px;
  padding: 5px 13px;
  color: #cbd5e1;
  font-size: 13.5px;
}

.cv-role-block + .cv-role-block { margin-top: 30px; padding-top: 26px; border-top: 1px solid #141e33; }
.cv-role-feature {
  background: #0d1424;
  border: 1px solid #1e3a5f;
  border-left: 3px solid #f59e0b;
  border-radius: 6px;
  padding: 20px 24px;
}
.cv-role-head { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.cv-role-head h3 { font-size: 18px; font-weight: 600; color: #f1f5f9; line-height: 1.35; }
.cv-org { color: #93c5fd; font-weight: 500; }
.cv-org::before { content: " · "; color: #475a74; }
.cv-dates {
  color: #8494a7;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.cv-intro { color: #94a3b8; font-size: 15.5px; margin-top: 8px; }
.cv-role-block ul { list-style: none; margin-top: 14px; }
.cv-role-block li { position: relative; padding-left: 18px; color: #cbd5e1; font-size: 16px; line-height: 1.65; }
.cv-role-block li + li { margin-top: 10px; }
.cv-role-block li::before { content: "▸"; position: absolute; left: 0; color: #f59e0b; }

.cv-skills dt {
  color: #f1f5f9;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.cv-skills dd { color: #94a3b8; font-size: 15px; line-height: 1.6; margin-top: 4px; }
.cv-skills dd + dt { margin-top: 18px; }

.cv-prose p { color: #cbd5e1; font-size: 16px; line-height: 1.75; }
.cv-prose p + p { margin-top: 14px; }
.cv-prose strong { color: #f1f5f9; font-weight: 600; }

.cv-early { color: #94a3b8; font-size: 15px; line-height: 1.75; }
.cv-note { color: #8494a7; font-size: 14px; margin-top: 10px; }

.cv-education dt { color: #f1f5f9; font-size: 16px; font-weight: 600; line-height: 1.45; }
.cv-education dt .cv-dates { margin-left: 8px; }
.cv-education dd { color: #94a3b8; font-size: 15px; line-height: 1.65; margin-top: 5px; }
.cv-education dt + dt, .cv-education dd + dt { margin-top: 16px; }

.cv-projects { list-style: none; }
.cv-projects li { color: #94a3b8; font-size: 15.5px; line-height: 1.7; }
.cv-projects li + li { margin-top: 14px; }
.cv-projects strong { color: #f1f5f9; font-weight: 600; }

.cv-foot { margin-top: 48px; padding-top: 26px; border-top: 1px solid #1e3a5f; }
.cv-foot p { color: #94a3b8; font-size: 15px; margin-bottom: 18px; }

@media (max-width: 600px) {
  .cv-head h1 { font-size: 29px; }
  .cv-role { font-size: 16px; }
  .cv-lede { font-size: 16px; }
  .cv-facts li + li::before { content: none; margin-right: 0; }
  .cv-role-feature { padding: 16px 18px; }
  .cv-role-block li { font-size: 15.5px; }
}

/* Ctrl-P on the CV should produce something a recruiter can file, not a dark
   screenshot of the site. The PDF button is the better path, but people print. */
@media print {
  body { background: #fff; color: #111; font-size: 11pt; }
  .site-header, .site-footer, .cv-actions, .cv-foot { display: none; }
  .wrap { max-width: none; padding: 0; }
  a { color: #111; }
  .cv-head h1 { color: #000; font-size: 22pt; }
  .cv-head h1 span, .cv-facts, .cv-dates, .cv-note { color: #444; }
  .cv-kicker, .cv-role { color: #000; }
  .cv-lede, .cv-intro, .cv-prose p, .cv-skills dd, .cv-early, .cv-education dd, .cv-projects li { color: #222; }
  .cv-section > h2 { color: #000; border-bottom-color: #999; }
  .cv-head, .cv-section > h2 { border-bottom-color: #999; }
  .cv-role-feature { background: none; border: 0; border-left: 2px solid #999; padding: 0 0 0 12px; }
  .cv-role-block li { color: #222; }
  .cv-role-block li::before { color: #666; }
  .cv-role-block h3, .cv-skills dt, .cv-education dt, .cv-projects strong { color: #000; }
  .cv-org { color: #000; }
  .cv-chips li { background: none; border-color: #999; color: #222; }
  .cv-role-block { page-break-inside: avoid; }
  .cv-prose strong { color: #000; }
}

/* ---- Comments ---- */
.comments { margin-top: 56px; padding-top: 28px; border-top: 1px solid #1e3a5f; }
.comments h2 {
  font-size: 15px;
  font-weight: 600;
  color: #f59e0b;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.comments-note { color: #8494a7; font-size: 14px; margin-bottom: 22px; }
/* giscus injects the frame at height 0 and sizes it later over postMessage.
   Reserve space so the block never collapses to nothing while it loads. */
.comments .giscus, .comments .giscus-frame { min-height: 260px; }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid #1e3a5f;
  margin-top: 60px;
  padding: 24px 0 40px;
  color: #8494a7;
  font-size: 14px;
}
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

@media (max-width: 600px) {
  .wrap { padding: 0 18px; }
  .page-intro h1 { font-size: 25px; }
  .post-header h1 { font-size: 26px; }
  .post-content { font-size: 16px; }
  .post-content h2 { font-size: 20px; }
}

/* Mermaid diagrams. The fence renders as a <pre> that the loader in
   default.html swaps for <pre class="mermaid">; both need the code-block
   chrome stripped, and the pre-swap one hidden so the raw source never flashes. */
.post-content pre:has(> code.language-mermaid) { background: none; border: 0; padding: 0; }
.post-content pre > code.language-mermaid { display: none; }
.post-content .mermaid { background: none; border: 0; padding: 0; text-align: center; overflow-x: auto; }
.post-content .mermaid svg { max-width: 100%; height: auto; }
