@import url('/subpage-theme.css');

:root {
  --bg-dark: #070a12;
  --surface-card: rgba(13, 19, 33, 0.9);
  --border-hud: rgba(255, 255, 255, 0.08);
  --yellow: #ffdc35;
  --cyan: #06b6d4;
  --cyan-neon: #22d3ee;
  --red: #ed3b36;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background-color: #070a13 !important;
  background-image: 
    radial-gradient(ellipse 90% 50% at 50% 0%, rgba(14, 165, 233, 0.12) 0%, rgba(99, 102, 241, 0.04) 50%, transparent 80%),
    radial-gradient(ellipse 60% 40% at 85% 85%, rgba(237, 59, 54, 0.05) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 15% 90%, rgba(6, 182, 212, 0.05) 0%, transparent 60%),
    linear-gradient(180deg, #070a13 0%, #0a0f1d 50%, #05070c 100%) !important;
  background-attachment: fixed !important;
  background-size: 100% 100% !important;
  color: var(--text-main);
  font-family: 'Chakra Petch', system-ui, sans-serif;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: 
    linear-gradient(180deg, 
      rgba(7, 10, 19, 0.90) 0%, 
      rgba(7, 10, 19, 0.84) 360px, 
      rgba(5, 7, 13, 0.96) 800px, 
      rgba(4, 6, 11, 0.99) 100%
    ),
    url('/assets/musutafu.png') center top / cover no-repeat;
  opacity: 0.22;
  filter: saturate(1.1) brightness(0.9);
}

main {
  max-width: 1360px;
  margin: auto;
  padding: 40px 24px 90px;
}

/* ==========================================================================
   HERO BANNER
   ========================================================================== */
.library-hero {
  position: relative;
  overflow: hidden;
  padding: 50px 40px;
  margin-bottom: 30px;
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(13, 20, 36, 0.95) 0%, rgba(8, 12, 22, 0.98) 100%);
  box-shadow: 0 12px 36px -6px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
}

.library-hero::after {
  content: 'ARCHIVES';
  position: absolute;
  right: 20px;
  top: 10px;
  font: 400 clamp(80px, 12vw, 150px)/1 Bangers, Impact, sans-serif;
  letter-spacing: 4px;
  color: rgba(255, 255, 255, 0.025);
  pointer-events: none;
}

.library-hero .eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--yellow);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 0 0 10px;
}

.library-hero .eyebrow::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--yellow);
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.library-hero h1 {
  font: 400 clamp(44px, 6vw, 76px)/1 Bangers, Impact, sans-serif;
  letter-spacing: 1.5px;
  margin: 0 0 14px;
  color: #fff;
  text-shadow: 0 0 30px rgba(6, 182, 212, 0.4), 3px 3px 0 #000;
}

.library-hero h1 span {
  color: var(--cyan);
}

.library-hero .intro {
  font-size: 16px;
  line-height: 1.6;
  color: #cbd5e1;
  max-width: 680px;
  margin: 0 0 24px;
}

.download-row {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.download-row .primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #ed3b36 0%, #b91c1c 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 4px 16px rgba(237, 59, 54, 0.4);
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.download-row .primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(237, 59, 54, 0.6);
}

.download-row a:not(.primary) {
  color: var(--cyan);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.6);
  transition: all 0.2s;
}

.download-row a:not(.primary):hover {
  color: var(--cyan-bright);
  border-color: var(--cyan);
  transform: translateY(-1px);
}

/* ==========================================================================
   GUIDE NOTE / DISCLAIMER
   ========================================================================== */
.guide-note {
  border-left: 4px solid var(--yellow);
  background: rgba(16, 24, 44, 0.85);
  padding: 18px 24px;
  margin-bottom: 28px;
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.7;
  border: 1px solid var(--border-hud);
  border-left: 4px solid var(--yellow);
}

/* ==========================================================================
   CONTROLS & SEARCH
   ========================================================================== */
.library-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin: 24px 0 16px;
  padding: 14px 18px;
  background: rgba(13, 19, 33, 0.85);
  border: 1px solid var(--border-hud);
  border-radius: 10px;
}

.library-controls input {
  flex: 1;
  min-width: 220px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 13.5px;
  transition: all 0.2s;
}

.library-controls input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.4);
}

.filter {
  padding: 9px 16px;
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.7);
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: all 0.2s;
}

.filter:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

.filter[aria-pressed="true"] {
  background: linear-gradient(135deg, #ed3b36 0%, #b91c1c 100%);
  color: #fff;
  border-color: rgba(237, 59, 54, 0.6);
  box-shadow: 0 0 14px rgba(237, 59, 54, 0.4);
}

#result-count {
  font-size: 12px;
  color: var(--text-muted);
  margin: 10px 0 24px;
}

/* ==========================================================================
   LIBRARY GRID
   ========================================================================== */
.library-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.library-card {
  padding: 24px 22px;
  border: 1px solid var(--border-hud);
  border-top: 3px solid var(--cyan);
  border-radius: 10px;
  background: var(--surface-card);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  text-decoration: none;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.library-card[hidden] {
  display: none !important;
}

.library-card:hover {
  transform: translateY(-4px);
  border-color: var(--cyan);
  box-shadow: 0 12px 30px rgba(6, 182, 212, 0.25);
}

.library-card:nth-child(3n+1) { border-top-color: var(--cyan); }
.library-card:nth-child(3n+2) { border-top-color: var(--yellow); }
.library-card:nth-child(3n) { border-top-color: var(--red); }

.library-card:nth-child(3n+2):hover {
  border-color: var(--yellow);
  box-shadow: 0 12px 30px rgba(255, 220, 53, 0.25);
}

.library-card:nth-child(3n):hover {
  border-color: var(--red);
  box-shadow: 0 12px 30px rgba(237, 59, 54, 0.25);
}

.library-card small {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--cyan);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.library-card:nth-child(3n+2) small { color: var(--yellow); }
.library-card:nth-child(3n) small { color: #ff7872; }

.library-card h2 {
  font: 400 24px/1.2 Bangers, Impact, sans-serif;
  letter-spacing: 0.8px;
  margin: 0 0 10px;
  color: #fff;
  text-shadow: 1px 1px 0 #000;
}

.library-card p {
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
footer {
  max-width: 1360px;
  margin: 40px auto 0;
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: var(--text-muted);
}

footer div {
  display: flex;
  gap: 20px;
}

footer a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

footer a:hover {
  color: var(--yellow);
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 990px) {
  .library-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 650px) {
  main { padding: 24px 14px 60px; }
  .library-hero { padding: 32px 20px; }
  .library-hero h1 { font-size: clamp(36px, 10vw, 54px); }
  .library-grid { grid-template-columns: 1fr; gap: 14px; }
  .library-controls { flex-direction: column; align-items: stretch; }
  .library-controls input { width: 100%; }
}
