:root {
  --bg: #1d2019;
  --bg-2: #262a22;
  --ink: #efeae0;
  --ink-2: #a9a698;
  --straw: #d9b66a;
  --line: rgba(239, 234, 224, 0.14);
  --rowh: 230px;
  --gap: 3px;
  --bar-h: 52px;
  --pad: 16px;
}
@media (max-width: 900px) { :root { --rowh: 150px; } }
@media (max-width: 600px) { :root { --rowh: 104px; --pad: 12px; } }

* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Assistant", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.lb-open { overflow: hidden; }
button { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--straw); outline-offset: 2px; }
[hidden] { display: none !important; }

/* header */
.top {
  padding: clamp(28px, 6vw, 64px) var(--pad) 18px;
  max-width: 1400px;
  margin: 0 auto;
}
.top h1 {
  font-family: "Bellefair", "Frank Ruhl Libre", serif;
  font-weight: 400;
  font-size: clamp(44px, 9vw, 92px);
  line-height: 1;
  letter-spacing: 0.01em;
  margin: 0 0 10px;
}
.when {
  margin: 0;
  color: var(--straw);
  font-size: 17px;
}
.hint {
  margin: 14px 0 0;
  color: var(--ink-2);
  max-width: 44ch;
  font-size: 16px;
}

/* sticky bar */
.bar, .personbar {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: var(--bar-h);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 var(--pad);
}
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 8px 0;
  flex: 1 1 auto;
  min-width: 0;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 15px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.chip.active {
  background: var(--straw);
  border-color: var(--straw);
  color: #221d10;
  font-weight: 600;
}
.dl-all {
  flex: 0 0 auto;
  font-size: 15px;
  color: var(--straw);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.dl-all:hover { border-bottom-color: var(--straw); }
@media (max-width: 600px) { .dl-all { display: none; } }

/* person filter bar */
.personbar { padding-top: 6px; padding-bottom: 6px; }
.avatar {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--bg-2);
  background-repeat: no-repeat;
  box-shadow: 0 0 0 2px var(--straw);
}
.ptext { flex: 1 1 auto; min-width: 0; font-weight: 600; }
.btn {
  flex: 0 0 auto;
  border: 1px solid var(--straw);
  background: var(--straw);
  color: #221d10;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); font-weight: 400; }
@media (max-width: 600px) {
  .btn { padding: 6px 11px; font-size: 14px; }
}

/* grid */
.grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
  padding: var(--gap);
}
.grid::after { content: ""; flex-grow: 1000000; }
.sec {
  flex: 1 0 100%;
  font-family: "Bellefair", "Frank Ruhl Libre", serif;
  font-weight: 400;
  font-size: 30px;
  color: var(--straw);
  margin: 26px 0 6px;
  padding: 0 calc(var(--pad) - var(--gap));
  scroll-margin-top: calc(var(--bar-h) + 8px);
}
.sec:first-child { margin-top: 10px; }
.sec small {
  font-family: "Assistant", sans-serif;
  color: var(--ink-2);
  font-size: 15px;
  margin-inline-start: 10px;
}
.ph {
  position: relative;
  flex-grow: calc(var(--r) * 100);
  flex-basis: calc(var(--r) * var(--rowh));
  background: var(--bg-2);
  overflow: hidden;
  cursor: pointer;
  scroll-margin-top: calc(var(--bar-h) + 8px);
}
.ph::before { content: ""; display: block; padding-bottom: calc(100% / var(--r)); }
.ph img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ph .pin {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--straw);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
  inset-inline-end: 8px;
  bottom: 8px;
  pointer-events: none;
}
.end {
  text-align: center;
  color: var(--ink-2);
  padding: 48px var(--pad) 72px;
  margin: 0;
}

/* lightbox */
.lb {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: #141612;
  display: flex;
  flex-direction: column;
  touch-action: pan-y;
}
.lb-top {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(8px, env(safe-area-inset-top)) 8px 4px;
  z-index: 2;
}
.lb-time { color: var(--ink-2); font-size: 15px; }
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
}
.icon:hover { background: rgba(255, 255, 255, 0.08); }
.lb-stage {
  flex: 1 1 auto;
  position: relative;
  min-height: 0;
  margin: 0 0 max(10px, env(safe-area-inset-bottom));
}
.lb-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-select: none;
}
.lb-stage img.loading { filter: blur(6px); }
.faces { position: absolute; }
.face {
  position: absolute;
  appearance: none;
  background: transparent;
  padding: 0;
  border: 1.5px solid rgba(239, 234, 224, 0.92);
  border-radius: 7px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: opacity 0.45s ease;
  cursor: pointer;
}
.lb.reveal .face, .face:hover { opacity: 1; }
.face::after {
  /* keep the tap target comfortable even for small faces */
  content: "";
  position: absolute;
  inset: -8px;
}
.nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, 0.35);
  color: var(--ink);
  cursor: pointer;
  z-index: 2;
}
.nav.prev { inset-inline-start: 12px; }
.nav.next { inset-inline-end: 12px; }
.nav:hover { background: rgba(0, 0, 0, 0.6); }
@media (hover: none) { .nav { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .face { transition: none; opacity: 0.55; }
  .chip, .btn { transition: none; }
}
