:root {
  --paper: #fbfbf8;
  --ink: #111111;
  --muted: #575757;
  --faint: #deded8;
  --line: #c7c7bf;
  --reverse: #ffffff;
  --panel: color-mix(in srgb, var(--paper) 88%, white);
  --measure: 72ch;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #080808;
  --ink: #f4f4ef;
  --muted: #b8b8ae;
  --faint: #242420;
  --line: #3a3a33;
  --reverse: #080808;
  --panel: #10100e;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  color: var(--ink);
  background: var(--paper);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.55;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.page-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--faint) 1px, transparent 1px),
    linear-gradient(90deg, var(--faint) 1px, transparent 1px),
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 24px 24px, 24px 24px, 120px 120px, 120px 120px;
  mask-image: linear-gradient(to bottom, black 0%, black 70%, transparent 100%);
}

.site-header,
.site-footer,
main {
  width: calc(100% - 32px);
  max-width: 1120px;
  margin-inline: auto;
}

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

.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  font-family: "Courier New", monospace;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0;
  text-decoration: none;
  text-transform: uppercase;
}

.wordmark::before {
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 10px;
  border: 2px solid var(--ink);
  background:
    linear-gradient(90deg, transparent 8px, var(--ink) 8px, var(--ink) 10px, transparent 10px),
    linear-gradient(transparent 8px, var(--ink) 8px, var(--ink) 10px, transparent 10px);
  content: "";
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 20px;
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
}

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

.theme-toggle {
  min-height: 28px;
  padding: 0 0 1px;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-transform: uppercase;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  color: var(--muted);
}

.site-nav a:hover,
.site-nav a:focus-visible {
  text-decoration: underline;
}

main {
  padding: 56px 0 72px;
}

.desk {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 40px;
  align-items: end;
  min-height: 48vh;
  padding-bottom: 40px;
  border-bottom: 3px double var(--ink);
}

.desk__intro {
  min-width: 0;
  max-width: 780px;
}

.kicker,
.post-card__meta,
.essay__meta,
.desk__note p,
.shelf span {
  font-family: "Courier New", monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--muted);
}

.kicker,
.desk__note p {
  margin: 0 0 12px;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  line-height: 1.05;
  font-weight: 500;
}

h1 {
  max-width: min(100%, 12ch);
  margin: 0;
  font-size: 7.6rem;
}

h2 {
  margin: 0;
  font-size: 3.6rem;
}

h3 {
  margin: 0;
  font-size: 1.35rem;
}

.desk__intro > p:last-child,
.section-heading p,
.dek {
  max-width: var(--measure);
  color: var(--muted);
  font-size: 1.12rem;
}

.desk__note {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--ink);
  background: var(--paper);
}

.desk__note strong {
  display: block;
  font-size: 1.8rem;
  font-weight: 500;
  line-height: 1;
}

.desk__note span {
  display: block;
  margin-top: 14px;
  color: var(--muted);
}

.latest,
.shelves,
.archive {
  padding-top: 56px;
}

.section-heading {
  display: grid;
  gap: 8px;
  margin-bottom: 24px;
}

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

.post-card {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 28px;
  padding: 22px 0;
  border-bottom: 1px solid var(--ink);
  background: var(--panel);
}

.post-card__meta {
  display: grid;
  align-content: start;
  gap: 6px;
}

.post-card__body {
  min-width: 0;
}

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

.post-card h3 a:hover,
.post-card h3 a:focus-visible {
  text-decoration: underline;
}

.post-card p {
  max-width: var(--measure);
  margin: 8px 0 0;
  color: var(--muted);
}

.shelf-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--ink);
}

.shelf {
  min-height: 260px;
  padding: 16px;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  background: var(--paper);
  text-decoration: none;
}

.shelf:hover,
.shelf:focus-visible {
  background: var(--ink);
  color: var(--reverse);
  outline: 0;
}

.shelf:hover p,
.shelf:hover span,
.shelf:focus-visible p,
.shelf:focus-visible span {
  color: var(--reverse);
}

.shelf h3 {
  margin-top: 54px;
}

.shelf p {
  color: var(--muted);
  font-size: 0.95rem;
}

.essay {
  max-width: 860px;
}

.back-link {
  display: inline-block;
  margin-bottom: 28px;
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.essay__header {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--ink);
}

.essay__header h1 {
  max-width: 14ch;
  font-size: 5.6rem;
}

.essay__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.essay__body {
  max-width: var(--measure);
  padding-top: 24px;
  font-size: 1.18rem;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0 32px;
  border-top: 1px solid var(--ink);
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 880px) {
  h1 {
    font-size: 5.2rem;
  }

  h2 {
    font-size: 3rem;
  }

  .desk,
  .post-card {
    grid-template-columns: 1fr;
  }

  .desk {
    min-height: auto;
  }

  .desk__note {
    max-width: 420px;
  }

  .shelf-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .site-header,
  .site-footer,
  main {
    width: calc(100vw - 48px);
    max-width: calc(100vw - 48px);
  }

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

  .site-nav {
    justify-content: flex-start;
  }

  main {
    padding-top: 36px;
  }

  h1 {
    max-width: 8ch;
    font-size: 3.7rem;
  }

  h2 {
    font-size: 2.3rem;
  }

  .essay__header h1 {
    font-size: 3.4rem;
  }

  .desk,
  .desk__intro,
  .desk__note,
  .post-card,
  .post-card__body,
  .post-card p {
    width: 100%;
    max-width: 100%;
  }

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

  .shelf {
    min-height: 190px;
  }
}
