/* Based on the Lovable "Writing" design. Fonts are self-hosted (see eleventy.config.js). */

@font-face { font-family: "Fraunces"; font-weight: 500; font-display: swap; src: url("/assets/fonts/fraunces-500.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-weight: 600; font-display: swap; src: url("/assets/fonts/fraunces-600.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 400; font-display: swap; src: url("/assets/fonts/source-sans-400.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 600; font-display: swap; src: url("/assets/fonts/source-sans-600.woff2") format("woff2"); }

:root {
  color-scheme: light dark;
  --bg: #f6f4ef; --surface: #efece5; --text: #24262b; --muted: #6b6e74; --line: #dcd8cf;
  --accent: #1f7a6b; --accent-soft: #1f7a6b1a;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Source Sans 3", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #16191c; --surface: #1d2125; --text: #e4e6e3; --muted: #979c9d; --line: #2c3236; --accent: #7fe0c3; --accent-soft: #7fe0c31f; }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 1.0625rem/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
h1, h2 { font-family: var(--serif); font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin: 0 0 1.5rem; }

/* Frame */
header.site, main, footer.site { max-width: 60rem; margin: 0 auto; padding: 0 1.5rem; }
header.site { display: flex; justify-content: space-between; align-items: baseline; padding-top: 2rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.brand { font: 600 1.35rem var(--serif); color: var(--text); text-decoration: none; }
header nav a { margin-left: 1.5rem; color: var(--muted); text-decoration: none; font-weight: 600; }
header nav a:hover, header nav a[aria-current] { color: var(--accent); }
main { padding-top: 3rem; padding-bottom: 4rem; min-height: 70vh; }
footer.site { padding-top: 1.5rem; padding-bottom: 2.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }

/* Index & topic pages */
.layout { display: grid; grid-template-columns: 1fr 14rem; gap: 4rem; }
@media (max-width: 760px) { .layout { grid-template-columns: 1fr; gap: 2.5rem; } }
.eyebrow { margin: 0 0 0.25rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.78rem; font-weight: 600; }
.posts { list-style: none; margin: 0; padding: 0; }
.posts li { display: flex; gap: 1.5rem; align-items: baseline; padding: 0.85rem 0; border-bottom: 1px solid var(--line); }
.posts time { flex: 0 0 auto; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.95rem; }
.posts a { color: var(--text); text-decoration: none; font-weight: 600; }
.posts a:hover { color: var(--accent); }
.topics { align-self: start; background: var(--surface); border-radius: 10px; padding: 1.25rem 1.5rem; }
.topics h2 { font-size: 1.1rem; margin: 0 0 0.75rem; }
.topics ul { list-style: none; margin: 0; padding: 0; }
.topics a { display: block; padding: 0.3rem 0; color: var(--text); text-decoration: none; }
.topics a span { color: var(--muted); }
.topics a:hover, .topics a[aria-current] { color: var(--accent); }
.topics a[aria-current] { font-weight: 600; }

/* Post */
.post { max-width: 42rem; }
.post h1 { margin-bottom: 0.75rem; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1rem; padding: 0; }
.tags a { display: inline-block; padding: 0.15rem 0.7rem; border-radius: 999px; background: var(--accent-soft); text-decoration: none; font-size: 0.88rem; font-weight: 600; }
.date { display: block; color: var(--muted); font-variant-numeric: tabular-nums; margin-bottom: 2rem; }
.pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; padding: 1rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 3rem; }
.pager a { max-width: 100%; text-decoration: none; font-weight: 600; }
.pager small { display: block; color: var(--muted); font-weight: 400; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; }
.pager .next { margin-left: auto; text-align: right; }

/* Post body (Markdown output) */
.prose h2 { font-size: 1.4rem; margin: 2.25rem 0 0.5rem; }
.prose h3 { font-size: 1.1rem; margin: 1.75rem 0 0.4rem; }
.prose blockquote { margin: 1.75rem 0; padding: 0.25rem 0 0.25rem 1.25rem; border-left: 3px solid var(--accent); font: 500 1.2rem/1.5 var(--serif); }
.prose blockquote p { margin: 0; }
.prose img { max-width: 100%; height: auto; border-radius: 8px; }
.prose code { font-family: var(--mono); font-size: 0.9em; background: var(--surface); padding: 0.1em 0.35em; border-radius: 4px; }
.prose pre { background: var(--surface); padding: 1rem 1.25rem; border-radius: 8px; overflow-x: auto; line-height: 1.5; }
.prose pre code { background: none; padding: 0; font-size: 0.88rem; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

/* About */
.profile { display: grid; grid-template-columns: 200px 1fr; gap: 3rem; align-items: start; max-width: 46rem; }
@media (max-width: 640px) { .profile { grid-template-columns: 1fr; } }
.profile img { width: 200px; height: 200px; border-radius: 50%; border: 4px solid var(--surface); outline: 1px solid var(--line); }
.lead { font-size: 1.2rem; }
.facts { list-style: none; padding: 0; margin: 2rem 0 0; border-top: 1px solid var(--line); }
.facts li { padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.facts span { display: inline-block; width: 8rem; color: var(--muted); }
