@font-face {
  font-family: "Public Sans Local";
  src: url("/assets/fonts/PublicSans-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Public Sans Local";
  src: url("/assets/fonts/PublicSans-SemiBold.woff2") format("woff2");
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #fff;
  --ink: #24221f;
  --muted: #77736a;
  --rule: #e5e0d7;
  --orange: #d95f28;
  --sans: "Public Sans Local", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration-color: #c8c0b4;
  text-underline-offset: 0.2em;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}

a:hover {
  color: var(--orange);
  text-decoration-color: currentColor;
}

a:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 4px;
  border-radius: 2px;
}

.top-rule {
  height: 2px;
  background: var(--orange);
}

.site-frame {
  width: min(100% - 48px, 760px);
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 27px 0 24px;
  border-bottom: 1px solid var(--rule);
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.brand-name {
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0;
}

.site-brand img {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 25px;
}

.site-nav a {
  position: relative;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
}

.site-nav a[aria-current="page"]::after {
  position: absolute;
  right: 0;
  bottom: -25px;
  left: 0;
  height: 2px;
  background: var(--orange);
  content: "";
}

.main-content {
  min-height: 65vh;
  padding: 0 0 64px;
}

.home-intro {
  padding: 67px 0 58px;
  border-bottom: 1px solid var(--rule);
}

.home-intro h1,
.info-page h1,
.article-header h1 {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(39px, 7vw, 56px);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.08;
}

.intro-copy {
  max-width: 570px;
  margin: 21px 0 0;
  color: #5f5b54;
  font-size: 17px;
  line-height: 1.75;
}

.post-list {
  padding-top: 38px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 7px;
}

.section-heading h2 {
  margin: 0;
  font-family: var(--sans);
  font-size: 23px;
  font-weight: 400;
  letter-spacing: -0.025em;
}

.post-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: baseline;
  gap: 20px;
  padding: 19px 0 20px;
  border-bottom: 1px solid var(--rule);
}

.post-date {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.post-row h2 {
  margin: 0;
  font-family: var(--sans);
  font-size: 19px;
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.4;
}

.post-row h2 a {
  text-decoration: none;
}

.pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding-top: 25px;
  font-size: 13px;
}

.pagination a:last-of-type {
  justify-self: end;
}

.page-count {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.info-page {
  max-width: 650px;
  padding: 64px 0 8px;
}

.info-page h1 {
  margin-bottom: 25px;
}

.info-page > p {
  margin: 0 0 19px;
  color: #555149;
  font-size: 16px;
  line-height: 1.8;
}

.article-header {
  max-width: 690px;
  padding: 59px 0 29px;
  border-bottom: 1px solid var(--rule);
}

.article-header h1 {
  max-width: 680px;
  font-size: clamp(36px, 6.5vw, 50px);
}

.article-meta {
  margin: 17px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.article-note {
  margin: 25px 0 0;
  padding: 13px 16px;
  border-left: 3px solid var(--orange);
  color: #66564a;
  background: #fff;
  font-size: 14px;
}

.article-note p {
  margin: 0;
}

.post-content {
  max-width: 690px;
  padding: 14px 0 24px;
  color: #393630;
  font-size: 16px;
  line-height: 1.82;
  overflow-wrap: anywhere;
}

.post-content > :first-child {
  margin-top: 0;
}

.post-content p,
.post-content ul,
.post-content ol,
.post-content blockquote,
.post-content table,
.post-content pre,
.post-content figure {
  margin-top: 1.35em;
  margin-bottom: 1.35em;
}

.post-content h2,
.post-content h3,
.post-content h4 {
  margin-top: 2em;
  margin-bottom: 0.65em;
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.3;
}

.post-content h2 { font-size: 29px; }
.post-content h3 { font-size: 23px; }
.post-content h4 { font-size: 19px; }

.post-content a {
  color: #a9471c;
  text-decoration-color: #dcb49d;
}

.post-content ul,
.post-content ol {
  padding-left: 1.4em;
}

.post-content ul { list-style: disc; }
.post-content ol { list-style: decimal; }

.post-content li + li {
  margin-top: 0.45em;
}

.post-content blockquote {
  padding: 2px 0 2px 19px;
  border-left: 2px solid #df9a72;
  color: #686158;
  font-family: var(--sans);
  font-size: 19px;
}

.post-content pre {
  max-width: 100%;
  padding: 18px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow-x: auto;
  background: #f0ede6;
  font-size: 13px;
  line-height: 1.6;
}

.post-content .highlight {
  margin: 1.35em 0;
  border-radius: 4px;
  overflow: auto;
  background: #282828;
}

.post-content .highlight pre {
  margin: 0;
  border: 0;
  border-radius: 0;
  color: #fbf1c7;
  background: #282828;
}

.post-content code {
  font-size: 0.88em;
}

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

.post-content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 14px;
}

.post-content th,
.post-content td {
  padding: 8px 11px;
  border: 1px solid var(--rule);
  text-align: left;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.book-entry {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--rule);
  background: #fff;
}

.book-entry h2 {
  display: inline;
  margin: 0 9px 0 0;
  font-family: var(--sans);
  font-size: 21px;
  font-weight: 400;
}

.book-type {
  color: var(--muted);
  font-size: 13px;
  font-style: italic;
}

.book-meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.book-notes {
  margin: 8px 0 0;
  color: #555149;
  font-size: 14px;
  line-height: 1.7;
}

.site-footer {
  display: flex;
  justify-content: flex-end;
  gap: 20px;
  padding: 18px 0 30px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 11px;
}

.site-footer a {
  text-decoration: none;
}

@media (max-width: 560px) {
  .site-frame {
    width: min(100% - 36px, 760px);
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
    padding: 22px 0 17px;
  }

  .site-nav {
    gap: 22px;
  }

  .site-nav a[aria-current="page"]::after {
    bottom: -18px;
  }

  .home-intro {
    padding: 48px 0 42px;
  }

  .intro-copy {
    font-size: 16px;
  }

  .post-row {
    grid-template-columns: 1fr;
    gap: 3px;
    padding: 15px 0 17px;
  }

  .book-grid {
    grid-template-columns: 1fr;
  }

  .article-header,
  .info-page {
    padding-top: 46px;
  }

  .post-content {
    font-size: 15px;
  }

  .pagination {
    gap: 8px;
    font-size: 12px;
  }
}

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