:root {
  --font-ui: Geist, Inter, ui-sans-serif, system-ui, sans-serif;
  --color-text: #f3f3f3;
  --color-text-muted: #c8c8c8;
  --color-text-subtle: #a8a8a8;
  --tile-min: 13.3rem;
  --grid-row-gap: 3.4rem;
  --grid-col-gap: 5.65rem;
}

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

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

body {
  color: var(--color-text);
  background: #000;
  font-family: var(--font-ui);
  font-weight: 400;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.density-hotspot {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  width: min(18rem, 46vw);
  height: 5.75rem;
  padding: 1.1rem 1.1rem 0 0;
}

.density {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid #2a2a2a;
  background: rgba(0, 0, 0, 0.72);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.density-hotspot:hover .density,
.density-hotspot:focus-within .density {
  opacity: 1;
  pointer-events: auto;
}

.density button {
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text);
  font: 500 1.1rem/1 var(--font-ui);
  cursor: pointer;
}

.density input[type="range"] {
  width: 7.5rem;
  accent-color: var(--color-text);
}

.site-header,
main,
.site-footer {
  width: min(1200px, calc(100% - 3rem));
  margin-inline: auto;
}

.site-header {
  padding: 3.5rem 0 2rem;
  text-align: center;
}

h1 {
  margin: 0;
  color: #fafafa;
  font-family: var(--font-ui);
  font-size: clamp(1.7rem, 3.6vw, 2.2rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--tile-min)), 1fr));
  row-gap: var(--grid-row-gap);
  column-gap: var(--grid-col-gap);
  margin: 0;
  padding: 1rem 0 4rem;
  list-style: none;
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: center;
}

.tile:focus {
  outline: none;
}

.tile:focus-visible .frame {
  outline: none;
  box-shadow: 0 0 0 2px #000, 0 0 0 4px #f4f0e8;
}

.frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 50%;
  background: transparent;
}

.frame img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.frame .gif {
  opacity: 0;
}

.tile.is-playing .still {
  opacity: 0;
}

.tile.is-playing .gif {
  opacity: 1;
}

.frame--empty {
  display: grid;
  place-items: center;
}

.empty-label {
  color: var(--color-text-subtle);
  font-size: 0.8125rem;
  font-weight: 500;
}

.tile-name {
  margin: 0;
  max-width: 100%;
  color: #ececec;
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.012em;
  line-height: 1.3;
}

.site-footer {
  padding-bottom: 2.75rem;
  color: var(--color-text-subtle);
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.5;
  text-align: center;
}

.site-footer p {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.35rem 1.1rem;
  margin: 0;
}

.site-footer a {
  color: #ececec;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: #fff;
}

code {
  font-family: var(--font-ui);
}

@media (prefers-reduced-motion: reduce) {
  .density {
    transition-duration: 0.01ms;
  }

  .tile.is-playing .still {
    opacity: 1;
  }

  .tile.is-playing .gif {
    opacity: 0;
  }
}
