:root {
  --page-margin: 20px;
  --grid-gutter: 20px;
  --ink: #050505;
  --paper: #ffffff;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --elastic: cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    sans-serif;
  color: var(--ink);
  background: var(--paper);
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

@view-transition {
  /* The liquid transition already owns the cross-page handoff. */
  navigation: none;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
}

* {
  box-sizing: border-box;
}

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

html.lenis {
  scroll-behavior: auto;
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: var(--paper);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
}

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

.works-page {
  position: relative;
  overflow: hidden;
}

.works-page > * {
  transition:
    opacity 260ms cubic-bezier(0.32, 0, 0.2, 1),
    transform 260ms cubic-bezier(0.32, 0, 0.2, 1);
}

.is-works-leaving-page .works-page > * {
  opacity: 0;
  transform: translate3d(0, 20px, 0);
  pointer-events: none;
}

.works-hero {
  position: relative;
  z-index: 0;
  display: flex;
  flex-direction: column;
  padding: 20px var(--page-margin);
}

.hero-title-wrap {
  display: flex;
  width: 100%;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
}

.works-title-stage {
  position: relative;
  width: 100%;
}

.hero-title {
  display: flex;
  width: 100%;
  margin: 0;
  align-items: center;
  justify-content: center;
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: var(--works-arrival-font-size, calc(26.413vw - 10.565px));
  font-weight: 200;
  height: var(--works-arrival-ink-height, auto);
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  color: var(--ink);
}

.works-booting .works-directory,
.works-booting .works-ending,
.works-booting .works-footer {
  visibility: hidden;
}

.hero-title-text {
  display: inline-block;
  scale: var(--works-arrival-scale-x, 1) 1;
  translate: var(--works-arrival-offset-x, 0px) var(--works-arrival-offset-y, 0px);
}

.is-works-arrival .hero-title {
  color: var(--ink);
  opacity: 1;
  filter: none;
  transform: none;
  animation: none;
}

.is-works-arrival .hero-title.reveal,
.is-works-arrival .hero-title-text {
  animation: none !important;
  transition: none !important;
  filter: none !important;
  transform: none !important;
}

.works-directory {
  position: relative;
  z-index: 2;
  padding: 0 var(--page-margin);
  color: #ffffff;
  mix-blend-mode: difference;
}

.side-label {
  position: fixed;
  z-index: 3;
  top: 50vh;
  display: block;
  width: max-content;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms var(--ease);
}

.is-list-view .side-label {
  opacity: 1;
  animation: project-line-rise 860ms var(--ease) 80ms both;
}

.is-list-view .side-label-right {
  animation-delay: 160ms;
}

.is-safari .is-list-view .side-label {
  animation-name: project-line-rise-safari;
}

.side-label-left {
  left: var(--page-margin);
}

.side-label-right {
  right: var(--page-margin);
}

.project-list {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 0;
}

.project-entry {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--grid-gutter);
  row-gap: 10px;
}

.project-line {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-column: 1 / -1;
  column-gap: var(--grid-gutter);
  align-items: center;
  min-height: 19px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  margin-top: 0;
  margin-bottom: 0;
  outline: none;
  color: inherit;
  text-decoration: none;
  transition:
    margin-top 420ms cubic-bezier(0.22, 0.78, 0.24, 1),
    margin-bottom 420ms cubic-bezier(0.22, 0.78, 0.24, 1);
}

.project-line-reveal {
  animation: project-line-rise 860ms var(--ease) both;
  animation-delay: var(--line-reveal-delay, 80ms);
  will-change: opacity, filter, transform;
}

.works-year span {
  animation: project-line-rise 860ms var(--ease) 80ms both;
}

.works-booting .project-line-reveal,
.works-booting .hero-title.reveal,
.works-booting .works-year span {
  animation-play-state: paused;
}

.is-safari .project-line-reveal {
  animation-name: project-line-rise-safari;
}

.is-safari .works-year span {
  animation-name: project-line-rise-safari;
}

@keyframes project-line-rise {
  0% {
    opacity: 0;
    filter: blur(5px);
    transform: translate3d(0, 10px, 0);
  }

  72% {
    opacity: 1;
    filter: blur(0.4px);
    transform: translate3d(0, -1px, 0);
  }

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

@keyframes project-line-rise-safari {
  0% {
    opacity: 0;
    transform: translate3d(0, 10px, 0);
  }

  72% {
    opacity: 1;
    transform: translate3d(0, -1px, 0);
  }

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

.project-line.has-article {
  position: relative;
  cursor: pointer;
}

.project-inline-cover {
  display: none;
}

html.is-works-pinching {
  scroll-behavior: auto;
  overflow-anchor: none;
}

html.is-works-pinching .project-line {
  pointer-events: none;
}

.project-line.has-article::before {
  position: absolute;
  z-index: 4;
  content: "";
  inset: -20px 0;
}

.line-pair {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-row: 1;
  gap: 14px;
  white-space: nowrap;
}

.line-pair:nth-of-type(1) {
  grid-column: 2;
}

.line-pair:nth-of-type(2) {
  grid-column: 3;
}

.line-pair > :nth-child(2) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.line-pair h2,
.line-pair time,
.line-pair strong {
  margin: 0;
  font: inherit;
}

.project-entry.has-subprojects h2 {
  position: relative;
  z-index: 3;
  transform: translate3d(0, var(--group-heading-y, 0px), 0);
  transition: transform 420ms cubic-bezier(0.22, 0.78, 0.24, 1);
  will-change: transform;
}

.row-rule {
  display: block;
  grid-row: 1;
  width: 100%;
  height: 12px;
  align-self: center;
  background: #ffffff;
  opacity: 0;
  clip-path: polygon(
    0 0,
    14px 1px,
    calc(100% - 14px) 1px,
    100% 0,
    100% 100%,
    calc(100% - 14px) calc(100% - 1px),
    14px calc(100% - 1px),
    0 100%
  );
  transition: opacity 180ms var(--ease);
}

.row-rule-left {
  grid-column: 1;
}

.row-rule-right {
  grid-column: 4;
}

.row-thread {
  display: block;
  z-index: 2;
  grid-column: 2 / 4;
  grid-row: 1;
  width: 100%;
  height: 1px;
  align-self: center;
  background: #ffffff;
  opacity: 0;
  pointer-events: none;
  transform: scaleX(0.7);
  transition:
    opacity 180ms var(--ease),
    transform 520ms var(--elastic);
}

.project-line > .row-rule,
.project-line > .row-thread {
  display: none;
}

.project-line.is-active {
  margin-top: 30px;
  margin-bottom: 30px;
}

/* The initial gap is layout, not a second animation underneath the entrance. */
.is-works-entering:not(.is-works-hovering) .project-line,
.is-works-entering:not(.is-works-hovering) .project-entry.has-subprojects h2 {
  transition: none;
}

/* Desktop ink shares the row's entrance; the mobile directory has no hover ink. */
@media (min-width: 561px) {
  .is-works-entering:not(.is-works-hovering) .project-line.is-active > .row-rule,
  .is-works-entering:not(.is-works-hovering) .project-line.is-active > .row-thread {
    display: block;
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.is-works-entering:not(.is-works-hovering) .project-hover-indicator {
  visibility: hidden;
}

.project-hover-indicator {
  --indicator-y: 0px;
  position: absolute;
  z-index: 0;
  top: 0;
  right: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--grid-gutter);
  height: 19px;
  align-items: center;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(0, calc(var(--indicator-y) + 10px), 0);
  transition:
    opacity 620ms var(--ease),
    transform 620ms var(--ease);
  will-change: transform;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.project-hover-indicator.is-ready {
  opacity: 1;
  transform: translate3d(0, var(--indicator-y), 0);
  transition:
    opacity 620ms var(--ease),
    transform 420ms cubic-bezier(0.22, 0.78, 0.24, 1);
}


.project-hover-indicator .row-rule,
.project-hover-indicator .row-thread {
  opacity: 1;
}

.project-hover-indicator.is-placing {
  transition: none;
}

.project-hover-indicator .row-thread {
  transform: scaleX(1);
}

.project-cover-preview {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  width: min(326px, calc(100vw - 40px));
  aspect-ratio: 3 / 2;
  pointer-events: none;
  transform: translate3d(-400px, -300px, 0);
  will-change: transform;
}

.project-cover-preview-media {
  position: relative;
  width: 100%; height: 100%;
  overflow: hidden;
  /* The zero-area mask owns the hidden endpoint. Avoid a separate visibility
     switch cutting off the last visible sliver of the closing animation. */
  visibility: visible;
  clip-path: inset(50% 0 50% 0);
  transition: clip-path 340ms cubic-bezier(0.42, 0, 0.58, 1);
}
.project-cover-preview .project-cover-canvas {
  display: block;
  width: 100%; height: 100%;
}
.project-cover-preview.is-visible .project-cover-preview-media {
  visibility: visible;
  clip-path: inset(0 0 0 0);
  transition: clip-path 420ms cubic-bezier(0.42, 0, 0.58, 1);
}
@media (prefers-reduced-motion: reduce) {
  .project-cover-preview-media {
    opacity: 0; clip-path: none; transform: none;
    transition: opacity 120ms linear, visibility 0s linear 120ms;
  }
  .project-cover-preview.is-visible .project-cover-preview-media {
    opacity: 1; clip-path: none; transform: none;
    transition: opacity 120ms linear, visibility 0s linear;
  }
}

@media (hover: none), (pointer: coarse) {
  .project-cover-preview {
    display: none;
  }
}

.works-ending {
  position: relative;
  z-index: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--grid-gutter);
  margin-top: -20px;
  padding: 0 var(--page-margin) 20px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
}

.works-ending-art {
  display: block;
  grid-column: 2 / 4;
  grid-row: 1;
  width: 100%;
  align-self: start;
  height: auto;
  opacity: 1;
  pointer-events: none;
  transition: opacity 180ms var(--ease);
}

.works-ending-canvas {
  position: absolute;
  top: -180px;
  left: 0;
  display: block;
  z-index: 0;
  width: 100%;
  height: calc(100% + 340px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms var(--ease);
}

.works-ending.is-particles .works-ending-art {
  opacity: 0;
}

.works-ending.is-particles .works-ending-canvas {
  opacity: 1;
  pointer-events: none;
}

.works-footer {
  position: absolute;
  z-index: 3;
  right: var(--page-margin);
  bottom: 20px;
  left: var(--page-margin);
  color: var(--ink);
  font-size: 14px;
  line-height: 14px;
  pointer-events: none;
}

.works-year {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--grid-gutter);
  color: var(--ink);
  pointer-events: none;
}

.works-year span {
  display: flex;
  grid-row: 1;
  height: 14px;
  align-self: end;
  align-items: center;
  font-variant-numeric: tabular-nums;
}

.works-year span:nth-child(1) {
  grid-column: 1;
}

.works-year span:nth-child(2) {
  grid-column: 2;
}

.works-year span:nth-child(3) {
  grid-column: 3;
}

.works-year span:nth-child(4) {
  grid-column: 4;
}

.works-footer .language-entry {
  position: absolute;
  right: 0;
  bottom: 0;
  display: flex;
  gap: 2px;
  height: 14px;
  white-space: nowrap;
}

.language-entry button {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  cursor: pointer;
  pointer-events: auto;
  opacity: 1;
  text-decoration: none;
  transition: opacity 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.language-entry button[aria-pressed="false"] {
  opacity: 0.2;
}

.language-entry button:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .language-entry button { transition: none; }
}

.reveal {
  opacity: 0;
  filter: blur(5px);
  transform: translate3d(0, 10px, 0);
  animation: rise-in 860ms var(--ease) forwards;
}

.hero-title.reveal {
  animation-delay: 80ms;
}

@keyframes rise-in {
  0% {
    opacity: 0;
    filter: blur(5px);
    transform: translate3d(0, 10px, 0);
  }

  72% {
    opacity: 1;
    filter: blur(0.5px);
    transform: translate3d(0, -1px, 0);
  }

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

@media (max-width: 900px) {
  :root {
    --grid-gutter: 16px;
  }

}

@media (max-width: 560px) {
  :root {
    --page-margin: 20px;
    --grid-gutter: 12px;
  }

  .hero-title-wrap {
    align-items: flex-start;
  }

  .project-hover-indicator {
    display: none;
  }

  .project-line.is-active {
    margin-top: 0;
    margin-bottom: 0;
  }

  .works-ending-art {
    grid-column: 1 / -1;
  }

  .works-ending {
    margin-top: 20px;
  }

  .directory-header {
    font-size: 14px;
  }

  .works-directory {
    color: #000;
    mix-blend-mode: normal;
  }

  .project-list {
    gap: 0;
  }

  .project-entry {
    border-top: 1px solid #888;
    padding: 10px 0 34px;
    row-gap: 20px;
  }

  .project-line {
    align-items: start;
  }

  .project-line.has-article::before {
    inset: 0;
  }

  .line-pair {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    white-space: normal;
    align-items: start;
    overflow-wrap: anywhere;
  }

  .project-entry.has-subprojects h2 {
    transform: none;
  }

  .project-inline-cover {
    position: relative;
    display: block;
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: end;
    width: var(--inline-cover-width, 0px);
    height: var(--inline-cover-height, 0px);
    opacity: var(--inline-cover-opacity, 0);
    margin-top: var(--inline-cover-gap, 0px);
    overflow: hidden;
    background: #f2f2f2;
  }

  .project-inline-cover.is-unavailable,
  .project-cover-preview {
    display: none;
  }

  .project-inline-cover img,
  .project-inline-cover video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: url("#works-cover-binary");
  }

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

  .row-rule {
    display: none;
  }

  .line-pair:nth-of-type(1) {
    grid-column: 1;
  }

  .line-pair:nth-of-type(2) {
    grid-column: 2;
  }

  .row-thread {
    grid-column: 1 / -1;
  }

  .side-label {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .is-list-view .side-label,
  .is-safari .is-list-view .side-label {
    animation: none;
    transition: none;
  }

  .reveal {
    opacity: 1;
    filter: none;
    transform: none;
    animation: none;
    transition: none;
  }

  .project-line-reveal {
    opacity: 1;
    filter: none;
    transform: none;
    animation: none;
  }

  .works-year span,
  .is-safari .works-year span {
    opacity: 1;
    filter: none;
    transform: none;
    animation: none;
  }
}
