:root {
  --paper: #f8f7f1;
  --ink: #151515;
  --muted: #686868;
  --soft: #8a8a8a;
  --line: #d9d6cc;
  --accent: #0b6b63;

  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --serif: var(--sans);
  --mono: var(--sans);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration-color: rgba(21, 21, 21, .35);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

img {
  max-width: 100%;
}

.site-header,
.content,
.site-footer {
  width: min(900px, calc(100% - 40px));
  margin-right: auto;
  margin-left: auto;
}

.site-header {
  padding: 56px 0 0;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-identity {
  min-width: 0;
}

.site-title {
  display: inline-block;
  color: var(--accent);
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: .03em;
  text-decoration: none;
}

.site-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font: 12px/1.35 var(--mono);
}

.site-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px 13px;
  color: var(--muted);
  font: 12px/1.2 var(--mono);
}

.site-links span {
  color: var(--soft);
}

.intro {
  max-width: 650px;
  padding: 12px 0 46px;
}

.intro h1 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0;
}

.intro-copy {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.intro-opportunity {
  font-style: italic;
}

.content {
  padding: 0 0 60px;
}

/* Project index */
.project-row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 26px;
  position: relative;
  margin: 0 -12px;
  padding: 30px 12px;
  border-bottom: 1px solid var(--line);
  border-radius: 6px;
  align-items: center;
  transition: background-color .16s ease;
}

.project-row:hover,
.project-row:focus-within {
  background-color: rgba(21, 21, 21, .035);
}

.project-row__link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 6px;
  text-decoration: none;
}

.project-row__link:focus-visible {
  outline: 2px solid rgba(11, 107, 99, .55);
  outline-offset: -2px;
}

.project-thumb {
  display: block;
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eeeae0;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.project-thumb__placeholder {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(11, 107, 99, .10), transparent 52%),
    repeating-linear-gradient(90deg, rgba(21, 21, 21, .055) 0 1px, transparent 1px 18px);
  color: var(--accent);
  font: 12px/1.25 var(--mono);
  text-align: center;
  text-transform: uppercase;
}

.project-info {
  position: relative;
  min-width: 0;
}

.project-meta {
  margin: 0 0 7px;
  color: var(--accent);
  font: 11px/1.3 var(--mono);
  text-transform: uppercase;
}

.project-info h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0;
}

.project-summary {
  max-width: 640px;
  margin: 10px 0 0;
  color: var(--muted);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.tag-list li {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font: 11px/1.2 var(--mono);
}

.project-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 17px;
  font: 12px/1.2 var(--mono);
}

.project-links a {
  position: relative;
  z-index: 2;
  color: var(--muted);
}

/* Post page */
.post {
  width: min(820px, calc(100% - 40px));
  margin: 40px auto;
  padding: 0 0 24px;
}

.back {
  display: inline-block;
  margin: 12px 0 20px;
  font: 13px/1.2 var(--mono);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

.back.bottom {
  margin-top: 28px;
}

.post-title {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: 0;
}

.post-date {
  margin: 0 0 24px;
  color: var(--muted);
  font: 13px/1.2 var(--mono);
}

.post-body {
  font-size: 16px;
  line-height: 1.65;
}

.post-body p {
  margin: 15px 0;
}

.post-body h1,
.post-body h2,
.post-body h3,
.post-body h4,
.post-body h5,
.post-body h6 {
  margin: 32px 0 12px;
  font-family: var(--serif);
  line-height: 1.25;
}

.post-body h1:first-child,
.post-body h2:first-child,
.post-body h3:first-child,
.post-body h4:first-child,
.post-body h5:first-child,
.post-body h6:first-child {
  margin-top: 0;
}

.post-body ul,
.post-body ol {
  margin: 18px 0 18px 1.4em;
  padding: 0;
}

.post-body li {
  margin: 8px 0;
}

.post-body hr {
  margin: 36px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.post-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 14px auto;
}

.post-body .media-block {
  width: 100%;
  margin: 30px auto;
}

.post-body .media-block--portrait {
  max-width: 520px;
}

.post-body .media-block--medium {
  max-width: 620px;
}

.post-body .media-block--diagram,
.post-body .media-block--wide {
  max-width: 100%;
}

.post-body .media-block img {
  width: 100%;
  margin: 0 auto;
  border: 1px solid rgba(21, 21, 21, .38);
  border-radius: 6px;
}

.post-body .media-block img+img {
  margin-top: 8px;
}

.post-body .media-block a {
  display: block;
}

.post-body .media-block figcaption {
  max-width: 92%;
  margin: 9px auto 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.post-body .media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 30px 0;
  align-items: start;
}

.post-body .media-grid .media-block {
  margin: 0;
}

.post-body .technical-equation {
  margin: 18px 0;
  padding: 12px 14px;
  overflow-x: auto;
  border-left: 2px solid var(--accent);
  background: rgba(255, 255, 255, .45);
}

.post-body .technical-equation code {
  white-space: nowrap;
}

.post-body table {
  width: 100%;
  margin: 22px 0 28px;
  border-collapse: collapse;
  font-size: 12px;
  line-height: 1.45;
}

.post-body th,
.post-body td {
  padding: 8px 9px;
  border-bottom: 1px solid rgba(21, 21, 21, .16);
  text-align: left;
  vertical-align: top;
}

.post-body th {
  border-bottom-color: rgba(21, 21, 21, .48);
  font-weight: 600;
}

.video-embed {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  overflow: hidden;
  margin: 14px 0;
  border-radius: 6px;
  background: #000;
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.site-footer {
  margin-top: 18px;
  padding: 18px 0 32px;
  color: var(--muted);
  text-align: center;
}

.last-updated {
  margin: 0;
  font: 11px/1.3 var(--mono);
}

@media (max-width: 720px) {

  .site-header,
  .content,
  .site-footer,
  .post {
    width: min(100% - 28px, 900px);
  }

  .site-header {
    padding-top: 34px;
  }

  .site-nav {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

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

  .intro {
    padding: 24px 0 36px;
  }

  .intro h1 {
    font-size: 25px;
  }

  .project-row {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 26px 12px;
  }

  .project-thumb {
    max-width: 360px;
  }

  .post-title {
    font-size: 32px;
  }

  .post-body .media-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    margin: 24px 0;
  }

  .post-body table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}