*, html {
  margin: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  background: var(--white);
}

body {
  font-family: var(--font);
  font-variation-settings: "wdth" 100;
  overflow: hidden;
}

:root {
    --gray: #BCBCBC;
    --white: #FFFFFF;
    --black: #000000;
    --font: "instrument-sans-variable", sans-serif;
    --right-col: 54%;
    --project-h: 100dvh;
    --font-services: clamp(28px, 3.4vw, 42px);
    --font-links: clamp(22px, 2.65vw, 34px);
    --font-medium: clamp(18px, 1.8vw, 30px);
}

.work-pages {
  transition: transform 0.9s cubic-bezier(0.77, 0, 0.175, 1);
  will-change: transform;
}

body.work-done .work-pages {
  transform: translateY(calc(-1 * var(--project-h)));
}

.work-layout {
  display: grid;
  grid-template-columns: 1.75fr 1fr;
  height: 100dvh;
}

.work-gallery {
  height: 100dvh;
  overflow-y: auto;
  background: var(--white);
  padding: 0 0 40px;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

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

.work-gallery img {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 28px;
  opacity: 0;
  transition: opacity 1.15s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.work-gallery img.is-in {
  opacity: 1;
}

.work-gallery img:last-child {
  margin-bottom: 0;
}

.work-sidebar {
  position: relative;
  height: 100dvh;
  background: var(--white);
  color: var(--black);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px 28px 28px;
  overflow: hidden;
}

.work-info {
  max-width: 520px;
  opacity: 0;
  transition: opacity 1.2s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.work-info.is-in {
  opacity: 1;
}

.work-info h1 {
  color: var(--black);
  font-size: clamp(28px, 3.2vw, 44px);
  font-weight: 450;
  letter-spacing: -0.05em;
  line-height: 110%;
  margin-bottom: 10px;
}

.work-role {
  color: var(--gray);
  font-size: var(--font-medium);
  font-weight: 400;
  letter-spacing: -0.03em;
  margin-bottom: 22px;
}

.work-description {
  color: var(--black);
  font-size: 14px;
  font-weight: 400;
  line-height: 140%;
}

.work-link {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 2px;
  width: 100%;
  margin-top: 22px;
  color: var(--black);
  font-size: var(--font-links);
  font-weight: 450;
  letter-spacing: -0.05em;
  line-height: 110%;
  /* text-align: right; */
  text-decoration: none;
}

.work-link span {
  text-decoration: underline;
  text-underline-offset: 0.16em;
  text-decoration-thickness: 0.06em;
  overflow-wrap: anywhere;
}

.work-link svg {
  width: 0.78em;
  height: 0.78em;
  flex-shrink: 0;
  margin-top: 0.25em;
}

.work-link[hidden] {
  display: none;
}

.work-info-toggle {
  display: none;
}

.work-info-toggle[hidden] {
  display: none !important;
}

.work-back {
  position: absolute;
  top: 14px;
  left: 28px;
  z-index: 8;
  width: calc(44px * 0.9);
  height: calc(44px * 0.9);
}

.work-back svg,
.work-back img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.work-back img {
  transform: rotate(-90deg);
}

body.menu-open .work-back {
  opacity: 0;
  pointer-events: none;
}

.more-works {
  position: relative;
  height: 100dvh;
  max-height: 100dvh;
  padding: 14px 18px;
  background: var(--white);
  overflow: hidden;
}

.more-works h2 {
  margin: 0;
  font-size: var(--font-services);
  font-weight: 450;
  line-height: 115%;
  letter-spacing: -0.07em;
  color: var(--black);
}

.more-works .work-titles {
  position: absolute;
  left: 40%;
  right: 18px;
  top: 14px;
  font-size: var(--font-services);
  padding-right: 2.8em;
}

.more-works .work-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.2em;
}

.more-works .work-titles a {
  display: block;
  min-width: 0;
  color: var(--gray);
  font-size: var(--font-services);
  font-weight: 450;
  line-height: 115%;
  letter-spacing: -0.07em;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.5s ease;
}

.more-works .work-year {
  flex-shrink: 0;
  color: var(--gray);
  font-size: var(--font-services);
  font-weight: 450;
  line-height: 115%;
  letter-spacing: -0.07em;
  white-space: nowrap;
  transition: color 0.5s ease;
}

@media (hover: hover) {
  .more-works .work-titles a:hover,
  .more-works .work-row:hover a,
  .more-works .work-row:hover .work-year {
    color: var(--black);
  }
}

.work-preview {
  position: absolute;
  left: 18px;
  bottom: 14px;
  z-index: 2;
  width: min(30vw, 380px);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.work-preview.is-visible {
  opacity: 1;
}

.work-preview img {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 900px) {
  html,
  body {
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body {
    overflow: auto;
  }

  .work-pages {
    transform: none !important;
  }

  .work-layout {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0;
  }

  .work-sidebar {
    order: -1;
    position: relative;
    height: auto;
    min-height: 0;
    justify-content: flex-start;
    padding: 72px 16px 12px;
    overflow: visible;
  }

  .work-back {
    left: 16px;
  }

  .work-info {
    max-width: none;
  }

  .work-info h1 {
    font-size: clamp(26px, 8vw, 40px);
  }

  .work-info-toggle {
    display: inline-flex;
    align-items: center;
    margin: 0 0 18px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--black);
    font-family: inherit;
    font-size: var(--font-medium);
    font-weight: 450;
    letter-spacing: -0.04em;
    line-height: 115%;
    cursor: pointer;
  }

  .work-info-toggle[hidden] {
    display: none !important;
  }

  .work-description {
    display: none;
    margin-bottom: 8px;
  }

  .work-info.is-open .work-description {
    display: block;
  }

  .work-link {
    font-size: clamp(18px, 5.2vw, 26px);
    justify-content: flex-start;
  }

  .work-gallery {
    height: auto;
    overflow: visible;
    padding: 8px 16px 56px;
  }

  .work-gallery img {
    margin-bottom: 16px;
  }

  .more-works {
    height: 100dvh;
    padding: 14px 16px;
  }

  .more-works .work-titles {
    left: 16px;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    padding-right: 0;
  }

  .more-works .work-titles a {
    white-space: normal;
  }

  .work-preview {
    display: none;
  }
}
