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

:root {
  --bg: #0c0c0f;
  --fg: #e8e4de;
  --muted: #5e5a64;
  --accent: #e8572a;
  --border: rgba(255,255,255,0.06);
  --card-bg: rgba(255,255,255,0.03);
  --bar-bg: rgba(20, 20, 26, 0.82);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--fg);
  overflow-x: hidden;
}

/* ── Ambient blobs ── */
body::before, body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.22;
  pointer-events: none;
  z-index: 0;
}
body::before { width: 500px; height: 500px; background: var(--accent); top: -140px; right: -80px; }
body::after  { width: 420px; height: 420px; background: #1a6b5a; bottom: 8%; left: -100px; }

/* ── Navbar ── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 22px 40px 0;
  transition: padding-top 0.5s cubic-bezier(0.22,1,0.36,1);
}
.navbar.scrolled { padding-top: 14px; }

.navbar-bar {
  display: flex; align-items: center; justify-content: space-between;
  width: auto; min-width: 280px;
  padding: 14px 18px; border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  backdrop-filter: none; -webkit-backdrop-filter: none;
  box-shadow: none; transform-origin: center top;
  transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
}
.navbar.scrolled .navbar-bar {
  background: var(--bar-bg); border-color: var(--border);
  backdrop-filter: blur(28px) saturate(1.4); -webkit-backdrop-filter: blur(28px) saturate(1.4);
  box-shadow: 0 10px 40px rgba(0,0,0,0.5), 0 1px 0 rgba(255,255,255,0.04) inset;
  animation: barIn 0.5s cubic-bezier(0.22,1,0.36,1) forwards;
}
.navbar.unscrolling .navbar-bar {
  animation: barOut 0.32s cubic-bezier(0.55,0,1,0.45) forwards;
}
@keyframes barIn {
  0%   { opacity: 0; transform: scale(0.88); filter: blur(8px); }
  100% { opacity: 1; transform: scale(1);    filter: blur(0); }
}
@keyframes barOut {
  0%   { opacity: 1; transform: scale(1);    filter: blur(0); }
  100% { opacity: 0; transform: scale(0.88); filter: blur(8px); }
}

.nav-logo {
  font-weight: 700; font-size: 1.1rem; letter-spacing: -0.03em;
  color: var(--fg); text-decoration: none; display: flex; align-items: center;
  gap: 8px; flex-shrink: 0;
}
.nav-logo .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { transform: scale(1); opacity: 1; }
  50%     { transform: scale(1.4); opacity: 0.5; }
}

/* ── Dropdown ── */
.dropdown { position: relative; }
.dropdown-trigger {
  display: flex; align-items: center; gap: 7px;
  color: var(--muted); font-size: 0.86rem; font-weight: 500;
  padding: 10px 18px; border-radius: 999px;
  background: none; border: none; cursor: pointer;
  font-family: inherit;
  transition: color 0.25s, background 0.25s;
}
.dropdown-trigger:hover { color: var(--fg); background: rgba(255,255,255,0.07); }
.dropdown-trigger i.fa-chevron-down {
  font-size: 0.65rem; transition: transform 0.3s cubic-bezier(0.22,1,0.36,1);
}
.dropdown.open .dropdown-trigger i.fa-chevron-down { transform: rotate(180deg); }

.dropdown-menu {
  position: absolute; top: calc(100% + 10px); left: 50%;
  transform: translateX(-50%) translateY(-8px) scale(0.96);
  min-width: 190px; padding: 6px;
  background: var(--bar-bg); border: 1px solid var(--border);
  border-radius: 14px; backdrop-filter: blur(28px) saturate(1.4);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  box-shadow: 0 16px 48px rgba(0,0,0,0.55);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.22,1,0.36,1),
              transform 0.25s cubic-bezier(0.22,1,0.36,1),
              visibility 0.25s;
}
.dropdown.open .dropdown-menu {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
}

.dropdown-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 14px; border-radius: 10px;
  color: var(--muted); text-decoration: none; font-size: 0.86rem; font-weight: 500;
  transition: color 0.2s, background 0.2s;
  opacity: 0; transform: translateY(-6px);
}
.dropdown.open .dropdown-item {
  animation: dropIn 0.28s cubic-bezier(0.22,1,0.36,1) forwards;
}
.dropdown.open .dropdown-item:nth-child(1) { animation-delay: 0.03s; }
.dropdown.open .dropdown-item:nth-child(2) { animation-delay: 0.06s; }
.dropdown.open .dropdown-item:nth-child(3) { animation-delay: 0.09s; }
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.dropdown-item:hover { color: var(--fg); background: rgba(255,255,255,0.07); }
.dropdown-item.active { color: var(--fg); background: rgba(255,255,255,0.1); }
.dropdown-item i { width: 18px; text-align: center; font-size: 0.82rem; }

/* ── Hero (index only) ── */
#hero {
  position: relative; z-index: 1;
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 120px 32px 80px;
}
#hero h1 {
  font-size: clamp(2.6rem, 7vw, 5rem); font-weight: 700;
  letter-spacing: -0.04em; line-height: 1.05;
}
#hero h1 .accent { color: var(--accent); }
#hero .hero-desc {
  max-width: 480px; font-size: 1.02rem; line-height: 1.7;
  color: var(--muted); margin-top: 16px;
}

/* ── Search ── */
.search-wrap {
  position: relative; width: 100%; max-width: 460px; margin-top: 28px;
}
.search-wrap.compact { max-width: 340px; margin-top: 0; margin-bottom: 8px; }
.search-wrap i.fa-magnifying-glass {
  position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 0.88rem; pointer-events: none;
}
.search-input {
  width: 100%; padding: 14px 18px 14px 46px;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 999px; color: var(--fg);
  font-family: inherit; font-size: 0.92rem;
  outline: none; transition: border-color 0.25s, box-shadow 0.25s;
}
.search-wrap.compact .search-input { padding: 11px 16px 11px 42px; font-size: 0.86rem; }
.search-input::placeholder { color: var(--muted); }
.search-input:focus {
  border-color: rgba(255,255,255,0.15);
  box-shadow: 0 0 0 3px rgba(232,87,42,0.08);
}

/* ── Marquee (index only) ── */
.marquee-wrap {
  position: relative; margin-top: 48px; width: 100%; max-width: 900px;
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
  transition: opacity 0.4s, max-height 0.4s;
}
.marquee-wrap.hidden { opacity: 0; max-height: 0; margin-top: 0; overflow: hidden; pointer-events: none; }
.marquee-track {
  display: flex; gap: 14px; width: max-content;
  animation: marquee 40s linear infinite;
}
.marquee-wrap:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

.marquee-item {
  flex-shrink: 0; display: flex; align-items: center; gap: 10px;
  padding: 8px 14px 8px 8px; border-radius: 12px;
  background: var(--card-bg); border: 1px solid var(--border);
  opacity: 0.5; transition: opacity 0.3s; cursor: default;
}
.marquee-item:hover { opacity: 1; }
.marquee-item img {
  width: 44px; height: 44px; border-radius: 8px; object-fit: cover;
  background: #16161a;
}
.marquee-item .mi-name { font-size: 0.8rem; font-weight: 600; color: var(--fg); white-space: nowrap; }
.marquee-item .mi-cat  { font-size: 0.65rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* ── Page header (category pages) ── */
.page-header {
  position: relative; z-index: 1;
  max-width: 1100px; margin: 0 auto;
  padding: 120px 32px 12px;
}
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); text-decoration: none;
  font-size: 0.82rem; font-weight: 500;
  margin-bottom: 20px;
  transition: color 0.2s;
}
.back-link:hover { color: var(--fg); }
.page-title {
  font-size: 2rem; font-weight: 700; letter-spacing: -0.03em;
  margin-bottom: 24px;
}

/* ── Sections ── */
.content-section {
  position: relative; z-index: 1;
  max-width: 1100px; margin: 0 auto;
  padding: 40px 32px 100px;
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.22,1,0.36,1), transform 0.7s cubic-bezier(0.22,1,0.36,1);
}
.content-section.visible { opacity: 1; transform: translateY(0); }
.content-section.no-reveal { opacity: 1; transform: none; transition: none; }

.section-heading {
  font-size: 1.4rem; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 32px;
}
.section-heading::after {
  content: ''; display: block; width: 28px; height: 2px;
  background: var(--accent); margin-top: 10px; border-radius: 1px;
}

/* ── Category grid (index) ── */
.category-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px;
}
.category-card {
  display: flex; align-items: center; gap: 16px;
  padding: 22px; border-radius: 14px;
  background: var(--card-bg); border: 1px solid var(--border);
  text-decoration: none; color: var(--fg);
  transition: transform 0.3s cubic-bezier(0.22,1,0.36,1), border-color 0.3s, box-shadow 0.3s;
}
.category-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255,255,255,0.12);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.category-card:active { transform: translateY(-1px); }
.cc-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: rgba(232,87,42,0.1); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; flex-shrink: 0;
}
.cc-info { min-width: 0; }
.cc-info h3 { font-size: 1rem; font-weight: 600; }
.cc-info p { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.cc-arrow {
  margin-left: auto; color: var(--muted); font-size: 0.78rem; flex-shrink: 0;
  transition: transform 0.25s, color 0.25s;
}
.category-card:hover .cc-arrow { transform: translateX(3px); color: var(--accent); }

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

.card {
  position: relative; border-radius: 14px; overflow: hidden; cursor: pointer;
  background: var(--card-bg); border: 1px solid var(--border);
  transition: transform 0.3s cubic-bezier(0.22,1,0.36,1), border-color 0.3s, box-shadow 0.3s, opacity 0.3s;
}
.card:hover {
  transform: translateY(-5px);
  border-color: rgba(255,255,255,0.12);
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}
.card:active { transform: translateY(-2px); }
.card.hidden-search { display: none; }

.card-badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  padding: 4px 10px; border-radius: 6px;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(6px);
  font-size: 0.68rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--fg);
  pointer-events: none;
}

.card-banner {
  width: 100%; aspect-ratio: 16/9; object-fit: cover;
  background: #16161a; display: block;
}
.card-body { padding: 18px 20px 20px; }
.card-body h3 {
  font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 6px;
}
.card-body p {
  font-size: 0.82rem; line-height: 1.55; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ── No results ── */
.no-results {
  text-align: center; padding: 60px 20px; color: var(--muted);
  display: none;
}
.no-results.show { display: block; }
.no-results i { font-size: 2rem; margin-bottom: 12px; display: block; opacity: 0.35; }
.no-results p { font-size: 0.92rem; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; opacity: 0; visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}

.modal-content {
  position: relative; background: #16161a; border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px; max-width: 620px; width: 100%;
  max-height: 85vh; overflow-y: auto;
  transform: scale(0.93) translateY(14px);
  transition: transform 0.4s cubic-bezier(0.22,1,0.36,1);
}
.modal-overlay.active .modal-content { transform: scale(1) translateY(0); }
.modal-content::-webkit-scrollbar { width: 4px; }
.modal-content::-webkit-scrollbar-track { background: transparent; }
.modal-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.modal-close {
  position: absolute; top: 14px; right: 14px; z-index: 5;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(0,0,0,0.45); backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.08);
  color: #fff; font-size: 0.85rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.modal-close:hover { background: rgba(0,0,0,0.65); }

.modal-gallery {
  position: relative; width: 100%; aspect-ratio: 16/10;
  background: #111114; border-radius: 20px 20px 0 0; overflow: hidden;
}
.modal-gallery img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; transition: opacity 0.35s;
  pointer-events: none;
}
.modal-gallery img.active { opacity: 1; }

.gallery-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff; cursor: pointer; font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.3s ease 0.08s, background 0.2s;
}
.modal-gallery:hover .gallery-arrow { opacity: 1; }
.gallery-arrow:hover { background: rgba(0,0,0,0.7); }
.gallery-arrow.prev { left: 12px; }
.gallery-arrow.next { right: 12px; }

.gallery-dots {
  display: flex; justify-content: center; gap: 6px; padding: 12px 0 0;
}
.gallery-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,0.18); border: none; cursor: pointer;
  padding: 0; transition: background 0.25s, transform 0.25s;
}
.gallery-dot.active { background: var(--accent); transform: scale(1.4); }

.modal-body { padding: 22px 28px 28px; }
.modal-body h3 {
  font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 10px;
}
.modal-body .modal-desc {
  font-size: 0.88rem; line-height: 1.7; color: var(--muted); margin-bottom: 28px;
}

.downloads-label {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--muted); margin-bottom: 12px;
}
.download-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-radius: 12px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 8px;
  transition: background 0.2s, border-color 0.2s;
}
.download-row:last-child { margin-bottom: 0; }
.download-row:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1); }

.download-link {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; text-decoration: none; color: inherit;
}
.dl-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dl-icon { color: var(--muted); font-size: 0.85rem; flex-shrink: 0; }
.dl-name { font-size: 0.83rem; font-weight: 500; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-meta { display: flex; align-items: center; gap: 14px; flex-shrink: 0; margin-left: 12px; }
.dl-size { font-size: 0.76rem; color: var(--muted); }
.dl-arrow { color: var(--accent); font-size: 0.75rem; transition: transform 0.2s; }
.download-row:hover .dl-arrow { transform: translateY(2px); }

/* ── Footer ── */
footer {
  position: relative; z-index: 1;
  max-width: 1100px; margin: 0 auto;
  padding: 20px 32px 48px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 20px;
}
.footer-left .footer-brand { font-weight: 700; font-size: 0.95rem; color: var(--muted); }
.footer-left .footer-copy { font-size: 0.74rem; color: var(--muted); margin-top: 3px; opacity: 0.5; }
.discord-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 26px; border-radius: 999px;
  background: #5865F2; color: #fff;
  font-size: 0.88rem; font-weight: 600; border: none;
  cursor: pointer; font-family: inherit; text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.discord-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(88,101,242,0.4);
  background: #4752c4;
}
.discord-btn:active { transform: translateY(0); }

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .navbar.scrolled .navbar-bar, .navbar.unscrolling .navbar-bar { animation: none; }
  .marquee-track { animation: none; }
  .nav-logo .dot { animation: none; }
  .dropdown.open .dropdown-item { animation: none; opacity: 1; transform: none; }
  .navbar { transition: none; }
  .content-section { transition: none; opacity: 1; transform: none; }
  .modal-content { transition: none; }
  .marquee-wrap { transition: none; }
}

/* ── Mobile ── */
@media (max-width: 640px) {
  .navbar { padding: 14px 16px 0; }
  .navbar-bar { padding: 12px 14px; min-width: 220px; }
  #hero { padding: 100px 20px 60px; }
  .marquee-wrap { margin-top: 36px; }
  .content-section { padding: 30px 20px 70px; }
  .card-grid { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: 1fr; }
  .modal-body { padding: 18px 20px 24px; }
  footer { padding: 16px 20px 40px; }
  .page-header { padding: 100px 20px 12px; }
  .dropdown-menu { min-width: 170px; }
}
