@import url("/assets/fonts/fonts.css");

html {
  font-size: .81vw;
  background: #fff;
  color: rgba(0, 0, 0, .85);
  --body-font: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Source Han Sans SC", "Noto Sans SC Variable", "Microsoft YaHei", sans-serif;
  --caption-font: "IBM Plex Mono", "PingFang SC", "Source Han Sans SC", "Noto Sans SC Variable", "Microsoft YaHei", monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--body-font);
  display: flex;
  flex-direction: column;
}

.page-layout {
  width: 78%;
  margin-left: auto;
}

main {
  flex: 1 0 auto;
}

main .page-content {
  padding: 3rem 3rem 3.1rem;
}

.page-copy {
  color: rgba(0, 0, 0, .85);
  font-size: 1.25rem;
  font-weight: 425;
  line-height: 1.3;
  letter-spacing: .009em;
}

.page-copy span[style*="--font-scale"] {
  font-size: calc(1em * var(--font-scale));
}

a {
  color: inherit;
  text-decoration: none;
}

a:active, .zoom-trigger:active {
  opacity: .7;
}

a:focus-visible, button:focus-visible {
  outline: 2px solid #111;
  outline-offset: 4px;
}

.desktop-nav {
  position: fixed;
  z-index: 2;
  left: 0;
  top: 0;
  width: 22%;
  padding: 3rem 0 0 3rem;
}

.desktop-nav a {
  text-decoration: underline;
}

.mobile-nav {
  display: none;
}

h1, h2 {
  margin: 0;
}

h1 {
  font-size: 4rem;
  font-weight: 700;
  line-height: 1;
}

h2 {
  color: rgba(0, 0, 0, .75);
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.1;
}

h3 {
  margin-block: 1em;
  font-size: 1.17em;
}

hr {
  border: 0;
  height: 0;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3rem 12rem;
  align-items: start;
}

.work-media {
  width: var(--media-width, 100%);
  margin: 0 auto;
  padding-top: 1.8rem;
}

.media, .media-link, .zoom-trigger {
  display: block;
  width: 100%;
}

.media {
  height: auto;
}

.zoom-trigger {
  cursor: zoom-in;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
}

.caption {
  display: block;
  font: 400 1.1rem/1.2 var(--caption-font);
  letter-spacing: 0;
  color: rgba(0, 0, 0, .4);
}

.work-media .caption {
  margin: 1em 0 2em;
}

footer .page-content {
  padding: 3rem;
}

.icp {
  text-decoration: underline;
  margin-top: .55em;
}

.lightbox {
  position: fixed;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border: 0;
  padding: 3rem;
  background: #fff;
}

.lightbox::backdrop {
  background: #fff;
}

.lightbox-frame {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.lightbox-frame img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: zoom-out;
}

.lightbox-nav {
  display: grid;
  place-content: center;
  border: 0;
  background: rgba(87, 87, 87, .35);
  color: white;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  position: absolute;
}

.lightbox-nav::before {
  content: "";
  width: 9px;
  height: 9px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
}

.lightbox-nav.previous {
  top: calc(50% - 15px);
  left: 20px;
}

.lightbox-nav.previous::before {
  transform: rotate(135deg);
}

.lightbox-nav.next {
  top: calc(50% - 15px);
  right: 20px;
}

.lightbox-nav.next::before {
  transform: rotate(-45deg);
}

.lightbox-nav.close {
  top: 20px;
  right: 20px;
}

.lightbox-nav.close::before, .lightbox-nav.close::after {
  content: "";
  width: 13px;
  height: 1.5px;
  border: 0;
  background: currentColor;
  grid-area: 1 / 1;
  transform: rotate(45deg);
}

.lightbox-nav.close::after {
  transform: rotate(-45deg);
}

@media (max-width: 767px) {
  html { font-size: 12.2304px; scrollbar-width: none; }
  .desktop-nav { display: none; }
  .page-layout { width: 100%; }
  .mobile-nav {
    position: sticky;
    z-index: 2;
    top: 0;
    display: block;
    width: 100%;
    min-height: 7.05rem;
    padding: .9rem .9rem 0;
    background: #fff;
  }
  .mobile-nav .page-copy { white-space: nowrap; }
  main .page-content { padding: .9rem; }
  .work-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 2.7rem;
  }
  .work-media { width: 100%; padding-top: .54rem; }
  footer .page-content { padding: .9rem; }
  .lightbox { padding: 10px; }
  .lightbox-nav.previous { left: 25px; }
  .lightbox-nav.next { right: 25px; }
}

