@font-face {
  font-family: "Maax Mono Portfolio";
  src:
    url("fonts/205TF-MaaxMono-Regular.woff2") format("woff2"),
    url("fonts/205TF-MaaxMono-Regular.woff") format("woff");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Maax Mono Portfolio";
  src:
    url("fonts/205TF-MaaxMono-Italic.woff2") format("woff2"),
    url("fonts/205TF-MaaxMono-Italic.woff") format("woff");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Maax Mono Portfolio";
  src:
    url("fonts/205TF-MaaxMono-Bold.woff2") format("woff2"),
    url("fonts/205TF-MaaxMono-Bold.woff") format("woff");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Maax Mono Portfolio";
  src:
    url("fonts/205TF-MaaxMono-BoldItalic.woff2") format("woff2"),
    url("fonts/205TF-MaaxMono-BoldItalic.woff") format("woff");
  font-style: italic;
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #fff;
  --text: #111;
  --line: #111;
  --soft: #c9c9c9;
  --code: #0047ff;
  --space: 18px;
  --content-width: 760px;
  --wide-width: 1100px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Maax Mono Portfolio", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
}

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

a:visited {
  color: inherit;
}

img {
  display: block;
  width: 100%;
  height: auto;
}

video,
iframe {
  display: block;
  width: 100%;
}

h1,
h2,
h3,
p,
figure {
  margin: 0;
}

h1,
h2,
h3 {
  font-size: inherit;
  line-height: inherit;
  letter-spacing: 0;
}

h1,
h2,
h3,
.work-title {
  font-weight: 400;
}

h1 a {
  text-decoration: none;
}

.rail header h1 {
  margin-bottom: 5px;
}

p + p {
  margin-top: 10px;
}

ul {
  margin: 0;
  padding-left: 18px;
}

li + li {
  margin-top: 3px;
}

.layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  border-right: 1px solid var(--line);
  padding: var(--space);
}

.rail-inner {
  position: sticky;
  top: var(--space);
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - (var(--space) * 2));
  gap: 20px;
}

.content {
  min-width: 0;
  padding: 0 var(--space) 48px;
}

.block {
  border-top: 1px solid var(--line);
  padding: var(--space) 0;
}

.block:first-child {
  border-top-width: 0;
}

.nav,
.meta,
.label {
  color: var(--text);
}

.nav {
  display: grid;
  gap: 4px;
  color: var(--text);
}

.nav a {
  text-decoration: none;
}

.nav a[aria-current="page"],
.rail-bottom a[aria-current="page"],
.footer-legal a[aria-current="page"] {
  font-weight: 400;
  text-decoration: none;
}

.nav a[aria-current="page"]::before,
.rail-bottom a[aria-current="page"]::before,
.footer-legal a[aria-current="page"]::before {
  content: "-> ";
}

.nav a:not([aria-current="page"]) {
  color: var(--text);
}

a:hover,
.nav a:hover,
.rail-bottom a:hover,
.footer-legal a:hover {
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
}

.contact {
  display: grid;
  gap: 4px;
  margin-top: auto;
}

.site-footer {
  display: none;
}

.rail-bottom {
  margin-top: 0;
}

.block > h2,
.page-title {
  margin-bottom: 10px;
}

.lede {
  max-width: var(--content-width);
}

.lede + dl,
dl + .lede {
  margin-top: var(--space);
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 280px);
  gap: 14px;
  align-items: start;
}

.work-card {
  width: 280px;
}

.work-card img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
}

.work-card a {
  display: block;
  position: relative;
  text-decoration: none;
}

.work-card a:hover {
  background: none;
  color: var(--text);
}

.work-card figcaption {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  align-content: start;
  gap: 2px;
  margin-top: 0;
  padding: 8px;
  background: var(--text);
  color: var(--bg);
  opacity: 0;
}

.work-card .meta,
.label,
dt {
  font-style: italic;
}

.work-card a:hover figcaption,
.work-card a:focus-visible figcaption {
  opacity: 1;
}

.project-image {
  border: 1px solid var(--line);
  max-width: var(--content-width);
}

.project-copy {
  max-width: var(--content-width);
}

.project-copy + .project-copy {
  margin-top: var(--space);
}

.figure-stack {
  display: grid;
  gap: var(--space);
  max-width: var(--content-width);
}

.figure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  max-width: var(--wide-width);
}

.figure-grid + .project-copy,
.project-copy + .figure-grid,
.project-image + .figure-grid,
.figure-stack + .project-copy,
.project-copy + .figure-stack,
.figure-grid + .figure-stack,
.figure-stack + .figure-grid {
  margin-top: var(--space);
}

.project-figure img,
.project-figure video {
  border: 1px solid var(--line);
}

.project-figure--small {
  max-width: 380px;
}

.project-figure figcaption {
  margin-top: 5px;
  font-style: italic;
}

pre {
  overflow-x: auto;
  margin: 0;
  border: 1px solid var(--line);
  padding: 8px;
  white-space: pre;
}

code {
  font: inherit;
}

pre code {
  color: var(--code);
}

.cv-list {
  display: grid;
  max-width: var(--content-width);
}

.cv-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 18px;
  border-top: 1px solid var(--soft);
  padding: 10px 0;
}

.cv-row:first-child {
  border-top-color: var(--line);
}

.cv-section + .cv-section {
  margin-top: var(--space);
}

dl {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 5px 14px;
  max-width: var(--content-width);
  margin: 0;
}

dt {
  color: var(--text);
}

dd {
  margin: 0;
}

address {
  font-style: normal;
}

@media (max-width: 840px) {
  body {
    font-size: 13px;
  }

  .layout {
    grid-template-columns: 1fr;
    align-content: start;
  }

  .rail {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .rail-inner {
    position: static;
    min-height: 0;
  }

  .rail .contact,
  .rail-bottom {
    display: none;
  }

  .content {
    padding-bottom: 32px;
  }

  .cv-row,
  dl {
    grid-template-columns: 1fr;
  }

  .site-footer {
    display: grid;
    gap: 20px;
    border-top: 1px solid var(--line);
    padding: var(--space);
  }

  .footer-contact {
    display: grid;
    gap: 4px;
  }

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

  .work-card {
    width: 100%;
  }

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

@media (max-width: 520px) {
  .work-grid {
    grid-template-columns: 1fr;
  }
}
