:root {
  color-scheme: dark;
  --bg: #0f1318;
  --bg-2: #1a2229;
  --panel: #171f26;
  --panel-2: #202a33;
  --border: #36424d;
  --text: #eef2f4;
  --muted: #aab5bd;
  --accent: #86f587;
  --accent-soft: rgba(134, 245, 135, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(1200px 640px at 8% -10%, rgba(134, 245, 135, 0.14), transparent 45%),
    radial-gradient(940px 620px at 105% 8%, rgba(83, 146, 235, 0.18), transparent 46%),
    linear-gradient(160deg, var(--bg) 8%, var(--bg-2) 58%, #10161d 100%);
  color: var(--text);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  opacity: 0.25;
  background-image:
    repeating-linear-gradient(
      -35deg,
      rgba(255, 255, 255, 0.04) 0,
      rgba(255, 255, 255, 0.04) 1px,
      transparent 1px,
      transparent 11px
    );
}

body::after {
  opacity: 0.22;
  background:
    radial-gradient(560px 360px at 84% 82%, rgba(0, 0, 0, 0.34), transparent 68%),
    radial-gradient(460px 280px at 18% 78%, rgba(0, 0, 0, 0.24), transparent 70%);
}

button,
input {
  font: inherit;
}

.page-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.hero {
  margin-bottom: 22px;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(25, 33, 40, 0.96), rgba(16, 21, 26, 0.96));
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(2px);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  font-weight: 700;
}

.hero h1 {
  margin: 0;
  font-size: clamp(32px, 7vw, 64px);
  line-height: 0.95;
}

.hero-copy {
  width: min(700px, 100%);
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.toolbar {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.search-field {
  display: grid;
  gap: 8px;
}

.search-field span {
  color: var(--muted);
  font-size: 14px;
}

.search-field input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  background: rgba(24, 28, 32, 0.9);
  color: var(--text);
  outline: none;
}

.search-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.count-label,
.status-message {
  margin: 0;
  color: var(--muted);
}

.folder-list {
  display: grid;
  gap: 16px;
}

.folder-block {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(24, 28, 32, 0.92);
  overflow: hidden;
}

.folder-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.folder-button:hover {
  background: rgba(255, 255, 255, 0.045);
}

.folder-sign {
  width: 22px;
  font-weight: 700;
  text-align: center;
  color: var(--accent);
}

.folder-name {
  font-size: 18px;
  font-weight: 700;
}

.folder-total {
  margin-left: auto;
  color: var(--muted);
  font-size: 14px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  padding: 0 16px 16px;
}

.media-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
  overflow: hidden;
}

.media-thumb {
  width: 100%;
  display: block;
  position: relative;
  padding: 0;
  border: 0;
  background: #0b0d0f;
  cursor: pointer;
}

.media-thumb:hover img {
  transform: scale(1.02);
}

.media-thumb img,
.video-placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 180ms ease;
}

.video-placeholder {
  display: grid;
  place-items: center;
  color: var(--accent);
  background: linear-gradient(180deg, #182025, #0f1215);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.media-type {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.media-copy {
  padding: 12px;
}

.media-copy h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
}

.media-meta {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 5, 7, 0.9);
}

.lightbox[hidden] {
  display: none;
}

.lightbox-frame {
  width: min(1100px, 100%);
  max-height: 80vh;
}

.lightbox-frame img,
.lightbox-frame video {
  width: 100%;
  max-height: 80vh;
  object-fit: contain;
  background: #000;
}

.lightbox-close,
.lightbox-nav {
  position: fixed;
  border: 1px solid var(--border);
  background: rgba(17, 19, 21, 0.95);
  color: var(--text);
  cursor: pointer;
}

.lightbox-close {
  top: 16px;
  right: 16px;
  padding: 10px 14px;
}

.lightbox-nav {
  top: 50%;
  width: 48px;
  height: 48px;
  transform: translateY(-50%);
  font-size: 24px;
}

.lightbox-prev {
  left: 16px;
}

.lightbox-next {
  right: 16px;
}

.lightbox-info {
  margin-top: 14px;
  text-align: center;
}

.lightbox-info p {
  margin: 0;
}

#lightboxTitle {
  font-size: 18px;
}

#lightboxPosition {
  margin-top: 6px;
  color: var(--muted);
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 18px, 100%);
    padding-top: 18px;
  }

  .hero {
    padding: 20px;
  }

  .media-grid {
    grid-template-columns: 1fr;
  }

  .folder-button {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .folder-total {
    width: 100%;
    margin-left: 34px;
  }

  .lightbox-nav {
    width: 42px;
    height: 42px;
  }
}