/* ════════════════════════════════════════════════
   NicheSMP — Main Stylesheet
   ════════════════════════════════════════════════ */

:root {
  --bg:          #0c0d0f;
  --bg-alt:      #101214;
  --bg-card:     #161a1e;
  --bg-hover:    #1c2026;
  --accent:      #e91e8c;
  --accent-dim:  rgba(233, 30, 140, 0.12);
  --accent-glow: rgba(233, 30, 140, 0.22);
  --accent-bdr:  rgba(233, 30, 140, 0.28);
  --text:        #f0f2f5;
  --text-2:      #8b9099;
  --text-3:      #4a525c;
  --border:      rgba(255,255,255,0.055);
  --border-h:    rgba(255,255,255,0.10);
  --radius:      14px;
  --radius-sm:   8px;

  /* Tag palette */
  --t-mgr:  #f59e0b; --t-mgr-bg:  rgba(245,158,11,0.12); --t-mgr-b:  rgba(245,158,11,0.28);
  --t-adm:  #ef4444; --t-adm-bg:  rgba(239,68,68,0.12);  --t-adm-b:  rgba(239,68,68,0.28);
  --t-cc:   #a78bfa; --t-cc-bg:   rgba(139,92,246,0.12); --t-cc-b:   rgba(139,92,246,0.28);
  --t-mem:  #60a5fa; --t-mem-bg:  rgba(59,130,246,0.12); --t-mem-b:  rgba(59,130,246,0.28);
}

/* ── Reset ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;

/* ── Pixel font on headings ─────────────────── */
h1, h2, h3,
.nav-logo,
.section-title,
.hero-title,
.member-name,
.feature-card h3 {
  font-family: 'Press Start 2P', monospace;
  font-weight: 400; /* Press Start 2P has only one weight */
  letter-spacing: 0;
  line-height: 1.6;
}
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,h2,h3,h4 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 700;
  line-height: 1.15;
}

a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.accent { color: var(--accent); }

/* ── Navbar ──────────────────────────────────── */
.navbar {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 200;
  height: 64px;
  background: rgba(12,13,15,0.80);
  backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
  transition: border-color .3s;
}
.navbar.scrolled { border-bottom-color: var(--border-h); }

.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: 'Press Start 2P', monospace;
  font-size: .8rem;
  font-weight: 400;
  letter-spacing: 0;
  cursor: pointer;
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-links li a {
  display: block;
  padding: 7px 14px;
  font-size: .88rem;
  font-weight: 500;
  color: var(--text-2);
  border-radius: var(--radius-sm);
  transition: color .2s, background .2s;
}
.nav-links li a:hover { color: var(--text); background: var(--border); }

.btn-discord {
  background: var(--accent) !important;
  color: #fff !important;
  font-weight: 600 !important;
  border-radius: var(--radius-sm) !important;
  transition: opacity .2s, transform .2s !important;
}
.btn-discord:hover {
  opacity: .88 !important;
  transform: translateY(-1px) !important;
  background: var(--accent) !important;
}

.nav-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all .3s;
}

/* ── Hero ────────────────────────────────────── */
.hero { padding-top: 64px; }

/* Uploaded banner mode */
.hero-banner {
  position: relative;
  width: 100%;
  max-height: 520px;
  overflow: hidden;
}
.hero-banner img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  object-position: center;
  display: block;
}
.hero-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(12,13,15,.7) 0%, transparent 60%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 48px;
}

/* Default hero */
.hero-default {
  min-height: 480px;
  background: linear-gradient(135deg, #0f1115 0%, #141820 60%, #0f1115 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--accent-dim) 1px, transparent 1px),
    linear-gradient(90deg, var(--accent-dim) 1px, transparent 1px);
  background-size: 36px 36px;
  opacity: .35;
}

/* Decorative floating blocks */
.hero-decorations { position: absolute; inset: 0; pointer-events: none; }
.hero-block {
  position: absolute;
  border-radius: 6px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-bdr);
  animation: floatBlock 6s ease-in-out infinite;
}
.b1 { width: 28px; height: 28px; top: 18%; left: 12%;  animation-delay: 0s;   animation-duration: 7s; }
.b2 { width: 18px; height: 18px; top: 60%; right: 10%; animation-delay: 1.5s; animation-duration: 5s; }
.b3 { width: 22px; height: 22px; top: 35%; right: 20%; animation-delay: .8s;  animation-duration: 8s; }

@keyframes floatBlock {
  0%,100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-14px) rotate(8deg); }
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 24px;
}

.hero-badge {
  display: inline-block;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent-bdr);
  border-radius: 100px;
  padding: 5px 14px;
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(1.4rem, 3.5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -2px;
  margin-bottom: 14px;
  text-shadow: 0 0 80px var(--accent-glow);
}

.hero-sub {
  color: var(--text-2);
  font-size: 1.05rem;
  margin-bottom: 36px;
  max-width: 420px;
  margin-inline: auto;
  line-height: 1.7;
}

.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  padding: 14px 34px;
  border-radius: 10px;
  box-shadow: 0 0 36px var(--accent-glow);
  transition: transform .2s, box-shadow .2s, opacity .2s;
  margin-bottom: 36px;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 52px rgba(233,30,140,.4);
  opacity: .9;
}

/* ── Sections ────────────────────────────────── */
.section { padding: 88px 0; }
.section-alt { background: var(--bg-alt); }

.section-head {
  text-align: center;
  margin-bottom: 52px;
}
.section-label {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.section-head h2 {
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  letter-spacing: 0;
}

/* ── Features ────────────────────────────────── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: border-color .25s, transform .25s, box-shadow .25s;
}
.feature-card:hover {
  border-color: var(--accent-bdr);
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(0,0,0,.35);
}

.feature-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-bdr);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  margin-bottom: 18px;
}
.feature-card h3 {
  font-size: .6rem;
  font-weight: 400;
  margin-bottom: 10px;
  color: var(--text);
  line-height: 1.8;
}
.feature-card p {
  font-size: .84rem;
  color: var(--text-2);
  line-height: 1.65;
}

/* skeleton */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.skeleton-card {
  height: 140px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ── Members ─────────────────────────────────── */
.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 40px;
}
.filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-2);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: .82rem;
  font-weight: 500;
  padding: 7px 18px;
  transition: all .2s;
}
.filter-btn:hover { border-color: var(--border-h); color: var(--text); }
.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.member-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 14px 18px;
  text-align: center;
  transition: border-color .25s, transform .25s;
}
.member-card:hover {
  border-color: var(--accent-bdr);
  transform: translateY(-4px);
}

.member-avatar {
  width: 90px;
  height: 90px;
  margin: 0 auto 14px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
}
.member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.member-name {
  font-size: .55rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 8px;
  word-break: break-word;
  line-height: 1.8;
}

.member-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
}

/* ── Tags ────────────────────────────────────── */
.tag {
  display: inline-block;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 100px;
  border: 1px solid;
}
.tag-manager        { background: var(--t-mgr-bg); color: var(--t-mgr); border-color: var(--t-mgr-b); }
.tag-admin          { background: var(--t-adm-bg); color: var(--t-adm); border-color: var(--t-adm-b); }
.tag-content_creator{ background: var(--t-cc-bg);  color: var(--t-cc);  border-color: var(--t-cc-b);  }
.tag-member         { background: var(--t-mem-bg); color: var(--t-mem); border-color: var(--t-mem-b); }

/* ── Uploads ─────────────────────────────────── */
.uploads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.upload-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .25s, transform .25s;
}
.upload-card:hover {
  border-color: var(--accent-bdr);
  transform: translateY(-3px);
}

.upload-thumb {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg);
}
.upload-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s;
}
.upload-card:hover .upload-thumb img { transform: scale(1.04); }

.upload-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.28);
  opacity: 0;
  transition: opacity .2s;
}
.upload-card:hover .upload-play-overlay { opacity: 1; }

.play-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 32px rgba(233,30,140,.5);
  display: flex;
  align-items: center;
  justify-content: center;
}
.play-btn svg { width: 20px; height: 20px; fill: #fff; margin-left: 3px; }

.upload-info { padding: 16px; }
.upload-title {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.upload-creator {
  display: flex;
  align-items: center;
  gap: 8px;
}
.creator-avatar {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg);
  flex-shrink: 0;
}
.creator-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}
.creator-name { font-size: .78rem; color: var(--text-2); }

/* ── Loading / Empty ─────────────────────────── */
.loading-spinner {
  grid-column: 1/-1;
  display: flex;
  justify-content: center;
  padding: 56px 0;
}
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  grid-column: 1/-1;
  text-align: center;
  padding: 64px 0;
  color: var(--text-3);
}
.empty-icon { font-size: 2.2rem; margin-bottom: 12px; }
.empty-state p { font-size: .9rem; }

/* ── Footer ──────────────────────────────────── */
.footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 52px 0 28px;
}
.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  margin-bottom: 36px;
}
.footer-brand p {
  color: var(--text-3);
  font-size: .82rem;
  margin-top: 8px;
  max-width: 260px;
  line-height: 1.6;
}
.footer-nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  padding-top: 4px;
}
.footer-nav a {
  color: var(--text-2);
  font-size: .85rem;
  transition: color .2s;
}
.footer-nav a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  text-align: center;
}
.footer-bottom p {
  font-size: .78rem;
  color: var(--text-3);
}

/* ── Responsive ──────────────────────────────── */
.nav-burger { display: none; }

@media (max-width: 768px) {
  .nav-burger { display: flex; }

  .nav-links {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links li a { padding: 12px 16px; width: 100%; }

  .skeleton-grid { grid-template-columns: 1fr; }
  .members-grid  { grid-template-columns: repeat(2, 1fr); }
  .footer-row    { flex-direction: column; }
  .section       { padding: 64px 0; }
}

@media (max-width: 480px) {
  .uploads-grid { grid-template-columns: 1fr; }
  .features-grid{ grid-template-columns: 1fr; }
}
