:root {
  color-scheme: light;
  --paper: #fbfaf7;
  --ink: #232323;
  --muted: #77736d;
  --line: rgba(35, 35, 35, 0.12);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Avenir Next", Avenir, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --body-small: "Avenir Next", Avenir, "Helvetica Neue", Arial, sans-serif;
  --page-x: clamp(32px, 6.95vw, 100px);
  --gap: 20px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  letter-spacing: 0;
}

body.is-animating .app-shell {
  opacity: 0;
  transform: translateY(18px);
}

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

button {
  color: inherit;
  font: inherit;
}

.site-header {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 28px var(--page-x);
  pointer-events: none;
  transform: translateY(0);
  transition: transform 520ms cubic-bezier(0.19, 1, 0.22, 1), opacity 360ms ease;
}

body.is-header-hidden .site-header {
  opacity: 0;
  transform: translateY(-110%);
}

.brand,
.top-nav {
  pointer-events: auto;
}

.brand {
  display: grid;
  justify-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font-family: var(--sans);
  font-size: clamp(20px, 1.45vw, 26px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.brand-subtitle {
  display: block;
  font-size: clamp(9px, 0.56vw, 11px);
  font-weight: 300;
  letter-spacing: 0.18em;
  line-height: 1;
  color: rgba(35, 35, 35, 0.46);
}

.top-nav {
  position: absolute;
  top: 28px;
  right: calc(var(--page-x) + 34px);
}

.category-list {
  display: flex;
  gap: 24px;
  justify-content: flex-end;
  justify-items: end;
  text-align: right;
}

.top-nav button {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font-family: var(--sans);
  font-size: clamp(13px, 0.86vw, 15px);
  font-style: normal;
  font-weight: 500;
  color: rgba(32, 32, 32, 0.34);
  transition: color 220ms ease, transform 260ms var(--ease);
}

.top-nav button:hover {
  color: rgba(32, 32, 32, 0.68);
  transform: none;
}

.top-nav button.active {
  color: var(--ink);
  transform: none;
}

.app-shell {
  min-height: 100vh;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 260ms ease, transform 520ms var(--ease);
}

.home-view {
  min-height: 100vh;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 240ms ease, transform 360ms var(--ease);
}

.home-view.is-switching {
  opacity: 0;
  transform: translateY(10px);
}

.album-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 116px var(--page-x) 86px;
}

.album-rows {
  width: 100%;
  display: grid;
  gap: var(--gap);
  align-items: start;
}

.album-grid {
  --columns: 2;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(var(--columns), minmax(0, 1fr));
  gap: var(--gap);
  align-items: start;
}

.album-item {
  display: block;
  min-width: 0;
  opacity: 1;
  scroll-snap-align: none;
  scroll-margin-block: 12vh;
}

.album-figure {
  position: relative;
  display: grid;
  margin: 0;
  overflow: hidden;
  aspect-ratio: 1.42 / 1;
  background: #eee7df;
}

.album-figure img {
  grid-area: 1 / 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  filter: saturate(0.95);
  transition: none;
}

.album-figure img.active {
  opacity: 1;
}

.album-item:hover img.active {
  filter: saturate(1.04);
  transform: none;
}

.album-figure figcaption {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  gap: 7px;
  padding: 24px 24px 14px;
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.48), rgba(0, 0, 0, 0));
}

.album-figure figcaption span {
  transform: translateY(0);
  transition: transform 240ms var(--ease);
}

.album-figure small {
  display: block;
  max-width: 520px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 11px;
  font-weight: 300;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 220ms ease, transform 260ms var(--ease);
}

.album-item:hover figcaption span {
  transform: translateY(-7px);
}

.album-item:hover .album-figure small {
  opacity: 1;
  transform: translateY(0);
}

.project-selected {
  padding: 0 var(--page-x) 120px;
}

.project-strip {
  padding: 86px 0 0;
}

.project-strip__head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  color: rgba(35, 35, 35, 0.64);
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 0.02em;
}

.project-strip__head a {
  transition: color 220ms ease;
}

.project-strip__head a:hover {
  color: var(--ink);
}

.album-empty {
  display: grid;
  place-items: center;
  min-height: 45vh;
  color: var(--muted);
  font-size: 13px;
}

.album-empty[hidden] {
  display: none;
}

.project-view {
  position: relative;
  padding: 104px var(--page-x) 96px;
}

.project-back {
  position: fixed;
  z-index: 45;
  top: 28px;
  left: var(--page-x);
  width: auto;
  height: auto;
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: 0.045em;
  transition: color 220ms ease, transform 260ms var(--ease), opacity 300ms ease;
}

.project-back:hover {
  color: rgba(35, 35, 35, 0.55);
  transform: translateX(-2px);
}

.project-hero {
  display: block;
  width: min(720px, 100%);
  margin: 0 auto clamp(46px, 5vw, 76px);
  text-align: center;
}

.project-hero h1 {
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(18px, 1.3vw, 24px);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: 0.015em;
}

.project-hero p {
  max-width: 520px;
  margin: 14px auto 0;
  color: #6f6f6b;
  font-family: var(--body-small);
  font-size: clamp(11px, 0.82vw, 13px);
  font-weight: 300;
  line-height: 1.78;
  letter-spacing: 0.035em;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: clamp(44px, 4.8vw, 78px) clamp(36px, 5vw, 84px);
  width: min(1320px, 100%);
  margin: 0 auto;
}

.image-item {
  margin: 0;
  scroll-snap-align: none;
  scroll-margin-block: 14vh;
}

.image-wrap {
  display: block;
  background: transparent;
}

.image-item img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: saturate(0.94);
  transition: transform 420ms var(--ease), filter 300ms ease;
}

.image-item:hover img {
  filter: saturate(1.04);
  transform: none;
}

.image-item figcaption {
  min-height: 1.4em;
  margin-top: 12px;
  color: var(--muted);
  font-family: var(--body-small);
  font-size: 12px;
  font-weight: 300;
  line-height: 1.58;
  letter-spacing: 0.04em;
}

.about-modal {
  position: fixed;
  z-index: 90;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(180px, 24vw) minmax(260px, 520px);
  justify-content: center;
  align-content: center;
  gap: clamp(34px, 6vw, 90px);
  padding: 80px var(--page-x);
  background: rgba(251, 250, 247, 0.96);
  animation: modalIn 360ms var(--ease);
}

.about-modal__close {
  position: absolute;
  top: 30px;
  right: var(--page-x);
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 14px;
  font-style: normal;
  font-weight: 300;
}

.about-modal__image {
  margin: 0;
}

.about-modal__image img {
  display: block;
  width: 100%;
  height: auto;
  filter: saturate(0.92);
}

.about-modal__body {
  align-self: end;
}

.about-modal__body p {
  margin: 0 0 20px;
  color: #555;
  font-family: var(--body-small);
  font-size: clamp(14px, 1vw, 17px);
  font-weight: 300;
  line-height: 1.72;
  letter-spacing: 0.025em;
}

.contact-list {
  display: grid;
  gap: 8px;
  margin-top: 28px;
}

.contact-list a,
.contact-list span {
  width: fit-content;
  border-bottom: 1px solid rgba(32, 32, 32, 0.32);
  font-family: var(--body-small);
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.035em;
}

.empty-state,
.error-state {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  :root {
    --page-x: 22px;
    --gap: 16px;
  }

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

  .top-nav {
    top: 22px;
    right: var(--page-x);
  }

  .album-screen {
    padding-top: 104px;
  }

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

  .image-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 34px 18px;
  }

  .about-modal {
    grid-template-columns: 1fr;
    align-content: start;
    overflow: auto;
    padding-top: 88px;
  }

  .about-modal__image {
    width: min(280px, 70vw);
    margin: 0 auto;
  }
}

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

  .project-strip__head {
    display: grid;
  }
}
