@font-face {
  font-family: "Inter";
  src: url("/fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #fafaf8;
  --fg: #191918;
  --muted: #6b6b66;
  --faint: #a2a29c;
  --line: #e6e6e1;
  --tint: #f1f1ed;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111110;
    --fg: #ecece9;
    --muted: #9b9b95;
    --faint: #67675f;
    --line: #262624;
    --tint: #1b1b1a;
  }
}

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

html {
  font-family: var(--sans);
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv05", "cv08", "ss03";
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-size: 1rem;
  line-height: 1.6;
}

::selection { background: var(--fg); color: var(--bg); }

a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; border-radius: 2px; }

.wrap {
  max-width: 42rem;
  margin: 0 auto;
  padding: 5rem 1.5rem 3rem;
}

/* ---------- header / footer ---------- */

header.site {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-bottom: 4.5rem;
}

.name {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.011em;
}

.links { display: flex; gap: 1.25rem; }
.links a, footer.site a, .more a, .back a { color: var(--muted); transition: color 0.15s; }
.links a:hover, footer.site a:hover, .more a:hover, .back a:hover { color: var(--fg); }

footer.site {
  display: flex;
  justify-content: space-between;
  margin-top: 6rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 0.8125rem;
}

/* ---------- home ---------- */

section + section { margin-top: 4rem; }

.label {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
}

.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.list li { border-bottom: 1px solid var(--line); }

.row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.9rem 0;
}

.row .title { font-weight: 500; letter-spacing: -0.006em; }
.row time {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.row:hover .title, .row:hover .repo-name {
  text-decoration: underline;
  text-decoration-color: var(--faint);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.repo { flex-wrap: wrap; gap: 0.2rem 1.5rem; }
.repo-name { font-family: var(--mono); font-size: 0.9rem; font-weight: 500; }
.repo-meta { color: var(--faint); font-size: 0.8125rem; white-space: nowrap; }
.repo-desc {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.more { margin: 1rem 0 0; font-size: 0.875rem; }
.empty { color: var(--muted); }

.draft {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0 0.4rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  vertical-align: 0.15em;
}

/* ---------- post ---------- */

.post h1 {
  margin: 0 0 0.6rem;
  font-size: 2rem;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.post h1 .draft { font-size: 0.75rem; vertical-align: 0.5em; }

.meta {
  margin: 0 0 2.75rem;
  color: var(--muted);
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}

.prose { font-size: 1.0625rem; line-height: 1.72; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre, .prose table { margin: 0 0 1.35rem; }

.prose h2, .prose h3 { letter-spacing: -0.015em; line-height: 1.3; text-wrap: balance; }
.prose h2 { margin: 2.75rem 0 0.9rem; font-size: 1.3rem; font-weight: 600; }
.prose h3 { margin: 2.25rem 0 0.75rem; font-size: 1.1rem; font-weight: 600; }

.prose a {
  text-decoration: underline;
  text-decoration-color: var(--faint);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: text-decoration-color 0.15s;
}
.prose a:hover { text-decoration-color: var(--fg); }

.prose strong { font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin: 0.4rem 0; }
.prose li::marker { color: var(--faint); }

.prose blockquote {
  margin-left: 0;
  padding-left: 1.1rem;
  border-left: 2px solid var(--line);
  color: var(--muted);
}
.prose blockquote p:last-child { margin-bottom: 0; }

.prose code {
  font-family: var(--mono);
  font-size: 0.85em;
  padding: 0.12em 0.35em;
  background: var(--tint);
  border-radius: 4px;
}
.prose pre {
  overflow-x: auto;
  padding: 1rem 1.15rem;
  background: var(--tint);
  border-radius: 6px;
  font-size: 0.875rem;
  line-height: 1.6;
}
.prose pre code { padding: 0; background: none; font-size: inherit; }

.prose img, .prose video { display: block; max-width: 100%; height: auto; border-radius: 6px; }

/* Figures may run a little wider than the text on big screens. */
.prose figure {
  width: min(calc(100vw - 3rem), 52rem);
  margin: 2.25rem 0 2.25rem 50%;
  transform: translateX(-50%);
}
.prose figure img { width: 100%; background: #fcfcfb; }
.prose figcaption { margin-top: 0.6rem; color: var(--muted); font-size: 0.875rem; text-align: center; }

.prose table {
  display: block;
  overflow-x: auto;
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.5;
}
.prose th, .prose td {
  padding: 0.55rem 1rem 0.55rem 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.prose th { font-weight: 600; }

.prose hr { margin: 2.75rem 0; border: 0; border-top: 1px solid var(--line); }

.link-coming { color: var(--faint); }

.back { margin: 3.5rem 0 0; font-size: 0.9375rem; }

/* ---------- small screens ---------- */

@media (max-width: 34rem) {
  .wrap { padding-top: 3rem; }
  header.site { margin-bottom: 3rem; }
  .post h1 { font-size: 1.65rem; }
  .prose { font-size: 1rem; }
  .row:not(.repo) { flex-direction: column; gap: 0.15rem; }
}
