:root {
  --bg: #FBF7F0;
  --paper: #FFFDF9;
  --ink: #2E2A25;
  --text: #5E564C;
  --label: #8F8476;
  --faint: #AFA597;
  --gold: #B08D57;
  --gold-dark: #94733F;
  --gold-soft: rgba(176,141,87,0.12);
  --line: rgba(94,86,76,0.14);
  --card: #F3EDE2;
  --serif: "Cormorant Garamond", "Songti SC", Georgia, serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: Inter, "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
  font-size: 14px; line-height: 1.5; min-height: 100vh; overflow-x: hidden;
}
button { font: inherit; cursor: pointer; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Hero */
.hero { max-width: 1440px; margin: 0 auto; padding: 96px 48px 56px; text-align: center; }
.eyebrow { display: flex; align-items: center; justify-content: center; gap: 16px; color: var(--gold); font-size: 12px; font-weight: 600;
  letter-spacing: .28em; text-transform: uppercase; margin-bottom: 22px; }
.eyebrow .rule { width: 48px; height: 1px; background: currentColor; opacity: .6; }
h1 { margin: 0; color: var(--ink); font-family: var(--serif); font-size: 88px; line-height: 1; font-weight: 500; letter-spacing: -0.01em; }
h1 em { font-style: italic; color: var(--gold); }
.date { margin-top: 18px; font-family: var(--serif); font-size: 22px; letter-spacing: .3em; color: var(--label); }
.sub { margin: 24px auto 34px; font-size: 16px; max-width: 560px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

.btn { height: 42px; min-width: 150px; padding: 0 24px; border-radius: 999px; font-size: 14px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: background .15s, border-color .15s, color .15s; white-space: nowrap; }
.btn.primary { background: var(--ink); color: var(--paper); border: 1px solid var(--ink); }
.btn.primary:hover { background: #45403A; }
.btn.outline { background: transparent; color: var(--ink); border: 1px solid rgba(46,42,37,0.25); }
.btn.outline:hover { border-color: var(--gold); color: var(--gold-dark); }
.btn:disabled { opacity: .5; cursor: default; }

/* Filters */
.filters { position: sticky; top: 0; z-index: 20; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: rgba(251,247,240,0.86); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.tabs, .people { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 12px 48px; }
.tabs::-webkit-scrollbar, .people::-webkit-scrollbar { display: none; }
.people { padding-top: 0; gap: 6px; }
.people[hidden] { display: none; }
.tab { flex: none; height: 36px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--paper); color: var(--text); font-size: 14px; font-weight: 500; }
.tab span { color: var(--faint); margin-left: 6px; font-size: 13px; }
.tab:hover { color: var(--ink); border-color: rgba(176,141,87,0.5); }
.tab.active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.tab.active span { color: rgba(255,253,249,0.6); }

.people-label { flex: none; align-self: center; color: var(--label); font-size: 12px; font-weight: 600; letter-spacing: .14em; margin-right: 6px; }
.person { flex: none; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px 0 4px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper); color: var(--text); font-size: 13px; font-weight: 500; transition: border-color .15s, background .15s; }
.person img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; display: block; }
.person span { color: var(--faint); font-size: 12px; }
.person:hover { border-color: rgba(176,141,87,0.5); color: var(--ink); }
.person.active { border-color: var(--gold); background: var(--gold-soft); color: var(--ink); box-shadow: inset 0 0 0 1px var(--gold); }
.person.active span { color: var(--gold-dark); }
.person.clear { padding: 0 14px; color: var(--label); }

/* Grid */
main { max-width: 1440px; margin: 0 auto; padding: 32px 48px 140px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.section-title { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 12px; margin: 32px 0 4px; }
.section-title:first-child { margin-top: 0; }
.section-title h2 { margin: 0; color: var(--ink); font-family: var(--serif); font-size: 30px; font-weight: 500; }
.section-title span { color: var(--faint); font-size: 13px; }
.empty { grid-column: 1 / -1; text-align: center; padding: 80px 0; color: var(--label); }

.tile { position: relative; aspect-ratio: 3 / 2; border-radius: 6px; overflow: hidden; background: var(--card);
  cursor: zoom-in; outline: 2px solid transparent; outline-offset: -2px; transition: outline-color .15s; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease, opacity .3s; opacity: 0; }
.tile img.loaded { opacity: 1; }
.tile:hover img { transform: scale(1.03); }
.tile::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom, rgba(30,26,22,0.4), transparent 32%, transparent 62%, rgba(30,26,22,0.5)); opacity: 0; transition: opacity .2s; }
.tile:hover::after, .selecting .tile::after, .tile.selected::after { opacity: 1; }
.tile.selected { outline-color: var(--gold); background: var(--gold-soft); }
.tile.selected img { transform: scale(0.94); border-radius: 4px; }

.check { position: absolute; z-index: 2; top: 10px; left: 10px; width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.9); background: rgba(30,26,22,0.25); display: grid; place-items: center;
  opacity: 0; transition: opacity .15s, background .15s; padding: 0; color: #fff; }
.check svg { width: 15px; height: 15px; stroke-width: 3; opacity: 0; }
.tile:hover .check, .selecting .check { opacity: 1; }
.tile.selected .check { opacity: 1; background: var(--gold); border-color: var(--gold); }
.tile.selected .check svg { opacity: 1; }

.dl { position: absolute; z-index: 2; right: 10px; bottom: 10px; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; color: var(--ink); background: rgba(255,253,249,0.88); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; transition: opacity .15s, background .15s, color .15s; }
.dl svg { width: 17px; height: 17px; }
.dl:hover { background: var(--gold); color: #fff; }
.tile:hover .dl { opacity: 1; }

.badge { position: absolute; z-index: 2; left: 10px; bottom: 10px; display: flex; align-items: center; gap: 5px;
  padding: 3px 8px 3px 6px; border-radius: 999px; background: rgba(30,26,22,0.55); color: #fff; font-size: 12px; font-weight: 600; }
.badge svg { width: 12px; height: 12px; fill: #fff; stroke: none; }

/* Selection bar */
.bar { position: fixed; z-index: 30; left: 50%; bottom: 24px; transform: translateX(-50%); width: min(760px, calc(100% - 32px));
  display: flex; align-items: center; gap: 20px; padding: 12px 12px 12px 24px; border-radius: 999px;
  background: rgba(255,253,249,0.9); border: 1px solid rgba(176,141,87,0.45); box-shadow: 0 18px 48px rgba(60,48,30,0.16);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.bar[hidden] { display: none; }
.bar-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bar-info strong { color: var(--ink); font-size: 15px; font-weight: 600; }
.bar-info span { font-size: 13px; }
.bar-progress { position: absolute; left: 28px; right: 28px; top: -1px; height: 2px; border-radius: 2px; overflow: hidden; background: var(--gold-soft); }
.bar-progress div { height: 100%; width: 0; background: var(--gold); transition: width .2s; }
.bar-actions { display: flex; gap: 10px; }
.bar .btn { min-width: 120px; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(251,247,240,0.98); display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lb-top { position: absolute; top: 0; left: 0; right: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; padding-top: max(14px, env(safe-area-inset-top)); }
.lb-name { color: var(--ink); font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-name small { color: var(--label); font-weight: 400; margin-left: 8px; font-size: 13px; }
.lb-actions { display: flex; gap: 8px; flex: none; }
.lb-btn { height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(46,42,37,0.2); background: var(--paper);
  color: var(--ink); display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; text-decoration: none; }
.lb-btn svg { width: 17px; height: 17px; }
.lb-btn.icon { width: 38px; padding: 0; justify-content: center; }
.lb-btn:hover { border-color: var(--gold); }
#lbDownload { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.lb-btn.on { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-dark); }
.lb-stage { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 68px 80px 28px; }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; box-shadow: 0 20px 60px rgba(60,48,30,0.18); }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid rgba(46,42,37,0.15); background: rgba(255,253,249,0.85); color: var(--ink); display: grid; place-items: center; }
.lb-nav svg { width: 22px; height: 22px; }
.lb-nav:hover { border-color: var(--gold); }
.lb-nav.prev { left: 16px; } .lb-nav.next { right: 16px; }

.toast { position: fixed; z-index: 60; left: 50%; top: 24px; transform: translateX(-50%); max-width: calc(100% - 32px);
  padding: 12px 20px; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: 14px; box-shadow: 0 12px 32px rgba(60,48,30,0.2); }

/* Entrance */
.fade { opacity: 0; transform: translateY(20px); transition: opacity .8s ease-out, transform .8s ease-out; }
.fade.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .fade { opacity: 1; transform: none; transition: none; }
  .tile img { transition: none; }
}

/* Touch devices: controls always visible */
@media (hover: none) {
  .check, .dl { opacity: 1; }
  .tile::after { opacity: 1; }
}

@media (max-width: 880px) {
  .hero { padding: 56px 16px 32px; }
  h1 { font-size: 54px; }
  .date { font-size: 18px; }
  .eyebrow .rule { width: 28px; }
  .sub { font-size: 15px; margin: 18px auto 24px; }
  .hero-actions .btn { flex: 1; min-width: 0; }
  .tabs, .people { padding-left: 16px; padding-right: 16px; }
  .people { padding-top: 0; }
  main { padding: 20px 16px 150px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
  .tile { border-radius: 4px; }
  .check { width: 26px; height: 26px; top: 8px; left: 8px; }
  .dl { width: 30px; height: 30px; right: 8px; bottom: 8px; }
  .bar { flex-wrap: wrap; gap: 12px; padding: 14px; border-radius: 20px; bottom: max(12px, env(safe-area-inset-bottom)); }
  .bar-actions { width: 100%; }
  .bar-actions .btn { flex: 1; min-width: 0; }
  .lb-stage { padding: 64px 0 16px; }
  .lb-nav { width: 40px; height: 40px; }
  .lb-nav.prev { left: 8px; } .lb-nav.next { right: 8px; }
  .lb-btn span { display: none; }
  .lb-btn { padding: 0; width: 38px; justify-content: center; }
}
