:root {
  --bg: #f4f1ea;
  --card: #e8e3da;
  --body: #57534e;
  --title: #292524;
  --muted: #79716b;
  --faint: #a6a09b;
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Source Sans 3", "Avenir Next", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --gap: 6px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #141412; --card: #22211e; --body: #c9c4bc; --title: #f2efe9; --muted: #a39d95; --faint: #7d776f; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--body); font: 20px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { display: block; }

/* ---------- a photoset page ---------- */
.set-page { padding: 5.5rem 0 3rem; }
.back { position: absolute; top: 1.5rem; left: 1.5rem; color: var(--muted); text-decoration: none; font-size: 1rem; font-weight: 500; }
.back:hover { color: var(--title); }

.hero { width: calc(100% - 3rem); max-width: 1000px; margin: 0 auto 5rem; background: var(--card); border-radius: 1.5rem; }
.hero-image { position: relative; border-radius: 1.5rem; overflow: hidden; }
.hero-image img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(#0a101200 0%, #0a101259 70%, #0a1012d9 100%); }
.hero-title { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 2.5rem; text-align: center; color: #fff; }
.hero-title h1 { font: 600 3rem/1.25 var(--display); margin: 0; letter-spacing: -0.01em; }
.hero-title p { font-size: 1.5rem; line-height: 1.2; color: #ffffffa6; margin: 0.6rem 0 0; }
.hero-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 2rem; padding: 1rem 1.5rem; font-size: 1rem; }
.hero-meta b { font-weight: 500; color: var(--muted); }
.hero-meta span { color: var(--faint); }
.plain-title { width: 92%; max-width: 40rem; margin: 0 auto 3rem; }
.plain-title h1 { font: 600 3rem/1.2 var(--display); color: var(--title); margin: 0; }
.plain-title p { color: var(--faint); font-size: 1.4rem; margin: 0.4rem 0 0; }

.prose, .segment, .caption { width: 92%; max-width: 40rem; margin-inline: auto; }
.prose p { margin: 0; padding-bottom: 1.25rem; }
.prose a { text-decoration-color: var(--faint); text-underline-offset: 3px; }
.prose h3 { font-size: 1.4rem; font-weight: 600; color: var(--title); margin: 1.5rem 0 0.5rem; }
.prose blockquote { margin: 0 0 1.25rem; padding-left: 1.25rem; border-left: 3px solid var(--card); color: var(--muted); }
.dropcap { float: left; font: 400 3.5rem/1 var(--display); color: var(--title); margin: 0.25rem 0.5rem 0 0; }

.segment { margin-top: 6rem; padding-top: 2rem; }
.segment h2 { font: 600 2.75rem/1 var(--sans); color: var(--title); margin: 0 0 0.5rem; letter-spacing: -0.01em; }
.segment .subtitle { font-size: 1.4rem; font-weight: 500; color: var(--faint); margin-bottom: 1rem; }

.photoset { width: calc(100% - 3rem); max-width: 1000px; margin: 3.5rem auto; border-radius: 2rem; overflow: hidden; display: flex; flex-direction: column; gap: var(--gap); }
.photoset + .caption { margin-top: -2.5rem; margin-bottom: 3.5rem; font-size: 0.95rem; color: var(--muted); text-align: center; }
.row { display: flex; gap: var(--gap); }
.photo { display: block; min-width: 0; background: var(--card); overflow: hidden; cursor: zoom-in; }
.photo img { width: 100%; height: 100%; object-fit: cover; }

.site-footer { text-align: center; color: var(--faint); font-size: 0.95rem; padding: 5rem 1rem 3rem; }

/* ---------- the index page ---------- */
.index-page { width: calc(100% - 2rem); max-width: 768px; margin: 0 auto; padding: 5rem 0 6rem; font-size: 18px; }
.index-header { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 3.5rem; }
.index-header h1 { font: 600 2rem/1.2 var(--display); color: var(--title); margin: 0; }
.index-header span { color: var(--faint); }
.label { color: var(--faint); font-weight: 500; font-size: 1rem; margin: 0 0 0.9rem; }
.stream { display: flex; gap: 1.1rem; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -1rem 3.5rem; padding: 0 1rem 0.5rem; scrollbar-width: none; }
.stream::-webkit-scrollbar { display: none; }
.stream a { flex: 0 0 auto; width: min(288px, 62vw); aspect-ratio: 3 / 2; border-radius: 14px; overflow: hidden; background: var(--card); scroll-snap-align: start; }
.stream img, .set-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s; }
.set-card { position: relative; display: block; border-radius: 1.25rem; overflow: hidden; background: var(--card); aspect-ratio: 3 / 2; margin-bottom: 2.5rem; color: #fff; text-decoration: none; }
.set-card:hover img { transform: scale(1.02); }
.set-card .shade { position: absolute; inset: 0; background: linear-gradient(#0a101200 35%, #0a101266 72%, #0a1012e0 100%); }
.set-card .text { position: absolute; left: 2rem; right: 2rem; bottom: 1.75rem; }
.set-card h2 { font: 600 2.1rem/1.2 var(--display); margin: 0; }
.set-card p { margin: 0.2rem 0 0; font-size: 1.15rem; color: #ffffffa6; }
.set-card .meta { margin-top: 0.5rem; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: #ffffff8c; }
.set-card .meta b { color: #fff; font-weight: 600; }
.set-card.no-cover { color: var(--title); }
.set-card.no-cover p, .set-card.no-cover .meta, .set-card.no-cover .meta b { color: var(--muted); }

/* ---------- full-size viewer ---------- */
#viewer { position: fixed; inset: 0; background: rgba(8, 8, 7, 0.97); display: none; z-index: 9; }
#viewer.open { display: flex; align-items: center; justify-content: center; }
#viewer img { max-width: 100vw; max-height: 100vh; object-fit: contain; }
#viewer button { position: absolute; background: none; border: 0; color: #ddd; font: 300 44px/1 system-ui; cursor: pointer; padding: 18px; opacity: 0.75; }
#viewer button:hover { opacity: 1; }
#viewer .close { top: 4px; right: 8px; }
#viewer .prev { left: 4px; top: 50%; transform: translateY(-50%); }
#viewer .next { right: 4px; top: 50%; transform: translateY(-50%); }
#viewer .count { position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; color: #8a8580; font: 12px var(--sans); letter-spacing: 0.15em; }

@media (max-width: 700px) {
  :root { --gap: 4px; }
  body { font-size: 18px; }
  .set-page { padding-top: 0.5rem; }
  .back { position: static; display: block; padding: 1rem 1rem 0.75rem; }
  .hero { width: calc(100% - 1.5rem); border-radius: 1rem; margin-bottom: 2.5rem; }
  .hero-image { border-radius: 1rem; }
  .hero-title { padding: 1.5rem; }
  .hero-title h1 { font-size: 2.25rem; }
  .hero-title p { font-size: 1.2rem; }
  .plain-title h1 { font-size: 2.25rem; }
  .segment { margin-top: 3.5rem; padding-top: 0.75rem; }
  .segment h2 { font-size: 2.3rem; }
  .segment .subtitle { font-size: 1.25rem; }
  .photoset { width: calc(100% - 1rem); margin: 2rem auto; border-radius: 1rem; }
  .photoset + .caption { margin-top: -1.25rem; margin-bottom: 2rem; }
  /* Three or four across is too small on a phone: wrap to two, cropping a little. */
  .row.many { flex-wrap: wrap; }
  .row.many .photo { flex-basis: 40% !important; aspect-ratio: auto !important; min-height: 44vw; }
  .index-page { padding-top: 2.5rem; }
  .set-card { aspect-ratio: 4 / 5; border-radius: 1rem; }
  .set-card .text { left: 1.25rem; right: 1.25rem; bottom: 1.25rem; }
  .set-card h2 { font-size: 1.8rem; }
}
