:root {
  --bg: #0a0a0b;
  --bg-elev: #131316;
  --bg-soft: #1a1a1f;
  --line: rgba(255, 255, 255, 0.06);
  --text: #ececef;
  --text-dim: #8a8a93;
  --text-faint: #5a5a63;
  --accent: #e8c79c;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  --gap: 6px;
  --row-h: 240px;
  --safe-top: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-weight: 300;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

img, video { display: block; max-width: 100%; }

/* ---------- Header ---------- */
.site-header {
  padding: calc(72px + var(--safe-top)) 48px 56px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.site-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 64px;
  height: 1px;
  background: var(--accent);
  opacity: 0.5;
}
.brand h1 {
  font-family: 'Cormorant Garamond', 'Songti SC', 'STSong', serif;
  font-weight: 500;
  font-size: clamp(40px, 6vw, 64px);
  letter-spacing: 0.4em;
  color: var(--text);
  margin-bottom: 12px;
}
.brand .tagline {
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 400;
}
.meta {
  margin-top: 28px;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  font-weight: 400;
}
.meta .dot { margin: 0 12px; color: var(--text-faint); }

/* ---------- Timeline ---------- */
.timeline {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 11, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
  padding: 14px 24px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.timeline::-webkit-scrollbar { display: none; }
.timeline button {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.15em;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.25s ease;
  font-weight: 400;
}
.timeline button:hover { color: var(--text); border-color: var(--line); }
.timeline button.active {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}

/* ---------- Gallery ---------- */
.gallery {
  padding: 32px 16px 120px;
  max-width: 1800px;
  margin: 0 auto;
}
.month-section { margin-bottom: 56px; }
.month-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 0 8px 18px;
  margin-bottom: 18px;
}
.month-header .m-title {
  font-family: 'Cormorant Garamond', 'Songti SC', 'STSong', serif;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text);
}
.month-header .m-sub {
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.month-header .m-line {
  flex: 1;
  height: 1px;
  background: var(--line);
}
.month-header .m-count {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--text-faint);
}

/* Justified rows */
.row {
  display: flex;
  gap: var(--gap);
  margin-bottom: var(--gap);
}
.cell {
  position: relative;
  overflow: hidden;
  background: var(--bg-elev);
  border-radius: 2px;
  cursor: zoom-in;
  flex-shrink: 0;
}
.cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.cell img.loaded { opacity: 1; }
.cell::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.35) 0%, transparent 30%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.cell:hover::after { opacity: 1; }
.cell:hover img { transform: scale(1.04); }

/* ---------- Loading ---------- */
.loading {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 200;
  transition: opacity 0.5s ease;
}
.loading.hide { opacity: 0; pointer-events: none; }
.loading p {
  margin-top: 24px;
  font-size: 11px;
  letter-spacing: 0.32em;
  color: var(--text-dim);
}
.spinner {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.96);
  z-index: 300;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.lightbox.open { display: flex; opacity: 1; }
.lb-stage {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 64px;
  overflow: hidden;
}
.lb-stage img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: var(--shadow);
  user-select: none;
  -webkit-user-drag: none;
}
.lb-info {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  letter-spacing: 0.24em;
  color: var(--text-dim);
  pointer-events: none;
}
.lb-close, .lb-prev, .lb-next {
  position: absolute;
  background: rgba(20, 20, 24, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  color: var(--text);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.lb-close { top: 24px; right: 24px; }
.lb-prev { left: 24px; top: 50%; transform: translateY(-50%); font-size: 28px; }
.lb-next { right: 24px; top: 50%; transform: translateY(-50%); font-size: 28px; }

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
  :root { --row-h: 150px; --gap: 4px; }
  .site-header { padding: 56px 20px 40px; }
  .gallery { padding: 20px 8px 80px; }
  .month-section { margin-bottom: 40px; }
  .month-header { padding: 0 4px 12px; gap: 12px; }
  .month-header .m-title { font-size: 22px; }
  .timeline { padding: 10px 16px; }
  .lb-stage { padding: 24px 8px; }
  .lb-close { top: max(16px, var(--safe-top)); right: 16px; width: 40px; height: 40px; }
  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }
  .lb-info { bottom: 16px; font-size: 10px; }
}

/* ---------- Empty state ---------- */
.empty {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-faint);
  font-size: 13px;
  letter-spacing: 0.2em;
}

/* Subtle entrance */
.month-section { animation: fadeUp 0.6s ease both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
