*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

@font-face {
  font-family: "RomMono";
  src: url("../fonts/ABCROMMono-Light.woff2") format("woff2");
}

:root {
  --font-family: "RomMono", "Courier New", Courier, monospace;
  --font-size: 15px;
  --line-height: 18px;
  --font-size-small: 10px;
  --line-height-small: 12px;
  --font-weight: 400;
  --line-height-margin: 18px;
  --padding: 12px;
  --color-black: rgb(0, 0, 0);
  --color-white: rgb(255, 255, 255);
  --color-selection: rgb(128, 128, 128);
  --color-link-hover: rgb(0, 0, 255);
  --color-light-gray: rgb(247, 247, 247);
}

::-moz-selection {
  background: transparent;
  color: var(--color-selection);
  text-shadow: none;
}

::selection {
  background: transparent;
  color: var(--color-selection);
  text-shadow: none;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-family);
  font-size: var(--font-size);
  font-weight: var(--font-weight);
  line-height: var(--line-height);
  color: var(--color-black);
  background: var(--color-white);
  -webkit-font-feature-settings: "liga", "kern", "ss01";
  -moz-font-feature-settings: "liga", "kern", "ss01";
  -ms-font-feature-settings: "liga", "kern", "ss01";
  font-feature-settings: "liga", "kern", "ss01";
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

h1, 
h2, 
h3 {
  font-size: var(--font-size);
  font-weight: var(--font-weight);
}

a {
  color: var(--color-black);
  text-decoration: none;
}

a:hover {
  color: var(--color-link-hover);
}

p:not(:last-child) {
  margin-bottom: var(--line-height-margin);
}

img, 
picture, 
svg, 
video, 
canvas {
  max-width: 100%;
  height: auto;
}

img {
  display: block;
  max-inline-size: 100%;
  block-size: auto;
  border-style: none;
}

.hyphenate,
figcaption {
  -webkit-hyphens: auto;
  -webkit-hyphenate-limit-before: 3;
  -webkit-hyphenate-limit-after: 3;
  -webkit-hyphenate-limit-chars: 6 3 3;
  -moz-hyphens: auto;
  -moz-hyphenate-limit-chars: 6 3 3;
  -ms-hyphens: auto;
  -ms-hyphenate-limit-chars: 6 3 3;
  hyphens: auto;
  hyphenate-limit-chars: 6 3 3;
}

html,
body {
  min-height: 100%;
}

nav {
  padding: var(--padding);
}

footer {
  font-size: var(--font-size-small);
  line-height: var(--line-height-small);
}

/* ---- Home gallery ---- */

section.gallery {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

section.gallery > nav {
  flex: 0 0 auto;
}

.gallery-canvas {
  flex: 1 1 auto;
  position: relative;
  overflow: hidden;
  display: block;
}

.gallery-canvas figure {
  position: absolute;
  margin: 0;
  padding: 0;
}

.gallery-canvas figure img {
  display: block;
  width: 100%;
  height: auto;
}

.gallery-canvas figcaption {
  font-size: var(--font-size-small);
  line-height: var(--line-height-small);
  margin-top: 0.25rem;
  text-align: center;
}

.gallery-canvas .fig-link {
  position: absolute;
  font-size: var(--font-size-small);
  line-height: var(--line-height-small);
  top: 5px;
  right: 5px;
  margin-right: 0.5em;
  color: var(--color-white);
  mix-blend-mode: difference;
}

.gallery-canvas .fig-link::before {
  content: "[";
  position: absolute;
  left: -0.6em;
  top: -0.15em;
}

.gallery-canvas .fig-link::after {
  content: "]";
  position: absolute;
  left: 0.6em;
  top: -0.15em;
}

.gallery-canvas .fig-link:hover {
  color: var(--color-link-hover);
  mix-blend-mode: normal;
}

#gallery-tooltip {
  position: fixed;
  pointer-events: none;
  z-index: 1000;
  text-align: center;
  white-space: pre-wrap;
  mix-blend-mode: difference;
  color: var(--color-white);
}

#gallery-shuffle-btn {
  flex: 0 0 auto;
  display: block;
  width: 100%;
  text-align: center;
  padding: var(--padding);
  font-family: var(--font-family);
  font-size: var(--font-size);
  font-weight: var(--font-weight);
  line-height: var(--line-height);
  color: var(--color-black);
  background: none;
  border: none;
  cursor: pointer;
}

/* ---- Information ---- */

section.information {
  flex: 0 0 auto;
  padding: 0 var(--padding) calc(var(--line-height-margin) - var(--padding)) var(--padding);
}

hr {
  border: none;
  margin: 0 0 var(--line-height-margin) 0;
}

hr:after {
  content: "";
  width: 100%;
  display: block;
  height: 2px;
  background: url("../images/dot.svg") repeat-x;
}

.information-text {
  margin-bottom: var(--line-height-margin);
}

#information-start {
  scroll-margin-top: var(--padding);
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: calc(var(--padding));
}

.grid.portrait {
  margin: var(--line-height-margin) 0;
}

.grid.imprint  {
  margin-bottom: var(--line-height-margin);
}

.grid-item {
  padding-bottom: calc(3 * var(--padding));
}

.grid.imprint .grid-item  {
  padding-bottom: 0;
}

.portrait-image,
.release-image {
  position: relative;
  width: 33%;
  height: auto;
  overflow: hidden;
  background-color: var(--color-light-gray);
}

.release-image {
  aspect-ratio: 1 / 1;
  margin-top: calc(var(--line-height-margin) / 2);
}

.portrait-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left top;
}

.release-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.titles {
  font-size: var(--font-size-small);
  line-height: var(--line-height-small);
}

/* ---- Media Queries ---- */

@media screen and (min-width: 600px) {
  .gallery-canvas .fig-link {
    top: 6px;
    right: 6px;
  }
  .portrait-image,
  .release-image {
    width: 25%;
  }
}

@media screen and (min-width: 800px) {
  .gallery-canvas .fig-link {
    top: 7px;
    right: 7px;
  }
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, calc(400px - calc(1.5 * var(--padding)))), 1fr));
  }
  .grid-item {
    padding-bottom: calc(3 * var(--line-height-margin));
  }
  .titles {
    font-size: var(--font-size);
    line-height: var(--line-height);
  }
}

@media screen and (min-width: 1200px) {
  .gallery-canvas .fig-link {
    font-size: var(--font-size);
    line-height: var(--line-height);
    top: 8px;
    right: 8px;
  }
}

@media screen and (min-width: 1600px) {
  .gallery-canvas .fig-link {
    top: 9px;
    right: 9px;
  }
  .grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media screen and (min-width: 1800px) {
  .portrait-image,
  .release-image {
    width: 20%;
  }
}