:root {
  --bg: #f7f2e7;
  --card: #fcfaf4;
  --line: #e4dbc7;
  --line-strong: #d4c8b0;
  --ink: #211d17;
  --muted: #665f52;
  --dim: #968c7a;
  --accent: #8a5a2b;
  --accent-border: rgba(138, 90, 43, 0.24);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Charter, Georgia, serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  --maxw: 980px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }

/* Header */
.hero {
  padding: 76px 0 36px;
}
.hero-nav { display: flex; align-items: baseline; justify-content: space-between; }
.blog-link { color: var(--accent); font: 14px var(--sans); text-underline-offset: 3px; }
.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px;
}
h1 {
  font-size: clamp(30px, 3.8vw, 42px);
  line-height: 1.1;
  margin: 0;
  font-weight: 400;
  letter-spacing: -0.01em;
}
.lede {
  margin: 12px 0 0;
  max-width: 54ch;
  font-size: 16.5px;
  line-height: 1.55;
  color: var(--muted);
  font-style: italic;
}

/* Ledger Section Header */
section { padding: 0; }
.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-strong);
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}
.sec-head h2 {
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  margin: 0;
  color: var(--muted);
}

/* Portfolio Rows */
.grid { display: block; }
.card {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  grid-template-areas:
    "logo name foot"
    "logo blurb foot";
  column-gap: 20px;
  row-gap: 3px;
  align-items: center;
  padding: 18px 16px 18px 18px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  transition: background-color 0.18s ease;
}
.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--accent);
  opacity: 0;
  transform: scaleY(0.65);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.card:hover,
.card:focus-within {
  background: var(--card);
}
.card:not(.is-static):hover::before,
.card:not(.is-static):focus-within::before {
  opacity: 1;
  transform: scaleY(1);
}
.card.is-inactive .logo-wrap {
  opacity: 0.68;
}

/* Logos */
.card-top { grid-area: logo; align-self: center; min-width: 0; }
.logo-wrap { width: 38px; height: 38px; display: grid; place-items: center; }
.logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 7px;
  opacity: 0.92;
  filter: saturate(0.88);
  transition: opacity 0.18s ease, filter 0.18s ease;
}
.logo[src$=".svg"] {
  border-radius: 0;
}
.card:hover .logo,
.card:focus-within .logo {
  opacity: 1;
  filter: saturate(1);
}
.card:hover .logo-marquee,
.card:focus-within .logo-marquee {
  opacity: 1;
}
.logo-marquee {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 7px;
  background: #16171b;
  overflow: hidden;
  opacity: 0.94;
  transition: opacity 0.18s ease;
}
.logo-marquee.light {
  background: transparent;
  border-radius: 0;
}
.marquee-img {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  margin: auto 0;
  max-width: none;
  display: block;
  backface-visibility: hidden;
}
.marquee-congruent {
  width: 117px;
  height: 13px;
  animation: ticker-congruent 6.9s linear -2.4s infinite;
}
.marquee-tenet {
  width: 63px;
  height: 20px;
  animation: ticker-tenet 4.5s linear -1.4s infinite;
}
.marquee-contentsage {
  width: 92px;
  height: 14px;
  animation: ticker-contentsage 5.8s linear -2.0s infinite;
}
@keyframes ticker-congruent {
  from { transform: translate3d(38px, 0, 0); }
  to { transform: translate3d(-120px, 0, 0); }
}
@keyframes ticker-tenet {
  from { transform: translate3d(38px, 0, 0); }
  to { transform: translate3d(-66px, 0, 0); }
}
@keyframes ticker-contentsage {
  from { transform: translate3d(38px, 0, 0); }
  to { transform: translate3d(-95px, 0, 0); }
}
.logo.mono {
  width: 36px;
  height: 36px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 15px;
  color: var(--muted);
  background: rgba(33, 29, 23, 0.03);
  border: 1px solid var(--line-strong);
  font-style: italic;
}

/* Copy & Stretched Row Link */
.name { grid-area: name; align-self: end; }
.name, .post-title {
  font-size: 17.5px;
  line-height: 1.25;
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.005em;
  min-width: 0;
}
.row-link {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  transition: color 0.16s ease;
}
.row-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}
.row-link:focus-visible {
  outline: none;
}
.card:focus-within {
  outline: 1px solid var(--accent-border);
  outline-offset: -1px;
}
.card:hover .row-link,
.card:focus-within .row-link {
  color: var(--accent);
}
.aka {
  font-size: 13.5px;
  font-weight: 400;
  font-style: italic;
  color: var(--dim);
  margin-left: 2px;
}
.arrow {
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 400;
  color: var(--accent);
  opacity: 0;
  transform: translate(-3px, 2px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.card:hover .arrow,
.card:focus-within .arrow {
  opacity: 0.85;
  transform: translate(0, 0);
}

.blurb {
  grid-area: blurb;
  align-self: start;
  margin: 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.45;
  min-width: 0;
}

/* Status Column */
.card-foot {
  grid-area: foot;
  align-self: center;
  text-align: right;
  font-family: var(--sans);
}
.status {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.s-acq {
  color: var(--accent);
}

/* Footer */
footer {
  padding: 28px 0 54px;
  color: var(--dim);
  font-size: 13px;
  font-style: italic;
}
footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 640px) {
  .wrap { padding: 0 20px; }
  .hero { padding: 48px 0 26px; }
  .lede { font-size: 15px; }
  .card {
    grid-template-columns: 32px minmax(0, 1fr) auto;
    column-gap: 14px;
    padding: 15px 6px 15px 10px;
  }
  .logo-wrap { width: 32px; height: 32px; }
  .logo, .logo-marquee { width: 30px; height: 30px; }
  .marquee-congruent { width: 99px; height: 11px; }
  .marquee-tenet { width: 53px; height: 17px; }
  .marquee-contentsage { width: 79px; height: 12px; }
  .logo.mono { width: 30px; height: 30px; font-size: 13px; }
  .name, .post-title { font-size: 16.5px; }
  .status { letter-spacing: 0.1em; }
  .arrow { opacity: 0.55; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .marquee-img { animation: none !important; transform: translateX(3px); }
  .marquee-congruent { transform: translateX(-68px); }
}

/* Writing archive and articles */
[hidden] { display: none !important; }
.skip-link { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.skip-link:focus { width: auto; height: auto; clip-path: none; background: var(--card); z-index: 2; }
.hero-nav nav { display: flex; flex-wrap: wrap; gap: 16px; }
.hero-nav .eyebrow a { color: inherit; text-decoration: none; }
.hero-nav .eyebrow a:hover { text-decoration: underline; }
.hero-nav { gap: 16px; }
.hero h1 { overflow-wrap: anywhere; }
.article-meta, .post-date, .article-nav {
  font: 13px/1.5 var(--sans);
  color: var(--muted);
}
.article-meta, .article-nav { display: flex; flex-wrap: wrap; gap: 16px; }
.article-meta { margin-top: 12px; }
.article-nav { margin-top: 32px; padding-top: 12px; border-top: 1px solid var(--line); }
.article-meta a, .article-nav a { color: var(--accent); text-underline-offset: 3px; }

.year-title { margin: 24px 0 0; font: 500 12px/1.5 var(--sans); color: var(--muted); }
.post-row { display: grid; grid-template-columns: 58px 1fr; align-items: baseline; gap: 20px; padding: 18px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.post-row:hover, .post-row:focus-visible { color: var(--accent); background: var(--card); }
.sec-head { flex-wrap: wrap; }

footer p { margin: 0; }

.prose { width: min(100%, 720px); font-size: 18px; line-height: 1.65; overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1.35em; }
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 { font-family: var(--serif); font-weight: 400; line-height: 1.25; letter-spacing: -.025em; text-wrap: pretty; }
.prose h1 { font-size: 2em; margin: 1.9em 0 .6em; }
.prose h2 { font-size: 1.65em; margin: 1.7em 0 .65em; }
.prose h3 { font-size: 1.3em; margin: 1.65em 0 .65em; }
.prose h4, .prose h5, .prose h6 { font-size: 1.1em; margin: 1.5em 0 .65em; }
.prose a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .18em; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose strong, .prose b { font-weight: 700; }
.prose ul, .prose ol { margin: 0 0 1.45em; padding-left: 1.45em; }
.prose li { margin-bottom: .4em; padding-left: .15em; }
.prose li > p { margin-bottom: .55em; }
.prose li > ul, .prose li > ol { margin-top: .6em; margin-bottom: .6em; }
.prose blockquote { margin: 1.8em 0; padding: .05em 0 .05em 1.3em; border-left: 2px solid var(--accent); color: var(--muted); font-style: italic; }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose blockquote cite { display: block; margin-top: 1em; font-family: var(--sans); font-size: 12px; font-style: normal; }
.prose hr { width: 100%; height: 0; margin: 2.3em 0; border: 0; border-top: 1px solid var(--line); }
.prose img { display: block; margin: 1.7em auto; max-width: 100%; height: auto; }
.prose figure { max-width: 100%; margin: 2em 0; }
.prose figure img { margin: 0 auto; }
.prose figcaption { margin: .8em 0 0; color: var(--muted); font-family: var(--sans); font-size: 12px; line-height: 1.6; text-align: center; }
.prose::after { content: ""; display: block; clear: both; }
.prose code, .prose kbd, .prose pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.prose code, .prose kbd { padding: .15em .3em; background: var(--card); border-radius: 2px; font-size: .8em; }
.prose pre { overflow-x: auto; margin: 1.8em 0; padding: 22px 25px; background: var(--card); border: 1px solid var(--line); font-size: 13px; line-height: 1.7; tab-size: 2; }
.prose pre code { padding: 0; background: transparent; border-radius: 0; font-size: inherit; white-space: pre; }
.prose table { display: block; width: 100%; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 1.6em 0; font-family: var(--sans); font-size: 13px; line-height: 1.6; }
.prose th, .prose td { padding: 12px 16px 12px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { border-bottom-color: var(--ink); font-weight: 600; }
.prose iframe { display: block; max-width: 100%; margin: 1.8em auto; border: 0; }
.prose sup, .prose sub { font-size: .65em; line-height: 0; }
.prose details { padding: .8em 0; border-block: 1px solid var(--line); }
.prose summary { cursor: pointer; }

@media (max-width: 640px) {
  .post-row { grid-template-columns: 50px 1fr; gap: 14px; padding: 15px 10px; }
  .prose { font-size: 17px; }
}
@media print {
  .hero-nav nav, .article-nav { display: none; }
  .prose { width: 100%; font-size: 11pt; }
  .prose pre { white-space: pre-wrap; overflow-wrap: anywhere; }
}

.newsletter { max-width: 38rem; border-top: 1px solid var(--line-strong); padding: 2rem 0; }
.newsletter h2 { margin: 0; font: 500 clamp(2.25rem, 6vw, 3.5rem)/1.1 var(--serif); }
.newsletter p { font-size: 1.2rem; color: var(--muted); max-width: 34rem; }
.newsletter form { margin: 2rem 0; }
.newsletter label { display: block; margin-bottom: .45rem; font: 600 .95rem var(--sans); }
.signup-fields { display: flex; flex-wrap: wrap; gap: .6rem; }
.signup-fields input, .signup-fields button { padding: .8rem 1rem; border-radius: .3rem; font: 1rem var(--sans); }
.signup-fields input { flex: 1 1 13rem; min-width: 0; background: var(--card); color: var(--ink); border: 1px solid var(--line-strong); }
.signup-fields button { background: var(--ink); color: var(--card); border: 1px solid var(--ink); cursor: pointer; }
.newsletter a { color: var(--accent); text-underline-offset: .2em; }
.newsletter .archive-link { font-size: 1rem; }

.newsletter-popup {
  position: fixed;
  z-index: 10;
  right: 1rem;
  bottom: max(1rem, env(safe-area-inset-bottom));
  width: min(24rem, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  padding: 1.4rem;
  border: 1px solid var(--line-strong);
  border-radius: .5rem;
  background: var(--card);
  box-shadow: 0 .4rem 2rem rgb(33 29 23 / 15%);
}
.newsletter-popup h2 { padding-right: 2.25rem; font-size: 2rem; }
.newsletter-popup p { margin: .6rem 0 1rem; font-size: 1rem; }
.newsletter-popup form { margin: 0; }
.newsletter-popup .signup-fields input { flex-basis: 10rem; }
.popup-close {
  position: absolute;
  top: .4rem;
  right: .4rem;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 1.6rem/1 var(--sans);
  cursor: pointer;
}
.popup-close:hover, .popup-close:focus-visible { background: var(--bg); }
@media print { .newsletter-popup { display: none; } }
