:root {
  --paper: #f9eedb;
  --paper-grid: rgb(130 81 74 / 8%);
  --ink: #282a2b;
  --dim: #675445;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--paper-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--paper-grid) 1px, transparent 1px),
    radial-gradient(ellipse at 16% 12%, #ffd7a5, #ffe3c0 29%, transparent 66%),
    linear-gradient(145deg, var(--paper) 14%, #f8dfd4 58%, #f2d7e0);
  background-size: 6px 6px, 6px 6px, 100% 100%, 100% 100%;
  background-repeat: repeat, repeat, no-repeat, no-repeat;
  color: var(--ink);
  font-family: var(--mono);
  line-height: 1.45;
}

canvas { image-rendering: pixelated; image-rendering: crisp-edges; image-rendering: pixelated; display: block; }

.world-page {
  background: linear-gradient(#bfd5ce 35%, #e7cda4 35%);
}

.world-stage {
  height: 100vh;
  height: 100dvh;
}

.world-stage img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

.world-stage .world-portrait { display: none; }

@media (max-aspect-ratio: 1 / 1) {
  .world-stage .world-landscape { display: none; }
  .world-stage .world-portrait { display: block; }
}

.gallery {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: clamp(8px, 1.5vmin, 16px);
  padding: clamp(8px, 2vmin, 24px);
  height: 100vh;
  height: 100dvh;
}

.moments { display: contents; }

.moment-img,
.moment {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
}

.moment-img { image-rendering: crisp-edges; image-rendering: pixelated; }

.empty { grid-column: 1 / -1; place-self: center; max-width: 42ch; margin: 0; text-align: center; color: var(--dim); }
.empty[hidden] { display: none; }

@media (max-aspect-ratio: 5 / 6) {
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-aspect-ratio: 3 / 2) {
  .gallery { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (min-aspect-ratio: 9 / 4) {
  .gallery { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}
