:root {
  --page-x: clamp(28px, 4.2vw, 76px);
  --ink: #111111;
  --muted: #5f5f5f;
  --focus: #767676;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #ffffff;
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 700;
  letter-spacing: 0;
}

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

img {
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  -webkit-user-select: none;
  user-select: none;
}

.page {
  min-height: 100vh;
  padding: clamp(42px, 4.5vw, 64px) var(--page-x) clamp(34px, 4vw, 54px);
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.site-header {
  width: min(100%, 680px);
}

.role,
h1 {
  margin: 0;
  font-size: clamp(2.35rem, 3vw, 3.2rem);
  line-height: 1.08;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  font-weight: 700;
}

h1 {
  margin-top: 10px;
}

.portfolio {
  display: grid;
  grid-template-rows: auto 1fr;
  row-gap: clamp(54px, 6vw, 86px);
  padding-top: clamp(58px, 6vw, 78px);
}

.category-row {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  column-gap: 24px;
}

.category-link {
  width: fit-content;
  min-width: 72px;
  padding: 0 0 6px;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  font-size: clamp(1.08rem, 1.45vw, 1.45rem);
  line-height: 1.2;
  text-align: left;
  transition: color 180ms ease, border-color 180ms ease, opacity 180ms ease;
}

.category-link:nth-child(1) {
  justify-self: start;
  margin-left: 7.2vw;
}

.category-link:nth-child(2),
.category-link:nth-child(3),
.category-link:nth-child(4) {
  justify-self: center;
}

.category-link:hover,
.category-link:focus-visible,
.category-link.is-active {
  border-color: currentColor;
}

.category-link:focus-visible {
  outline: 1px solid var(--focus);
  outline-offset: 8px;
}

.category-link:not(.is-active) {
  color: #1f1f1f;
}

.work-view {
  width: 100%;
  min-width: 0;
}

.work-grid {
  --work-column-gap: clamp(42px, 3.4vw, 68px);
  --work-row-gap: clamp(58px, 6vw, 96px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: flex-start;
  column-gap: var(--work-column-gap);
  row-gap: var(--work-row-gap);
  width: 100%;
  overflow: visible;
  padding: 0;
}

.work-grid,
.thumbnail-row {
  scrollbar-color: rgba(17, 17, 17, 0.32) transparent;
  scrollbar-width: thin;
}

.work-grid::-webkit-scrollbar,
.thumbnail-row::-webkit-scrollbar {
  height: 6px;
  background: transparent;
}

.work-grid::-webkit-scrollbar-track,
.thumbnail-row::-webkit-scrollbar-track {
  background: transparent;
}

.work-grid::-webkit-scrollbar-thumb,
.thumbnail-row::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.32);
}

.work-grid::-webkit-scrollbar-corner,
.thumbnail-row::-webkit-scrollbar-corner {
  background: transparent;
}

.work-grid.is-auto-scrolling {
  scroll-snap-type: none;
  scroll-behavior: auto;
}

.work-grid.is-preparing {
  opacity: 0;
}

.work-grid.is-revealing {
  animation: refinedGalleryReveal 1800ms cubic-bezier(0.16, 1, 0.3, 1) both;
  will-change: opacity;
}

@keyframes refinedGalleryReveal {
  0% {
    opacity: 0;
  }

  22% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

.work-card {
  display: grid;
  justify-items: center;
  align-content: start;
  row-gap: 18px;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  text-align: center;
}

.work-grid.is-preparing .work-card {
  opacity: 0;
  transform: translate3d(28px, 0, 0);
}

.work-grid.is-revealing .work-card {
  animation: refinedWorkDrift 2400ms cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: var(--motion-delay, 0ms);
  will-change: opacity, transform;
}

@keyframes refinedWorkDrift {
  0% {
    opacity: 0;
    transform: translate3d(28px, 0, 0);
  }

  24% {
    opacity: 0;
    transform: translate3d(22px, 0, 0);
  }

  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.work-card:focus-visible {
  outline: 1px solid var(--focus);
  outline-offset: 8px;
}

.work-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: clamp(430px, 58vh, 760px);
  object-fit: contain;
  object-position: center center;
}

.work-name {
  display: block;
  width: 100%;
  margin: 0 auto;
  font-size: clamp(0.92rem, 0.95vw, 1.05rem);
  line-height: 1.35;
  color: var(--ink);
  text-align: center;
}

.home-random {
  width: 100%;
  display: grid;
  justify-items: center;
}

.home-random-card {
  position: relative;
  width: min(46vw, 840px);
  height: clamp(410px, 58vh, 800px);
  min-width: 320px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}

.home-random-card:focus-visible {
  outline: 1px solid var(--focus);
  outline-offset: 8px;
}

.home-random-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  opacity: 0;
  transition: opacity 900ms ease;
}

.home-random-image.is-visible {
  opacity: 1;
}

.home-random-image.is-leaving {
  opacity: 0;
}

.work-slider {
  width: 100%;
  min-width: 0;
}

.slider-layout {
  width: 100%;
  display: grid;
  justify-items: center;
  row-gap: clamp(18px, 2vw, 28px);
}

.slider-frame {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(52px, 1fr) minmax(260px, min(40vw, 720px)) minmax(52px, 1fr);
  grid-template-rows: auto 1fr;
  align-items: center;
  column-gap: clamp(22px, 3vw, 58px);
  row-gap: clamp(18px, 2.2vw, 36px);
}

.slider-work-title {
  grid-column: 1;
  grid-row: 1;
  justify-self: center;
  align-self: end;
  width: min(22vw, 270px);
  margin: 0;
  font-size: clamp(0.78rem, 0.85vw, 0.96rem);
  line-height: 1.35;
  font-weight: 700;
  color: var(--ink);
  text-align: left;
}

.slider-image {
  grid-column: 2;
  grid-row: 1 / span 2;
  justify-self: center;
  display: block;
  max-width: 100%;
  max-height: min(58vh, 720px);
  width: auto;
  height: auto;
  object-fit: contain;
}

.slider-arrow {
  --arrow-stroke: 1.4px;
  --arrow-head: clamp(13px, 1.25vw, 18px);
  --arrow-padding: 18%;
  position: relative;
  width: clamp(48px, 4vw, 72px);
  height: clamp(48px, 4vw, 72px);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  color: var(--ink);
  font-size: 0;
}

.slider-arrow-prev {
  grid-column: 1;
  grid-row: 2;
  justify-self: end;
}

.slider-arrow-next {
  grid-column: 3;
  grid-row: 2;
  justify-self: start;
}

.slider-arrow:focus-visible {
  outline: 1px solid var(--focus);
  outline-offset: 8px;
}

.slider-arrow::before,
.slider-arrow::after {
  content: "";
  position: absolute;
  top: 50%;
  display: block;
}

.slider-arrow::before {
  left: var(--arrow-padding);
  right: var(--arrow-padding);
  border-top: var(--arrow-stroke) solid currentColor;
  transform: translateY(-50%);
}

.slider-arrow::after {
  width: var(--arrow-head);
  height: var(--arrow-head);
  border-top: var(--arrow-stroke) solid currentColor;
  border-right: var(--arrow-stroke) solid currentColor;
}

.slider-arrow-prev::after {
  left: var(--arrow-padding);
  transform: translateY(-50%) rotate(-135deg);
}

.slider-arrow-next::after {
  right: var(--arrow-padding);
  transform: translateY(-50%) rotate(45deg);
}

.thumbnail-row {
  display: flex;
  justify-content: center;
  gap: clamp(14px, 1.7vw, 28px);
  width: min(62vw, 980px);
  max-width: 100%;
  overflow-x: auto;
  padding: 0 0 12px;
}

.thumbnail-button {
  flex: 0 0 clamp(58px, 5.2vw, 96px);
  padding: 0;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  opacity: 0.62;
}

.thumbnail-button.is-active,
.thumbnail-button:hover,
.thumbnail-button:focus-visible {
  opacity: 1;
  border-color: currentColor;
}

.thumbnail-button:focus-visible {
  outline: 1px solid var(--focus);
  outline-offset: 8px;
}

.thumbnail-button img {
  display: block;
  width: 100%;
  height: clamp(74px, 6.2vw, 120px);
  object-fit: contain;
  object-position: center center;
}

.empty-message {
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.95rem, 1vw, 1.05rem);
}

.site-footer {
  padding-top: clamp(82px, 8vw, 140px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  column-gap: 24px;
}

.contact-link {
  grid-column: 1;
  justify-self: start;
  display: inline-block;
  margin-left: 6.1vw;
  text-decoration: none;
  font-size: clamp(1.08rem, 1.35vw, 1.35rem);
  line-height: 1.25;
  border-bottom: 1px solid transparent;
}

.contact-link:hover,
.contact-link:focus-visible {
  border-color: currentColor;
}

.contact-link:focus-visible {
  outline: 1px solid var(--focus);
  outline-offset: 8px;
}

.instagram-link {
  --instagram-stroke: clamp(2.3px, 0.18vw, 3px);
  grid-column: 4;
  justify-self: end;
  display: grid;
  place-items: center;
  margin-right: clamp(94px, 8.2vw, 170px);
  width: clamp(28px, 2.2vw, 36px);
  height: clamp(28px, 2.2vw, 36px);
  text-decoration: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.instagram-link:hover,
.instagram-link:focus-visible {
  opacity: 0.68;
  transform: translateY(-1px);
}

.instagram-link:focus-visible {
  outline: 1px solid var(--focus);
  outline-offset: 8px;
}

.instagram-glyph {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border: var(--instagram-stroke) solid var(--ink);
  border-radius: 30%;
  background: #ffffff;
}

.instagram-glyph::before,
.instagram-glyph::after {
  content: "";
  position: absolute;
  display: block;
}

.instagram-glyph::before {
  inset: 28%;
  border: var(--instagram-stroke) solid var(--ink);
  border-radius: 50%;
}

.instagram-glyph::after {
  top: 20%;
  right: 20%;
  width: 15%;
  height: 15%;
  border-radius: 50%;
  background: var(--ink);
}

@media (max-width: 900px) {
  .category-link:nth-child(1) {
    margin-left: 0;
  }

  .home-random-card {
    width: min(72vw, 620px);
    height: clamp(360px, 56vh, 700px);
    min-width: 300px;
  }

  .slider-frame {
    grid-template-columns: minmax(42px, 1fr) minmax(240px, 62vw) minmax(42px, 1fr);
    column-gap: 20px;
  }

  .slider-work-title {
    width: min(25vw, 220px);
  }

  .thumbnail-row {
    width: 82vw;
  }

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

  .contact-link {
    margin-left: 0;
  }

  .instagram-link {
    margin-right: 0;
  }
}

@media (max-width: 640px) {
  .page {
    padding-inline: 24px;
  }

  .category-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 22px;
  }

  .category-link,
  .category-link:nth-child(n) {
    justify-self: start;
    margin-left: 0;
  }

  .work-grid {
    grid-template-columns: 1fr;
    row-gap: 46px;
  }

  .work-image {
    width: 100%;
    max-height: clamp(300px, 52vh, 560px);
  }

  .home-random-card {
    width: 100%;
    height: clamp(320px, 54vh, 580px);
    min-width: 0;
  }

  .slider-frame {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    grid-template-rows: auto auto;
    column-gap: 10px;
  }

  .slider-work-title {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-self: start;
    width: 100%;
    font-size: 0.82rem;
  }

  .slider-image {
    grid-column: 2;
    grid-row: 2;
  }

  .slider-arrow-prev,
  .slider-arrow-next {
    grid-row: 2;
  }

  .slider-arrow {
    width: 42px;
    height: 42px;
    font-size: 2.4rem;
  }

  .thumbnail-row {
    justify-content: flex-start;
    width: 100%;
  }

  .site-footer {
    grid-template-columns: repeat(2, 1fr);
  }

  .instagram-link {
    grid-column: 2;
  }
}
