:root {
  /* Shared with the current christopherbrown.io landing page. */
  --paper: #f7f2e9;
  --paper-bright: #fffdf8;
  --ink: #22313b;
  --ink-soft: #657078;
  --teal: #247a76;
  --mustard: #e5ae3f;
  --line: #d1d7cf;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-rounded, "Avenir Next", "Trebuchet MS", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  scrollbar-color: var(--ink-soft) var(--paper);
  scrollbar-gutter: stable;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  padding-inline: max(1.25rem, env(safe-area-inset-left, 0px)) max(1.25rem, env(safe-area-inset-right, 0px));
  background: var(--paper);
  font-size: 1rem;
  line-height: 1.65;
}

::selection { background: var(--mustard); color: var(--ink); }

a {
  color: var(--teal);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
  transition: color 160ms ease;
}

a:hover { color: var(--ink); }

a:focus-visible {
  border-radius: 0.2rem;
  outline: 3px solid var(--mustard);
  outline-offset: 4px;
}

svg { display: block; flex: none; }

.skip-link {
  position: fixed;
  top: 0.8rem;
  left: 0.8rem;
  z-index: 20;
  padding: 0.65rem 0.85rem;
  border-radius: 0.55rem;
  background: var(--ink);
  color: var(--paper-bright);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-180%);
}

.skip-link:focus { transform: translateY(0); }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: min(100%, 52rem);
  margin-inline: auto;
  padding-block: max(1.5rem, env(safe-area-inset-top, 0px)) 0.75rem;
}

.site-name {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: -0.015em;
  text-decoration: none;
}

.site-name:hover { color: var(--teal); }
.site-nav { display: flex; align-items: center; gap: 1.4rem; }

.site-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding-block: 0.5rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
}

.site-nav a:hover, .site-nav a[aria-current] { color: var(--teal); }
.site-nav a[aria-current] { text-decoration: underline; text-decoration-thickness: 2px; }
.feed-link { gap: 0.35rem; }
.feed-link svg { width: 1rem; height: 1rem; }

.blog-main {
  flex: 1;
  width: min(100%, 52rem);
  margin-inline: auto;
  padding-block: clamp(2.5rem, 6vh, 4rem) 4rem;
}

.blog-hero {
  margin-bottom: 2.5rem;
}

.blog-hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(3.5rem, 7vw, 5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.blog-hero__intro { color: var(--ink-soft); font-size: 1.1rem; line-height: 1.7; }
.blog-hero__intro p { margin: 0; }
.blog-hero__intro a { color: inherit; }
.blog-hero__intro a:hover { color: var(--teal); }

.post-index { padding-top: 2rem; border-top: 1px solid var(--line); }
.post-index__heading { margin: 0 0 0.5rem; font-size: 1.4rem; font-weight: 750; }
.post-list { margin: 0; padding: 0; list-style: none; }
.post-preview { padding-block: 1.9rem; border-bottom: 1px solid var(--line); }
.post-preview:last-child { border-bottom: 0; }
.post-preview time { color: var(--ink-soft); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.post-preview__title { margin: 0.35rem 0 0.6rem; font-size: clamp(1.45rem, 3vw, 1.85rem); font-weight: 750; line-height: 1.3; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.post-preview__title a { display: inline-block; color: var(--ink); text-decoration: none; }
.post-preview__title a:hover { color: var(--teal); text-decoration: underline; }
.post-preview__excerpt { max-width: 70ch; color: var(--ink-soft); line-height: 1.75; overflow-wrap: anywhere; }
.post-preview__excerpt p { margin: 0; }
.empty-state h2 { margin: 0 0 0.5rem; font-size: 1.4rem; font-weight: 750; letter-spacing: -0.015em; }
.empty-state p { margin: 0; color: var(--ink-soft); }

.reading-page { max-width: 70ch; margin-inline: auto; }
.article-header { margin-bottom: 2.5rem; }
.article-header h1 { margin: 0; font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 800; line-height: 1.15; letter-spacing: -0.03em; text-wrap: balance; overflow-wrap: anywhere; }
.article-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1rem 0 0; color: var(--ink-soft); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.back-link { display: inline-flex; align-items: center; gap: 0.45rem; min-height: 44px; margin-bottom: 1.5rem; font-size: 0.9rem; font-weight: 700; text-decoration: none; }
.back-link svg { width: 1.1rem; height: 1.1rem; }

.prose { font-size: 1.1rem; line-height: 1.8; overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p, .prose ul, .prose ol { margin-block: 0 1.4rem; }
.prose ul, .prose ol { padding-left: 1.5rem; }
.prose li + li { margin-top: 0.4rem; }
.prose li::marker { color: var(--teal); }
.prose h2, .prose h3, .prose h4 { margin: 2.5rem 0 0.8rem; color: var(--ink); font-weight: 750; line-height: 1.3; letter-spacing: -0.02em; text-wrap: balance; }
.prose h2 { font-size: 1.8rem; }
.prose h3 { font-size: 1.4rem; }
.prose h4 { font-size: 1.15rem; }
.prose img { display: block; max-width: 100%; height: auto; margin: 1.8rem auto; border-radius: 0.75rem; }
.prose figure { margin: 2rem 0; }
.prose figcaption { margin-top: 0.75rem; color: var(--ink-soft); font-size: 0.9rem; text-align: center; }
.prose blockquote { margin: 1.8rem 0; padding: 1.25rem 1.5rem; border-radius: 0.75rem; background: var(--paper-bright); color: var(--teal); }
.prose blockquote > :last-child { margin-bottom: 0; }
.prose hr { height: 1px; margin: 2.5rem 0; border: 0; background: var(--line); }
.prose table { display: block; max-width: 100%; margin-block: 1.8rem; border-collapse: collapse; overflow-x: auto; font-size: 0.95rem; }
.prose th, .prose td { min-width: 9rem; padding: 0.7rem 1rem; border-bottom: 1px solid var(--line); text-align: left; overflow-wrap: normal; word-break: normal; }
.prose th { background: var(--paper-bright); font-weight: 750; }
.prose code { padding: 0.15em 0.3em; border-radius: 0.25rem; background: var(--paper-bright); font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 0.85em; }
.prose pre { max-width: 100%; margin-block: 1.8rem; padding: 1.25rem; border: 1px solid var(--line); border-radius: 0.75rem; background: var(--paper-bright); line-height: 1.7; overflow-x: auto; overflow-wrap: normal; }
.prose pre code { padding: 0; border-radius: 0; background: transparent; font-size: 0.9rem; }
.highlight .c, .highlight .c1, .highlight .cm { color: var(--ink-soft); }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .nt { color: var(--teal); font-weight: 700; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .na { color: #9d3b20; }
.highlight .m, .highlight .mi, .highlight .mf { color: #976000; }

.post-navigation { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 2rem; margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.post-navigation a { display: flex; flex-direction: column; gap: 0.35rem; font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.post-navigation a:hover { text-decoration: underline; }
.post-navigation__label { color: var(--ink-soft); font-size: 0.8rem; font-weight: 400; }

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  padding-block: 1rem calc(1.3rem + env(safe-area-inset-bottom, 0px));
  color: var(--ink-soft);
  font-size: 0.72rem;
}

@media (max-width: 640px) {
  .site-header { gap: 0.6rem; padding-top: max(1rem, env(safe-area-inset-top, 0px)); }
  .site-name { max-width: 10rem; font-size: 0.9rem; line-height: 1.3; }
  .site-nav { gap: 0.85rem; }
  .site-nav a { font-size: 0.8rem; }
  .blog-main { padding-block: 2rem 3rem; }
  .blog-hero h1 { font-size: 3.5rem; }
  .blog-hero__intro { font-size: 1rem; }
  .post-index { padding-top: 1.5rem; }
  .article-header { margin-bottom: 2rem; }
  .article-header h1 { font-size: 2.4rem; }
  .prose { font-size: 1rem; line-height: 1.8; }
  .prose blockquote { padding: 1rem; }
  .prose h2 { font-size: 1.55rem; }
}

@media (max-width: 360px) {
  .site-header { align-items: flex-start; }
  .site-name { padding-top: 0.65rem; max-width: 7.5rem; }
  .site-nav { gap: 0.65rem; }
  .feed-link span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .feed-link { min-width: 1.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
