:root {
  color-scheme: light;
  --paper: #ffffff;
  --ink: #111111;
  --muted: #5f6368;
  --rule: #111111;
  --hairline: #d7dce0;
  --accent: #b42334;
  --link: #075985;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.45;
}

a {
  color: inherit;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.masthead {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 18px 14px;
  text-align: center;
}

.masthead::after {
  display: block;
  height: 5px;
  margin-top: 13px;
  border-top: 2px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  content: "";
}

.masthead-small h1 {
  font-size: clamp(2.25rem, 8vw, 5.5rem);
}

.edition,
.dateline {
  margin: 0;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.dateline {
  margin-top: clamp(10px, 1.6vw, 18px);
}

.masthead-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(58px, 9vw, 116px);
  align-items: center;
  gap: clamp(10px, 2.2vw, 30px);
  margin-top: 10px;
}

.masthead h1 {
  min-width: 0;
  margin: 0;
  font-size: clamp(1.45rem, 7.6vw, 5.8rem);
  font-weight: 900;
  line-height: 1;
  text-align: left;
  white-space: nowrap;
}

.masthead-portrait {
  justify-self: end;
  width: clamp(58px, 9vw, 116px);
  aspect-ratio: 1;
  background: #ffffff;
  image-rendering: pixelated;
  object-fit: cover;
}

.paper,
.page-shell {
  max-width: 1180px;
  margin: 0 auto 48px;
  padding: 0 18px 42px;
}

.desktop-masonry {
  display: none;
}

.mobile-list,
.desktop-masonry {
  border-top: 1px solid var(--rule);
}

.category {
  padding: 18px 0 8px;
  border-bottom: 1px solid var(--rule);
}

.category h2 {
  margin: 0 0 12px;
  color: var(--accent);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.project-stack {
  display: grid;
  gap: 14px;
}

.project {
  min-width: 0;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--hairline);
}

.project:last-child {
  border-bottom: 0;
}

.project-image {
  display: block;
  width: auto;
  height: 100px;
  max-width: 100%;
  margin: 0 0 9px;
  border: 1px solid var(--rule);
  object-fit: contain;
}

.project-image-no-border {
  border: 0;
}

.project-copy > :first-child,
.markdown-page > :first-child {
  margin-top: 0;
}

.project-copy h1,
.project-copy h2,
.project-copy h3,
.project-copy h4 {
  margin: 0 0 4px;
  font-size: 1.25rem;
  line-height: 1.05;
}

.project-copy p {
  margin: 0 0 8px;
  color: #2b2f33;
  font-size: 0.98rem;
}

.project-copy ul,
.markdown-page ul {
  padding-left: 1.1rem;
}

.metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  margin: 8px 0 0;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.72rem;
}

.metadata div {
  display: flex;
  gap: 4px;
  min-width: 0;
}

.metadata dt {
  font-weight: 800;
  text-transform: uppercase;
}

.metadata dd {
  margin: 0;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 13px;
  margin-top: 11px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.82rem;
  font-weight: 750;
}

.links a {
  color: var(--link);
  text-decoration-line: underline;
}

.markdown-page {
  max-width: 760px;
  margin: 0 auto;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
  font-size: 1.08rem;
}

.page-return {
  max-width: 760px;
  margin: 0 auto 14px;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.markdown-page h1,
.markdown-page h2,
.markdown-page h3 {
  line-height: 1.05;
}

@media (min-width: 820px) {
  .paper {
    padding-bottom: 60px;
  }

  .mobile-list {
    display: none;
  }

  .desktop-masonry {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
  }

  .masonry-column {
    min-width: 0;
    border-right: 1px solid var(--rule);
    padding-right: 26px;
  }

  .masonry-column:last-child {
    border-right: 0;
    padding-right: 0;
  }

  .category:first-child {
    padding-top: 18px;
  }

  .project-image {
    height: 86px;
  }
}
