/* Look and tokens follow ../attend. */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(/fonts/fraunces-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(/fonts/fraunces-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  --bg: #5d5854;
  --fg: #f5ece5;
  --muted: rgba(245, 236, 229, 0.68);
  --faint: rgba(245, 236, 229, 0.42);
  --card: rgba(30, 26, 23, 0.22);
  --field: rgba(30, 26, 23, 0.32);
  --line: rgba(245, 236, 229, 0.16);
  --line-strong: rgba(245, 236, 229, 0.34);
  --err: #ffc2b5;
  --err-line: rgba(255, 170, 150, 0.7);
  --serif: "Fraunces", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
/* The scrollbar's space is always reserved, so short and long albums line up. */
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px 16px 120px;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(120% 60% at 50% 0%, rgba(245, 236, 229, 0.08), transparent 70%);
}
body.centered { display: flex; padding: 32px 16px 48px; }
body.locked { overflow: hidden; }
main { width: 100%; max-width: 1180px; margin: 0 auto; }
main.narrow { max-width: 420px; margin: auto; }
[hidden] { display: none !important; }

h1 {
  margin: 0 0 8px;
  font: 500 38px/1.1 var(--serif);
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h2 { margin: 44px 0 14px; font: 500 26px/1.15 var(--serif); letter-spacing: -0.01em; }
.eyebrow {
  margin: 0 0 10px;
  color: var(--faint);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.lead { margin: 0 0 24px; max-width: 60ch; color: var(--muted); text-wrap: pretty; }
.note { margin: 12px 0 0; text-align: center; color: var(--faint); font-size: 14px; text-wrap: balance; }
.note.left { margin: -6px 0 14px; text-align: left; }
.view { animation: rise .45s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 12px 22px;
  border-radius: 12px;
  border: 1px solid var(--fg);
  background: var(--fg);
  color: var(--bg);
  font-weight: 650;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), opacity .15s;
}
.btn:hover:not(:disabled) { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); box-shadow: none; }
.btn:disabled { opacity: .65; cursor: progress; }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--line-strong); }
.btn.ghost:hover:not(:disabled) { background: rgba(245, 236, 229, 0.06); }
.btn.small { min-height: 40px; padding: 8px 16px; border-radius: 999px; font-size: 15px; }
.link { padding: 4px 0; border: 0; background: none; color: var(--muted); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--fg); }

.card { padding: 18px 18px 20px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; }
.label { display: block; margin: 0 0 7px; font-size: 14px; color: var(--muted); }
.label .opt { color: var(--faint); }
input[type="text"], input[type="password"] {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--fg);
  font: inherit;
  font-size: 16px; /* no iOS zoom on focus */
  outline: none;
  transition: border-color .15s, background .15s;
}
input::placeholder { color: var(--faint); }
input[type="text"]:hover, input[type="password"]:hover { border-color: var(--line-strong); }
input[type="text"]:focus, input[type="password"]:focus { border-color: var(--fg); background: rgba(30, 26, 23, 0.4); }
.err {
  margin: 14px 0 0;
  padding: 10px 14px;
  border: 1px solid var(--err-line);
  border-radius: 12px;
  background: rgba(255, 140, 120, 0.1);
  color: var(--err);
  font-size: 15px;
}
.err:empty { display: none; }

/* ---- login -------------------------------------------------------- */
#login input { margin-bottom: 16px; }
#login .btn { width: 100%; margin-top: 6px; }

/* ---- header and tabs ---------------------------------------------- */
.top { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.top form { margin: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 30px; }
.tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
}
.tabs a:hover { border-color: var(--fg); }
/* Same weight as the others: a bolder label would be wider and push its neighbours. */
.tabs a[aria-current] { background: var(--fg); border-color: var(--fg); color: var(--bg); }

/* ---- uploader ----------------------------------------------------- */
#uploader { max-width: 560px; margin-bottom: 36px; }
.name-row { margin-bottom: 14px; }
.add {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 18px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 18px;
  background: transparent;
  text-align: left;
  transition: background .15s, border-color .15s;
}
.add:hover { background: rgba(245, 236, 229, 0.05); border-color: var(--fg); }
.add .plus {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
}
.add .plus svg { width: 16px; height: 16px; }
.add b { display: block; font-weight: 600; }
.add small { display: block; color: var(--muted); font-size: 14px; }

.uploads { margin-top: 14px; animation: rise .35s var(--ease) both; }
.up-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.up-head b { display: block; font-weight: 600; }
.up-head small { display: block; color: var(--muted); font-size: 14px; }
.bar { height: 4px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar.big { height: 8px; }
.bar i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--fg); transition: width .2s linear; }
.up-list { max-height: 320px; margin: 14px -6px 0; padding: 0 6px; overflow-y: auto; list-style: none; overscroll-behavior: contain; }
.up-item { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.up-name { display: flex; gap: 7px; min-width: 0; font-size: 15px; }
.up-file { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.up-item.is-done .up-name::after { content: "✓"; flex: none; }
.up-state { grid-column: 1; color: var(--muted); font-size: 13px; }
.up-item .bar { grid-column: 1; margin-top: 4px; }
.up-act {
  grid-column: 2;
  grid-row: 1 / span 3;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--faint);
  transition: background .15s, color .15s;
}
.up-act:hover { background: rgba(245, 236, 229, 0.08); color: var(--fg); }
.up-act svg { width: 18px; height: 18px; }
/* Kept for screen readers; visually the check mark after the name says it. */
.up-item.is-done .up-state { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.up-item.is-done .bar, .up-item.is-skip .bar, .up-item.is-error .bar { display: none; }
.up-item.is-error .up-state { color: var(--err); }
.up-item.is-skip .up-name { color: var(--muted); }

.drop {
  position: fixed;
  inset: 12px;
  z-index: 40;
  display: grid;
  place-items: center;
  border: 2px dashed var(--fg);
  border-radius: 24px;
  background: rgba(60, 55, 51, 0.92);
  font: 500 26px/1.2 var(--serif);
  pointer-events: none;
}

/* ---- gallery ------------------------------------------------------ */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 4px; }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); } }
.tile { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--card); }
.tile .open { position: relative; display: block; width: 100%; height: 100%; padding: 0; border: 0; border-radius: inherit; overflow: hidden; background: none; cursor: zoom-in; transition: transform .25s var(--ease); }
.tile a.open { cursor: pointer; }
/* Tall and wide pictures are shown whole; a blurred, enlarged copy fills the rest of the square. */
.tile img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.tile .fg { object-fit: contain; }
.tile .bg { object-fit: cover; filter: blur(14px) brightness(.75); transform: scale(1.25); }
.tile .open:focus-visible { outline-offset: -3px; }
.tile.selected .open { transform: scale(.86); border-radius: 6px; }
.tile.selected { background: rgba(30, 26, 23, 0.5); }
.pick {
  position: absolute;
  top: 0;
  left: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
}
.pick::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: rgba(30, 26, 23, 0.35) center / 14px no-repeat;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
  transition: background-color .15s, opacity .15s, transform .15s var(--ease);
}
.pick:hover::before { transform: scale(1.1); }
.tile.selected .pick::before {
  background-color: var(--fg);
  border-color: var(--fg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%235d5854' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-6.5'/%3E%3C/svg%3E");
}
@media (hover: hover) {
  .tile .pick::before { opacity: 0; }
  .tile:hover .pick::before, .pick:focus-visible::before, .tile.selected .pick::before, .selecting .pick::before { opacity: 1; }
}
.selecting .tile .open { cursor: pointer; }

.tile.video .open::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .55), transparent 45%);
  pointer-events: none;
}
.tile .play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  border-radius: 50%;
  background: rgba(30, 26, 23, 0.55);
  border: 1.5px solid rgba(255, 255, 255, .85);
  pointer-events: none;
}
.tile .play svg { width: 18px; height: 18px; margin-left: 2px; }
.tile .meta {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 6px;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
}
.tile .meta span:first-child { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tile.leaving { animation: leave .22s ease-in both; }
@keyframes leave { to { opacity: 0; transform: scale(.9); } }
.tile.fresh { animation: rise .4s var(--ease) both; }
#sentinel { height: 1px; }

/* ---- selection bar and toast -------------------------------------- */
.selbar {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 24px);
  padding: 8px 8px 8px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #3f3b38;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .4);
  transform: translateX(-50%);
  animation: pop .3s var(--ease) both;
  white-space: nowrap;
}
.selbar span { margin-right: 6px; font-size: 15px; font-weight: 600; }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 16px); } }
@media (max-width: 460px) {
  .selbar { gap: 6px; padding-left: 14px; }
  .selbar .btn.small { padding: 8px 12px; font-size: 14px; }
  .selbar span { font-size: 14px; margin-right: 2px; }
}
.toast {
  position: fixed;
  left: 50%;
  bottom: max(84px, calc(env(safe-area-inset-bottom) + 68px));
  z-index: 30;
  max-width: calc(100vw - 32px);
  padding: 10px 18px;
  border-radius: 12px;
  background: #2f2c2a;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  font-size: 15px;
  text-align: center;
  transform: translateX(-50%);
  animation: pop .3s var(--ease) both;
}

/* ---- viewer ------------------------------------------------------- */
.viewer { position: fixed; inset: 0; z-index: 50; background: #1b1917; animation: fade .2s ease-out both; user-select: none; -webkit-user-select: none; }
@keyframes fade { from { opacity: 0; } }
.v-stage { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; }
.v-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity .2s;
  -webkit-touch-callout: none;
}
.v-stage img.ready { opacity: 1; }
.v-stage img.slide { transition: transform .18s ease-out, opacity .18s; }
.v-spinner {
  grid-area: 1 / 1;
  width: 30px;
  height: 30px;
  border: 2.5px solid rgba(245, 236, 229, .25);
  border-top-color: var(--fg);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.v-btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(30, 26, 23, 0.55);
  color: #fff;
  transition: background .15s, opacity .15s;
}
.v-btn:hover { background: rgba(30, 26, 23, 0.9); }
.v-btn:disabled { opacity: .25; cursor: default; }
.v-btn svg { width: 22px; height: 22px; }
.v-close { top: max(12px, env(safe-area-inset-top)); right: 12px; }
.v-prev { top: 50%; left: 12px; margin-top: -24px; }
.v-next { top: 50%; right: 12px; margin-top: -24px; }
@media (hover: none) { .v-prev, .v-next { display: none; } }
.v-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(12px, env(safe-area-inset-bottom));
  margin: 0;
  padding: 0 16px;
  color: rgba(255, 255, 255, .8);
  font-size: 14px;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .8);
  pointer-events: none;
}

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