*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #ffffff;
  --text: #202124;
  --muted: #5f6368;
  --tile-bg: #f1f3f4;
  --heart-active: #ff4b6e;
  --gap: 6px;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.site-header {
  max-width: 720px;
  margin: 0 auto;
  padding: 36px 20px 28px;
  text-align: center;
}

.intro {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text);
  font-weight: 400;
}

main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 12px 48px;
}

.gallery {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.gallery-row {
  display: flex;
  gap: var(--gap);
}

.photo-tile {
  position: relative;
  overflow: hidden;
  background: var(--tile-bg);
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.photo-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.photo-tile img.loaded {
  opacity: 1;
}

@media (hover: hover) {
  .photo-tile:hover img {
    transform: scale(1.015);
  }
}

.heart-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: none;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #ffffff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.photo-tile .heart-btn {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
}

.heart-btn:hover {
  background: rgba(0, 0, 0, 0.56);
}

.heart-btn:active {
  transform: scale(0.92);
}

.heart-icon {
  fill: none;
  stroke: #ffffff;
  stroke-width: 2;
  transition: fill 0.15s ease, stroke 0.15s ease, transform 0.15s ease;
}

.heart-btn.liked .heart-icon {
  fill: var(--heart-active);
  stroke: var(--heart-active);
  transform: scale(1.1);
}

.heart-count:empty {
  display: none;
}

.status {
  text-align: center;
  color: var(--muted);
  padding: 48px 16px;
  font-size: 0.95rem;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(12, 12, 14, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-y;
}

.lightbox[hidden] {
  display: none;
}

.lb-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 64px 72px;
}

.lb-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.lb-btn {
  position: fixed;
  z-index: 102;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  cursor: pointer;
  transition: background 0.15s ease;
}

.lb-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.lb-close {
  top: 16px;
  right: 16px;
}

.lb-nav {
  top: 50%;
  transform: translateY(-50%);
}

.lb-prev {
  left: 16px;
}

.lb-next {
  right: 16px;
}

.lb-footer {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 102;
  display: flex;
  align-items: center;
  gap: 14px;
}

.lb-counter {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.lb-heart-btn {
  padding: 8px 14px;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.14);
}

.lb-heart-btn:hover {
  background: rgba(255, 255, 255, 0.24);
}

@media (max-width: 640px) {
  .site-header {
    padding: 24px 16px 20px;
  }

  .intro {
    font-size: 0.98rem;
  }

  main {
    padding: 0 6px 36px;
  }

  .lb-stage {
    padding: 52px 12px 68px;
  }

  .lb-nav {
    display: none;
  }
}
