/* ============================================
   ASTRO STORE - Mobile-First Space Theme
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
  --bg-primary: #0B1026;
  --bg-secondary: #111833;
  --bg-card: #161d3a;
  --bg-card-hover: #1c2545;
  --accent-blue: #0B3D91;
  --accent-orange: #FC3D21;
  --accent-cyan: #00d4ff;
  --text-primary: #ffffff;
  --text-secondary: #a0aec0;
  --text-muted: #6b7280;
  --border-color: #1e2a4a;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.6);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.3s ease;
}

/* ---------- Reset & Base (mobile-first) ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 70px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

a { color: var(--accent-cyan); text-decoration: none; transition: color var(--transition); }
a:hover { color: #5ce1ff; }
img { max-width: 100%; display: block; height: auto; }

main { padding-top: 60px; }

/* ---------- Skip Link ---------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--accent-cyan);
  color: var(--bg-primary);
  padding: 0.75rem 1.5rem;
  z-index: 10000;
  font-weight: 600;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus {
  top: 0;
}

/* ---------- Screen Reader Only ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Starfield ---------- */
.starfield {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  contain: strict;
}

.starfield .star {
  position: absolute;
  background: #fff;
  border-radius: 50%;
  will-change: opacity;
  animation: twinkle var(--duration) ease-in-out infinite alternate;
}

@keyframes twinkle {
  0% { opacity: 0.2; }
  100% { opacity: 1; }
}

/* CSS-only starfield fallback */
.starfield:empty::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-image:
    radial-gradient(1px 1px at 10% 15%, #fff 100%, transparent),
    radial-gradient(1px 1px at 25% 35%, #fff 100%, transparent),
    radial-gradient(1.5px 1.5px at 40% 55%, #fff 100%, transparent),
    radial-gradient(1px 1px at 55% 75%, #fff 100%, transparent),
    radial-gradient(1.5px 1.5px at 70% 20%, #fff 100%, transparent),
    radial-gradient(1px 1px at 85% 90%, #fff 100%, transparent),
    radial-gradient(1px 1px at 15% 80%, #fff 100%, transparent),
    radial-gradient(1.5px 1.5px at 30% 60%, #fff 100%, transparent),
    radial-gradient(1px 1px at 45% 10%, #fff 100%, transparent),
    radial-gradient(1px 1px at 60% 45%, #fff 100%, transparent),
    radial-gradient(1.5px 1.5px at 75% 65%, #fff 100%, transparent),
    radial-gradient(1px 1px at 90% 30%, #fff 100%, transparent),
    radial-gradient(1px 1px at 5% 50%, #fff 100%, transparent),
    radial-gradient(1.5px 1.5px at 20% 95%, #fff 100%, transparent),
    radial-gradient(1px 1px at 35% 25%, #fff 100%, transparent),
    radial-gradient(1px 1px at 50% 70%, #fff 100%, transparent),
    radial-gradient(1.5px 1.5px at 65% 5%, #fff 100%, transparent),
    radial-gradient(1px 1px at 80% 50%, #fff 100%, transparent),
    radial-gradient(1px 1px at 95% 85%, #fff 100%, transparent),
    radial-gradient(1.5px 1.5px at 8% 40%, #fff 100%, transparent);
  animation: twinkle 4s ease-in-out infinite alternate;
}

/* ---------- Navigation ---------- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(11, 16, 38, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  contain: layout style;
}

.navbar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  height: 56px;
}

.navbar-bottom {
  display: none;
  border-top: 1px solid rgba(30, 42, 74, 0.5);
  padding: 0 1rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.navbar-bottom::-webkit-scrollbar { display: none; }

.navbar-bottom-links {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  min-width: max-content;
  padding: 0.4rem 0;
}

.navbar-bottom-links a {
  display: block;
  padding: 0.35rem 0.75rem;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
  white-space: nowrap;
}
.navbar-bottom-links a:hover {
  color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.08);
}
.navbar-bottom-links a.active {
  color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.12);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}
.nav-logo svg { width: 32px; height: 32px; }

.nav-links {
  display: none;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  transition: color var(--transition);
}
.nav-links a:hover, .nav-links a.active { color: var(--accent-cyan); }

.nav-toggle {
  display: block;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  background: radial-gradient(ellipse at center bottom, #0d1b3e 0%, var(--bg-primary) 70%);
}

.hero-content { max-width: 800px; }

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 50px;
  font-size: 0.75rem;
  color: var(--accent-cyan);
  margin-bottom: 1rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #fff 0%, var(--accent-cyan) 50%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.hero-buttons { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  color: #fff;
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(0, 212, 255, 0.5);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--border-color);
}
.btn-outline:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  transform: translateY(-2px);
}

.btn-sm { padding: 8px 16px; font-size: 0.8rem; }

/* ---------- Stats ---------- */
.stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  max-width: 600px;
  margin: -40px auto 0;
  padding: 0 1rem;
}

.stat-card {
  text-align: center;
  padding: 1.25rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  contain: layout style;
}

.stat-card .number {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent-cyan);
  line-height: 1;
}
.stat-card .label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* ---------- Section Common ---------- */
.section {
  position: relative;
  z-index: 1;
  padding: 3rem 1rem;
  max-width: 1400px;
  margin: 0 auto;
}

.section-header { text-align: center; margin-bottom: 2rem; }

.section-header h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.section-header p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto;
}

.section-header .underline {
  width: 50px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue));
  border-radius: 2px;
  margin: 0.75rem auto 0;
}

/* ---------- Category Cards ---------- */
.categories-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.category-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16/9;
  cursor: pointer;
  transition: transform var(--transition);
  contain: layout paint;
}
.category-card:hover { transform: translateY(-4px); }

.category-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.category-card:hover img { transform: scale(1.05); }

.category-card .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 50%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1rem;
}

.category-card .overlay h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.15rem; }
.category-card .overlay span { font-size: 0.8rem; color: var(--text-secondary); }

/* ---------- Featured Grid ---------- */
.featured-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

/* ---------- Topics Grid ---------- */
.topics-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-top: 2rem;
}
.topic-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-decoration: none;
  transition: all var(--transition);
}
.topic-card:hover {
  border-color: rgba(0, 212, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.topic-card svg {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}
.topic-card h3 {
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
}
.topic-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

/* ---------- Media Card ---------- */
.media-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
  contain: layout paint;
}
.media-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 212, 255, 0.3);
  box-shadow: var(--shadow);
}

.media-card .thumb {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-secondary);
}

.media-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.media-card:hover .thumb img { transform: scale(1.05); }

.media-card .thumb .play-icon {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 48px; height: 48px;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(255,255,255,0.8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}
.media-card:hover .play-icon { opacity: 1; }

.media-card .thumb .type-badge {
  position: absolute;
  top: 8px; left: 8px;
  padding: 3px 10px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.media-card .thumb .type-badge.image { color: var(--accent-cyan); }
.media-card .thumb .type-badge.video { color: var(--accent-orange); }

.media-card .info { padding: 0.75rem; }
.media-card .info h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-card .info .meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.media-card .info .category-tag {
  font-size: 0.7rem;
  color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.1);
  padding: 2px 8px;
  border-radius: 50px;
}
.media-card .info .size { font-size: 0.7rem; color: var(--text-muted); }
.media-card .actions { display: flex; gap: 0.4rem; }
.media-card .actions .btn { flex: 1; justify-content: center; padding: 6px 12px; font-size: 0.75rem; }

/* ---------- Gallery Page ---------- */
.gallery-hero {
  position: relative;
  z-index: 1;
  padding: 5rem 1rem 2rem;
  text-align: center;
  background: radial-gradient(ellipse at center, #0d1b3e 0%, var(--bg-primary) 70%);
}
.gallery-hero h1 { font-size: 1.8rem; font-weight: 800; margin-bottom: 0.5rem; }
.gallery-hero p { color: var(--text-secondary); font-size: 0.95rem; max-width: 400px; margin: 0 auto 1.5rem; }

/* ---------- Search & Filters ---------- */
.controls {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem 1rem;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 500px;
  margin: 0 auto 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  padding: 4px 4px 4px 16px;
  transition: border-color var(--transition);
}
.search-bar:focus-within { border-color: var(--accent-cyan); }
.search-bar svg { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }
.search-bar input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.9rem;
  padding: 8px 0;
  min-width: 0;
}
.search-bar input::placeholder { color: var(--text-muted); }
.search-bar .btn { flex-shrink: 0; padding: 8px 16px; font-size: 0.8rem; }

.search-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.search-clear:hover {
  background: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 0.25rem;
}
.filter-row::-webkit-scrollbar { display: none; }

.filter-btn {
  padding: 6px 14px;
  border-radius: 50px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.filter-btn:hover { border-color: var(--accent-cyan); color: var(--accent-cyan); }
.filter-btn.active {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  color: var(--bg-primary);
}
.filter-btn .count {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  background: rgba(255,255,255,0.15);
  border-radius: 50px;
  font-size: 0.65rem;
}
.filter-btn.active .count { background: rgba(0,0,0,0.2); }

/* ---------- Gallery Grid ---------- */
.gallery-section {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}

.results-info {
  text-align: center;
  padding: 0.5rem 0 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.sort-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 6px 32px 6px 14px;
  border-radius: 50px;
  border: 1px solid var(--border-color);
  background: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a0aec0' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.sort-select:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.sort-select:focus {
  outline: none;
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.sort-select option {
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 8px 12px;
}

.load-more {
  display: flex;
  justify-content: center;
  padding: 1.5rem 0;
  position: relative;
  z-index: 1;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 2rem 0;
  position: relative;
  z-index: 1;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.page-btn:hover {
  background: rgba(0, 212, 255, 0.1);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.page-btn.active {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  color: white;
}

.page-dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.no-results {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}
.no-results svg { width: 48px; height: 48px; margin: 0 auto 1rem; opacity: 0.4; }
.no-results h3 { font-size: 1.1rem; margin-bottom: 0.5rem; color: var(--text-primary); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  contain: layout;
}
.lightbox.active { opacity: 1; visibility: visible; }

.lightbox-content {
  position: relative;
  max-width: 95vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content img,
.lightbox-content video {
  max-width: 100%;
  max-height: 75vh;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.lightbox-close {
  position: fixed;
  top: 12px; right: 12px;
  width: 40px; height: 40px;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2001;
}
.lightbox-close:hover { background: var(--accent-orange); }

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 40px;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2001;
}
.lightbox-nav:hover { background: rgba(0, 212, 255, 0.3); }
.lightbox-prev { left: 8px; }
.lightbox-next { right: 8px; }

.lightbox-info {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 2001;
  width: 90%;
  max-width: 600px;
}
.lightbox-info h3 { font-size: 0.95rem; margin-bottom: 0.2rem; }
.lightbox-info p { font-size: 0.8rem; color: var(--text-secondary); }

.lightbox-download {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 2001;
}

/* ---------- Footer ---------- */
.footer {
  position: relative;
  z-index: 1;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 2rem 1rem 1rem;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.footer-brand h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.footer-brand p { color: var(--text-secondary); font-size: 0.85rem; line-height: 1.6; }

.footer-col h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.4rem; }
.footer-col a { color: var(--text-secondary); font-size: 0.85rem; }
.footer-col a:hover { color: var(--accent-cyan); }

.footer-bottom {
  max-width: 1400px;
  margin: 0 auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ---------- Scroll to Top ---------- */
.scroll-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
  width: 44px; height: 44px;
  background: var(--accent-blue);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--transition);
  box-shadow: var(--shadow);
}
.scroll-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.scroll-top:hover { background: var(--accent-cyan); }

/* ---------- Skeleton Loading ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ---------- Performance: Content Visibility ---------- */
.section {
  content-visibility: auto;
  contain-intrinsic-size: 0 600px;
}

.gallery-section {
  content-visibility: auto;
  contain-intrinsic-size: 0 2000px;
}

.footer {
  content-visibility: auto;
  contain-intrinsic-size: 0 400px;
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .starfield { display: none; }
  html { scroll-behavior: auto; }
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---------- Tablet (600px+) ---------- */
@media (min-width: 600px) {
  .navbar { padding: 0 2rem; }
  .hero h1 { font-size: 2.8rem; }
  .hero p { font-size: 1.1rem; }
  .stats { grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-top: -50px; padding: 0 2rem; }
  .stat-card .number { font-size: 2rem; }
  .section { padding: 4rem 2rem; }
  .section-header h2 { font-size: 2rem; }
  .categories-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .featured-grid { grid-template-columns: repeat(2, 1fr); }
  .topics-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
  .footer-content { grid-template-columns: 1fr 1fr; }
  .footer-bottom { text-align: left; display: flex; justify-content: space-between; }
  .search-bar { max-width: 600px; }
}

/* ---------- Desktop (1024px+) ---------- */
@media (min-width: 1024px) {
  main { padding-top: 100px; }
  .navbar-top { padding: 0 2rem; }
  .navbar-bottom { display: block; padding: 0 2rem; }
  .nav-links { display: none; }
  .nav-toggle { display: none; }
  .hero h1 { font-size: 3.5rem; }
  .categories-grid { grid-template-columns: repeat(3, 1fr); }
  .featured-grid { grid-template-columns: repeat(3, 1fr); }
  .topics-grid { grid-template-columns: repeat(3, 1fr); }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; }
  .footer-content { grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; }
  .filter-row { gap: 0.6rem; }
  .filter-btn { padding: 8px 18px; font-size: 0.85rem; }
}

/* ---------- Large Desktop (1400px+) ---------- */
@media (min-width: 1400px) {
  .categories-grid { grid-template-columns: repeat(4, 1fr); }
  .footer-content { grid-template-columns: 2fr 1fr 1fr 1fr 1fr; }
}

/* ---------- Ultra Wide (1800px+) ---------- */
@media (min-width: 1800px) {
  .navbar-bottom { padding: 0 calc(50vw - 880px); }
}

/* ---------- Ad Placeholders ---------- */
.ad-container {
  position: relative;
  z-index: 1;
  background: var(--bg-secondary);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  margin: 1.5rem auto;
  max-width: 1400px;
  padding: 1rem;
}

.ad-label {
  position: absolute;
  top: 4px;
  left: 8px;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  background: var(--bg-primary);
  padding: 2px 6px;
  border-radius: 4px;
}

.ad-banner {
  min-height: 100px;
}

.ad-inline {
  min-height: 250px;
  max-width: 300px;
  margin: 2rem auto;
}

@media (min-width: 768px) {
  .ad-banner { min-height: 120px; }
}

@media (min-width: 1024px) {
  .ad-banner { min-height: 150px; }
}
