:root {
  --bg-from: #427992;
  --bg-to: #dae1e5;
  --lab-blue: #0b6ff0;
  --lab-blue-deep: #073f9e;
  --lab-blue-light: #bfe7ff;
  --reaction-red: #b90012;
  --ink: #000000;
  --paper: #ffffff;
  --easing: cubic-bezier(0.25, 1, 0.5, 1);
  font-family: "Neue Haas Grotesk", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1;
  font-weight: 400;
  color: var(--ink);
  background: var(--bg-from);
  font-synthesis: none;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

html::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background: linear-gradient(180deg, var(--bg-from), var(--bg-to));
  transition: background 1s var(--easing);
}

body {
  margin: 0;
  min-height: 100%;
}

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

button {
  appearance: none;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

a {
  text-decoration: none;
}

.site-header {
  position: fixed;
  left: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 56px;
  padding: 16px;
  color: var(--paper);
  mix-blend-mode: difference;
  user-select: none;
}

.header-back-link {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.site-header h1 {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  margin: 0;
  transform: translate3d(-50%, -50%, 0);
  font: inherit;
  white-space: nowrap;
}

.site-header button {
  position: relative;
  z-index: 2;
  line-height: 1;
}

.studio-link {
  position: absolute;
  left: 72px;
  top: 50%;
  z-index: 1;
  line-height: 1;
  transform: translate3d(0, -50%, 0);
}

.site-header [data-info-toggle] {
  margin-left: auto;
}

.info-panel {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 16px 88px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 50% 44%, rgba(191, 231, 255, 0.38), transparent 31%),
    linear-gradient(180deg, var(--lab-blue), var(--lab-blue-deep));
  transform: translate3d(0, 100%, 0);
  transition: transform 1s var(--easing);
}

.show-info .info-panel {
  transform: translate3d(0, 0, 0);
}

.info-image {
  width: min(38vh, 52vw);
  aspect-ratio: 4 / 5;
  background: var(--dominant-color);
  box-shadow: 0 0 0 1px rgba(191, 231, 255, 0.28);
}

.info-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reaction-formula {
  display: flex;
  align-items: baseline;
  gap: 0.34em;
  margin: 28px 0 0;
  padding: 0;
  color: var(--reaction-red);
  font-size: 16px;
  line-height: 1.2;
}

.reaction-formula span {
  display: inline-block;
  opacity: 0;
  transform: translate3d(0, 18px, 0) rotateX(76deg) scale(0.86);
  transform-origin: 50% 100%;
}

.reaction-formula sub {
  font-size: 0.7em;
  line-height: 0;
}

.show-info .reaction-formula span {
  animation: reagent-in 640ms var(--easing) both;
  animation-delay: calc(420ms + var(--i) * 74ms);
}

.works {
  position: relative;
  padding-bottom: 30vh;
}

.work {
  display: grid;
  min-height: 112vh;
  place-items: center;
  padding: 18vh 16px 20vh;
}

.work + .work {
  margin-top: 260px;
}

.work figure {
  width: min(58vw, 760px);
  margin: 0;
}

.image-shell {
  position: relative;
  width: 100%;
  aspect-ratio: var(--ratio);
  overflow: hidden;
  background: var(--dominant-color);
}

.image-shell img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.image-mask {
  position: absolute;
  inset: 0;
  background: var(--dominant-color);
  transform: scaleY(1);
  transform-origin: 50% 100%;
  transition: transform 1.25s linear;
}

.work.is-visible .image-mask {
  transform: scaleY(0);
}

.work figcaption {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  line-height: 1.2;
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition:
    opacity 1s var(--easing),
    transform 1s var(--easing);
}

.work.is-visible figcaption {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

@keyframes reagent-in {
  0% {
    opacity: 0;
    transform: translate3d(0, 18px, 0) rotateX(76deg) scale(0.86);
  }

  72% {
    opacity: 1;
    transform: translate3d(0, -2px, 0) rotateX(0deg) scale(1.06);
  }

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

@media (max-width: 720px) {
  .site-header {
    height: 52px;
    padding: 12px;
  }

  .info-panel {
    padding: 90px 16px 120px;
    text-align: center;
  }

  .info-image {
    width: min(64vw, 280px);
  }

  .work {
    min-height: 100svh;
    padding: 110px 12px 120px;
  }

  .work + .work {
    margin-top: 160px;
  }

  .work figure {
    width: min(88vw, 460px);
  }

  .work figcaption {
    display: grid;
    gap: 8px;
  }
}
