:root {
  --diamond-width: clamp(44px, 6.25vw, 80px);
  color-scheme: dark;
  color: #fff4d9;
  font: 100%/1.5 system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --gold: #f8cf69;
  --gold-bright: #ffe49c;
  --ink: #160d20;
  --plum: #322044;
  --muted: #d3bfdc;
  --border: #916d9f;
  --panel: #241731;
  background-color: #191819;
  background-image: repeating-conic-gradient(
    from 33.69deg,
    #4a3569 0deg 112.62deg,
    #191819 112.62deg 180deg
  );
  background-size: var(--diamond-width) calc(var(--diamond-width) * 1.5);
}

* { box-sizing: border-box; }

body {
  min-block-size: 100vh;
  margin: 0;
}

h1, h2, h3, p { margin: 0; }

.archive {
  --page-gutter: clamp(1rem, 4.2vw, 2.4rem);
  max-inline-size: 62rem;
  margin-inline: auto;
  padding: clamp(1rem, 4.4vw, 3rem) var(--page-gutter) 2.5rem;
}

.masthead {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-block-size: clamp(10rem, 23vw, 14rem);
  padding: clamp(1.25rem, 4.2vw, 2.8rem);
  overflow: hidden;
  border: 2px solid #c3944b;
  background: #341a43;
  box-shadow: 5px 5px 0 #0c0613;
}

.dio-collage {
  position: absolute;
  z-index: -2;
  inset: 0;
  overflow: hidden;
  background: #c3944b;
}

.dio-collage::after {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, #160d20a8, #160d2020 52%, transparent 76%),
    linear-gradient(0deg, #160d20a8, transparent 65%);
  content: "";
}

.dio-panel {
  position: absolute;
  inset-block: 0;
  background-size: cover;
  background-repeat: no-repeat;
}

/* Stardust Crusaders, https://jojowiki.com/File:DIO%27s_face_revealed.png */
.dio-portrait {
  inset-inline-start: 0;
  inline-size: 45%;
  clip-path: polygon(0 0, 100% 0, 82% 100%, 0 100%);
  background-image: url("/art/dio-portrait.webp");
  background-position: 60% 23%;
}

/* Stardust Crusaders, https://jojowiki.com/File:DIO_menacing_1.png */
.dio-rooftop {
  inset-inline-start: 37.5%;
  inline-size: 43%;
  clip-path: polygon(19% 0, 100% 0, 81% 100%, 0 100%);
  background-image: url("/art/dio-rooftop.webp");
  background-position: 64% 9%;
}

/* Stardust Crusaders, https://jojowiki.com/File:Oh_you%27re_approaching_me.png */
.dio-approach {
  inset-inline: 73% 0;
  clip-path: polygon(30% 0, 100% 0, 100% 100%, 0 100%);
  background-image: url("/art/dio-approach.webp");
  background-position: 43% top;
}

.masthead::before {
  position: absolute;
  z-index: -1;
  inset: .36rem;
  border: 1px solid #e8b86068;
  content: "";
  pointer-events: none;
}

.game {
  display: flex;
  align-items: center;
  gap: .58rem;
  color: var(--gold-bright);
  font-size: .875rem;
  font-weight: 780;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.game::before {
  inline-size: .48rem;
  block-size: .48rem;
  transform: rotate(45deg);
  background: var(--gold);
  content: "";
}

.brand {
  margin-block-start: .3rem;
  color: #fff6dc;
  font-size: clamp(2.75rem, 9vw, 5.2rem);
  line-height: 1.08;
  font-weight: 880;
  font-style: italic;
  letter-spacing: -.075em;
  text-shadow: .045em .065em #120a19;
}

.brand span { color: var(--gold); }

.sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .62rem;
  margin-block: .95rem clamp(1.5rem, 4vw, 2.45rem);
}

.sections a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  min-block-size: 3.16rem;
  padding: .56rem .44rem;
  border: 1px solid var(--border);
  background: linear-gradient(112deg, var(--plum), var(--panel));
  color: #f7e6fa;
  font-weight: 760;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
}

.sections a:hover { border-color: var(--gold); }

.sections a[aria-current="page"] {
  border-color: #f6d684;
  color: #23122c;
  background: linear-gradient(110deg, var(--gold), #ffe99d 70%, #efba53);
  box-shadow: 3px 3px 0 #7f4b96;
}

.nav-icon {
  position: relative;
  flex: 0 0 auto;
  inline-size: 1rem;
  block-size: .9rem;
  border: 1.5px solid currentColor;
  border-radius: .1rem;
}

.package-icon::before {
  position: absolute;
  inset: 0 29% auto;
  block-size: .22rem;
  border: solid currentColor;
  border-width: 0 1px 1px;
  content: "";
}

.file-icon {
  inline-size: .78rem;
  block-size: 1rem;
}

.file-icon::before {
  position: absolute;
  inset: 33% 19% 23%;
  border-block: 1px solid currentColor;
  content: "";
}

.pack-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .35rem .85rem;
  margin-block-end: .85rem;
  padding-inline-start: .76rem;
  border-inline-start: 3px solid var(--gold);
}

.pack + .pack { margin-block-start: 1.45rem; }

.pack-header :is(h1, h2) {
  font-size: clamp(1.25rem, 4vw, 1.88rem);
  line-height: 1.24;
  letter-spacing: -.041em;
}

.pack-header p, .file-info p, .test-note {
  color: var(--muted);
  font-size: .875rem;
}

.pack-header p, .file-info p {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
}

.pack-header p { white-space: nowrap; }

.files {
  display: grid;
  gap: .64rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.file {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .8rem;
  padding: .86rem;
  border: 1px solid #815995;
  border-inline-start: 3px solid #bd84d4;
  background: linear-gradient(104deg, #38214c, var(--panel) 72%);
  box-shadow: 3px 3px 0 #100819;
}

.format {
  display: grid;
  place-items: center;
  inline-size: 2.5rem;
  block-size: 2.5rem;
  border: 1px solid #a676ab;
  background: #4b2b61;
  color: var(--gold-bright);
}

.file-info :is(h2, h3) {
  font-size: 1.04rem;
  line-height: 1.3;
  text-wrap: pretty;
}

.file-info p { margin-block-start: .25rem; }

.file-info p span { color: #f0acff; }

.download {
  display: grid;
  place-items: center;
  min-block-size: 2.75rem;
  min-inline-size: 5rem;
  padding: .45rem .68rem;
  border: 1px solid #f7d68a;
  border-radius: .12rem;
  background: var(--gold);
  color: #26152b;
  font-weight: 830;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: 2px 2px 0 #8b60a0;
}

.download:hover { background: var(--gold-bright); }

a:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 4px;
}

.test-note { margin-block-start: .8rem; }

@media (max-width: 38rem) {
  :root {
    --diamond-width: 24px;
    background-position: center top;
  }

  .archive { padding-block-start: .65rem; }

  .masthead {
    min-block-size: 9rem;
    padding: .95rem var(--page-gutter);
  }

  .masthead::before { inset: .25rem .5rem; }

  .brand { font-size: clamp(2.35rem, 8.5vw, 3.25rem); }

  .dio-collage::after {
    background:
      linear-gradient(90deg, #160d209e, #160d2038 47%, transparent 85%),
      linear-gradient(0deg, #160d20f2, #160d200d 65%);
  }
}

@media (max-width: 25rem) {
  .file { gap: .55rem; padding: .72rem; }
  .format { inline-size: 2.05rem; block-size: 2.25rem; }
  .download { min-inline-size: 4.45rem; padding-inline: .48rem; }
}

@media (max-width: 21rem) {
  .file { grid-template-columns: minmax(0, 1fr) auto; }
  .format { display: none; }
}
