:root {
  --bg: #0e0f12;
  --bg-elev: #16181d;
  --fg: #e8e8ea;
  --fg-dim: #9aa0a6;
  --accent: #76e1ff;
  --border: #2a2d34;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

header {
  padding: 2rem 1.25rem 1rem;
  max-width: 1100px;
  margin: 0 auto;
}

header h1 {
  margin: 0;
  font-size: 1.75rem;
  letter-spacing: -0.01em;
}

header .sub {
  margin: 0.25rem 0 0;
  color: var(--fg-dim);
  font-size: 0.95rem;
}

.controls {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.controls label {
  font-size: 0.9rem;
  color: var(--fg-dim);
}

.controls input[type="date"] {
  background: var(--bg-elev);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  font-size: 0.95rem;
  color-scheme: dark;
}

.controls .count {
  color: var(--fg-dim);
  font-size: 0.9rem;
  margin-left: auto;
}

.grid {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.tile {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4 / 3;
  position: relative;
  transition: transform 0.1s ease, border-color 0.1s ease;
}

.tile:hover,
.tile:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent);
  outline: none;
}

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

.tile .ts {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.3rem 0.5rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  font-size: 0.8rem;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

.status {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem 2rem;
  color: var(--fg-dim);
  font-size: 0.9rem;
}

footer {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  padding: 1.25rem;
  text-align: center;
  color: var(--fg-dim);
  font-size: 0.85rem;
}

footer a {
  color: var(--fg-dim);
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  padding: 1rem;
}

.lightbox figure {
  margin: 0;
  max-width: 95vw;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox img {
  max-width: 100%;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox figcaption {
  color: var(--fg);
  padding-top: 0.5rem;
  font-size: 0.9rem;
}

.lb-close, .lb-prev, .lb-next {
  position: absolute;
  background: rgba(255,255,255,0.08);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-close:hover, .lb-prev:hover, .lb-next:hover {
  background: rgba(255,255,255,0.18);
}

.lb-close { top: 1rem; right: 1rem; }
.lb-prev  { left: 1rem; top: 50%; transform: translateY(-50%); }
.lb-next  { right: 1rem; top: 50%; transform: translateY(-50%); }

@media (max-width: 600px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  header h1 { font-size: 1.4rem; }
}
