:root {
  color-scheme: light;
  --paper: #f4f0e8;
  --paper-deep: #e9e1d3;
  --ink: #17201d;
  --muted: #66706a;
  --line: #cdc5b7;
  --accent: #bd4f37;
  --accent-dark: #843523;
  --green: #315f4b;
  --content: 72rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 88% 7%, rgb(189 79 55 / 8%), transparent 28rem),
    var(--paper);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration-color: rgb(189 79 55 / 55%);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover,
a:focus-visible {
  color: var(--accent-dark);
  text-decoration-color: currentColor;
}

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

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 10;
  padding: 0.45rem 0.7rem;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-160%);
}

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

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

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

.site-header .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 5.2rem;
  gap: 2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.72rem;
  color: var(--ink);
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", monospace;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-decoration: none;
  text-transform: uppercase;
}

.brand-mark {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border: 1px solid var(--ink);
  background: var(--accent);
  box-shadow: 4px 4px 0 var(--ink);
  color: #fff8ed;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  letter-spacing: 0;
}

.site-nav {
  display: flex;
  gap: 1.35rem;
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", monospace;
  font-size: 0.73rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(15rem, 0.55fr);
  gap: clamp(2.5rem, 7vw, 6rem);
  align-items: end;
  padding-block: clamp(4.5rem, 10vw, 8.5rem) clamp(4rem, 8vw, 7rem);
}

.eyebrow,
.meta,
.post-number,
.section-label,
.note-label {
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.eyebrow,
.section-label,
.note-label {
  color: var(--accent-dark);
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 13ch;
  margin-bottom: 1.5rem;
  font-size: clamp(3.1rem, 8vw, 7rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.96;
}

.hero-copy {
  max-width: 39rem;
  margin-bottom: 0;
  color: #424c47;
  font-size: clamp(1.06rem, 2vw, 1.3rem);
}

.hero-aside {
  padding-top: 1.4rem;
  border-top: 2px solid var(--ink);
}

.hero-aside p:last-child {
  margin-bottom: 0;
}

.rule {
  height: 1px;
  border: 0;
  margin: 0;
  background: var(--line);
}

.posts-section {
  padding-block: 4rem 6rem;
}

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

.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(1.9rem, 4vw, 3.2rem);
  font-weight: 500;
  letter-spacing: -0.035em;
}

.post-list {
  border-top: 2px solid var(--ink);
}

.post-card {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) minmax(10rem, 0.35fr);
  gap: 1.5rem;
  padding-block: 2.1rem 2.25rem;
  border-bottom: 1px solid var(--line);
}

.post-number {
  padding-top: 0.35rem;
  color: var(--accent);
}

.post-card h3 {
  margin-bottom: 0.55rem;
  font-size: clamp(1.45rem, 3vw, 2.25rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.post-card h3 a {
  text-decoration: none;
}

.post-card p {
  max-width: 44rem;
  margin-bottom: 0;
  color: #505a55;
}

.post-card .meta {
  padding-top: 0.45rem;
  color: var(--muted);
  text-align: right;
}

.about {
  display: grid;
  grid-template-columns: 0.55fr 1.45fr;
  gap: clamp(2rem, 8vw, 8rem);
  padding-block: 5rem 7rem;
}

.about h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 500;
  letter-spacing: -0.04em;
}

.about-copy {
  max-width: 44rem;
  font-size: 1.12rem;
}

.site-footer {
  padding-block: 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.site-footer .shell {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.article-header {
  max-width: 56rem;
  padding-block: clamp(4rem, 9vw, 7.5rem) 3.5rem;
}

.article-header h1 {
  max-width: 12ch;
  margin-block: 0.8rem 1.3rem;
  font-size: clamp(2.8rem, 7vw, 5.7rem);
}

.article-header .dek {
  max-width: 43rem;
  color: #46504b;
  font-size: clamp(1.08rem, 2.3vw, 1.38rem);
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(12rem, 0.34fr);
  gap: clamp(3rem, 9vw, 8rem);
  align-items: start;
  padding-block: 4rem 7rem;
}

.prose {
  max-width: 44rem;
}

.prose h2 {
  margin-block: 2.8rem 0.85rem;
  font-size: clamp(1.65rem, 3.2vw, 2.35rem);
  font-weight: 500;
  letter-spacing: -0.028em;
  line-height: 1.15;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose p,
.prose ul {
  margin-bottom: 1.35rem;
}

.prose li + li {
  margin-top: 0.55rem;
}

.prose code {
  padding: 0.08rem 0.3rem;
  border: 1px solid var(--line);
  background: var(--paper-deep);
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", monospace;
  font-size: 0.82em;
}

.callout {
  margin-block: 2.2rem;
  padding: 1.15rem 1.25rem 1.2rem;
  border-left: 4px solid var(--accent);
  background: rgb(233 225 211 / 75%);
}

.callout p:last-child {
  margin-bottom: 0;
}

.article-aside {
  position: sticky;
  top: 2rem;
  padding-top: 1rem;
  border-top: 2px solid var(--ink);
  color: var(--muted);
  font-size: 0.88rem;
}

.article-aside p {
  margin-bottom: 0.7rem;
}

.article-aside a {
  color: var(--green);
}

.error-page {
  display: grid;
  min-height: calc(100vh - 9rem);
  place-items: center;
  text-align: center;
}

.error-page h1 {
  max-width: none;
  margin-bottom: 1rem;
}

.error-page p {
  color: var(--muted);
}

@media (max-width: 760px) {
  body {
    font-size: 16px;
  }

  .site-header .shell {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.9rem;
    padding-block: 1.2rem;
  }

  .site-nav {
    gap: 1rem;
  }

  .hero,
  .about,
  .article-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    align-items: start;
  }

  .post-card {
    grid-template-columns: 2rem minmax(0, 1fr);
    gap: 0.8rem;
  }

  .post-card .meta {
    grid-column: 2;
    padding-top: 0.25rem;
    text-align: left;
  }

  .article-aside {
    position: static;
  }
}

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