body {
  background: rgb(246, 6, 5);
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
}

.logo-container { position: fixed; top: 12px; left: 12px; z-index: 1000; }
.logo-container .logo-icon { width: 48px; height: 48px; display: block; }

/* Header — a single centered hero image with a download button below it.
   16px side padding matches the gallery's, so the button's edges line up with
   the image grid. Equal space above the hero (padding-top) and below it
   (hero margin-bottom); padding-top also stops the top space collapsing. */
.noize-header {
  padding: 48px 16px 0;
  text-align: center;
}
.noize-hero {
  display: block;
  width: 60%;
  max-width: 400px;
  height: auto;
  margin: 0 auto 48px;
}

/* Full-width call-to-action spanning the page: ghost button, black outline. */
.noize-download {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 16px;
  background: transparent;
  color: #000;
  border: 2px solid #000;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  font-weight: 700;
  /* Shrink with the viewport on phones so the label stays on one line;
     caps at 1.1rem, matching the desktop size that already looks right. */
  font-size: clamp(0.75rem, 3.2vw, 1.1rem);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.noize-download:hover,
.noize-download:focus {
  background: #000;
  color: #fff;
}
@media (min-width: 600px) {
  .noize-download { letter-spacing: 0.08em; }
}

/* Layout comparison toggle — small ghost button below the download CTA. */
.noize-toggle {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 10px;
  padding: 8px 16px;
  background: transparent;
  color: #000;
  border: 2px solid #000;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: clamp(0.7rem, 2.8vw, 0.95rem);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.noize-toggle:hover,
.noize-toggle:focus {
  background: #000;
  color: #fff;
}
@media (min-width: 600px) {
  .noize-toggle { letter-spacing: 0.08em; }
}

/* Gallery — mobile-first square feed (single render, no infinite scroll).
   Single column on phones; widens to 2 cols on tablet, 3 on desktop.
   The gap carries the extra margin between images beyond each caption. */
.noize-gallery { padding: 16px; }
.noize-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}
@media (min-width: 600px)  { .noize-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .noize-grid { grid-template-columns: repeat(3, 1fr); } }

/* One gallery item = square image tile + caption stacked below it. */
.noize-item { margin: 0; }

/* 10px of black padding on all sides gives every image a black border. */
.noize-tile {
  box-sizing: border-box;
  padding: 10px;
  background: #000;
  overflow: hidden;
  cursor: pointer;
  border-radius: 2px;
}
.noize-tile img {
  display: block;
  width: 100%;
}
/* Square layout only: force each photo into a 1/1 box (aspect-ratio on the
   <img>, not a percentage height, so it resolves on mobile Safari) and
   letterbox it on black. Tight mode gets no ratio/object-fit at all, so
   near-square images can't pick up stray letterbox bars. */
.noize-grid:not(.tight) .noize-tile img {
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

/* Submitter username + optional location, below the image in black. */
.noize-caption {
  margin: 8px 0 0;
  color: #000;
  text-align: left;
  line-height: 1.3;
  word-break: break-word;
}
.noize-caption .noize-user {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
}
.noize-caption .noize-loc {
  display: block;
  font-size: 0.8rem;
}
/* Google Maps link + black target icon shown when the item has coordinates. */
.noize-map {
  display: inline-block;
  margin-left: 5px;
  padding: 2px;
  color: #000;
  line-height: 0;
  vertical-align: middle;
}
.noize-map svg {
  display: block;
  width: 1.15em;
  height: 1.15em;
}

/* Tight comparison layout (toggled): masonry columns instead of a square grid.
   Each image fills the fixed column width and keeps its natural aspect ratio —
   no forced square, no letterbox — kept in a thin 2px black frame. */
.noize-grid.tight {
  display: block;
  column-count: 1;
  column-gap: 24px;
}
@media (min-width: 600px)  { .noize-grid.tight { column-count: 2; } }
@media (min-width: 1000px) { .noize-grid.tight { column-count: 3; } }
.noize-grid.tight .noize-item {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  margin: 0 0 24px;
}
.noize-grid.tight .noize-tile { padding: 2px; }

.noize-empty { text-align: center; opacity: 0.6; }

/* Footer — mirrors the index footer (black bar, centered logo) but sits at the
   bottom of the scroll rather than fixed, and links back to the site root. */
.noize-footer {
  background: #000;
  color: #fff;
  text-align: center;
  padding: 8px 0;
}
.noize-footer img {
  display: inline-block;
  vertical-align: middle;
  max-width: 100%;
}

/* Lightbox */
.noize-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
.noize-lightbox.open { display: flex; }
.noize-lb-img { max-width: 90vw; max-height: 85vh; object-fit: contain; }
.noize-lb-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 2.4rem;
  padding: 12px;
}
.noize-lb-caption {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  text-align: center;
  padding: 0 16px;
  color: rgba(255, 255, 255, 0.9);
}
body.noize-lb-open { overflow: hidden; }
