/* Darkroom: blacks with a hint of warmth, one paper-white ink. */
@font-face { font-family: Geist; src: url(fonts/Geist-Light.woff2) format('woff2'); font-weight: 300; font-display: swap; }
@font-face { font-family: Geist; src: url(fonts/Geist-Regular.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Geist; src: url(fonts/Geist-Medium.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: GeistMono; src: url(fonts/GeistMono-Regular.woff2) format('woff2'); font-weight: 400; font-display: swap; }

:root {
  --black: #070707;
  --s1: #0e0e0f;
  --s2: #151516;
  --s3: #1d1d1f;
  --hair: #232325;
  --hair2: #323235;
  --paper: #edeae4;
  --dim: #8b8984;
  --faint: #55544f;
  --ghost: #34332f;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--black); color: var(--paper); }
body {
  font-family: Geist, system-ui, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; }
.mono { font-family: GeistMono, ui-monospace, monospace; font-size: 11px; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.dim { color: var(--dim); }
.spacer { flex: 1; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 14px;
  padding: 18px var(--gutter);
  background: rgba(7, 7, 7, .86);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(35, 35, 37, .6);
}
.wordmark { text-decoration: none; font-size: 15px; font-weight: 500; letter-spacing: .16em; }
.wordmark span { font-weight: 300; color: var(--dim); letter-spacing: .02em; }
.tag { padding: 3px 8px; border: 1px solid var(--hair2); border-radius: 10px; font-size: 9.5px; }
.count { color: var(--faint); }

/* Intro */
.intro { padding: clamp(32px, 9vw, 96px) var(--gutter) clamp(20px, 4vw, 40px); max-width: 1100px; }
.intro h1 {
  margin: 0 0 18px;
  font-weight: 300;
  font-size: clamp(30px, 5.6vw, 64px);
  line-height: 1.04;
  letter-spacing: -.035em;
}
.intro p { margin: 0; font-size: 10.5px; }

/* Filters */
.filters { display: flex; gap: 8px; padding: 6px var(--gutter) 22px; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  padding: 8px 14px; border: 1px solid var(--hair2); border-radius: 40px;
  font-family: GeistMono, ui-monospace, monospace; font-size: 11px; letter-spacing: .12em;
  text-decoration: none; color: var(--paper);
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.pill:hover { border-color: var(--dim); }
.pill[aria-pressed="true"] { background: var(--paper); color: var(--black); border-color: var(--paper); }
.pill .n { color: var(--faint); }
.pill[aria-pressed="true"] .n { color: #6b6a65; }
.glyph { width: 9px; height: 9px; flex: none; }

/* Contact sheet: JS masonry (shortest column first), true aspect ratios */
.sheet { padding: 0 var(--gutter) 64px; display: flex; gap: 14px; align-items: flex-start; }
.col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.state { color: var(--faint); padding: 40px 0; }
.frame {
  display: block; width: 100%; margin: 0 0 18px; padding: 0; text-align: left;
  opacity: 0; transform: translateY(8px); transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.frame.in { opacity: 1; transform: none; }
.frame .ph { position: relative; display: block; background: var(--s2); overflow: hidden; }
.frame img {
  display: block; width: 100%; height: auto;
  opacity: 0; transition: opacity .45s var(--ease), transform .6s var(--ease);
}
.frame img.loaded { opacity: 1; }
.frame:hover img { transform: scale(1.012); }
.frame:focus-visible { outline: 1px solid var(--paper); outline-offset: 4px; }
.meta { display: flex; align-items: center; gap: 8px; margin-top: 7px; color: var(--dim); font-size: 10px; }
.meta .model { margin-left: auto; color: var(--faint); font-size: 9px; }
.meta .date { color: var(--faint); font-size: 9px; }

/* Viewer */
.viewer {
  position: fixed; inset: 0; z-index: 20;
  display: grid; grid-template-rows: auto 1fr auto;
  background: rgba(7, 7, 7, .97);
  opacity: 0; transition: opacity .28s var(--ease);
}
.viewer[hidden] { display: none; }
.viewer.open { opacity: 1; }
.v-top { display: flex; align-items: center; gap: 12px; padding: 12px var(--gutter); }
.icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; }
.icon svg, .nav svg { width: 20px; height: 20px; fill: none; stroke: var(--paper); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.v-stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 12px var(--gutter); }
.v-frame { position: relative; margin: 0; max-width: 100%; max-height: 100%; display: grid; place-items: center; }
.v-frame img { display: block; max-width: min(100%, 1600px); max-height: calc(100vh - 290px); width: auto; height: auto; object-fit: contain; }
/* Crop marks, drawn just outside the image like a viewfinder. */
.v-frame::before, .v-frame::after { content: ''; position: absolute; inset: -9px; pointer-events: none;
  background:
    linear-gradient(var(--dim), var(--dim)) top left / 14px 1px no-repeat,
    linear-gradient(var(--dim), var(--dim)) top left / 1px 14px no-repeat,
    linear-gradient(var(--dim), var(--dim)) top right / 14px 1px no-repeat,
    linear-gradient(var(--dim), var(--dim)) top right / 1px 14px no-repeat;
}
.v-frame::after { background:
    linear-gradient(var(--dim), var(--dim)) bottom left / 14px 1px no-repeat,
    linear-gradient(var(--dim), var(--dim)) bottom left / 1px 14px no-repeat,
    linear-gradient(var(--dim), var(--dim)) bottom right / 14px 1px no-repeat,
    linear-gradient(var(--dim), var(--dim)) bottom right / 1px 14px no-repeat;
}
.nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 64px; display: grid; place-items: center; opacity: .55; transition: opacity .18s; z-index: 1; }
.nav:hover { opacity: 1; }
.prev { left: 4px; } .next { right: 4px; }
.v-info { padding: 6px var(--gutter) calc(18px + env(safe-area-inset-bottom)); max-width: 980px; width: 100%; margin: 0 auto; }
.v-prompt { margin: 0 0 12px; font-weight: 300; font-size: 15px; line-height: 1.55; color: var(--paper); max-height: 7.8em; overflow: auto; }
.v-prompt.empty { color: var(--faint); }
.v-sig { overflow-x: auto; scrollbar-width: none; margin-bottom: 14px; }
.v-sig code { color: var(--dim); font-size: 10.5px; white-space: nowrap; }
.v-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.foot { display: flex; justify-content: space-between; padding: 28px var(--gutter) 36px; border-top: 1px solid var(--hair); color: var(--faint); font-size: 10px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 30; transform: translate(-50%, 12px);
  padding: 10px 14px; background: var(--s3); border: 1px solid var(--hair2); border-radius: 8px;
  opacity: 0; pointer-events: none; transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 640px) {
  .sheet { gap: 10px; }
  .frame { margin-bottom: 14px; }
  .nav { display: none; }
  .v-frame img { max-height: calc(100vh - 320px); }
  .count { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .frame { opacity: 1; transform: none; }
}
