/* rknepp.com. One stylesheet, no build step, no web fonts. */

:root {
  --bg: #fbfaf7;
  --surface: #f2f0ea;
  --text: #1c1c1a;
  --muted: #5a5954;
  --rule: #dedbd2;
  --accent: #0a6464;
  --accent-hover: #074848;
  --code-bg: #f2f0ea;

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Liberation Sans", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", "DejaVu Sans Mono", Menlo, Consolas, monospace;

  --measure: 42rem;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: 2.1rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413;
    --surface: #1d1d1b;
    --text: #e7e5df;
    --muted: #a6a39b;
    --rule: #33322f;
    --accent: #6cc6c4;
    --accent-hover: #9adbd9;
    --code-bg: #1d1d1b;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.65;
  overflow-wrap: break-word;
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1rem;
}

/* Skip link: visible only on focus */
.skip {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  padding: 0.5rem 0.75rem;
  background: var(--text);
  color: var(--bg);
  z-index: 10;
}
.skip:focus { top: 0.5rem; }

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }
a:focus-visible, .skip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}
.site-name {
  color: var(--text);
  font-weight: 650;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.site-name:hover { color: var(--accent); }
.site-header ul {
  display: flex;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--step--1);
}
.site-header nav a {
  color: var(--muted);
  text-decoration: none;
}
.site-header nav a:hover { color: var(--accent); text-decoration: underline; }

/* Main */
main.wrap {
  padding-top: 3rem;
  padding-bottom: 4rem;
}

h1, h2, h3 {
  line-height: 1.25;
  letter-spacing: -0.015em;
  font-weight: 650;
}
h1 { font-size: var(--step-3); margin: 0 0 1rem; }
h2 { font-size: var(--step-1); margin: 3rem 0 1rem; }
h3 { font-size: var(--step-0); margin: 2rem 0 0.5rem; }

p, ul, ol, table, pre, blockquote { margin: 0 0 1.1rem; }

.intro p { font-size: 1.125rem; }
.intro p:first-of-type { font-size: var(--step-1); line-height: 1.5; color: var(--text); }

section + section h2,
#contact h2 {
  padding-top: 0.25rem;
}

/* Lists of posts */
.post-list {
  list-style: none;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.post-list li {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--rule);
}
.post-list p { margin: 0.25rem 0 0; color: var(--muted); }
.post-title {
  font-weight: 600;
  font-size: 1.1rem;
}

.meta {
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  align-items: baseline;
}
.post-list .meta { margin-top: 0.4rem; }

.status {
  display: inline-block;
  padding: 0 0.45rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  font-size: 0.78rem;
  line-height: 1.6;
  text-transform: lowercase;
}

.note { color: var(--muted); font-size: var(--step--1); }

/* Contact */
.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.contact-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
  padding: 0.35rem 0;
}
.label {
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--muted);
  min-width: 5.5rem;
}

/* Article */
.post-header { margin-bottom: 2.5rem; }
.post-header h1 { margin-bottom: 0.5rem; }
.post-header .repo { margin: 0.75rem 0 0; font-size: var(--step--1); display: flex; flex-wrap: wrap; gap: 0 1rem; }
.post-header .repo .label { min-width: 0; }

.prose h2 { margin-top: 2.5rem; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin: 0.25rem 0; }
.prose li > p { margin: 0; }
.prose img { max-width: 100%; height: auto; }

.prose blockquote {
  margin-left: 0;
  padding: 0.25rem 0 0.25rem 1rem;
  border-left: 3px solid var(--rule);
  color: var(--muted);
}

/* Tables scroll inside their own box rather than widening the page */
.prose table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: var(--step--1);
  max-width: 100%;
}
.prose th, .prose td {
  text-align: left;
  padding: 0.45rem 0.9rem 0.45rem 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.prose th { font-weight: 600; }

/* Code */
code, pre, kbd, samp { font-family: var(--mono); font-size: 0.9em; }
:not(pre) > code {
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  overflow-wrap: anywhere;
}
pre {
  background: var(--code-bg);
  padding: 0.9rem 1rem;
  border-radius: 4px;
  border: 1px solid var(--rule);
  overflow-x: auto;
  line-height: 1.5;
  font-size: 0.85rem;
}
pre code { font-size: inherit; background: none; padding: 0; }
/* Zola's giallo highlighter sets its own pre background; keep ours */
pre.giallo { background: var(--code-bg) !important; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: var(--step--1);
}
.site-footer .wrap { padding-top: 1.5rem; padding-bottom: 2rem; }
.site-footer p { margin: 0; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

@media (min-width: 48rem) {
  main.wrap { padding-top: 4.5rem; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

@media print {
  .site-header nav, .site-footer, .skip { display: none; }
  body { background: #fff; color: #000; }
  a { color: #000; }
  pre { white-space: pre-wrap; }
}
