:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0a0a0b;
  color: #f5f5f2;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 18rem;
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(circle at top, #262229 0, #0a0a0b 34rem);
}

main {
  width: min(100% - 2rem, 100rem);
  margin-inline: auto;
  padding-block: clamp(2rem, 6vw, 5rem);
}

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #3a363d;
}

h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 7vw, 4.75rem);
  font-weight: 800;
  letter-spacing: -0.055em;
}

.status {
  margin: 0 0 0.9rem;
  color: #b9b4bc;
  text-align: right;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gallery-item {
  min-width: 0;
}

.gallery-link {
  display: grid;
  min-height: 100%;
  overflow: hidden;
  border: 1px solid #3a363d;
  border-radius: 0.75rem;
  background: #151417;
  color: inherit;
  text-decoration: none;
  transition: border-color 150ms ease, transform 150ms ease;
}

.gallery-link:hover {
  border-color: #8d8492;
  transform: translateY(-2px);
}

.gallery-link:focus-visible {
  outline: 3px solid #f2ce73;
  outline-offset: 3px;
}

.gallery-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #222025;
}

.gallery-name {
  overflow: hidden;
  padding: 0.8rem 0.9rem;
  color: #d7d2da;
  font-size: 0.875rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty,
.error {
  grid-column: 1 / -1;
  padding: 3rem 1rem;
  border: 1px dashed #514b55;
  border-radius: 0.75rem;
  color: #b9b4bc;
  text-align: center;
}

.error {
  color: #ffb4ab;
}

.error p {
  margin-top: 0;
}

.error button {
  min-height: 2.75rem;
  padding: 0.65rem 1rem;
  border: 1px solid #8d8492;
  border-radius: 0.5rem;
  background: #29252c;
  color: #f5f5f2;
  font: inherit;
  cursor: pointer;
}

.error button:focus-visible {
  outline: 3px solid #f2ce73;
  outline-offset: 3px;
}

@media (max-width: 36rem) {
  main {
    width: min(100% - 1rem, 100rem);
    padding-block: 1.25rem;
  }

  .site-header {
    display: block;
  }

  .status {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-link {
    transition: none;
  }
}
