/* ============================================================
   mypie Engineering Blog — Minimal stylesheet
   No framework dependencies. System fonts only.
   ============================================================ */

:root {
  --text:        #24292f;
  --muted:       #57606a;
  --bg:          #ffffff;
  --bg-subtle:   #f6f8fa;
  --border:      #d0d7de;
  --accent:      #0550ae;
  --accent-fg:   #ffffff;
  --heading:     #1f2328;
  --code-bg:     #f6f8fa;
  --code-border: #d0d7de;
  --tag-bg:      #ddf4ff;
  --tag-text:    #0550ae;
  --warning-bg:  #fff8c5;
  --warning-border: #d4a72c;
  --max-width:   760px;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans",
               Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
}

/* ── Container ──────────────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Header ─────────────────────────────────────────────── */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--heading);
  font-size: 15px;
  font-weight: 400;
}
.site-logo:hover { color: var(--accent); }
.logo-mark {
  font-size: 20px;
  color: var(--accent);
  line-height: 1;
}
.logo-text strong { font-weight: 700; }
.site-nav { display: flex; gap: 24px; align-items: center; }
.site-nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s;
}
.site-nav a:hover, .site-nav a.active { color: var(--accent); }

/* ── Main ───────────────────────────────────────────────── */
.main-content { padding: 48px 0 80px; }

/* ── Home page ──────────────────────────────────────────── */
.home-hero {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}
.home-hero h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--heading);
  margin: 0 0 8px;
}
.home-hero p {
  color: var(--muted);
  font-size: 16px;
  margin: 0;
}

.post-list { list-style: none; margin: 0; padding: 0; }
.post-list-item {
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}
.post-list-item:last-child { border-bottom: none; }
.post-list-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.post-list-date {
  font-size: 13px;
  color: var(--muted);
}
.post-list-item h2 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
}
.post-list-item h2 a {
  text-decoration: none;
  color: var(--heading);
}
.post-list-item h2 a:hover { color: var(--accent); }
.post-list-item p {
  color: var(--muted);
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.6;
}
.read-more {
  font-size: 14px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.read-more:hover { text-decoration: underline; }

/* ── Tags ───────────────────────────────────────────────── */
.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 20px;
  background: var(--tag-bg);
  color: var(--tag-text);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ── Post ───────────────────────────────────────────────── */
.post-header {
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.post-date { font-size: 13px; color: var(--muted); }
.post-title {
  font-size: 32px;
  font-weight: 800;
  color: var(--heading);
  line-height: 1.25;
  margin: 0 0 12px;
}
.post-subtitle {
  font-size: 18px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

/* ── Post content typography ────────────────────────────── */
.post-content h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--heading);
  margin: 40px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.post-content h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--heading);
  margin: 28px 0 8px;
}
.post-content p { margin: 0 0 16px; }
.post-content ul, .post-content ol {
  margin: 0 0 16px;
  padding-left: 24px;
}
.post-content li { margin-bottom: 4px; }
.post-content li p { margin: 0; }
.post-content strong { font-weight: 700; color: var(--heading); }
.post-content a { color: var(--accent); }
.post-content a:hover { text-decoration: underline; }
.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

/* ── Inline code ─────────────────────────────────────────── */
.post-content code {
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono",
               Menlo, monospace;
  font-size: 13.5px;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 4px;
  padding: 1px 5px;
  color: #953800;
}

/* ── Code blocks ─────────────────────────────────────────── */
.post-content pre {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 8px;
  padding: 16px 20px;
  overflow-x: auto;
  margin: 0 0 20px;
  line-height: 1.55;
}
.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  color: var(--text);
}

/* ── Blockquote / callout ────────────────────────────────── */
.post-content blockquote {
  border-left: 4px solid var(--accent);
  background: var(--bg-subtle);
  margin: 0 0 20px;
  padding: 12px 16px;
  border-radius: 0 6px 6px 0;
  color: var(--muted);
}
.post-content blockquote p { margin: 0; }

/* ── Warning callout ─────────────────────────────────────── */
.callout-warning {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: 8px;
  padding: 14px 16px;
  margin: 0 0 20px;
  font-size: 14px;
}
.callout-warning strong { color: #633c01; }

/* ── Post footer ─────────────────────────────────────────── */
.post-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.back-link {
  font-size: 14px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.back-link:hover { text-decoration: underline; }

/* ── About page ──────────────────────────────────────────── */
.about-content h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--heading);
  margin: 0 0 16px;
}
.about-content p {
  color: var(--text);
  margin: 0 0 16px;
  font-size: 16px;
}
.about-content ul {
  padding-left: 24px;
  margin: 0 0 16px;
}
.about-content li { margin-bottom: 6px; }

/* ── Syntax highlight (Rouge github theme) ───────────────── */
.highlight { background: var(--code-bg); }
.highlight .c  { color: #6e7781; font-style: italic }
.highlight .err { color: #82071e; background: #ffebe9 }
.highlight .k  { color: #cf222e; font-weight: bold }
.highlight .o  { color: #0550ae }
.highlight .cm { color: #6e7781; font-style: italic }
.highlight .cp { color: #6e7781 }
.highlight .c1 { color: #6e7781; font-style: italic }
.highlight .cs { color: #6e7781; font-style: italic; font-weight: bold }
.highlight .gd { color: #82071e; background: #ffebe9 }
.highlight .ge { font-style: italic }
.highlight .gi { color: #116329; background: #dafbe1 }
.highlight .gp { color: #0550ae; font-weight: bold }
.highlight .gs { font-weight: bold }
.highlight .kc { color: #0550ae; font-weight: bold }
.highlight .kd { color: #cf222e; font-weight: bold }
.highlight .kn { color: #cf222e; font-weight: bold }
.highlight .kp { color: #cf222e }
.highlight .kr { color: #cf222e; font-weight: bold }
.highlight .kt { color: #0550ae }
.highlight .m  { color: #0550ae }
.highlight .s  { color: #0a3069 }
.highlight .na { color: #116329 }
.highlight .nb { color: #953800 }
.highlight .nc { color: #953800; font-weight: bold }
.highlight .no { color: #0550ae }
.highlight .nd { color: #8250df }
.highlight .ni { color: #0550ae }
.highlight .ne { color: #953800 }
.highlight .nf { color: #8250df }
.highlight .nl { color: #116329 }
.highlight .nn { color: #953800 }
.highlight .nt { color: #116329 }
.highlight .nv { color: #953800 }
.highlight .ow { color: #cf222e; font-weight: bold }
.highlight .w  { color: #6e7781 }
.highlight .mf { color: #0550ae }
.highlight .mh { color: #0550ae }
.highlight .mi { color: #0550ae }
.highlight .mo { color: #0550ae }
.highlight .sb { color: #0a3069 }
.highlight .sc { color: #0a3069 }
.highlight .sd { color: #0a3069 }
.highlight .s2 { color: #0a3069 }
.highlight .se { color: #0550ae }
.highlight .sh { color: #0a3069 }
.highlight .si { color: #0550ae }
.highlight .sx { color: #0a3069 }
.highlight .sr { color: #0a3069 }
.highlight .s1 { color: #0a3069 }
.highlight .ss { color: #0a3069 }
.highlight .bp { color: #953800 }
.highlight .vc { color: #953800 }
.highlight .vg { color: #953800 }
.highlight .vi { color: #953800 }
.highlight .il { color: #0550ae }

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
}
.site-footer p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  text-align: center;
}
.site-footer a { color: var(--muted); text-decoration: underline; }
.site-footer a:hover { color: var(--accent); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
  .post-title { font-size: 24px; }
  .site-nav a { font-size: 13px; }
  .site-nav { gap: 16px; }
  .main-content { padding: 32px 0 60px; }
}
