:root {
  --bg: #f4efe4;
  --bg-2: #ebe4d4;
  --ink: #1c1712;
  --muted: #5c5348;
  --line: #d7cbb6;
  --accent: #9a3412;
  --accent-ink: #7c2d12;
  --focus: #1c1712;
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --body: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --read: 76rem;
  --page: 76rem;
  --ease: 160ms ease;
}

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

html {
  scroll-behavior: smooth;
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.7;
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  text-wrap: pretty;
  overflow-wrap: break-word;
}

::selection {
  background: #ead7c3;
}

img {
  max-width: 100%;
  height: auto;
}

code {
  font-family: var(--mono);
  font-size: 0.84em;
  background: var(--bg-2);
  padding: 0.08em 0.28em;
}

a {
  color: var(--accent);
  text-underline-offset: 0.16em;
}

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

:focus-visible {
  outline: 0.14rem solid var(--focus);
  outline-offset: 0.16rem;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
}

.skip-link:focus {
  top: 0.7rem;
}

.wrap {
  width: min(var(--page), calc(100% - 2rem));
  margin-inline: auto;
  min-width: 0;
}

.site-header {
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 0 1.05rem;
}

.logo {
  text-decoration: none;
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.28rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1;
}

.logo span {
  display: block;
  margin-top: 0.22rem;
  color: var(--muted);
  font-family: var(--body);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.nav {
  display: flex;
  flex-shrink: 0;
  gap: 1.15rem;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.35rem 0.1rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.28em;
}

.hero {
  padding: 2.4rem 0 1.8rem;
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-family: var(--display);
  font-size: clamp(2.1rem, 5vw, 3.15rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.lede {
  margin: 0;
  max-width: 48rem;
  color: var(--muted);
  font-size: 1.12rem;
}

.posts {
  display: grid;
  gap: 0;
  padding-bottom: 4rem;
  border-top: 1px solid var(--ink);
}

.post {
  padding: 1.35rem 0 1.4rem;
  border-bottom: 1px solid var(--line);
}

.post__meta {
  margin: 0 0 0.4rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.post h2 {
  margin: 0 0 0.4rem;
  font-family: var(--display);
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.post h2 a {
  color: inherit;
  text-decoration: none;
  overflow-wrap: break-word;
}

.post h2 a:hover {
  color: var(--accent);
}

.post p {
  margin: 0;
  max-width: 52rem;
  color: var(--muted);
}

.page-prose {
  padding: 2.2rem 0 4rem;
  max-width: none;
}

.page-prose h1,
.essay h1 {
  margin: 0 0 0.85rem;
  font-family: var(--display);
  font-size: clamp(2rem, 4.6vw, 2.85rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.page-prose h2,
.essay h2 {
  margin: 2.1rem 0 0.65rem;
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.page-prose h3,
.essay h3 {
  margin: 1.4rem 0 0.4rem;
  font-size: 1.08rem;
}

.page-prose p,
.essay p {
  margin: 0 0 1rem;
}

.kicker {
  margin: 0 0 0.45rem;
  color: var(--accent);
  font-size: 0.82rem;
}

.updated {
  display: inline-block;
  margin: 0 0 0.8rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.crumb {
  margin: 0 0 1.1rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.crumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.crumb li:not(:last-child)::after {
  content: "/";
  margin-left: 0.45rem;
  color: var(--line);
}

.crumb a {
  color: var(--muted);
  text-decoration: none;
}

.crumb a:hover {
  color: var(--accent);
}

.read-progress {
  position: sticky;
  top: 0;
  z-index: 8;
  height: 0.18rem;
  background: var(--line);
}

.read-progress span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
}

.article-page {
  padding: 1.6rem 0 4.2rem;
}

.essay header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.byline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.byline a {
  color: inherit;
}

.essay .dek {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 1.12rem;
}

.essay .lead {
  font-size: 1.14rem;
}

.how-built,
.intent,
.callout,
.checklist {
  margin: 0 0 1.35rem;
  padding: 0.95rem 1rem;
  background: var(--bg-2);
  border-left: 0.22rem solid var(--accent);
}

.how-built p,
.intent p {
  margin: 0.35rem 0 0;
}

.how-built p:first-child,
.intent p:first-child,
.callout p:first-child,
.checklist p:first-child {
  margin-top: 0;
}

.pull {
  margin: 1.4rem 0;
  padding-left: 1rem;
  border-left: 0.16rem solid var(--accent);
  font-family: var(--display);
  font-size: 1.25rem;
  font-style: italic;
  line-height: 1.4;
}

.app-examples {
  margin: 0 0 1.5rem;
  padding: 0.9rem 1rem 1rem;
  background: var(--bg-2);
  border: 1px solid var(--line);
}

.app-examples__kicker {
  margin: 0 0 0.7rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.app-examples ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13.2rem, 1fr));
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.app-examples li {
  margin: 0;
}

.app-examples a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 3.75rem;
  padding: 0.4rem 0.55rem;
  background: var(--bg);
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--line);
}

.app-examples a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.app-examples img {
  width: 3rem;
  height: 3rem;
  object-fit: contain;
  background: #fff;
  flex-shrink: 0;
}

.app-examples span {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-family: var(--display);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.2;
}

.app-examples span small {
  display: block;
  margin-top: 0.16rem;
  color: var(--muted);
  font-family: var(--body);
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.3;
}

.app-examples a:hover span small {
  color: inherit;
}

.faq-list {
  margin: 1rem 0 1.6rem;
}

.faq-list details {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
}

.faq-list details:first-of-type {
  border-top: 1px solid var(--line);
}

.faq-list summary {
  cursor: pointer;
  min-height: 2.75rem;
  padding: 0.35rem 0;
  font-family: var(--display);
  font-weight: 600;
}

.faq-list details p {
  margin: 0.5rem 0 0.1rem;
}

.essay ul,
.essay ol,
.checklist ul,
.page-prose ul {
  margin: 0.3rem 0 1rem;
  padding-left: 1.2rem;
}

.essay li,
.checklist li,
.page-prose li {
  margin: 0.28rem 0;
}

.table-wrap {
  overflow-x: auto;
  margin: 1rem 0 1.4rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.98rem;
}

th,
td {
  padding: 0.5rem 0.55rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

caption {
  caption-side: top;
  text-align: left;
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 0.82rem;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.related {
  margin-top: 2.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ink);
}

.related h2 {
  margin-top: 0;
}

.lost {
  min-height: 58vh;
  display: grid;
  align-content: center;
  padding: 2rem 0 4rem;
}

.lost h1 {
  margin: 0 0 0.7rem;
  font-family: var(--display);
  font-size: clamp(2.2rem, 7vw, 3.4rem);
}

.site-footer {
  border-top: 1px solid var(--ink);
  padding: 1.4rem 0 2rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.8rem 1.4rem;
}

.site-footer p,
.site-footer nav {
  min-width: 0;
}

.site-footer p {
  margin: 0;
  max-width: 40rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.1rem;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--ink);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent);
  text-decoration: underline;
}

@media (max-width: 879px) {
  .site-header__inner {
    flex-wrap: wrap;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  h1,
  h2,
  h3 {
    text-wrap: wrap;
  }

  .site-header__inner {
    flex-direction: column;
    gap: 0.7rem;
    padding-bottom: 1.15rem;
  }

  .nav {
    gap: 1.35rem;
  }
}

@media print {
  .site-header,
  .site-footer,
  .read-progress,
  .skip-link {
    display: none;
  }

  body {
    background: #fff;
    color: #111;
    font-size: 12pt;
  }

  a {
    color: inherit;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .read-progress span {
    transform: none;
  }
}
