.portfolio-directory {
  --directory-width: min(1512px, 92.8%);
  padding-inline: calc((100% - var(--directory-width)) / 2);
  background: radial-gradient(ellipse at 50% 42%, #fafaf8 25%, #f3f3f0 100%);
}

.master-index.crystal-index {
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: clamp(4px, .55vw, 9px);
}

.crystal-index li {
  display: grid;
  min-width: 0;
}

.crystal-index a {
  display: grid;
  grid-template-rows: auto 1fr;
  align-items: start;
  min-width: 0;
  padding: clamp(7px, .75vw, 12px) clamp(8px, .71vw, 11px) 15px;
  border: 1px solid transparent;
  --card-title: #31312d;
  --card-caption: #565650;
  transition: background-color .16s ease, border-color .16s ease;
}

.crystal-index a:is(:hover, :focus-visible) {
  border-color: #d1d1cc;
  background: #e8e8e5;
  --card-title: #191917;
  --card-caption: #3b3b36;
}

.crystal-index a:focus-visible {
  outline: 1px solid #42423f;
  outline-offset: 3px;
}

.crystal-index .crystal-art {
  display: grid;
  place-items: center;
  aspect-ratio: 560 / 356;
}

.crystal-index .crystal-art > * {
  grid-area: 1 / 1;
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(1px 3px 4px #26352d1d);
}

.crystal-index .crystal-art img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  max-width: 92%;
}

.crystal-index .crystal-art [hidden] {
  display: none;
}

.crystal-index .crystal-caption {
  display: grid;
  min-width: 0;
  grid-template-rows: 1.25rem clamp(1.65rem, 2vw, 1.95rem) auto;
  gap: 3px;
  margin: 9px 2px 0;
  text-align: left;
}

.crystal-index .crystal-partner {
  grid-row: 1;
  align-self: end;
  color: #5d5d56;
  font: 400 .75rem/1.25 "Nimbus Sans", Arial, sans-serif;
  letter-spacing: .015em;
}

.crystal-index .crystal-title {
  grid-row: 2;
  align-self: center;
  color: var(--card-title);
  font: 400 clamp(1.08rem, 1.52vw, 1.4rem)/1.19 "Iowan Old Style", Georgia, "Times New Roman", serif;
  letter-spacing: -.017em;
  white-space: nowrap;
}

.crystal-index [href="#nearness"] .crystal-title {
  font-size: clamp(.98rem, 1.27vw, 1.22rem);
  letter-spacing: .035em;
}

.crystal-index .crystal-ability {
  grid-row: 3;
  color: var(--card-caption);
  font: 400 clamp(.8125rem, 1.04vw, .95rem)/1.44 "Nimbus Sans", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  line-break: strict;
  text-wrap: balance;
}

#equal-access-title {
  white-space: nowrap;
  overflow-wrap: normal;
  font-size: clamp(1.7rem, 5.1vw, 4.75rem);
}

#pico-five-worlds.framed-project {
  --project-art: url("work/pico-art/cloud-detail.png");
  background: #eeefed;
  overflow-x: clip;
}

#pico-five-worlds::before {
  background: var(--project-art) center 31% / cover no-repeat fixed;
  filter: contrast(1.15);
  transform: none;
}

#pico-five-worlds::after {
  content: "";
  height: clamp(260px, 41vw, 590px);
  background: linear-gradient(to bottom, rgb(249 249 247 / .57), transparent);
  mask-image: none;
}

#pico-five-worlds > .project-glass {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

#pico-five-worlds .five-worlds-index {
  padding: clamp(18px, 3vw, 37px);
  border: 1px solid rgb(255 255 255 / .65);
  background: linear-gradient(102deg, rgb(253 253 251 / .78), rgb(253 253 251 / .42));
}

#pico-five-worlds :is(#cargo-rush, #wonderland, #liaozhai) {
  --editorial-ink: #252528;
  --editorial-muted: #4d4d53;
  --editorial-line: rgb(54 54 61 / .24);
  --world-muted: var(--editorial-muted);
  --selection-line: #747587;
  color: var(--editorial-ink);
  overflow: visible;
  background: transparent;
}

#cargo-rush {
  --chapter-edge-left: rgb(63 91 153 / .61);
  --chapter-edge-right: rgb(98 65 139 / .64);
}

#wonderland {
  --chapter-edge-left: rgb(216 159 160 / .55);
  --chapter-edge-right: rgb(203 134 152 / .55);
}

#liaozhai {
  --chapter-edge-left: rgb(102 115 122 / .57);
  --chapter-edge-right: rgb(136 62 56 / .53);
}

#pico-five-worlds :is(#cargo-rush, #wonderland, #liaozhai)::before,
#pico-five-worlds :is(#cargo-rush, #wonderland, #liaozhai)::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

#pico-five-worlds :is(#cargo-rush, #wonderland, #liaozhai)::before {
  inset: -16px calc(50% - 50vw);
  z-index: -2;
  background: linear-gradient(90deg,
    var(--chapter-edge-left), transparent 36%,
    transparent 64%, var(--chapter-edge-right));
  mask-image: linear-gradient(to bottom, transparent, #000 27%, #000 69%, transparent);
}

#pico-five-worlds :is(#cargo-rush, #wonderland, #liaozhai)::after {
  inset: 0;
  z-index: -1;
  border: 1px solid rgb(255 255 255 / .68);
  background: linear-gradient(102deg,
    rgb(253 253 251 / .79), rgb(253 253 251 / .64) 35%,
    rgb(253 253 251 / .40) 73%, rgb(253 253 251 / .47));
  box-shadow: 0 12px 34px rgb(52 47 62 / .065);
}

#cargo-rush .five-worlds-copy .five-worlds-english { color: var(--editorial-muted); }

@media (max-width: 1229px) {
  .master-index.crystal-index { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .crystal-index .crystal-title { font-size: clamp(1.07rem, 2.2vw, 1.4rem); }
}

@media (max-width: 680px) {
  .master-index.crystal-index { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  #pico-five-worlds::before {
    background: var(--project-art) center top / auto 115svh repeat-y;
  }
  #pico-five-worlds :is(#cargo-rush, #wonderland, #liaozhai)::after {
    background: linear-gradient(to bottom, rgb(253 253 251 / .80), rgb(253 253 251 / .52));
  }
}

@media (max-width: 350px) {
  .crystal-index .crystal-title { font-size: 1rem; }
  .crystal-index .crystal-partner { font-size: .6875rem; }
}

@media (prefers-reduced-motion: reduce) {
  .crystal-index a { transition: none; }
}
