body.home-page .gallery-band {
  background: #141b17;
  color: #f3f5ed;
  padding: clamp(2.5rem, 4.7vw, 4.5rem) 0;
  scroll-margin-top: 1rem;
}

.gallery-band .section-shell { display: block; }

.gallery-band .gallery-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin: 0 0 1.5rem;
}

.gallery-intro h2 {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin: 0;
  color: #f3f5ed;
  font: 400 clamp(1.7rem, 3vw, 2.375rem)/1.15 "Blockwork Display", var(--heading-font);
  letter-spacing: 0;
  text-transform: uppercase;
}

.gallery-intro h2 img {
  width: 1.05em;
  height: 1.05em;
  image-rendering: pixelated;
}

.gallery-intro p {
  color: #bfcbc0;
  margin: .65rem 0 0;
  font-size: 1rem;
  line-height: 1.5;
}

.gallery-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem 1.25rem;
}

.gallery-band .gallery-summary {
  margin: 0;
  color: #c3d1c0;
  font: .8125rem/1.5 ui-monospace, Consolas, monospace;
}

.gallery-sort:not([hidden]) {
  display: inline-flex;
  gap: .55rem;
  align-items: center;
  font-size: .875rem;
  color: #b9c6b9;
}

.gallery-band .gallery-sort select {
  cursor: pointer;
  appearance: none;
  border: 1px solid #50604f;
  border-radius: 3px;
  min-height: 44px;
  padding: .45rem 2rem .45rem .75rem;
  font: 600 .875rem/1.4 var(--body-font);
  color: #f2f5eb;
  background: #252d26 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='none' stroke='%23c4d0c1' stroke-width='1.5' d='M1 1l4 4 4-4'/%3E%3C/svg%3E") no-repeat right .7rem center;
}

.gallery-band .gallery-sort select:hover { border-color: #879a80; }
.gallery-band :focus-visible { outline: 3px solid #b0ed64 !important; outline-offset: 3px; }

body.home-page .gallery-band .gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 1.8vw, 1.5rem);
}

.gallery-band .run-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #1e2721;
  border: 1px solid #39483c;
  border-radius: 5px;
  backdrop-filter: none;
  box-shadow: 0 3px 0 #0f1310;
}

.gallery-band .run-card:hover,
.gallery-band .run-card:focus-within {
  transform: none;
  border-color: #819577;
  box-shadow: 0 3px 0 #0f1310;
}

/* These crops are centered on the actual isometric captures. */
.gallery-band .run-media {
  --paper: #b7dcc7;
  --corner: #476d58;
  --zoom: 1.02;
  --shift-x: 0%;
  --shift-y: 0%;
  aspect-ratio: 1.61;
  width: 100%;
  overflow: hidden;
  background-color: var(--paper);
  background-image:
    linear-gradient(90deg, #324f3610 1px, transparent 1px),
    linear-gradient(#324f3610 1px, transparent 1px),
    linear-gradient(130deg, #ffffff48, transparent 65%, #223f2810);
  background-size: 23px 23px, 23px 23px, auto;
  isolation: isolate;
}

.gallery-band .run-media[href*="astral-observatory"] {
  --paper: #bfcbed;
  --corner: #52678e;
  --zoom: 1.27;
}

.gallery-band .run-media[href*="sakura-sanctuary"] {
  --paper: #f1c4d2;
  --corner: #91586b;
  --zoom: 1.31;
  --shift-y: -8%;
}

.gallery-band .run-media[href*="ember-dragon"] {
  --paper: #f4c399;
  --corner: #925d3a;
  --zoom: 1.19;
  --shift-x: -6%;
}

.gallery-band .run-media[href*="totoro"] {
  --paper: #bedb9f;
  --corner: #516e3d;
  --zoom: 1.16;
  --shift-y: -4%;
}

.gallery-band .run-media:not(.is-empty)::before,
.gallery-band .run-media:not(.is-empty)::after {
  content: "";
  display: block;
  position: absolute;
  z-index: 1;
  width: 10px;
  height: 10px;
  border: 0 solid var(--corner);
  opacity: .8;
  pointer-events: none;
}

.gallery-band .run-media:not(.is-empty)::before {
  top: 10px;
  left: 10px;
  border-width: 2px 0 0 2px;
}

.gallery-band .run-media:not(.is-empty)::after {
  right: 10px;
  bottom: 10px;
  border-width: 0 2px 2px 0;
}

.gallery-band .run-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  mix-blend-mode: multiply;
  transform: translate(var(--shift-x), var(--shift-y)) scale(var(--zoom));
}

.gallery-band .run-preview-link:hover .run-image,
.gallery-band .run-preview-link:focus-visible .run-image {
  transform: translate(var(--shift-x), var(--shift-y)) scale(calc(var(--zoom) + .025));
}

.gallery-band .run-preview-link:focus-visible { outline-offset: -5px; }

.gallery-band .run-media.is-empty {
  display: grid;
  place-items: center;
  background: #293329;
}

.gallery-band .run-media.is-empty::after {
  display: block;
  content: "Preview pending";
  color: #c0d1be;
}

.gallery-band .run-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .6rem;
  padding: 1rem 1.15rem .8rem;
}

.gallery-band .run-body h3,
.gallery-band .run-title {
  margin: 0;
  color: #f5f7ee;
  font: 650 clamp(1.125rem, 1.5vw, 1.375rem)/1.25 var(--body-font);
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}

.gallery-band .run-title-link:hover .run-title,
.gallery-band .run-title-link:focus-visible .run-title { color: #b7ed80; }

.gallery-band .run-facts {
  align-items: baseline;
  gap: .25rem .65rem;
  margin-bottom: .4rem;
}

.gallery-band .fact {
  font-family: ui-monospace, Consolas, monospace;
  font-size: .8125rem;
  color: #becbbb;
}

.gallery-band .fact + .fact {
  padding-left: .65rem;
  border-left: 1px solid #647160;
}

.gallery-band .run-actions {
  width: 100%;
  align-items: center;
  gap: .25rem .85rem;
  border-top: 1px solid #37433a;
  padding-top: .65rem;
  margin-top: auto;
}

.gallery-band .run-actions .button {
  background: none;
  border: 0;
  min-height: 44px;
  padding: .45rem .25rem;
  box-shadow: none;
  font-size: .875rem;
  color: #d8e3d7;
  border-radius: 3px;
}

.gallery-band .run-actions .run-viewer {
  padding-inline: .8rem;
  border: 1px solid #50644c;
  background: #29392d;
  color: #c8eda9;
}

.gallery-band .run-actions .button:hover { transform: none; text-decoration: underline; text-underline-offset: 4px; }
.gallery-band .run-actions .run-viewer:hover { background: #344a38; border-color: #74966c; }
.gallery-band .run-actions [aria-disabled="true"] { color: #a3ada2; cursor: default; }

.gallery-band .empty-state {
  grid-column: 1 / -1;
  background: #222922;
  border-color: #3b453a;
  color: #f1f4e9;
}

.gallery-band .empty-state h3,
.gallery-band .empty-state p { color: inherit; }

@media (prefers-reduced-motion: reduce) {
  .gallery-band .run-preview-link:hover .run-image,
  .gallery-band .run-preview-link:focus-visible .run-image {
    transform: translate(var(--shift-x), var(--shift-y)) scale(var(--zoom));
  }
}

@media (max-width: 959px) {
  body.home-page .gallery-band .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 639px) {
  .gallery-band .gallery-heading { align-items: flex-start; flex-direction: column; gap: .85rem; }
  .gallery-band .gallery-tools { width: 100%; justify-content: space-between; }
  body.home-page .gallery-band .gallery-grid { grid-template-columns: minmax(0, 1fr); }
}
