/* Shares its palette and type with the photogspencer link page: film base, orange edge print. */
:root {
  --base: #16120f;
  --raised: #221b16;
  --ink: #f1e7d8;
  --muted: #a8998a;
  --edge: #e8772e;
  --line: #3a3029;
  --row: 260px;
  --gap: 6px;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --serif: "Instrument Serif", Georgia, serif;
  color-scheme: dark;
}

@media (max-width: 640px) {
  :root { --row: 150px; --gap: 4px; }
}

* { box-sizing: border-box; }

html { background: var(--base); }

body {
  margin: 0;
  background: var(--base);
  color: var(--ink);
  font: 14px/1.5 var(--mono);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ---------- header ---------- */
.head {
  max-width: 1400px;
  margin: 0 auto;
  padding: 48px 16px 28px;
}

.edge {
  display: inline-block;
  color: var(--edge);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
}
.edge span { color: var(--muted); }
a.edge:hover { text-decoration: underline; }

h1 {
  margin: 10px 0 6px;
  font: 400 clamp(40px, 7vw, 76px)/1 var(--serif);
  letter-spacing: -.01em;
  overflow-wrap: anywhere;
}

.meta { margin: 0; color: var(--muted); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 0; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--edge);
  border-radius: 3px;
  background: var(--edge);
  color: #1a120b;
  font: 500 13px var(--mono);
  text-decoration: none;
  cursor: pointer;
}
.btn span { opacity: .7; font-weight: 400; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--muted); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 12px; }
.btn:focus-visible, .ph:focus-visible, .card:focus-visible, .v-nav:focus-visible {
  outline: 2px solid var(--edge);
  outline-offset: 2px;
}

.credit { margin: 18px 0 0; color: var(--muted); font-size: 12px; }

/* ---------- justified grid ---------- */
.grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px;
}
.ph { display: block; position: relative; background: var(--raised); overflow: hidden; }
.ph img { display: block; width: 100%; height: auto; transition: opacity .2s; }
.ph:hover img { opacity: .88; }
.grid .fill { flex-grow: 1000000; }

/* ---------- viewer ---------- */
dialog#viewer {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #0b0907;
  color: var(--ink);
}
dialog#viewer::backdrop { background: #0b0907; }
dialog#viewer[open] { display: grid; grid-template-rows: 1fr auto; }

#v-img {
  align-self: center;
  justify-self: center;
  max-width: 100%;
  max-height: calc(100dvh - 64px);
  width: auto;
  height: auto;
  object-fit: contain;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-drag: none;
}

.v-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  height: 64px;
  padding: 0 16px;
}
#v-count { margin-right: auto; color: var(--muted); font-size: 12px; }

.v-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 88px;
  border: 0;
  background: rgba(11, 9, 7, .45);
  color: var(--ink);
  font: 36px/1 var(--serif);
  cursor: pointer;
}
.v-nav.prev { left: 0; border-radius: 0 3px 3px 0; }
.v-nav.next { right: 0; border-radius: 3px 0 0 3px; }
.v-nav:hover { background: rgba(11, 9, 7, .7); }
@media (hover: none) { .v-nav { display: none; } }

/* ---------- index cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 28px 18px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px;
}
.card { display: flex; flex-direction: column; gap: 4px; text-decoration: none; }
.card img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: var(--raised);
  margin-bottom: 8px;
}
.card:hover img { opacity: .88; }
.card-title { font: 400 28px/1.1 var(--serif); }
.card-meta { color: var(--muted); font-size: 12px; }
.empty { color: var(--muted); }

/* ---------- full-res list ---------- */
.files { list-style: none; margin: 0 auto; padding: 0 16px; max-width: 1400px; }
.files li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.files span { color: var(--muted); white-space: nowrap; }

.foot {
  max-width: 1400px;
  margin: 0 auto;
  padding: 48px 16px 40px;
  color: var(--muted);
  font-size: 12px;
}
