:root {
  --bg: #0b1020;
  --panel: #121933;
  --panelAlt: #17203d;
  --text: #eef2ff;
  --muted: #b4bdd6;
  --line: #2a3658;
  --accent: #7dd3fc;
  --accent2: #c084fc;
  --shadow: 0 16px 36px rgba(0,0,0,.24);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: linear-gradient(180deg, #121933 0, #0b1020 260px);
  color: var(--text);
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Header --- */
header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11,16,32,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.bar { max-width: 1100px; margin: 0 auto; padding: 1rem; }
.brand { font-weight: 800; letter-spacing: .02em; }

/* --- Shell --- */
.shell { max-width: 1100px; margin: 0 auto; padding: 1rem; }

.hero, .panel, .card {
  background: rgba(18,25,51,.92);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.hero {
  padding: 1.35rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, rgba(125,211,252,.12), rgba(192,132,252,.08));
}
.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .74rem;
  font-weight: 700;
}

/* --- Mobile nav --- */
.mobile-nav { margin: 0 0 1rem; }
.menu-toggle { display: none; }
.menu-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  padding: 1rem 1.1rem;
  cursor: pointer;
}
.burger { display: inline-flex; flex-direction: column; gap: 4px; }
.burger span { display: block; width: 20px; height: 2px; background: #eef2ff; border-radius: 2px; }
.menu-list { padding: 0 1rem 1rem; display: none; }
.menu-toggle:checked + .menu-label + .menu-list { display: block; }
.menu-list a {
  display: block;
  padding: .75rem .85rem;
  border-radius: 12px;
  background: rgba(255,255,255,.03);
  margin: .4rem 0;
  color: #e8eeff;
}
.menu-list a.active, .menu-list a:hover { background: rgba(255,255,255,.08); text-decoration: none; }

/* --- Page layout (mobile-first: single column) --- */
.layout { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.sidebar-desktop { display: none; }
.content {
  padding: 1.25rem;
}

/* --- Cards / Grid --- */
.cards, .grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.card { padding: 1rem; }
.muted { color: var(--muted); }

/* --- Typography --- */
h1, h2, h3 { overflow-wrap: break-word; }
h1 { font-size: clamp(1.9rem, 8vw, 3rem); line-height: 1.12; margin: .25rem 0 1rem; }
h2 { margin-top: 1.8rem; font-size: 1.3rem; }
h3 { margin-top: 1.2rem; }
ul, ol { padding-left: 1.2rem; }

/* --- Tables --- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; }
th, td {
  padding: .6rem .5rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  text-align: left;
  vertical-align: top;
}
th { color: var(--accent); }

/* --- Code --- */
code { background: rgba(255,255,255,.08); padding: .12rem .35rem; border-radius: 6px; }

/* --- Gallery / Media cards (mobile: single column) --- */
.gallery { display: grid; grid-template-columns: 1fr; gap: .85rem; }
.media-card { overflow: hidden; }
.media-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: #0b1020;
}
.media-card .meta {
  padding: .75rem .85rem;
  overflow-wrap: break-word;
  word-break: break-word;
}
.gallery figure {
  overflow: hidden;
  margin: 0;
}
.gallery figure img {
  display: block;
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: #0b1020;
}
.gallery figure figcaption {
  padding: .6rem .75rem;
  font-size: .8rem;
  color: var(--muted);
  overflow-wrap: break-word;
}

/* --- Pills --- */
.pill {
  display: inline-block;
  background: rgba(125,211,252,.12);
  color: var(--accent);
  padding: .28rem .58rem;
  border-radius: 999px;
  margin: .25rem .3rem 0 0;
  font-size: .8rem;
  font-weight: 700;
}

/* --- Medium screens: tablets (≥ 700px) --- */
@media (min-width: 700px) {
  .cards, .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* --- Filter Panel --- */
#filter-panel {
  margin-bottom: 1.5rem;
}

.filter-toggle {
  display: block;
  width: 100%;
  padding: 1rem;
  background: var(--panelAlt);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 1rem;
  transition: background 0.2s;
}

.filter-toggle:hover {
  background: rgba(125,211,252,.12);
}

.filter-container {
  display: none;
  background: rgba(18,25,51,.92);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 1.25rem;
}

.filter-toggle.active + .filter-container,
.filter-container.show {
  display: block;
}

.filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.filter-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.clear-btn {
  padding: 0.5rem 1rem;
  background: rgba(192,132,252,.12);
  border: 1px solid rgba(192,132,252,.24);
  border-radius: 8px;
  color: var(--accent2);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}

.clear-btn:hover {
  background: rgba(192,132,252,.24);
}

.filter-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.filter-group h3 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.filter-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 0.95rem;
}

.filter-group label:hover {
  background: rgba(255,255,255,.04);
}

.filter-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent);
}

.filter-group select {
  padding: 0.6rem 0.75rem;
  background: var(--panelAlt);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
}

.filter-group select:hover,
.filter-group select:focus {
  border-color: var(--accent);
  outline: none;
}

.result-count {
  padding: 0.75rem 0;
  font-size: 0.9rem;
  color: var(--muted);
  border-top: 1px solid rgba(255,255,255,.08);
  text-align: center;
}

.media-card.hidden {
  display: none;
}

/* --- File cards (non-image media) --- */
.file-link {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 150px;
  background: linear-gradient(135deg, rgba(125,211,252,.06), rgba(192,132,252,.04));
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.file-icon {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
  font-family: monospace;
  letter-spacing: 0.1em;
}

/* --- Nav group labels --- */
.nav-group-label {
  padding: .5rem .85rem .25rem;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent2);
  margin-top: .5rem;
}
.nav-group-label:first-child { margin-top: 0; }

/* --- Large screens: desktop (≥ 980px) --- */
@media (min-width: 700px) {
  .filter-container {
    display: block;
  }

  .filter-toggle {
    display: none;
  }

  .filter-controls {
    grid-template-columns: 1fr 2fr 1fr;
  }
}

@media (min-width: 980px) {
  .shell { padding: 1.25rem; }
  .layout { grid-template-columns: 280px 1fr; }
  .mobile-nav { display: none; }
  .sidebar-desktop {
    display: block;
    position: sticky;
    top: 5rem;
    height: max-content;
  }
  .sidebar-desktop .menu-list { display: block; padding: 0; }
  .panel { padding: 1rem; }
  .gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }

  .filter-controls {
    grid-template-columns: repeat(3, 1fr);
  }
}
