* {
  box-sizing: border-box;
  margin: 0;
}

:root {
  color: rgba(0,0,0,.6);
  background: #fff;
  font-family: "IBM Plex Serif", serif;
}

body {
  font-size: 16px;
}

button, a, summary {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
  font: inherit;
  cursor: pointer;
}

button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 5px;
}

.site-header {
  position: fixed;
  inset: 30px 30px auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 2;
  pointer-events: none;
}

h1 {
  font-size: 23px;
  line-height: 24px;
  font-weight: 400;
}

.icon {
  border: 0;
  background: transparent;
  padding: 10px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon:hover {
  color: rgba(0,0,0,.9);
}

.icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
}

.menu-toggle {
  pointer-events: auto;
  flex-direction: column;
  gap: 5px;
  opacity: 1;
  transform: rotate(0) scale(1);
  transition: opacity .3s ease, transform .3s ease;
}

body.menu-open .menu-toggle {
  opacity: 0;
  transform: rotate(90deg) scale(.75);
  pointer-events: none;
}

.menu-toggle, .menu-toggle:hover, .menu-toggle:focus, .menu-toggle:focus-visible, .menu-toggle:active {
  border: none;
  outline: none;
  box-shadow: none;
}

.menu-toggle:focus-visible {
  color: rgba(0,0,0,.9);
}

.menu-toggle::-moz-focus-inner {
  border: 0;
}

.menu-toggle span {
  width: 23px;
  height: 1px;
  background: currentColor;
}

dialog {
  position: fixed;
  inset: 0 0 0 auto;
  width: 360px;
  max-width: 100vw;
  height: 100dvh;
  max-height: none;
  border: 0;
  padding: 100px 40px 40px;
  color: inherit;
  background: #f7f7f7;
  transform: translateX(100%);
  transition: transform .3s ease;
}

dialog[open].visible {
  transform: translateX(0);
}

dialog::backdrop {
  background: rgba(255,255,255,.65);
  opacity: 0;
  transition: opacity .3s ease;
}

dialog.visible::backdrop {
  opacity: 1;
}

.close-menu svg {
  opacity: 0;
  transform: rotate(-90deg) scale(.75);
  transition: opacity .3s ease, transform .3s ease;
}

dialog.visible .close-menu svg {
  opacity: 1;
  transform: rotate(0) scale(1);
}

.close-menu {
  border: 0;
  outline: none;
  box-shadow: none;
  appearance: none;
  position: absolute;
  right: 30px;
  top: 30px;
  font-family: sans-serif;
  font-size: 30px;
  font-weight: 200;
}

nav ul {
  font-size: 15px;
  line-height: 19px;
  font-weight: 300;
  list-style: none;
  padding: 0;
}

nav li {
  padding-bottom: 20px;
}

.close-menu, .close-menu:hover, .close-menu:focus, .close-menu:focus-visible, .close-menu:active {
  border: none;
  outline: none;
  box-shadow: none;
  text-decoration: none;
}

.close-menu:focus-visible {
  color: rgba(0,0,0,.9);
}

.close-menu::-moz-focus-inner {
  border: 0;
}

nav a, nav summary {
  position: relative;
  display: inline-block;
  color: inherit;
  text-decoration: none;
  padding-bottom: 3px;
}

nav a::after, nav summary::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: .5px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .3s ease;
}

nav a:hover, nav summary:hover {
  color: rgba(0,0,0,.9);
}

nav a:hover::after, nav summary:hover::after, nav a:focus-visible::after, nav summary:focus-visible::after {
  transform: scaleX(1);
}

summary {
  cursor: pointer;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

details ul {
  padding-top: 20px;
}

nav li.indent {
  padding: 0 0 20px 10px;
  line-height: 12px;
}

details li:last-child {
  padding-bottom: 0;
}

.contact {
  padding-top: 20px;
}

.contact ul {
  font-size: 11px;
  line-height: 12px;
}

.gallery {
  position: fixed;
  inset: 88px 84px;
}

.slides {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.slide {
  position: relative;
  grid-area: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s ease;
}

.slide.is-current {
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}

.gallery:not(.ready) .slide {
  opacity: 0;
}

.slide[hidden] {
  display: none;
}

.slide img {
  display: block;
  width: auto;
  height: auto;
  max-width: calc(100vw - 168px);
  max-height: calc(100dvh - 176px);
  object-fit: contain;
}

.previous, .next {
  position: fixed;
  top: calc(50% - 22px);
}

.previous {
  left: 20px;
}

.next {
  right: 20px;
}

.view-controls {
  position: fixed;
  bottom: 14px;
  right: 30px;
  display: flex;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

body.grid-view .gallery {
  position: relative;
  inset: auto;
  padding: 110px 84px 80px;
}

body.grid-view .slides {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(max(240px, calc((100% - 160px) / 5)), 1fr));
  gap: 60px 40px;
  align-items: center;
}

body.grid-view .slide {
  display: flex;
  grid-area: auto;
  width: 100%;
  height: auto;
  opacity: 1;
  pointer-events: auto;
  transition: none;
}

body.grid-view .slide img {
  cursor: pointer;
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: none;
}

body.grid-view .previous, body.grid-view .next, body.grid-view .play-toggle {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  dialog, dialog::backdrop, .menu-toggle, .close-menu svg, .slide, nav a::after, nav summary::after {
    transition: none;
  }

}

@media (max-width: 700px) {
  body.grid-view .gallery {
    padding-left: 20px;
    padding-right: 20px;
  }

  body.grid-view .slides {
    grid-template-columns: minmax(0, 1fr);
  }

  body.grid-view .slide img {
    cursor: default;
  }

  .view-controls {
    display: none;
  }

}

/* Archive pages share the homepage gallery, with a quiet project caption. */
.site-header h1 a {
  color: inherit;
  text-decoration: none;
  pointer-events: auto;
}

.site-header h1 a:hover {
  color: rgba(0,0,0,.9);
}

.project-caption {
  position: fixed;
  left: 30px;
  bottom: 30px;
  max-width: calc(100vw - 180px);
  white-space: nowrap;
  overflow-x: auto;
  font-size: 15px;
  line-height: 24px;
  font-weight: 400;
  background: rgba(255,255,255,.8);
  padding: 0 6px 0 0;
  scrollbar-width: thin;
}

@media (max-width: 700px) {
  .project-caption {
    left: 20px;
    bottom: 20px;
    max-width: calc(100vw - 40px);
  }

}

.project-caption .caption-date {
  font-weight: 300;
}

/* Identify the current project in archive navigation. */
nav a[aria-current="page"] {
  font-weight: 400;
  color: rgba(0,0,0,.9);
}

/* Stronger navigation text against the mobile menu background. */
@media (max-width: 700px) {
  nav {
    color: rgba(0,0,0,.7);
  }

  nav a:hover, nav summary:hover,
  nav a:focus-visible, nav summary:focus-visible,
  nav a:active, nav summary:active,
  nav a[aria-current="page"] {
    color: #000;
  }
}
