:root {
  --bg: #ffffff;
  --bg-soft: #f7f7f5;
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --surface-strong: rgba(255, 255, 255, 0.94);
  --ink: #171717;
  --muted: #6f6f6a;
  --muted-soft: #9b9b94;
  --line: rgba(23, 23, 23, 0.1);
  --line-strong: rgba(23, 23, 23, 0.24);
  --accent: #171717;
  --accent-soft: #f1f1ee;
  --shadow-soft: 0 18px 44px rgba(0, 0, 0, 0.06);
  --shadow-card: none;
  --radius-xl: 8px;
  --radius-lg: 6px;
  --radius-md: 6px;
  --radius-sm: 4px;
  --font-sans: "Avenir Next", "Neue Haas Grotesk Text", "Segoe UI", "Helvetica Neue", sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

:root[data-theme="dark"] {
  --bg: #0f0e0d;
  --bg-soft: #1b1a18;
  --surface: #1b1a18;
  --surface-solid: #1b1a18;
  --surface-strong: rgba(28, 27, 24, 0.94);
  --ink: #f0e8d8;
  --muted: #9a9388;
  --muted-soft: #6a6560;
  --line: rgba(240, 232, 216, 0.1);
  --line-strong: rgba(240, 232, 216, 0.22);
  --accent: #f0e8d8;
  --accent-soft: #1e1d1a;
  --shadow-soft: 0 18px 44px rgba(0, 0, 0, 0.36);
  --shadow-card: none;
}

html.theme-transition,
html.theme-transition *,
html.theme-transition *::before,
html.theme-transition *::after {
  transition:
    background-color 0.32s ease,
    color 0.22s ease,
    border-color 0.28s ease !important;
}

* {
  box-sizing: border-box;
  border-radius: 0 !important;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  padding-top: 72px;
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.5;
  position: relative;
}

body.lightbox-open {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

body::before {
  display: none;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

code {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
}

.page-status {
  position: fixed;
  top: 26px;
  right: 28px;
  z-index: 60;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: rgba(27, 23, 19, 0.88);
  color: #fbf8f2;
  box-shadow: 0 16px 30px rgba(23, 18, 12, 0.22);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: opacity 0.35s ease, transform 0.45s var(--ease);
}

body.is-ready .page-status {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
}

.container,
.site-header,
.site-footer {
  width: min(1500px, calc(100% - 40px));
}

.container {
  margin: 0 auto;
  padding: 0 0 84px;
  display: flex;
  flex-direction: column;
  gap: 70px;
}

.site-footer,
.shell {
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: min(1500px, calc(100% - 40px));
  margin: 0 auto;
  padding: 20px 0;
  border-radius: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  z-index: 40;
  background: var(--bg);
  border: 0;
  box-shadow: none;
  border-bottom: 1px solid var(--line);
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-nav {
  justify-content: flex-end;
}

.site-nav a,
.text-link {
  color: var(--ink);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-decoration: none;
  text-transform: uppercase;
}

.site-nav a {
  padding: 0.35rem 0;
  border-bottom: 1px solid transparent;
}

.site-nav a:hover,
.text-link:hover {
  border-color: currentColor;
}

.header-left {
  min-width: 0;
}

.header-center {
  justify-self: center;
  text-align: center;
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.header-center:empty {
  display: none;
}

.eyebrow {
  margin: 0;
  color: var(--muted-soft);
  font-size: 0.68rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.site-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3.4vw, 1.72rem);
  font-weight: 400;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}

.site-title a {
  text-decoration: none;
}

.header-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.8);
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-icon-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.35rem 0.1rem;
  line-height: 1;
  border-bottom: 1px solid transparent;
  cursor: pointer;
  transition:
    color 0.2s ease,
    border-color 0.2s ease;
}

.header-icon-btn:hover {
  color: var(--ink);
  border-color: currentColor;
}

.back-link,
.btn {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.35s var(--ease),
    box-shadow 0.35s var(--ease),
    border-color 0.35s ease,
    background 0.35s ease;
}

.back-link {
  min-height: 44px;
  padding: 0.7rem 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.back-link::before {
  content: "←";
  margin-right: 0.45rem;
}

.btn {
  min-height: 44px;
  padding: 0.72rem 1.1rem;
  box-shadow: 0 8px 20px rgba(49, 38, 24, 0.04);
}

.btn:hover,
.back-link:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: 0 14px 26px rgba(46, 35, 20, 0.08);
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fcf9f3;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.header-btn {
  min-width: 104px;
}

.hero {
  padding: 0;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
}

.hero-title,
.section-title,
.group-card-title,
.stat strong,
.modal-panel h3 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.045em;
}

.hero-title {
  margin: 0.6rem 0 1rem;
  max-width: 13ch;
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: 0.95;
}

.hero-copy-minimal {
  justify-content: center;
}

.hero-title-compact {
  max-width: 8ch;
}

.hero-meta-line {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.album-title {
  max-width: 9ch;
  margin-bottom: 0.35rem;
}

.hero-text,
.section-copy,
.group-card-meta,
.photo-caption,
.site-footer,
.muted,
.empty {
  color: var(--muted);
}

.hero-text,
.section-copy,
.empty p {
  margin: 0;
  max-width: 40rem;
  line-height: 1.8;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.stat {
  min-width: 150px;
  padding: 1rem 1.15rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.stat-label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted-soft);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  font-size: 1.95rem;
}

.section-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
  scroll-margin-top: 96px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
}

.section-title {
  margin: 0.35rem 0 0;
  font-size: clamp(1.7rem, 3.2vw, 2.65rem);
}

.groups-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.group-card,
.photo-card,
.skeleton-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 0;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.group-card {
  text-decoration: none;
  position: relative;
  transition:
    transform 0.45s var(--ease),
    box-shadow 0.45s var(--ease),
    border-color 0.45s ease;
}

.group-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: none;
}

.card-kicker {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.group-card-media {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--bg-soft);
}

.group-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: filter 0.45s ease;
}

.group-card-body {
  padding: 12px 2px 18px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 16px;
}

.group-card-copy {
  min-width: 0;
}

.group-card-title {
  margin: 0 0 0.1rem;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.group-card-meta {
  margin: 0;
  font-size: 0.76rem;
}

.favorites-grid {
  height: min(calc(100svh - 112px), 720px);
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 8px;
  background: #fff;
}

:root[data-theme="dark"] .favorites-grid {
  background: #000;
}

.favorites-row {
  min-width: 0;
  min-height: 0;
  display: flex;
  gap: 8px;
  background: #fff;
}

:root[data-theme="dark"] .favorites-row {
  background: #000;
}

.favorite-tile {
  position: relative;
  display: block;
  flex: var(--tile-weight, 1) 1 0;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--bg-soft);
  text-decoration: none;
}

.favorite-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  opacity: 1;
  transition:
    opacity 0.7s ease,
    transform 0.45s var(--ease),
    filter 0.45s ease;
}

.favorite-tile:hover img {
  transform: scale(1.025);
  filter: contrast(1.02);
}

.favorite-tile-next {
  opacity: 0 !important;
}

.favorite-tile-next.is-visible {
  opacity: 1 !important;
}

.favorite-tile img.is-fading {
  opacity: 0;
}

.minimal-empty {
  padding: 28px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--bg-soft);
}

.group-card-link {
  flex: 0 0 auto;
  padding: 0.72rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.82);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.photos-grid {
  position: relative;
  width: 100%;
}

.photos-grid > .skeleton-card {
  display: block;
}

.photo-card {
  margin: 0;
  position: absolute;
  display: block;
  background: transparent;
  transition:
    transform 0.4s var(--ease),
    box-shadow 0.4s var(--ease),
    border-color 0.4s ease;
}

.photo-card:hover {
  transform: none;
  border-color: var(--line-strong);
}

.photo-card.selected {
  border-color: rgba(33, 27, 22, 0.38);
  box-shadow:
    0 0 0 1px rgba(33, 27, 22, 0.18),
    0 28px 52px rgba(48, 37, 24, 0.14);
}

.photo-link {
  text-decoration: none;
  display: block;
}

.photo-media {
  position: relative;
  min-height: 220px;
  background: var(--bg-soft);
}

.photo-media.has-ratio {
  min-height: 0;
  aspect-ratio: var(--aspect);
}

.photo-card img {
  width: 100%;
  height: auto;
  display: block;
  transition: filter 0.45s ease;
}

.skeleton-card::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.76), transparent);
  animation: shimmer 1.65s infinite;
}

.select-indicator {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  min-height: 42px;
  padding: 0.6rem 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 24px rgba(33, 25, 15, 0.08);
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(-8px);
  transition:
    opacity 0.26s ease,
    transform 0.34s var(--ease),
    background 0.26s ease,
    color 0.26s ease;
}

.select-mode .photo-card:hover .select-indicator,
.photo-card.selected .select-indicator {
  opacity: 1;
  transform: none;
}

.photo-card.selected .select-indicator {
  background: var(--accent);
  border-color: var(--accent);
  color: #fbf8f2;
}

.bottom-bar {
  position: fixed;
  left: 50%;
  bottom: 24px;
  width: min(1080px, calc(100% - 48px));
  transform: translate(-50%, calc(100% + 24px));
  opacity: 0;
  z-index: 35;
  transition:
    transform 0.45s var(--ease),
    opacity 0.35s ease;
}

.select-mode .bottom-bar {
  transform: translate(-50%, 0);
  opacity: 1;
}

.bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 20px;
  border-radius: 28px;
  background: rgba(250, 247, 241, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.bottom-summary strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.02rem;
  font-weight: 500;
}

.bottom-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 118px;
  transform: translateX(-50%);
  z-index: 50;
  padding: 0.9rem 1.1rem;
  border-radius: 18px;
  background: rgba(27, 23, 19, 0.94);
  color: #fbf8f2;
  box-shadow: 0 18px 34px rgba(18, 14, 10, 0.2);
}

.empty {
  padding: 1.25rem 1.4rem;
  border-radius: var(--radius-md);
  border: 1px dashed var(--line-strong);
  background: rgba(255, 255, 255, 0.5);
}

.site-footer {
  margin: 0 auto;
  padding: 0 0 44px;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 55;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 18, 13, 0.34);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(92vw, 520px);
  transform: translate(-50%, -50%);
  padding: 20px;
  border-radius: 28px;
  background: rgba(251, 248, 242, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-soft);
}

.modal-panel h3 {
  margin: 0 0 0.5rem;
  font-size: 2rem;
}

.muted {
  margin: 0 0 0.75rem;
}

.share-form {
  display: grid;
  gap: 8px;
  margin: 1rem 0;
}

.share-form .radio {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0.85rem 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid var(--line);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.lightbox {
  --lb-offset-x: 0px;
  --lb-offset-y: 0px;
  --lb-scale: 1;
  --lb-backdrop-opacity: 1;
  --lb-track-offset: 0px;
  --lb-shell-pad-top: calc(env(safe-area-inset-top, 0px) + 84px);
  --lb-shell-pad-side: clamp(10px, 3vw, 40px);
  --lb-shell-pad-bottom: calc(env(safe-area-inset-bottom, 0px) + 146px);
  position: fixed;
  inset: 0;
  z-index: 90;
  min-height: 100vh;
  min-height: 100dvh;
  background: #000;
  overflow: hidden;
  overscroll-behavior: none;
  transition: background 0.28s ease;
}

.lightbox[hidden] {
  display: none;
}

.lb-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}

.lb-media-shell {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: var(--lb-shell-pad-top) var(--lb-shell-pad-side) var(--lb-shell-pad-bottom);
  transform: translate3d(var(--lb-offset-x), var(--lb-offset-y), 0) scale(var(--lb-scale));
  transition:
    transform 0.3s var(--ease),
    padding 0.38s var(--ease);
  will-change: transform;
}

.lightbox.is-dragging .lb-media-shell {
  transition: none;
}

.lb-track {
  width: 100%;
  height: 100%;
  display: flex;
  transform: translate3d(calc(var(--lb-track-base, -100%) + var(--lb-track-offset)), 0, 0);
  will-change: transform;
}

.lightbox.is-track-animating .lb-track {
  transition: transform 0.3s var(--ease);
}

.lightbox.is-dragging .lb-track {
  transition: none;
}

.lb-slide {
  flex: 0 0 100%;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.lb-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
  box-shadow: 0 40px 100px rgba(11, 8, 6, 0.28);
  transform: none;
  transform-origin: center;
  touch-action: none;
  transition:
    filter 0.2s ease,
    box-shadow 0.38s ease,
    transform 0.26s var(--ease);
}

.lb-image.is-active {
  transform: translate(var(--lb-pan-x, 0px), var(--lb-pan-y, 0px)) scale(var(--lb-zoom, 1));
}

/* Suppress transform transition during active pinch/pan so it tracks fingers */
.lightbox.is-pinching .lb-image.is-active {
  transition:
    filter 0.2s ease,
    box-shadow 0.38s ease;
}

.lb-image.is-thumb {
  filter: blur(1.3px) saturate(0.9) brightness(0.92);
}

.lb-chrome,
.lb-btn {
  appearance: none;
  transition:
    opacity 0.24s ease,
    transform 0.24s var(--ease),
    background 0.24s ease,
    border-color 0.24s ease;
}

.lb-topbar,
.lb-bottombar {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 3;
}

.lb-topbar {
  top: 0;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) 22px 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  background: linear-gradient(180deg, rgba(15, 12, 10, 0.68), rgba(15, 12, 10, 0));
}

.lb-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.lb-album-name,
.lb-counter {
  color: #f8f3ea;
}

.lb-album-name {
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(248, 243, 234, 0.62);
}

.lb-counter {
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.lb-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: end;
}

.lb-action-btn {
  appearance: none;
  min-height: 44px;
  padding: 0.72rem 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(251, 248, 242, 0.12);
  color: #fbf8f2;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.lb-action-btn.is-active {
  background: rgba(251, 248, 242, 0.9);
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.34);
}

.lb-close {
  justify-self: start;
}

.lb-bottombar {
  bottom: 0;
  padding: 20px 22px calc(env(safe-area-inset-bottom, 0px) + 20px);
  background: linear-gradient(180deg, rgba(15, 12, 10, 0), rgba(15, 12, 10, 0.72));
}

.lb-filmstrip {
  width: min(100%, 860px);
  margin: 0 auto;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.lb-filmstrip::-webkit-scrollbar {
  display: none;
}

.lb-thumb {
  appearance: none;
  flex: 0 0 auto;
  width: 58px;
  aspect-ratio: 3 / 4;
  padding: 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(251, 248, 242, 0.08);
  opacity: 0.62;
  cursor: pointer;
  transform: scale(0.96);
  transition:
    opacity 0.24s ease,
    transform 0.24s var(--ease),
    border-color 0.24s ease,
    box-shadow 0.24s ease;
}

.lb-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.lb-thumb.is-active {
  opacity: 1;
  transform: none;
  border-color: rgba(255, 255, 255, 0.62);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.lb-btn {
  position: absolute;
  top: 50%;
  width: 52px;
  height: 52px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(251, 248, 242, 0.1);
  color: #fbf8f2;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transform: translateY(-50%);
  z-index: 2;
}

.lb-prev,
.lb-next {
  font-size: 0;
}

.lb-prev::before,
.lb-next::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  background-color: currentColor;
  transform: translate(-50%, -50%);
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
}

.lb-prev::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M12.5 3.75 6.25 10l6.25 6.25' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M12.5 3.75 6.25 10l6.25 6.25' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.lb-next::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M7.5 3.75 13.75 10 7.5 16.25' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M7.5 3.75 13.75 10 7.5 16.25' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.lb-prev {
  left: max(18px, calc(env(safe-area-inset-left, 0px) + 18px));
}

.lb-next {
  right: max(18px, calc(env(safe-area-inset-right, 0px) + 18px));
}

.lb-zone {
  appearance: none;
  position: absolute;
  top: 0;
  bottom: 0;
  width: 20%;
  z-index: 1;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.lb-zone-prev { left: 0; }
.lb-zone-next { right: 0; }

.lightbox.is-single .lb-prev,
.lightbox.is-single .lb-next,
.lightbox.is-single .lb-zone {
  display: none;
}

.lb-progress {
  position: absolute;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 118px);
  transform: translateX(-50%);
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: rgba(251, 248, 242, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fbf8f2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.lightbox.is-chrome-hidden .lb-topbar,
.lightbox.is-chrome-hidden .lb-bottombar {
  opacity: 0;
  pointer-events: none;
}

.lightbox.is-chrome-hidden {
  --lb-shell-pad-top: max(env(safe-area-inset-top, 0px), 12px);
  --lb-shell-pad-side: clamp(0px, 1vw, 14px);
  --lb-shell-pad-bottom: max(env(safe-area-inset-bottom, 0px), 12px);
}

.lightbox.is-chrome-hidden .lb-topbar {
  transform: translateY(-18px);
}

.lightbox.is-chrome-hidden .lb-bottombar {
  transform: translateY(18px);
}

.lightbox.is-chrome-hidden .lb-prev,
.lightbox.is-chrome-hidden .lb-next {
  opacity: 0;
  pointer-events: none;
}

.lightbox.is-chrome-hidden .lb-image {
  box-shadow: 0 18px 56px rgba(11, 8, 6, 0.18);
}

.lightbox.is-dragging .lb-topbar,
.lightbox.is-dragging .lb-bottombar,
.lightbox.is-dragging .lb-prev,
.lightbox.is-dragging .lb-next {
  opacity: 0.18;
}

/* Lightbox — light mode */
:root:not([data-theme="dark"]) .lightbox {
  background: #fff;
}

:root:not([data-theme="dark"]) .lb-topbar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0));
}

:root:not([data-theme="dark"]) .lb-bottombar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.92));
}

:root:not([data-theme="dark"]) .lb-album-name {
  color: rgba(23, 23, 23, 0.5);
}

:root:not([data-theme="dark"]) .lb-counter {
  color: #171717;
}

:root:not([data-theme="dark"]) .lb-action-btn {
  border-color: rgba(23, 23, 23, 0.14);
  background: rgba(23, 23, 23, 0.06);
  color: #171717;
}

:root:not([data-theme="dark"]) .lb-action-btn.is-active {
  background: rgba(23, 23, 23, 0.88);
  border-color: rgba(23, 23, 23, 0.5);
  color: #fbf8f2;
}

:root:not([data-theme="dark"]) .lb-btn {
  border-color: rgba(23, 23, 23, 0.14);
  background: rgba(255, 255, 255, 0.88);
  color: #171717;
}

:root:not([data-theme="dark"]) .lb-thumb {
  border-color: rgba(23, 23, 23, 0.12);
  background: rgba(23, 23, 23, 0.05);
  opacity: 0.5;
}

:root:not([data-theme="dark"]) .lb-thumb.is-active {
  border-color: rgba(23, 23, 23, 0.5);
  box-shadow: 0 0 0 1px rgba(23, 23, 23, 0.1);
  opacity: 1;
}

:root:not([data-theme="dark"]) .lb-progress {
  background: rgba(23, 23, 23, 0.07);
  border-color: rgba(23, 23, 23, 0.14);
  color: #171717;
}

:root:not([data-theme="dark"]) .lb-image {
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.12);
}

:root:not([data-theme="dark"]) .lightbox.is-chrome-hidden .lb-image {
  box-shadow: 0 18px 56px rgba(0, 0, 0, 0.08);
}

.skeleton-card {
  position: relative;
}

.skeleton-media {
  position: relative;
  background: linear-gradient(160deg, rgba(241, 235, 226, 0.98), rgba(224, 215, 202, 0.84));
}

.skeleton-group .skeleton-media {
  aspect-ratio: 4 / 5;
}

.skeleton-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skeleton-line {
  display: block;
  height: 12px;
  border-radius: 999px;
  background: rgba(215, 207, 194, 0.8);
}

.skeleton-line-short {
  width: 34%;
}

.skeleton-line-long {
  width: 68%;
}

[data-reveal] {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.7s var(--ease),
    transform 0.7s var(--ease);
  transition-delay: calc(var(--stagger-index, 0) * 50ms);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

:root[data-theme="dark"] code {
  background: rgba(255, 255, 255, 0.06);
}

:root[data-theme="dark"] .skeleton-media {
  background: linear-gradient(160deg, rgba(35, 33, 30, 0.98), rgba(28, 26, 23, 0.84));
}

:root[data-theme="dark"] .skeleton-line {
  background: rgba(55, 52, 46, 0.9);
}

:root[data-theme="dark"] .skeleton-card::after {
  background: linear-gradient(90deg, transparent, rgba(50, 47, 42, 0.76), transparent);
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

@media (max-width: 1120px) {

  .groups-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

}

@media (max-width: 780px) {
  body {
    padding-top: 62px;
  }

  .container,
  .site-header,
  .site-footer,
  .bottom-bar {
    width: calc(100% - 24px);
  }

  .container {
    padding-top: 0;
    gap: 52px;
  }

  .site-header {
    padding: 16px 0;
    gap: 10px;
    grid-template-columns: 1fr;
    grid-template-areas: none;
    align-items: center;
  }

  .header-pill {
    display: none;
  }

  .page-home .header-center {
    display: none;
  }

  .page-home .site-nav {
    display: flex;
  }

  .page-home .site-nav a {
    display: none;
  }

  .page-home .header-left {
    justify-content: center;
  }

  .header-left,
  .header-right,
  .header-center {
    grid-area: auto;
    align-self: center;
  }

  .header-left {
    gap: 10px;
    min-width: 0;
  }

  .site-title {
    font-size: 1.08rem;
    letter-spacing: 0.2em;
  }

  .site-nav {
    gap: 10px;
  }

  .site-nav a {
    font-size: 0.6rem;
    letter-spacing: 0.14em;
  }

  .page-group .site-header {
    grid-template-columns: auto 1fr auto;
  }

  .page-group .header-center {
    display: block;
    font-size: 0.62rem;
    letter-spacing: 0.1em;
  }

  .hero {
    padding: 0;
  }

  .hero-title {
    font-size: clamp(2.4rem, 12vw, 3.7rem);
  }

  .section-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  .groups-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .photos-grid {
    gap: 8px;
  }

  .photos-grid > .skeleton-card,
  .photo-card {
    margin-bottom: 8px;
  }

  .favorites-grid {
    height: min(calc(100svh - 94px), 560px);
    gap: 6px;
  }

  .favorites-row {
    gap: 6px;
  }

  .group-card-body {
    padding: 10px 0 16px;
  }

  /* Compact header controls */
  .back-link {
    font-size: 0;
    min-width: 40px;
    width: 40px;
    padding: 0;
  }

  .back-link::before {
    font-size: 1.15rem;
    margin-right: 0;
  }

  .header-btn {
    min-width: 0;
    padding: 0.52rem 0.85rem;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
  }

  /* Icon-only bottom bar */
  .bottom-inner {
    flex-direction: row;
    align-items: center;
    padding: 12px 14px;
    gap: 12px;
  }

  .bottom-summary {
    flex: 1 1 auto;
    min-width: 0;
  }

  .bottom-summary .eyebrow {
    display: none;
  }

  .bottom-summary strong {
    margin-top: 0;
    font-size: 0.88rem;
  }

  .bottom-actions {
    flex: 0 0 auto;
    width: auto;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .action-btn {
    min-width: 44px;
    width: 44px;
    padding: 0;
    font-size: 0;
    letter-spacing: 0;
  }

  .action-btn::before {
    font-size: 1.1rem;
    line-height: 1;
  }

  .action-btn-select::before {
    content: "◻";
  }

  .action-btn-select.is-clear::before {
    content: "✕";
  }

  .action-btn-share::before {
    content: "↑";
  }

  .action-btn-download::before {
    content: "↓";
  }

  .lb-topbar {
    grid-template-columns: auto 1fr auto;
    padding: calc(env(safe-area-inset-top, 0px) + 14px) 14px 14px;
    gap: 10px;
  }

  .lb-album-name {
    display: none;
  }

  .lb-counter {
    font-size: 0.72rem;
  }

  .lb-actions {
    gap: 8px;
  }

  .lb-action-btn {
    min-height: 40px;
    padding: 0.68rem 0.9rem;
    font-size: 0.72rem;
  }

  .lb-close,
  #lbSelectBtn,
  #lbShareBtn,
  #lbDownloadBtn {
    min-width: 40px;
    width: 40px;
    padding: 0;
    font-size: 0;
    letter-spacing: 0;
  }

  .lb-close::before {
    content: "×";
    font-size: 1.32rem;
    line-height: 1;
  }

  #lbSelectBtn::before {
    content: "+";
    font-size: 1.1rem;
    line-height: 1;
  }

  #lbSelectBtn.is-active::before {
    content: "✓";
    font-size: 0.96rem;
  }

  #lbShareBtn::before {
    content: "↑";
    font-size: 1rem;
    line-height: 1;
  }

  #lbDownloadBtn::before {
    content: "↓";
    font-size: 1rem;
    line-height: 1;
  }

  .lb-media-shell {
    --lb-shell-pad-top: calc(env(safe-area-inset-top, 0px) + 74px);
    --lb-shell-pad-side: 0px;
    --lb-shell-pad-bottom: calc(env(safe-area-inset-bottom, 0px) + 118px);
  }

  /* Presenter mode on mobile: override the direct .lb-media-shell vars so the
     image fills the screen. The ancestor .lightbox.is-chrome-hidden rule sets
     these vars too, but a direct declaration on .lb-media-shell always wins
     over an inherited one regardless of selector specificity. */
  .lightbox.is-chrome-hidden .lb-media-shell {
    --lb-shell-pad-top: env(safe-area-inset-top, 0px);
    --lb-shell-pad-side: 0px;
    --lb-shell-pad-bottom: env(safe-area-inset-bottom, 0px);
  }

  .lb-btn {
    top: auto;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 106px);
    width: 44px;
    height: 44px;
    transform: none;
  }

  .lb-prev {
    left: 14px;
  }

  .lb-next {
    right: 14px;
  }

  .lb-progress {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 130px);
    font-size: 0.68rem;
  }

  .lb-bottombar {
    padding: 14px 14px calc(env(safe-area-inset-bottom, 0px) + 14px);
  }

  .lb-filmstrip {
    gap: 8px;
  }

  .lb-thumb {
    width: 52px;
    border-radius: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
}

