/* PennyWise Blog — Medium-inspired reading experience (self-contained) */

:root {
  --ink: #242424;
  --ink-soft: #5f5f5f;
  --ink-faint: #9a9a9a;
  --rule: #e9e9e9;
  --bg: #ffffff;
  --accent: #16a34a;
  --accent-dark: #15803d;
  --tint: #f4faf6;
  --serif: "Source Serif 4", Georgia, Cambria, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --content: 720px;
  --wide: 1100px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Reading progress bar */
.progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: var(--accent); z-index: 60; transition: width 0.08s linear;
}

/* Top bar */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--rule);
  font-family: var(--sans);
}
.site-header .bar {
  max-width: var(--wide); margin: 0 auto; padding: 13px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; }
.brand img { width: 28px; height: 28px; border-radius: 8px; }
.brand span { font-weight: 700; font-size: 19px; color: var(--accent); letter-spacing: -0.01em; }
.brand:hover span { color: var(--accent-dark); }
.nav-cta {
  font-size: 14px; font-weight: 600; background: #111; color: #fff;
  padding: 8px 16px; border-radius: 999px; text-decoration: none; white-space: nowrap;
}
.nav-cta:hover { background: #333; }

/* Article */
.article { max-width: var(--content); margin: 0 auto; padding: 56px 24px 96px; }
.breadcrumb { font-family: var(--sans); font-size: 14px; color: var(--ink-faint); margin-bottom: 30px; }
.breadcrumb a { color: var(--ink-soft); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { color: var(--ink-faint); }

.article h1 {
  font-size: clamp(33px, 5vw, 46px);
  line-height: 1.13; font-weight: 700; letter-spacing: -0.021em;
  margin: 0 0 18px;
}
.dek { font-size: 22px; color: var(--ink-soft); line-height: 1.45; margin: 0 0 30px; font-weight: 400; }

.byline {
  display: flex; align-items: center; gap: 13px; font-family: var(--sans);
  margin: 0 0 44px; padding-bottom: 28px; border-bottom: 1px solid var(--rule);
}
.avatar {
  width: 46px; height: 46px; border-radius: 999px; flex: none;
  background: linear-gradient(135deg, var(--accent), #34d399);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 17px;
}
.byline .name { font-weight: 600; font-size: 15px; color: var(--ink); line-height: 1.3; }
.byline .meta { font-size: 14px; color: var(--ink-faint); line-height: 1.3; }

/* Body */
.prose > * { margin: 0 0 1.7rem; }
.prose > *:last-child { margin-bottom: 0; }
.prose p { font-size: 20px; line-height: 1.8; }
.prose .lead { font-size: 22px; line-height: 1.65; color: #333; }
.prose h2 { font-size: 30px; line-height: 1.25; font-weight: 700; letter-spacing: -0.012em; margin-top: 3rem; margin-bottom: 1rem; }
.prose h3 { font-size: 24px; line-height: 1.3; font-weight: 700; margin-top: 2.3rem; margin-bottom: 0.7rem; }
.prose a { color: var(--ink); text-decoration: underline; text-decoration-color: #cfcfcf; text-underline-offset: 3px; }
.prose a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.prose ul, .prose ol { padding-left: 1.35em; }
.prose li { margin-bottom: 0.6rem; }
.prose blockquote {
  margin: 2rem 0; padding: 2px 0 2px 24px; border-left: 3px solid var(--ink);
  font-style: italic; color: var(--ink-soft); font-size: 23px; line-height: 1.5;
}
.prose figure { margin: 2.5rem 0; }
.prose img { width: 100%; border-radius: 10px; display: block; }
.prose figcaption { font-family: var(--sans); font-size: 14px; color: var(--ink-faint); text-align: center; margin-top: 10px; }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.88em; background: #f3f4f6; padding: 2px 6px; border-radius: 6px; }
.prose pre { background: #0f172a; color: #e2e8f0; padding: 20px 22px; border-radius: 12px; overflow-x: auto; font-size: 15px; line-height: 1.6; }
.prose pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.prose hr { border: none; border-top: 1px solid var(--rule); margin: 3rem 0; }

/* End-of-post CTA */
.post-cta {
  font-family: var(--sans); margin-top: 3.5rem; padding: 28px 30px;
  background: var(--tint); border: 1px solid #dcefe2; border-radius: 16px;
}
.post-cta p { margin: 0 0 12px; font-size: 17px; line-height: 1.5; color: var(--ink); }
.post-cta a { color: var(--accent-dark); font-weight: 600; text-decoration: none; }
.post-cta a:hover { text-decoration: underline; }

/* Footer */
.site-footer { font-family: var(--sans); border-top: 1px solid var(--rule); color: var(--ink-faint); font-size: 14px; }
.site-footer .inner { max-width: var(--wide); margin: 0 auto; padding: 44px 24px; text-align: center; }
.site-footer p { margin: 0 0 6px; }
.site-footer a { color: var(--accent); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* Blog index */
.blog-hero { max-width: var(--content); margin: 0 auto; padding: 66px 24px 8px; }
.blog-hero h1 { font-size: clamp(36px, 6vw, 50px); line-height: 1.08; font-weight: 700; letter-spacing: -0.025em; margin: 0 0 16px; }
.blog-hero .sub { font-size: 21px; color: var(--ink-soft); line-height: 1.5; margin: 0; }
.post-list { max-width: var(--content); margin: 0 auto; padding: 20px 24px 96px; }
.post-card { display: block; padding: 34px 0; border-bottom: 1px solid var(--rule); text-decoration: none; color: inherit; }
.post-card:first-child { border-top: 1px solid var(--rule); }
.post-card h2 { font-size: 27px; line-height: 1.22; font-weight: 700; letter-spacing: -0.012em; margin: 0 0 10px; transition: color 0.15s; }
.post-card:hover h2 { color: var(--accent); }
.post-card .excerpt { font-size: 18px; color: var(--ink-soft); line-height: 1.55; margin: 0 0 12px; }
.post-card .meta { font-family: var(--sans); font-size: 13.5px; color: var(--ink-faint); }
.coming-soon { font-family: var(--sans); font-size: 15px; color: var(--ink-faint); margin: 8px 0 18px; }
.topic-list { font-family: var(--sans); }
.topic-list li { color: var(--ink-soft); }

@media (max-width: 640px) {
  body { font-size: 18px; }
  .article { padding: 34px 20px 64px; }
  .prose p, .prose .lead { font-size: 18.5px; }
  .prose h2 { font-size: 26px; }
  .prose h3 { font-size: 21px; }
  .dek { font-size: 20px; }
}
