.project-page .project-detail-hero {
  min-height: 0;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(24px, 4vw, 68px);
  padding: clamp(40px, 6vw, 88px) clamp(18px, 6vw, 104px);
}

.project-page .detail-project-logo {
  width: min(100%, 26rem);
}

.project-page .project-detail-hero > :last-child {
  width: min(100%, 38rem);
  min-width: 0;
  justify-self: center;
}

.project-page .detail-lead {
  max-width: 42ch;
}

.project-page .section[id] {
  scroll-margin-top: 5.5rem;
}

.project-page .detail-systems-title {
  margin: 12px 0 32px;
  font-size: clamp(2rem, 6vw, 4.4rem);
  line-height: 0.96;
  letter-spacing: -0.055em;
}

.project-page .detail-systems-title em {
  color: var(--cyan);
  font-style: normal;
}

.project-device,
.project-screen-figure {
  margin: 0;
}

.project-page .psp-media-frame {
  aspect-ratio: 720 / 324;
  overflow: hidden;
  filter: drop-shadow(0 14px 16px #0008);
}

/* Crop the 100px top margin in the source frame. The screen starts at (163, 137). */
.project-page .psp-media-shell {
  inset: -30.8642% 0 auto;
  height: auto;
}

.project-page .psp-media-screen {
  left: 22.64%;
  top: 11.42%;
  width: 55%;
  height: 69.44%;
  object-fit: contain;
}

.project-screen-frame {
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  width: min(100%, 31rem);
  aspect-ratio: 16 / 10;
  margin-inline: auto;
  padding: clamp(8px, 1.5vw, 16px);
  border: 1px solid #8c372b;
  border-radius: 10px;
  background: #100908;
  box-shadow: 0 12px 28px #0008, 0 0 24px #ff492019;
}

.project-screen-frame img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  background: #050304;
}

.vita-device-figure {
  width: min(100%, 42rem) !important;
}

.vita-device-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1279 / 579;
  filter: drop-shadow(0 18px 22px #000b);
}

.vita-device-screen {
  position: absolute;
  z-index: 2;
  left: 19.7%;
  top: 8.12%;
  width: 60.59%;
  height: 74.44%;
  object-fit: contain;
  background: #050304;
}

.vita-device-shell {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.vita-device-figure figcaption strong {
  color: #fff;
}

.project-device > figcaption,
.project-screen-figure > figcaption,
.project-page .psp-media-figure .project-device > figcaption {
  width: auto;
  margin: 8px 0 16px;
  padding: 0;
  color: #c5bdd0;
  background: transparent;
  text-align: center;
  font: 600 0.75rem/1.5 ui-monospace, monospace;
}

.project-page .clip-picker {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 6.25rem), 1fr));
}

.project-page .clip-picker button {
  min-height: 44px;
}

.marble-build-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: clamp(24px, 6vw, 62px) 18px;
  border: 1px solid #284a64;
  background: radial-gradient(circle at center, #10283f, #090e1a 72%);
  color: #a1defc;
  text-align: center;
  font: 750 clamp(0.7rem, 1.35vw, 0.95rem)/1.25 ui-monospace, monospace;
  letter-spacing: 0.075em;
}

.marble-build-card strong {
  color: #e2f3ff;
  font: 950 clamp(4rem, 11vw, 8rem)/0.95 system-ui, sans-serif;
  letter-spacing: -0.07em;
}

.project-page .marble-title {
  font-size: clamp(2.8rem, 7vw, 7rem);
  overflow-wrap: anywhere;
}

.project-gallery-section {
  --gallery-accent: var(--cyan);
  padding-block: clamp(38px, 6vw, 84px);
  border-block: 1px solid var(--line);
  background: radial-gradient(ellipse at top left, #162232, transparent 60%), #0b0a12;
}

.project-gallery-section.doom-gallery {
  --gallery-accent: #ff876b;
  background: radial-gradient(ellipse at top left, #34150f, transparent 65%), #100a0c;
}

.project-gallery-section.talisman-gallery {
  --gallery-accent: #f2cc68;
  background: radial-gradient(ellipse at top left, #2d2513, transparent 65%), #0e0c09;
}

.project-gallery-inner {
  max-width: 72rem;
  margin-inline: auto;
}

.project-gallery-heading {
  margin-bottom: clamp(14px, 2.5vw, 24px);
}

.project-gallery-heading h2 {
  margin: 0;
  font-size: clamp(1.65rem, 4vw, 2.85rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.project-gallery-heading p {
  max-width: 65ch;
  margin: 8px 0 0;
  color: #c5bdd0;
  font-size: 0.94rem;
}

.project-gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(8px, 1.6vw, 18px);
}

.project-gallery-grid figure {
  min-width: 0;
  margin: 0;
}

.project-gallery-grid a {
  display: block;
  aspect-ratio: 480 / 272;
  border: 1px solid #81738e70;
  border-radius: 4px;
  overflow: hidden;
  background: #070609;
}

.project-gallery-grid a:hover {
  border-color: var(--gallery-accent);
}

.project-gallery-grid img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.project-gallery-grid figcaption {
  margin-top: 6px;
  color: #e8dfee;
  font: 650 clamp(0.7rem, 1.1vw, 0.86rem)/1.4 system-ui, sans-serif;
  overflow-wrap: anywhere;
}

.project-gallery-more {
  margin-top: 18px;
}

.project-gallery-more summary {
  width: fit-content;
  min-height: 44px;
  padding: 10px 2px;
  color: var(--gallery-accent);
  cursor: pointer;
  font-weight: 750;
}

.project-gallery-more summary:focus-visible {
  outline: 2px solid var(--gallery-accent);
  outline-offset: 3px;
}

.project-gallery-more .project-gallery-grid {
  margin-top: 12px;
}

@media (max-width: 800px) {
  .project-page .project-detail-hero {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .project-page .section[id] {
    scroll-margin-top: 7rem;
  }
}
