:root {
  --paper: #F5F1E8;
  --ink: #171A17;
  --green: #1D6157;
  --secondary-ink: #5E625D;
  --rule: #D8D1C3;
  --surface: #FFFDFC;
  --green-hover: #144B43;
  --disabled-ink: #686B65;
  --error: #9A3227;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "IBM Plex Sans", "Segoe UI", sans-serif;
  --page-width: 1120px;
  --reading-width: 70ch;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

html,
body,
#_kobweb-root {
  min-height: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--serif);
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--green);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

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

a:focus-visible,
button:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  min-height: 44px;
  padding: 12px 16px;
  color: var(--surface);
  background: var(--green-hover);
  font: 600 14px/20px var(--sans);
  transform: translateY(calc(-100% - 12px));
}

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

.site-shell {
  width: min(var(--page-width), calc(100% - 40px));
  margin: 0 auto;
}

.page-frame {
  min-width: 0;
  padding: 48px 0 72px;
}

.eyebrow,
.metadata,
.topic-list,
.utility-copy {
  font-family: var(--sans);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1.4;
  text-transform: uppercase;
}

.page-title,
.article-title,
.featured-title,
.row-title {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.025em;
}

.page-title {
  max-width: 18ch;
  font-size: clamp(42px, 7vw, 72px);
  line-height: 0.98;
}

.section-rule {
  margin: 0;
  border: 0;
  border-top: 1px solid var(--rule);
}

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

.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  font: 600 24px/1 var(--serif);
  letter-spacing: -0.02em;
  text-decoration: none;
}

.header-links,
.site-nav,
.utility-nav,
.footer-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.header-links {
  justify-content: flex-end;
  gap: 16px;
}

.site-nav,
.utility-nav,
.footer-nav {
  gap: 4px;
}

.site-nav a,
.utility-nav a,
.footer-nav a {
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  color: var(--secondary-ink);
  font: 500 14px/1.2 var(--sans);
  text-decoration: none;
}

.site-nav a:hover,
.utility-nav a:hover,
.footer-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--green-hover);
  text-decoration: underline;
}

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

.copyright {
  margin: 0;
  color: var(--secondary-ink);
  font: 400 13px/1.5 var(--sans);
}

.home-page,
.about-page {
  display: grid;
  gap: 48px;
}

.home-intro {
  max-width: 760px;
}

.home-statement,
.about-narrative {
  max-width: 60ch;
  margin: 24px 0 0;
  color: var(--secondary-ink);
  font-size: 21px;
  line-height: 1.65;
}

.featured-post {
  padding: 32px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.featured-title {
  max-width: 20ch;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.02;
}

.featured-title a,
.row-title a {
  color: inherit;
  text-decoration: none;
}

.featured-title a:hover,
.row-title a:hover {
  color: var(--green-hover);
  text-decoration: underline;
}

.featured-excerpt,
.row-excerpt {
  max-width: 62ch;
  color: var(--secondary-ink);
  line-height: 1.6;
}

.featured-excerpt {
  margin: 16px 0 0;
  font-size: 20px;
}

.metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 16px;
  color: var(--secondary-ink);
  font-size: 13px;
  line-height: 1.5;
}

.topic-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: 14px 0 0;
  padding: 0;
  color: var(--green);
  font-size: 13px;
  font-weight: 500;
  list-style: none;
}

.topic-list li + li::before {
  content: "/";
  margin-right: 12px;
  color: var(--rule);
}

.recent-writing,
.writing-list {
  display: grid;
  gap: 0;
}

.section-title {
  margin: 0 0 16px;
  font-size: 28px;
  line-height: 1.1;
}

.post-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  padding: 24px 0;
  border-top: 1px solid var(--rule);
}

.post-row-main {
  min-width: 0;
}

.row-title {
  font-size: clamp(25px, 3vw, 34px);
  line-height: 1.08;
}

.row-excerpt {
  margin: 10px 0 0;
  font-size: 17px;
}

.post-row > .metadata {
  justify-content: flex-end;
  margin-top: 4px;
  white-space: nowrap;
}

.home-about {
  max-width: 62ch;
  padding-left: 24px;
  border-left: 3px solid var(--green);
}

.home-about p {
  color: var(--secondary-ink);
  font-size: 18px;
  line-height: 1.65;
}

.home-about a,
.about-links a,
.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-right: 16px;
  font-family: var(--sans);
}

.about-page {
  max-width: 760px;
}

.about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--rule);
}

.writing-page {
  display: grid;
  gap: 40px;
}

.writing-intro {
  display: grid;
  gap: 0;
  max-width: 760px;
}

.writing-description {
  max-width: 58ch;
  margin: 20px 0 0;
  color: var(--secondary-ink);
  font-size: 19px;
  line-height: 1.65;
}

.writing-empty {
  padding: 28px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.not-found {
  max-width: 760px;
  padding: 32px 0;
}

.not-found-copy {
  max-width: 52ch;
  margin: 22px 0;
  color: var(--secondary-ink);
  font-size: 19px;
  line-height: 1.65;
}

.not-found-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.not-found-actions a,
.writing-empty a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-right: 16px;
  font-family: var(--sans);
}

.article-page {
  display: grid;
  gap: 32px;
}

.article-page > * {
  min-width: 0;
}

.article-header {
  width: min(100%, 860px);
  margin: 0 auto;
}

.article-title {
  max-width: 18ch;
  font-size: clamp(44px, 7vw, 76px);
  line-height: 0.98;
}

.article-dek {
  max-width: 58ch;
  margin: 20px 0 0;
  color: var(--secondary-ink);
  font-size: clamp(20px, 2.4vw, 25px);
  line-height: 1.5;
}

.article-metadata {
  margin-top: 20px;
}

.article-body {
  min-width: 0;
  width: min(100%, var(--reading-width));
  margin: 8px auto 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: max(19px, 1.1875rem);
  font-weight: 400;
  line-height: 1.7;
  overflow-wrap: break-word;
}

.article-body h2,
.article-body h3,
.article-body h4 {
  margin: 1.8em 0 0.6em;
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.12;
}

.article-body h2 {
  font-size: 1.75em;
}

.article-body h3 {
  font-size: 1.4em;
}

.article-body p,
.article-body ul,
.article-body ol,
.article-body blockquote,
.article-body pre,
.article-body table,
.article-body figure {
  margin: 0 0 1.35em;
}

.article-body ul,
.article-body ol {
  padding-left: 1.35em;
}

.article-body li + li {
  margin-top: 0.4em;
}

.article-body blockquote {
  padding: 0.15em 0 0.15em 1.2em;
  border-left: 3px solid var(--green);
  color: var(--secondary-ink);
}

.article-body a {
  color: var(--green);
  text-decoration: underline;
  overflow-wrap: anywhere;
}

.article-body pre,
.article-body table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.article-body pre {
  padding: 18px;
  color: var(--surface);
  background: var(--ink);
  font: 400 14px/1.55 ui-monospace, monospace;
  white-space: pre;
  overflow-wrap: normal;
}

.article-body code {
  font-family: ui-monospace, monospace;
  font-size: 0.84em;
}

.article-body :not(pre) > code {
  padding: 0.08em 0.28em;
  background: var(--rule);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
}

.article-body th,
.article-body td {
  min-width: 9rem;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  text-align: left;
}

.article-body th {
  background: var(--surface);
  font-weight: 600;
}

.article-cover-frame {
  width: min(100%, 960px);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--surface);
}

.article-cover {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: cover;
}

.cover-fallback {
  display: grid;
  place-items: center;
  min-height: 160px;
  max-height: 240px;
  padding: 24px;
  color: var(--secondary-ink);
  background: var(--surface);
  font: 500 14px/1.5 var(--sans);
  text-align: center;
}

.article-image {
  display: grid;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  margin-right: auto;
  margin-left: auto;
}

.article-image-inline {
  display: inline-grid;
  gap: 6px;
  max-width: 100%;
  vertical-align: middle;
}

.article-image img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
}

.article-image img[hidden],
.article-image-inline img[hidden] {
  display: none;
}

.article-image-caption {
  color: var(--secondary-ink);
  font: 400 14px/1.5 var(--sans);
}

.article-image-fallback {
  display: grid;
  place-items: center;
  min-height: 96px;
  max-height: 180px;
  padding: 20px;
  border: 1px solid var(--rule);
  color: var(--secondary-ink);
  background: var(--surface);
  font: 500 14px/1.5 var(--sans);
  text-align: center;
}

.article-image-fallback[hidden] {
  display: none;
}

.article-author {
  width: min(100%, var(--reading-width));
  margin: 16px auto 0;
  padding: 24px 0;
  border-top: 1px solid var(--rule);
}

.article-author h2 {
  margin: 0;
  font-size: 26px;
}

.article-author > p:not(.eyebrow) {
  max-width: 56ch;
  color: var(--secondary-ink);
  font-size: 17px;
  line-height: 1.6;
}

.article-author a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-right: 16px;
  font-family: var(--sans);
}

@media (max-width: 760px) {
  .site-header {
    align-items: flex-start;
    min-height: 0;
    padding: 12px 0;
  }

  .wordmark {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  .header-links {
    gap: 0;
  }

  .utility-nav {
    width: 100%;
    justify-content: flex-end;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .site-shell {
    width: min(100% - 24px, var(--page-width));
  }

  .page-frame {
    padding: 32px 0 52px;
  }

  .page-title {
    font-size: clamp(38px, 12vw, 54px);
  }
}

@media (max-width: 640px) {
  .home-page,
  .about-page {
    gap: 36px;
  }

  .post-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .post-row > .metadata {
    justify-content: flex-start;
    white-space: normal;
  }

  .featured-post {
    padding: 24px 0;
  }

  .home-statement,
  .about-narrative {
    font-size: 19px;
  }

  .article-page {
    gap: 24px;
  }

  .article-title {
    font-size: clamp(40px, 12vw, 58px);
  }

  .article-body {
    font-size: 19px;
    line-height: 1.7;
  }

  .article-cover {
    max-height: 240px;
  }

  .cover-fallback {
    min-height: 120px;
  }
}

@media (max-width: 520px) {
  .site-header {
    flex-direction: column;
    gap: 0;
  }

  .header-links,
  .site-nav,
  .utility-nav {
    width: 100%;
    justify-content: flex-start;
  }

  .site-nav a,
  .utility-nav a,
  .footer-nav a {
    padding-right: 16px;
    padding-left: 0;
  }
}

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