/* style.css — minimal normalize + system styles. No build step; loaded raw.
 *
 * CACHE BUSTING: pages link this as /style.css?v=N. After editing this file,
 * bump N in the <link> on EVERY page (index, about, 404, each post) so browsers
 * re-fetch instead of serving a stale cached copy. The ./push.sh helper reminds
 * you and fails if any page is missing the ?v= query string.
 */

/* --- normalize --- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { line-height: 1.6; -webkit-font-smoothing: antialiased; }
img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; }
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }

/* --- system theme --- */
:root {
  --fg: rgb(30, 30, 30);
  --muted: #6b6b6b;
  --accent: rgb(30, 30, 30);
  --bg: #ffffff;
  --rule: #e6e6e6;
  --code-bg: #f2f2f2;
}

/* --- layout --- */
body {
  color: var(--fg);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.05rem;
  max-width: 41rem;
  margin: 0 auto;
  padding: 3rem 1.25rem 6rem;
}

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration: none; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

h1, h2, h3, h4, h5, h6 { margin-top: 2rem; line-height: 1.25; }
main > :first-child, article > header:first-child h1 { margin-top: 0; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.1rem; }
p { margin-top: 1rem; }

/* --- site header --- */
.site-header { margin-bottom: 2.5rem; }
.site-header a { text-decoration: none; }
.site-nav { color: var(--muted); margin-top: 0.25rem; font-size: 0.95rem; }
.site-nav a { color: var(--muted); }

/* --- post list (home) --- */
.posts { list-style: none; padding: 0; margin-top: 2rem; }
.posts li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--rule);
}
.posts li:last-child { border-bottom: 1px solid var(--rule); }
.posts a { text-decoration: none; }
.posts a:hover { text-decoration: underline; }
.posts time { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }

/* --- individual post --- */
article header { margin-bottom: 2rem; }
article .meta { color: var(--muted); font-size: 0.9rem; margin-top: 0.5rem; }
article ul, article ol { margin-top: 1rem; }

article blockquote {
  margin: 1.5rem 0;
  padding-left: 1rem;
  border-left: 3px solid var(--rule);
  color: var(--muted);
  font-style: italic;
}

/* prose paragraphs: flush left, blank line between them */
article p { margin-top: 1rem; font-size: 1.15rem; }

/* --- figures: break out wider than the text column --- */
figure {
  /* full-bleed: escape the centered text column out to the viewport edges */
  width: 100vw;
  max-width: 100vw;
  margin-left: 50%;
  transform: translateX(-50%);
  margin-top: 6rem;
  margin-bottom: 6rem;
  padding: 0 1.25rem;
  text-align: center;
}
figure img {
  /* never upscale past natural size; cap height; center */
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(70vh, 800px);
  margin: 0 auto;
  border-radius: 6px;
}
figcaption {
  max-width: 41rem;
  margin: 0.3rem auto 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
  text-align: left;
}

/* --- footer --- */
.site-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer a { color: var(--muted); }
.site-footer > :last-child { text-align: right; } /* right column hugs the edge */
.footer-home { text-decoration: none; } /* arrow link, no underline */
