:root {
  color-scheme: light;
  --ink: #151515;
  --paper: #fff;
  --muted: #727272;
  --page-x: clamp(1.2rem, 5.4vw, 5.2rem);
  --sidebar-w: 15rem;
  --content-x: clamp(1.25rem, 2.4vw, 2.5rem);
  font-family: Helvetica, Arial, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
}

.site-header {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: start;
  width: var(--sidebar-w);
  padding: 1.75rem 1.25rem;
  background: var(--paper);
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-top: 2.2rem;
}

.nav-heading,
.info-link,
.site-name {
  margin: 0;
  padding: 0;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.nav-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.nav-heading {
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.15;
  text-transform: uppercase;
}

.nav-heading:hover,
.nav-heading:focus-visible,
.nav-heading.is-active,
.nav-heading--label {
  border-bottom-color: transparent;
  outline: none;
}

.site-name {
  order: -1;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  padding: 1.75rem var(--content-x) 8rem 0;
}

.view[hidden] {
  display: none;
}

.series-title,
.about-title {
  margin: 0;
  padding-top: 0.8rem;
}

.series-menu {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.28rem;
  width: calc(var(--sidebar-w) - 2.5rem);
  margin-top: 0.28rem;
  padding: 0 0 0 1.15rem;
}

.series-link {
  display: block;
  width: max-content;
  max-width: 100%;
  padding: 0;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.84rem;
  line-height: 1.28;
  text-align: left;
  cursor: pointer;
}

.series-link:hover,
.series-link:focus-visible,
.series-link.is-active {
  border-bottom-color: currentColor;
  outline: none;
}

.part-menu {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.22rem;
  padding-left: 1rem;
}

.part-menu[hidden] {
  display: none;
}

.part-link {
  color: var(--muted);
  font-size: 0.78rem;
}

.info-menu {
  margin-top: 2rem;
}

.info-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.28rem;
  margin-top: 0.28rem;
  padding-left: 1.15rem;
}

.info-link {
  font-size: 0.84rem;
  line-height: 1.28;
}

.info-link:hover,
.info-link:focus-visible,
.info-link.is-active {
  border-bottom-color: currentColor;
  outline: none;
}

.site-header.is-info .series-link.is-active {
  border-bottom-color: transparent;
}

.series-title h1,
.about-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  text-transform: lowercase;
}

.cover {
  display: flex;
  align-items: flex-start;
  width: 100%;
  min-height: calc(100vh - 3.5rem);
}

.cover[hidden],
.sequence[hidden] {
  display: none;
}

.cover img {
  display: block;
  width: 100%;
  height: calc(100vh - 3.5rem);
  object-fit: contain;
  object-position: left top;
}

.sequence {
  display: flex;
  align-items: flex-start;
  gap: clamp(1.4rem, 2.6vw, 3rem);
  width: 100%;
  margin-top: 0;
  padding: 0 var(--content-x) 1.35rem 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: #b7b7b7 transparent;
}

.sequence::-webkit-scrollbar {
  height: 4px;
}

.sequence::-webkit-scrollbar-track {
  background: transparent;
}

.sequence::-webkit-scrollbar-thumb {
  background: #b7b7b7;
}

.chapter {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  gap: clamp(1.4rem, 2.6vw, 3rem);
}

.chapter + .chapter {
  margin-left: clamp(5rem, 9vw, 10rem);
}

.chapter > .stage {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
}

.chapter > .stage--pair,
.chapter > .stage--triptych {
  display: contents;
}

figure {
  margin: 0;
}

.sequence > figure {
  flex: 0 0 auto;
  height: clamp(29rem, calc(100vh - 14rem), 45rem);
}

.photo {
  display: block;
  width: auto;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

.sequence .photo img {
  display: block;
  width: auto;
  height: 100%;
  max-width: none;
}

.about-image img {
  display: block;
  width: 100%;
  height: auto;
}

.view--biography,
.view--contact {
  max-width: 88rem;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(17rem, 0.68fr) minmax(28rem, 1.32fr);
  align-items: start;
  gap: clamp(3rem, 8vw, 9rem);
  margin-top: 3.8rem;
}

.about-copy {
  max-width: 31rem;
  font-size: 1rem;
  line-height: 1.55;
}

.about-copy p {
  margin: 0 0 1.4rem;
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  margin: 3.7rem 0 0;
  font-size: 1.12rem;
  line-height: 1.3;
}

.contact-list div,
.contact-list dt,
.contact-list dd {
  margin: 0;
}

.contact-list a {
  color: inherit;
  text-decoration: none;
}

.contact-list a:hover,
.contact-list a:focus-visible {
  text-decoration: underline;
  outline: none;
}

.about-image {
  width: 100%;
  max-width: 27rem;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr) 4.5rem;
  grid-template-rows: 3.5rem minmax(0, 1fr) 2.8rem;
  align-items: center;
  background: rgba(255, 255, 255, 0.985);
}

.lightbox[hidden] {
  display: none;
}

.lightbox-image {
  grid-column: 2;
  grid-row: 2;
  justify-self: center;
  max-width: 100%;
  max-height: calc(100vh - 8rem);
  object-fit: contain;
}

.lightbox-close,
.lightbox-nav {
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.lightbox-close {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  align-self: start;
  padding: 1.1rem 1.3rem;
  font-size: 0.9rem;
  text-transform: lowercase;
}

.lightbox-nav {
  grid-row: 2;
  align-self: stretch;
  font-size: 1.3rem;
}

.lightbox-prev {
  grid-column: 1;
}

.lightbox-next {
  grid-column: 3;
}

.lightbox-count {
  grid-column: 2;
  grid-row: 3;
  justify-self: center;
  color: var(--muted);
  font-size: 0.82rem;
}

body.has-lightbox {
  overflow: hidden;
}

body.has-lightbox > .site-header,
body.has-lightbox > main {
  visibility: hidden;
}

body.has-lightbox > .lightbox {
  visibility: visible;
}

@media (max-width: 760px) {
  :root {
    --sidebar-w: 9.25rem;
    --content-x: 0.75rem;
  }

  body {
    font-size: 13px;
  }

  .site-header {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--sidebar-w);
    min-height: 100vh;
    padding: 1rem 0.7rem 1.4rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar-menu {
    width: auto;
    margin-top: 1.5rem;
  }

  .site-name {
    font-size: 0.9rem;
  }

  main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    padding: 1rem var(--content-x) 4rem 0;
  }

  .nav-group {
    width: auto;
  }

  .nav-heading {
    font-size: 0.82rem;
  }

  .series-menu {
    display: flex;
    flex-direction: column;
    gap: 0.24rem;
    width: calc(var(--sidebar-w) - 1.4rem);
    padding-left: 0.85rem;
  }

  .series-link {
    width: max-content;
    font-size: 0.76rem;
  }

  .part-menu {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0.18rem;
    padding: 0 0 0 0.72rem;
  }

  .part-link {
    font-size: 0.7rem;
  }

  .info-menu {
    margin-top: 1.4rem;
  }

  .info-links {
    flex-direction: column;
    gap: 0.24rem;
    padding-left: 0.85rem;
  }

  .info-link {
    font-size: 0.76rem;
  }

  .series-title {
    padding-top: 0;
  }

  .cover {
    width: 100%;
    min-height: calc(100vh - 2rem);
  }

  .cover img {
    width: 100%;
    height: auto;
    max-height: none;
    align-self: flex-start;
  }

  .sequence {
    flex-direction: row;
    gap: 1rem;
    width: 100%;
    margin-top: 0;
    padding: 0 var(--content-x) 1rem 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: auto;
    scrollbar-gutter: stable;
  }

  .sequence::-webkit-scrollbar {
    height: 6px;
  }

  .chapter + .chapter {
    margin-left: 4rem;
  }

  .chapter {
    gap: 1rem;
  }

  .chapter figure {
    height: min(62vh, 29rem);
  }

  .sequence > figure {
    flex: 0 0 auto;
    width: auto;
    height: min(58vh, 30rem);
  }

  .photo {
    width: auto;
    height: 100%;
  }

  .sequence .photo img {
    width: auto;
    height: 100%;
    max-width: none;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 2.8rem;
    margin-top: 2.6rem;
  }

  .about-copy {
    max-width: none;
  }

  .contact-list {
    margin-top: 2.6rem;
  }

  .lightbox {
    grid-template-columns: 3rem minmax(0, 1fr) 3rem;
  }

  .lightbox-image {
    max-height: calc(100vh - 7rem);
  }
}

/* Phones retain the desktop composition on a 980px canvas and scale it as one unit. */
html.scaled-phone-layout body {
  min-width: 980px;
}

html.scaled-phone-layout .site-header {
  position: absolute;
  bottom: auto;
  min-height: 0;
  height: auto;
}

html.scaled-phone-layout .cover {
  min-height: 0;
  padding-top: 5.5rem;
}

html.scaled-phone-layout .cover img {
  width: auto;
  height: auto;
  max-width: 700px;
  max-height: 36rem;
  object-position: left top;
}

html.scaled-phone-layout .sequence > figure,
html.scaled-phone-layout .chapter figure {
  width: auto;
  height: auto;
}

html.scaled-phone-layout .photo,
html.scaled-phone-layout .sequence .photo img {
  width: auto;
  height: auto;
  max-width: 700px;
  max-height: 36rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
