/* base */
body {
  margin: 0;
  background: #fafafa;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

/* page wrapper */
#page {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

/* 🔥 animated title */
.site-title {
  color: #000;           
}

.site-title:hover {
  opacity: 0.6;
}

/* header */
.header {
  position: sticky;
  top: 0;
  z-index: 200;

  display: flex;
  justify-content: space-between;
  align-items: baseline;

  margin: 0 -16px 24px;
  padding: 12px 16px;

  background: #fafafa;
}

/* nav */
.nav-links a {
  margin-left: 12px;
  color: #666;
}

.nav-links a.active {
  color: #222;
  border-bottom: 1px solid #222;
}

/* overlay */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(250,250,250,0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.overlay img {
  max-width: 100%;
  max-height: calc(100vh - 80px);
}

.overlay-date {
  position: absolute;
  bottom: 20px;
  font-size: 13px;
  color: #666;
}

.overlay-close {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 22px;
  cursor: pointer;
}

/* arrows */
.overlay-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 32px;
  color: #666;
  cursor: pointer;
  padding: 8px 12px;
}

.overlay-arrow.left { left: 12px; }
.overlay-arrow.right { right: 12px; }

/* loading */
#loading {
  text-align: center;
  margin: 30px 0;
  font-size: 13px;
  color: #777;
}

/* to top */
#to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
}

#to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

/* feed */
#feed > div { margin-bottom: 80px; }
#feed img { width: 100%; border-radius: 6px; }

.date {
  margin-top: 12px;
  font-size: 13px;
  color: #777;
}

/* archive */
#month-nav {
  position: sticky;
  top: 48px;
  z-index: 150;
  background: #fafafa;
  padding: 8px 0;
  text-align: center;
}

#year-links a { margin-right: 6px; color: #777; }
#year-links a.active { color: #222; border-bottom: 1px solid #222; }

.month { margin-bottom: 40px; }

.month-title {
  margin: 20px 0 10px;
  color: #333;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px,1fr));
  gap: 4px;
}

.grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  cursor: pointer;
  opacity: 0;
  transition: 0.2s;
}

.grid img.loaded { opacity: 1; }
