:root {
  /* default = dark */
  --bg: #0b0b0b;
  --panel: rgba(0,0,0,.72);
  --text: #eaeaea;
  --muted: #a0a0a0;
  --border: #232323;
  --card: #111;
  --btn: #121212;
}

:root[data-theme="light"] {
  --bg: #f6f6f7;
  --panel: rgba(255,255,255,.78);
  --text: #111;
  --muted: #555;
  --border: #dedee3;
  --card: #ffffff;
  --btn: #ffffff;
}


* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 12px; }

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--panel);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}

.brand { display: flex; gap: 10px; align-items: center; }
.brand__om {
  filter: drop-shadow(0 0 6px rgba(124,92,255,.25));
  font-size: 18px; /* was ~20–22px earlier */
  line-height: 1;
}
.brand__dot {
  width: 12px; height: 12px; border-radius: 999px;
  background: #7c5cff;
  box-shadow: 0 0 0 4px rgba(124,92,255,.15);
}
.brand__title { font-weight: 700; letter-spacing: .2px; }
.brand__subtitle { font-size: 12px; color: var(--muted); margin-top: 2px; }

.actions { display: flex; gap: 10px; align-items: center; }

.btn {
  border: 1px solid var(--border);
  background: var(--btn);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
}
.btn:hover { filter: brightness(1.1); }
.btn--ghost { background: transparent; }

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 12px 0 18px;
}

@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .grid { grid-template-columns: 1fr; }
}

.tile {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--card);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.01);
}

.tile:hover img { filter: brightness(1.08); }

.tile__meta {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 10px;
  background: linear-gradient(to top, rgba(0,0,0,.70), rgba(0,0,0,0));
  color: #eaeaea;
  font-size: 12px;
  opacity: 0;
  transition: opacity .15s ease;
}
.tile:hover .tile__meta { opacity: 1; }
.tile__meta span { color: #cfcfcf; }

.status {
  text-align: center;
  color: var(--muted);
  padding: 18px 0 40px;
}

.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.88);
  z-index: 999;
  padding: 18px;
}

.lightbox__close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid #2a2a2a;
  background: rgba(18,18,18,.6);
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  z-index: 1001;
}

/* Wrapper so caption can overlay on image */
.lightbox__frame {
  position: relative;
  max-width: 96vw;
  max-height: 88vh;
}

/* The image itself */
.lightbox__img {
  display: block;
  max-width: 96vw;
  max-height: 88vh;
  object-fit: contain;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  background: #0f0f0f;
}

/* Caption overlay at bottom of image */
.lightbox__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 14px;
  border-radius: 0 0 12px 12px;
  background: linear-gradient(to top, rgba(0,0,0,.72), rgba(0,0,0,0));
  color: #eaeaea;
  font-size: 14px;
  line-height: 1.4;
  pointer-events: none; /* click passes through */
  white-space: pre-wrap;
}

/* Date section */
.section {
  padding: 10px 0 18px;
}

.section__title {
  margin: 14px 2px 10px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 650;
  letter-spacing: .2px;
}

/* Each section contains its own grid */
.section .grid {
  padding: 0;
}

/* Right-side year rail */
.year-rail {
  position: fixed;
  right: 10px;
  top: 120px;
  bottom: 70px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 6px;
  border-radius: 14px;
  background: rgba(0,0,0,.18);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  z-index: 60;
  overflow: auto;
}

:root[data-theme="light"] .year-rail {
  background: rgba(255,255,255,.45);
}

.year-rail button {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 6px 8px;
  font-size: 12px;
  border-radius: 10px;
  cursor: pointer;
  text-align: right;
  white-space: nowrap;
}

.year-rail button:hover {
  background: rgba(124,92,255,.14);
  color: var(--text);
}

.year-rail button.is-active {
  background: rgba(124,92,255,.22);
  color: var(--text);
}

/* Optional: video badge overlay */
.badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 7px;
  font-size: 12px;
  border-radius: 999px;
  background: rgba(0,0,0,.55);
  color: #fff;
  border: 1px solid rgba(255,255,255,.15);
  pointer-events: none;
}

/* --- Mobile: prevent rail from covering the grid --- */
@media (max-width: 720px) {
  .year-rail {
    right: 6px;
    top: 84px;
    bottom: 24px;

    /* collapsed by default */
    width: 18px;
    padding: 10px 4px;

    /* only show dots/compact */
    background: rgba(0,0,0,.10);
    border-color: rgba(0,0,0,.12);
  }

  :root[data-theme="light"] .year-rail {
    background: rgba(255,255,255,.35);
    border-color: rgba(0,0,0,.10);
  }

  /* hide year labels when collapsed */
  .year-rail button {
    padding: 6px 0;
    font-size: 0;            /* hides text */
    width: 100%;
  }

  /* show a dot instead */
  .year-rail button::after {
    content: "•";
    font-size: 14px;
    display: block;
    text-align: center;
    color: var(--muted);
  }

  .year-rail button.is-active::after {
    content: "●";
    color: var(--text);
  }

  /* Expand rail when user taps it (we’ll toggle .is-open in JS) */
  .year-rail.is-open {
    width: 64px;
    padding: 10px 6px;
    background: rgba(0,0,0,.22);
    border-color: var(--border);
  }

  :root[data-theme="light"] .year-rail.is-open {
    background: rgba(255,255,255,.55);
  }

  .year-rail.is-open button {
    font-size: 12px;     /* restore text */
    padding: 6px 8px;
  }

  .year-rail.is-open button::after {
    content: "";
  }
}

@media (max-width: 720px) {
  main.wrap { padding-right: 28px; }
}

/* Floating back-to-top button */
.fab {
  position: fixed;
  right: 14px;
  bottom: 14px;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--btn);
  color: var(--text);
  cursor: pointer;
  display: none;            /* hidden until scroll */
  z-index: 80;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

.fab:hover { filter: brightness(1.06); }

.fab.is-visible { display: inline-flex; align-items: center; justify-content: center; }
