/* Visitor pages: unlock, notices and the gallery itself. */

/* ---------- centered pages (unlock, notices) ---------- */
.page-center {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(120% 80% at 50% 0%, var(--card) 0%, transparent 60%),
    var(--paper);
}
.unlock, .notice {
  width: 100%;
  max-width: 380px;
  text-align: center;
  animation: rise .5s ease-out both;
}
.unlock .display, .notice .display {
  margin: 0;
  font-size: clamp(30px, 7vw, 40px);
  overflow-wrap: anywhere;
}
.unlock-mark {
  width: 26px; height: 26px;
  margin: 0 auto 1.5rem;
  color: var(--accent);
  stroke-width: 1.4;
}
.unlock-meta { margin: .6rem 0 0; color: var(--muted); font-size: 14px; }
.unlock-form { margin-top: 2.25rem; }
.pw-field {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line-strong);
  transition: border-color .2s;
}
.pw-field:focus-within { border-color: var(--ink); }
.pw-field.has-error { border-color: var(--danger); animation: nudge .35s ease-in-out; }
.pw-field input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 .25rem;
  border: 0;
  background: transparent;
  font-size: 17px;
  letter-spacing: .08em;
  text-align: center;
  outline: none;
}
.pw-field input::placeholder { letter-spacing: .02em; color: var(--muted); }
.pw-field button {
  flex: none;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: transparent;
  color: var(--ink);
}
.pw-field button:hover { background: var(--paper-2); }
.pw-field button svg { width: 20px; height: 20px; }
.unlock-hint, .unlock-error { margin: .9rem 0 0; font-size: 13px; color: var(--muted); }
.unlock-error { color: var(--danger); }
.notice-body { margin: 1rem 0 0; color: var(--ink-2); }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes nudge { 0%, 100% { transform: none; } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* ---------- gallery ---------- */
.page-gallery { background: var(--paper); }

.admin-notice {
  position: relative;
  z-index: 30;
  padding: 8px 16px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  text-align: center;
}
.admin-notice a { color: inherit; font-weight: 600; }

.cover {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 460px;
  max-height: 1100px;
  overflow: hidden;
  background: #2a2824;
  color: #fbf8f2;
}
.cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity 1s ease, transform 2.4s cubic-bezier(.2, .7, .2, 1);
}
.cover-img.is-loaded { opacity: 1; transform: none; }
.cover-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.18) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,0) 45%, rgba(0,0,0,.55) 100%);
}
.cover-empty { height: auto; min-height: 0; background: var(--paper); color: var(--ink); }
.cover-empty .cover-shade { display: none; }
.cover-empty .cover-text { position: static; padding-top: 18vh; padding-bottom: 6vh; }
.cover-text {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 0 max(20px, 5vw) max(36px, 7vh);
  max-width: 1100px;
}
.cover-meta {
  margin: 0 0 .9rem;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  opacity: .88;
}
.cover-title {
  margin: 0;
  font-size: clamp(38px, 7.4vw, 92px);
  line-height: 1.02;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.cover-enter {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-top: 1.75rem;
  padding-bottom: 4px;
  border-bottom: 1px solid currentColor;
  font-size: 14px;
  letter-spacing: .04em;
  text-decoration: none;
  opacity: .92;
}
.cover-enter:hover { opacity: 1; }
.cover-enter svg { width: 16px; height: 16px; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: none; } 50% { transform: translateY(3px); } }

.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
  padding: 0 max(16px, 3vw);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.bar.is-stuck { border-bottom-color: var(--line); }
.bar-title {
  min-width: 0;
  overflow: hidden;
  font-family: var(--serif);
  font-size: 19px;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-decoration: none;
}
.bar-actions { display: flex; align-items: center; gap: 14px; flex: none; }
.bar-count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

.intro {
  max-width: 640px;
  margin: 0 auto;
  padding: clamp(40px, 8vw, 88px) 20px clamp(28px, 5vw, 56px);
  font-family: var(--serif);
  font-size: clamp(17px, 2.2vw, 20px);
  line-height: 1.75;
  color: var(--ink-2);
  text-align: center;
}
.intro p { margin: 0 0 1em; }
.intro p:last-child { margin-bottom: 0; }

.grid {
  padding: 6px max(8px, 1.4vw) 0;
  scroll-margin-top: 60px;
}
.intro + .grid { padding-top: 0; }
.row { display: flex; gap: var(--gap, 6px); margin-bottom: var(--gap, 6px); }
.tile {
  position: relative;
  flex: none;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: var(--paper-2);
  cursor: zoom-in;
}
.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .5s ease, transform .6s cubic-bezier(.2, .7, .2, 1);
}
.tile img.is-loaded { opacity: 1; }
.tile:hover img { transform: scale(1.015); }
.tile:focus-visible { outline-offset: -3px; }

.empty { padding: 12vh 20px; text-align: center; color: var(--muted); }

.foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 56px max(16px, 3vw) 40px;
  font-size: 12.5px;
  letter-spacing: .04em;
  color: var(--muted);
}
.foot a { text-decoration: none; }
.foot a:hover { color: var(--ink); }

/* ---------- lightbox ---------- */
.lb {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-rows: auto 1fr;
  background: rgb(14, 13, 12);
  color: #f1ede6;
  opacity: 0;
  transition: opacity .2s ease;
  touch-action: pan-y pinch-zoom;
}
.lb.is-open { opacity: 1; }
.lb:focus { outline: none; }
.lb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 56px;
  padding: 0 8px 0 18px;
  padding-top: env(safe-area-inset-top);
  box-sizing: content-box;
}
.lb-count { font-size: 13px; letter-spacing: .08em; font-variant-numeric: tabular-nums; opacity: .75; }
.lb-tools { display: flex; gap: 2px; }
.lb-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  text-decoration: none;
  opacity: .82;
  transition: opacity .15s, background .15s;
}
.lb-btn:hover { opacity: 1; background: rgba(255, 255, 255, .08); }
.lb-btn svg { width: 22px; height: 22px; }
.lb-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
}
/* Absolutely positioned so max-width/height resolve against the stage's definite size. */
.lb-img {
  position: absolute;
  inset: 8px max(8px, 5vw) max(20px, env(safe-area-inset-bottom));
  margin: auto;
  max-width: calc(100% - 2 * max(8px, 5vw));
  max-height: calc(100% - 8px - max(20px, env(safe-area-inset-bottom)));
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  transition: opacity .25s ease, transform .25s ease;
}
.lb-img.is-loading { opacity: .35; }
.lb-img { -webkit-touch-callout: default; }
.lb-note {
  position: absolute;
  left: 50%;
  bottom: max(20px, calc(env(safe-area-inset-bottom) + 12px));
  max-width: calc(100% - 32px);
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: #1f1d1a;
  font-size: 13.5px;
  text-align: center;
  transform: translateX(-50%);
  pointer-events: none;
  animation: note-in .25s ease-out both;
}
@keyframes note-in { from { opacity: 0; } }
.lb-img.is-original { -webkit-user-select: auto; user-select: auto; }
.lb-nav {
  position: absolute;
  top: 50%;
  width: 52px;
  height: 52px;
  margin-top: -26px;
}
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
.lb-nav:disabled { opacity: 0; pointer-events: none; }

@media (max-width: 720px) {
  .bar { height: 54px; }
  .bar-title { font-size: 17px; }
  .bar .btn span { display: none; }
  .bar .btn { width: 38px; padding: 0; }
  .grid { padding-left: 4px; padding-right: 4px; }
  .lb-nav { display: none; }
  .lb-img { inset: 0 0 env(safe-area-inset-bottom); max-width: 100%; max-height: calc(100% - env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- password page with the cover behind it ---------- */
.has-cover { background: #141311; color: #fbf8f2; }
.unlock-bg { position: fixed; inset: 0; overflow: hidden; }
.unlock-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 1.2s ease, transform 3s cubic-bezier(.2, .7, .2, 1);
}
.unlock-bg img.is-loaded { opacity: 1; transform: none; }
.unlock-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 50% 45%, rgba(14, 13, 12, .5) 0%, rgba(14, 13, 12, .82) 100%);
}
.has-cover .unlock { position: relative; z-index: 1; }
.has-cover .eyebrow, .has-cover .unlock-meta, .has-cover .unlock-hint { color: rgba(251, 248, 242, .78); }
.has-cover .unlock-mark { color: #e6c793; }
.has-cover .pw-field { border-color: rgba(255, 255, 255, .5); }
.has-cover .pw-field:focus-within { border-color: #fff; }
.has-cover .pw-field input { color: #fff; }
.has-cover .pw-field input::placeholder { color: rgba(255, 255, 255, .62); }
.has-cover .pw-field button { color: #fff; }
.has-cover .pw-field button:hover { background: rgba(255, 255, 255, .12); }
.has-cover .unlock-error { color: #ffb4a3; }
.has-cover .pw-field.has-error { border-color: #ffb4a3; }
