:root {
  color-scheme: light;
  --bg: #ffffff;
  --ink: #000000;
  --muted: #777777;
  --line: #e8e8e8;
  --pad: clamp(18px, 3vw, 42px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Times New Roman", Times, Georgia, serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.2;
}

a,
button {
  color: inherit;
  font: inherit;
}

a {
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 22px var(--pad) 0;
  background: linear-gradient(180deg, #fff 0%, rgb(255 255 255 / 0.9) 64%, transparent);
}

.brand,
.nav a,
.text-button {
  border: 0;
  background: transparent;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.brand {
  min-width: 120px;
  font-size: 22px;
  line-height: 1;
}

.nav {
  display: flex;
  gap: clamp(34px, 8vw, 132px);
  font-size: 22px;
  line-height: 1;
}

.nav a,
.text-button {
  cursor: pointer;
}

.nav a:hover,
.nav a.is-active,
.brand:hover,
.text-button:hover,
.contact a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.home {
  position: relative;
  min-height: 190vh;
  padding: 86px var(--pad) 70px;
  overflow: visible;
}

.home-images {
  position: absolute;
  inset: 0;
}

.home-image {
  position: absolute;
  z-index: 1;
  display: block;
  width: clamp(88px, 9vw, 172px);
  transition: opacity 160ms ease;
}

.home-image:hover {
  opacity: 0.72;
}

.home-image img {
  width: 100%;
  height: auto;
  max-height: 210px;
  object-fit: contain;
}

.home-image-1 {
  left: 25vw;
  top: 13vh;
  width: clamp(86px, 7vw, 132px);
}

.home-image-2 {
  right: 13vw;
  top: 10vh;
  width: clamp(82px, 7vw, 128px);
}

.home-image-3 {
  left: 4vw;
  top: 37vh;
  width: clamp(120px, 12vw, 220px);
}

.home-image-4 {
  right: 30vw;
  top: 41vh;
  width: clamp(110px, 10vw, 190px);
}

.home-image-5 {
  right: 6vw;
  top: 36vh;
  width: clamp(140px, 15vw, 270px);
}

.home-image-6 {
  left: 23vw;
  top: 76vh;
  width: clamp(120px, 12vw, 230px);
}

.home-image-7 {
  left: 53vw;
  top: 73vh;
  width: clamp(90px, 8vw, 150px);
}

.home-image-8 {
  right: 15vw;
  top: 78vh;
  width: clamp(118px, 11vw, 220px);
}

.home-image-9 {
  left: 9vw;
  top: 111vh;
  width: clamp(92px, 8vw, 150px);
}

.home-image-10 {
  left: 37vw;
  top: 104vh;
  width: clamp(120px, 13vw, 240px);
}

.home-image-11 {
  right: 8vw;
  top: 111vh;
  width: clamp(96px, 9vw, 170px);
}

.home-image-12 {
  left: 18vw;
  top: 147vh;
  width: clamp(138px, 14vw, 260px);
}

.home-image-13 {
  left: 58vw;
  top: 141vh;
  width: clamp(110px, 10vw, 190px);
}

.home-image-14 {
  right: 18vw;
  top: 153vh;
  width: clamp(90px, 8vw, 150px);
}

.portfolio {
  min-height: 100vh;
  padding-top: 76px;
}

.portfolio-meta,
.portfolio-actions {
  position: fixed;
  z-index: 8;
  display: flex;
  gap: 18px;
}

.portfolio-meta {
  left: var(--pad);
  bottom: 22px;
  color: var(--muted);
  font-size: 15px;
}

.portfolio-meta p {
  margin: 0;
}

.portfolio-actions {
  right: var(--pad);
  bottom: 18px;
}

.portfolio-meta,
.portfolio-actions,
.page-button {
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

body.is-portfolio .portfolio-meta,
body.is-portfolio .portfolio-actions,
body.is-portfolio .page-button {
  opacity: 1;
  pointer-events: auto;
}

.page-button {
  position: fixed;
  top: var(--page-button-y, 50%);
  left: var(--page-button-x, var(--pad));
  z-index: 9;
  min-width: 44px;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1;
  background: rgb(255 255 255 / 0.88);
  transform: translateY(-50%);
}

#previousButton {
  --page-button-x: var(--previous-button-x, var(--pad));
}

#nextButton {
  --page-button-x: var(--next-button-x, calc(100vw - 100px));
}

.text-button[disabled] {
  color: var(--muted);
  cursor: default;
  text-decoration: none;
}

.text-button {
  padding: 0;
}

.gallery {
  display: flex;
  align-items: center;
  gap: clamp(72px, 9vw, 132px);
  min-height: calc(100vh - 76px);
  padding: 0 max(9vw, var(--pad)) 72px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.gallery::-webkit-scrollbar {
  display: none;
}

.work {
  flex: 0 0 auto;
  display: grid;
  gap: 13px;
  width: auto;
  margin: 0;
  scroll-snap-align: center;
}

.work img {
  width: auto;
  height: min(68vh, 620px);
  max-width: 72vw;
  object-fit: contain;
}

.work:nth-child(2n) img,
.work:nth-child(5n) img {
  height: min(76vh, 690px);
}

.work:nth-child(3n) img {
  height: min(54vh, 500px);
}

figcaption {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font-size: 15px;
  white-space: nowrap;
}

.gallery.is-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  gap: 46px 26px;
  min-height: auto;
  padding-top: 42px;
  padding-bottom: 120px;
  overflow: visible;
  scroll-snap-type: none;
}

.gallery.is-grid .work {
  width: 100%;
  scroll-snap-align: none;
}

.gallery.is-grid .work img {
  width: 100%;
  height: auto;
  max-width: none;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  min-height: 70vh;
  padding: 110px var(--pad) 90px;
  border-top: 1px solid var(--line);
}

.label,
.contact h1,
.contact p {
  margin: 0;
}

.label,
.contact-details p {
  color: var(--muted);
}

.contact h1 {
  margin-top: 5px;
  font-size: clamp(42px, 9vw, 128px);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0;
}

.contact-details {
  display: grid;
  align-content: start;
  gap: 10px;
  max-width: 360px;
}

.contact-details p {
  margin-bottom: 18px;
}

@media (max-width: 760px) {
  body {
    font-size: 15px;
  }

  .brand,
  .nav {
    font-size: 18px;
  }

  .site-header {
    display: grid;
    justify-items: center;
    gap: 28px;
    padding: 24px var(--pad) 0;
  }

  .nav {
    width: 100%;
    justify-content: space-between;
    gap: 18px;
  }

  .portfolio {
    padding-top: 58px;
  }

  .home {
    min-height: 235vh;
    padding-top: 136px;
    overflow: visible;
  }

  .home-images {
    position: absolute;
    inset: 0;
    display: block;
    margin-top: 0;
  }

  .home-image {
    position: absolute;
  }

  .home-image img {
    width: 100%;
    height: auto;
    max-height: 260px;
    object-fit: contain;
  }

  .home-image-1 {
    left: 30vw;
    top: 19vh;
    width: 38vw;
  }

  .home-image-2 {
    right: 6vw;
    top: 46vh;
    width: 32vw;
  }

  .home-image-3 {
    left: 6vw;
    top: 74vh;
    width: 35vw;
  }

  .home-image-4 {
    right: 11vw;
    top: 104vh;
    width: 42vw;
  }

  .home-image-5 {
    left: 9vw;
    top: 133vh;
    width: 30vw;
  }

  .home-image-6 {
    right: 6vw;
    top: 151vh;
    width: 36vw;
  }

  .home-image-7 {
    left: 24vw;
    top: 172vh;
    width: 34vw;
  }

  .home-image-8 {
    right: 8vw;
    top: 203vh;
    width: 30vw;
  }

  .home-image-9,
  .home-image-10,
  .home-image-11,
  .home-image-12,
  .home-image-13,
  .home-image-14 {
    display: none;
  }

  .gallery {
    gap: 34px;
    min-height: calc(100vh - 58px);
    padding: 0 var(--pad) 92px;
    scroll-snap-type: x mandatory;
  }

  .work img,
  .work:nth-child(2n) img,
  .work:nth-child(3n) img,
  .work:nth-child(5n) img {
    width: calc(100vw - (var(--pad) * 2));
    height: auto;
    max-width: none;
    max-height: 68vh;
    object-fit: contain;
  }

  figcaption {
    white-space: normal;
  }

  .portfolio-meta {
    bottom: 50px;
  }

  .portfolio-actions {
    bottom: 18px;
    gap: 14px;
  }

  .page-button {
    top: auto;
    bottom: 50px;
    min-width: 0;
    padding: 0 var(--pad);
    font-size: 12px;
    background: transparent;
    transform: none;
  }

  .gallery.is-grid {
    grid-template-columns: 1fr;
    gap: 36px;
    padding-top: 26px;
  }

  .contact {
    grid-template-columns: 1fr;
    min-height: 72vh;
    padding-top: 84px;
  }
}
