* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: #0a0a0a;
  color: #b0b0b0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: #5fa8d3; text-decoration: none; transition: color 0.2s; }
a:hover { color: #28c840; }

.terminal-bar {
  background: #111;
  padding: 6px 16px;
  border-bottom: 1px solid #222;
  position: sticky;
  top: 0;
  z-index: 10;
}

.terminal-title { color: #666; font-size: 13px; }
.terminal-title:hover { color: #28c840; }

.terminal-body { padding: 24px; flex: 1; max-width: 1400px; width: 100%; margin: 0 auto; }

h1 { color: #28c840; font-size: 18px; font-weight: 600; margin: 16px 0 8px; }
h1::before { content: '$ '; color: #444; }
h2 { color: #888; font-size: 14px; font-weight: 600; margin: 12px 0 8px; }

.crumbs { color: #555; font-size: 13px; margin-top: 4px; }
.cat-desc { color: #888; font-size: 13px; margin-bottom: 12px; max-width: 70ch; }
.count { color: #555; }

.layout { display: flex; gap: 32px; align-items: flex-start; }
.tree { flex: 0 0 280px; font-size: 13px; border-right: 1px solid #1c1c1c; padding-right: 16px; }
.tree ul { list-style: none; padding-left: 14px; }
.tree > ul { padding-left: 0; }
.tree li { margin: 3px 0; }
.tree summary { cursor: pointer; list-style: none; }
.tree summary::-webkit-details-marker { display: none; }
.tree summary::before { content: '+ '; color: #28c840; }
.tree details[open] > summary::before { content: '- '; }
section { flex: 1; min-width: 0; }

.subgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin: 14px 0;
}

.subcard { display: block; border: 1px solid #222; border-radius: 6px; overflow: hidden; background: #0f0f0f; transition: border-color 0.2s; }
.subcard:hover { border-color: #28c840; }
.subcard img { width: 100%; height: 150px; object-fit: cover; display: block; filter: brightness(0.8) saturate(0.85); transition: filter 0.3s; }
.subcard:hover img { filter: brightness(1) saturate(1); }
.subcard-empty { width: 100%; height: 150px; background: #111; }
.subcard-label { padding: 8px 12px; font-size: 13px; color: #5fa8d3; }
.subcard:hover .subcard-label { color: #28c840; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.thumb { display: block; border: 1px solid #222; border-radius: 4px; overflow: hidden; background: #0f0f0f; transition: border-color 0.2s; }
.thumb:hover { border-color: #28c840; }
.thumb img { width: 100%; height: 200px; object-fit: cover; display: block; filter: brightness(0.85) saturate(0.9); transition: filter 0.3s; }
.thumb:hover img { filter: brightness(1) saturate(1); }

.picture { text-align: center; }
.pic-nav { display: flex; justify-content: space-between; align-items: center; margin: 12px 0; font-size: 13px; }
.nav.dim { color: #333; }
.picture img { max-width: 100%; max-height: 78vh; display: block; margin: 0 auto; border: 1px solid #222; border-radius: 4px; }
.pic-meta { margin-top: 10px; font-size: 13px; }
.pic-title { color: #b0b0b0; font-weight: 600; }
.pic-date { color: #555; }

.exif { margin: 14px auto 0; border-collapse: collapse; font-size: 12px; color: #888; }
.exif th { text-align: right; color: #555; font-weight: 400; padding: 2px 12px 2px 0; white-space: nowrap; }
.exif td { text-align: left; color: #9a9a9a; padding: 2px 0; }

@media (max-width: 800px) {
  .layout { flex-direction: column; }
  .tree { flex: none; border-right: none; padding-right: 0; }
  .terminal-body { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  a, .thumb, .thumb img { transition: none; }
}
