:root {
  color-scheme: light dark;
  --background: #ffffff;
  --text: #111111;
  --secondary: #6b6b70;
  --fill: #f2f2f7;
  --accent: #7715f6;
  --gap: 2px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #000000;
    --text: #f5f5f7;
    --secondary: #98989f;
    --fill: #1c1c1e;
    --accent: #8e3dff;
  }
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.page-header {
  padding: calc(28px + env(safe-area-inset-top, 0px)) 16px 16px;
}

h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.subtitle {
  margin: 4px 0 0;
  color: var(--secondary);
}

.status {
  margin: 0;
  padding: 0 16px 24px;
  color: var(--secondary);
}

/* Three across on a phone, edge to edge like the app's grid; more on wider
   screens. */
.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

@media (min-width: 700px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    padding: 0 16px;
  }
}

.cell {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  background: var(--fill);
  cursor: zoom-in;
  overflow: hidden;
}

.cell img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.more { height: 1px; }

.callout {
  margin: 40px 16px 32px;
  padding: 20px;
  border-radius: 16px;
  background: var(--fill);
  text-align: center;
}

.callout-title {
  margin: 0;
  font-weight: 600;
  font-size: 17px;
}

.callout-body {
  margin: 6px 0 0;
  color: var(--secondary);
}

.callout-action {
  margin: 14px 0 0;
  color: var(--secondary);
}

.button {
  display: inline-block;
  padding: 12px 20px;
  border-radius: 12px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
  text-decoration: none;
}

/* The photo on black, with Close and Save along the bottom. */
.viewer {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #000000;
}

.viewer::backdrop { background: #000000; }

.viewer img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.viewer-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
}

.viewer-button {
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  background: rgba(60, 60, 67, 0.6);
  color: #ffffff;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.home {
  padding: calc(64px + env(safe-area-inset-top, 0px)) 16px;
  text-align: center;
}
