/* Shared typography and article styles. System fonts, no framework. */
:root {
  color-scheme: light dark;
  --serif: Charter, "Bitstream Charter", "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --text-font: var(--sans);
  font-family: var(--text-font);
  font-size: 17px;
  background: var(--paper);
  color: var(--ink);
}

* { box-sizing: border-box; }
body { margin: 0; line-height: 1.65; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible, [tabindex="0"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
::selection { background: var(--accent); color: var(--paper); }
button { font: inherit; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.16; }
h1 { font-size: clamp(2.4rem, 4.5vw, 3.3rem); letter-spacing: -.055em; font-weight: 550; }
h2 { font-size: 1.16rem; font-weight: 600; letter-spacing: -.025em; }
h3 { font-size: 1.04rem; font-weight: 600; letter-spacing: -.015em; }
main { min-width: 0; }
main:focus { outline: none; }
svg, img { max-width: 100%; height: auto; }

.skip-link { position: fixed; top: 12px; left: 12px; padding: .6rem 1rem; background: var(--ink); color: var(--paper); z-index: 20; transform: translateY(-180%); }
.skip-link:focus { transform: none; }
.eyebrow { font-family: var(--mono); font-size: .66rem; font-weight: 400; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.small-link { font-size: .76rem; text-underline-offset: .3em; }
.empty-state { color: var(--muted); font-size: .92rem; padding: .5rem 0; }

.project { padding: .4rem 0 1.35rem; }
.project + .project { border-top: 1px solid var(--rule); padding-top: 1.4rem; }
.project h3 a { text-decoration: none; }
.project h3 a:hover { text-decoration: underline; }
.project h3 span { font-size: .85em; color: var(--muted); }
.project p { color: var(--muted); font-size: .85rem; line-height: 1.6; margin: .55rem 0 .5rem; max-width: 35rem; }
.project .small-link { color: var(--accent); }
.writing-entry { padding: .5rem 0 1.5rem; }
.writing-entry h2, .writing-entry h3 { margin: .6rem 0; font-size: 1.45rem; line-height: 1.3; }
.writing-entry h3 a, .writing-entry h2 a { text-decoration: none; }
.writing-entry h3 a:hover, .writing-entry h2 a:hover { text-decoration: underline; }
.writing-entry p { font-size: .92rem; color: var(--muted); }
.writing-entry + .writing-entry { border-top: 1px solid var(--rule); padding-top: 1.5rem; }
.site-footer { margin-top: 4.5rem; padding: 1.35rem 0; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; font-size: .7rem; color: var(--muted); }
.site-footer div { display: flex; gap: 1.2rem; }

/* Markdown article content. */
.article-header { margin-bottom: 2.3rem; }
.article-header .eyebrow { margin-bottom: 1.1rem; }
.article-header h1 { text-wrap: balance; }
.article-meta { margin-top: 1.5rem; font-family: var(--mono); font-size: .68rem; color: var(--muted); }
.prose { font-family: var(--text-font); font-size: 1rem; line-height: 1.85; }
.prose > * + * { margin-top: 1.35rem; }
.prose h2 { margin-top: 2.8rem; font-size: 1.55rem; letter-spacing: -.025em; }
.prose h3 { margin-top: 2rem; font-size: 1.2rem; }
.prose :is(h2, h3) a { text-decoration: none; }
.prose :is(h2, h3) a:hover { text-decoration: underline; }
.prose :is(h2, h3, [id]) { scroll-margin-top: 2rem; }
.prose a { color: var(--accent); }
.prose p, .prose li { overflow-wrap: anywhere; }
.prose code { font-family: var(--mono); font-size: .82em; background: var(--wash); padding: .15em .3em; border-radius: 3px; overflow-wrap: anywhere; }
.prose pre { overflow-x: auto; padding: 1.4rem; border: 1px solid var(--rule); border-radius: 3px; font-size: .79rem; line-height: 1.8; }
.prose pre code { background: none; padding: 0; font-size: inherit; overflow-wrap: normal; }
.prose blockquote { margin-left: 0; margin-right: 0; padding: .15rem 0 .15rem 1.3rem; border-left: 3px solid var(--accent); font-family: var(--serif); font-size: 1.35rem; line-height: 1.5; }
.prose table { border-collapse: collapse; width: 100%; font-family: var(--sans); font-size: .8rem; line-height: 1.55; }
.prose th, .prose td { padding: .85rem .6rem; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.prose th { background: var(--wash); }
.prose th:first-child, .prose td:first-child { width: 35%; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose sup { line-height: 0; }
.prose .footnote-definition, .prose .footnotes { font-size: .8rem; color: var(--muted); }
.prose .footnotes { margin-top: 3rem; border-top: 1px solid var(--rule); padding-top: 1rem; }

@media (max-width: 620px) {
  h1 { font-size: 2.45rem; }
  .prose { font-size: 1rem; line-height: 1.8; }
  .prose pre { padding: 1rem; font-size: .72rem; }
}

@media print {
  :root { color-scheme: light; --paper: white; --ink: black; --muted: #444; --rule: #aaa; --accent: black; }
  .skip-link, .site-footer { display: none; }
  .prose pre { white-space: pre-wrap; }
  a { text-decoration: underline; }
}
