:root { color-scheme: dark; --gold: #ffcc66; }
* { box-sizing: border-box; }
body {
  margin: 0;
  color: #fff4e8;
  background: #100d14;
  font: 1rem/1.5 system-ui, sans-serif;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, #100d1433, #100d14b3),
    var(--gallery-background, url("starfield-and-mars-globe.jpg")) center / cover no-repeat;
}
.shell { width: min(100% - 2rem, 76rem); margin-inline: auto; }
body > header { background: #120e15ef; border-bottom: 1px solid #f7c49d55; }
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem 1.5rem;
  padding-block: 1rem;
}
.brand { color: var(--gold); font-weight: 700; }
.gallery-nav { display: flex; flex-wrap: wrap; gap: .5rem; }
.more {
  border: 1px solid #c6a893;
  border-radius: 999px;
  padding: .45rem 1rem;
  background: #241b24;
  color: #e0cbbb;
  font: inherit;
  text-decoration: none;
}
.more:hover { color: #fff4e8; border-color: var(--gold); }
.more:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
main { padding-block: clamp(2rem, 6vw, 5rem) 3rem; }
.gallery-heading {
  width: fit-content;
  margin: 0 0 1.5rem;
  padding: .55rem .85rem;
  border-radius: .5rem;
  background: #120e15e8;
}
.gallery-heading p { margin: .4rem 0 0; font-size: 1rem; }
.gallery-heading h1 {
  margin: 0;
  color: #ffe3a3;
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 1.1;
}
.stories {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(.75rem, 2vw, 1.25rem);
  padding: 0;
  margin: 0;
  list-style: none;
}
.card {
  display: block;
  width: 100%;
  padding: 0;
  font: inherit;
  overflow: hidden;
  border: 1px solid #f7c49d66;
  border-radius: .75rem;
  background: #19131bf5;
  color: inherit;
  text-decoration: none;
}
.tile-art { position: relative; }
.tile-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  position: absolute;
  inset: auto .35rem .35rem;
  padding: .35rem .5rem;
  border-radius: .4rem;
  background: #120e15f5;
  color: #fff4e8;
  font-size: .875rem;
  line-height: 1.25;
  text-align: center;
  visibility: hidden;
  pointer-events: none;
}
.medallion {
  position: relative;
  isolation: isolate;
  flex: none;
  display: grid;
  place-items: center;
  width: 1.45rem;
  height: 1.8rem;
  padding-bottom: .35rem;
  color: #35200c;
  font-weight: 800;
}
.medallion::before, .medallion::after {
  content: "";
  position: absolute;
  z-index: -1;
}
.medallion::before {
  inset: .75rem .3rem 0;
  background: #d9484c;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 76%, 0 100%);
}
.medallion::after {
  inset: 0 0 .35rem;
  border: 1px solid #ffe7a4;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 25%, #fff0a1, #d9a438 75%);
  box-shadow: inset 0 0 0 2px #99601455;
}
.medallion.second::after {
  border-color: #e3e8ee;
  background: radial-gradient(circle at 35% 25%, #f3f6fa, #a2adba 75%);
}
.medallion.third::after {
  border-color: #ffd0a0;
  background: radial-gradient(circle at 35% 25%, #f3bd91, #bb7543 75%);
}
@media (hover: hover) and (pointer: fine) {
  .tile-art:hover { z-index: 1; transform: scale(1.07238); }
  .tile-art:hover .card { border-color: var(--gold); }
  .tile-art:hover .cover { filter: brightness(1.12); }
  .tile-art:hover .tile-label { visibility: visible; }
}
.tile-art:focus-within { z-index: 1; }
.card:focus-visible + .tile-label { visibility: visible; }
a.card:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
.cover {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: fill;
}
.card:active .cover,
.card.is-tapped .cover,
.card:focus-visible .cover { filter: brightness(1.12); }
@media (prefers-reduced-motion: no-preference) {
  .cover { transition: filter 100ms ease-out; }
}
.cover-500-sol { object-fit: cover; object-position: center 18%; }
.caption {
  display: block;
  padding: .35rem .15rem;
  line-height: 1.25;
  font-weight: 700;
  width: fit-content;
  min-height: 44px;
  color: #ffe3a3;
  text-underline-offset: .18em;
}
.caption:hover { color: #fff4e8; }
.caption:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
@media (max-width: 58rem) {
  .stories { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 37rem) {
  .stories { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.more-stories { --gallery-background: url("rpc-reinforcements.jpg"); }
.more-stories .cover { object-fit: cover; }
