/*   based on Pixel Garden by xzelleiv */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&family=Press+Start+2P&display=swap');

:root {
  --bg: #120c01;
  --panel: rgba(45, 35, 30, 0.75);
  --border: rgba(107, 76, 59, 0.5);
  --accent: #c8933b;
  --accent-hover: #e0a852;
  --text: #f1e6d6;
  --muted: #9b7f6a;
  --danger: #ff6b6b;
  --success: #8ee4af;
  --glass: blur(6px);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  --font-pixel: "Press Start 2P", cursive;
  --font-body: "Inter", sans-serif;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image: url('../images/stone_bg.png'); 
  background-size: 64px; 
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}


body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65); 
  pointer-events: none;
  z-index: -1;
  /* promote to its own layer to avoid repaint flicker during scroll */
  transform: translateZ(0);
  will-change: opacity, transform;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

a { text-decoration: none; color: inherit; }


.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(26, 22, 20, 0.65);
  backdrop-filter: var(--glass);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  color: var(--accent);
  font-size: 20px;
  font-family: var(--font-pixel);
  text-shadow: 0 0 10px rgba(200, 147, 59, 0.3);
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-links {
  display: flex;
  gap: 15px;
}

.nav-item {
  color: var(--text); 
  font-size: 12px;
  font-weight: 600;
  padding: 8px; 
  border-radius: 8px;
  background: rgba(26, 22, 20, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.03);
  transition: all 0.2s;
  font-family: var(--font-pixel);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-icon {
    width: 20px;
    height: 20px;
}

.nav-item:hover, .nav-item.active {
  color: var(--text);
  background: rgba(30, 25, 22, 0.55);
  border-color: rgba(200, 147, 59, 0.3);
  box-shadow: 0 0 10px rgba(200, 147, 59, 0.1);
}


.container {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
  z-index: 1;
  position: relative;
}


.hero-card {
  text-align: center;

  padding: 40px 20px;
  max-width: 800px;
  margin: 10vh auto;    
  animation: fadeUp 0.8s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}



.hero-desc {
    color: var(--muted);
    margin-bottom: 60px;
    font-size: 18px;
    line-height: 1.6;
    max-width: 600px;
    text-shadow: 2px 2px 0 #000;
}


.main-logo {
    image-rendering: auto; 
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5));
    animation: float 4s ease-in-out infinite;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 400px;
}

.btn {
  background: rgba(0, 0, 0, 0.5); 
  border: 2px solid var(--muted); 
  color: var(--text);
  padding: 20px 30px;
  font-family: var(--font-pixel);
  font-size: 16px;
  transition: all 0.2s;
  border-radius: 0; 
  text-transform: uppercase;
  cursor: pointer;
  display: block;
  text-align: center;
  text-decoration: none;
  box-shadow: 4px 4px 0 #000;
}

.btn:hover {
  background: rgba(100, 100, 100, 0.5);
  border-color: var(--text);
  color: #fff;
  transform: scale(1.02);
  box-shadow: 6px 6px 0 #000;
}

.btn.primary {
  background: var(--accent);
  color: #1a1614;
  border-color: #a07a3b;
  box-shadow: 4px 4px 0 #000;
}

.btn.primary:hover {
  background: var(--accent-hover);
  box-shadow: 6px 6px 0 rgba(0,0,0,0.5);
  color: #000;
}

.section-title {
  font-family: var(--font-pixel);
  color: var(--accent);
  font-size: 18px;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.content-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
}

@media (max-width: 900px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

.card {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(107, 76, 59, 0.3);
  border-radius: 8px;
  padding: 20px;
  transition: 0.2s;
}

.card:hover {
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.card-title {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--text);
  line-height: 1.4;
}

.card-desc {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
}

.bg-pattern {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
  z-index: -2; /* send pattern behind the overlay to avoid overlay flicker */
    opacity: 0.1;
    pointer-events: none;
    background-image: url('../images/dark_bg_pattern.png');
    background-size: 64px;
}

.footer {
    text-align: center;
    padding: 40px 0;
    color: var(--muted);
    font-size: 12px;
    opacity: 0.6;
}


@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}


@media (max-width: 768px) {
  .header {
    padding: 15px 10px;
  }
  
  .logo {
    font-size: 16px;
  }
  
  .main-logo {
      width: 90% !important; 
      max-width: 400px !important; 
  }
  
  .hero-title {
    font-size: 42px;
  }
  
  .github-nav, .discord-nav {
    display: none;
  }
  
  .logo-text {
    display: none;
  }
  

  .nav-item {
      padding: 8px; 
      font-size: 0; 
  }

  .nav-item svg {
      width: 24px;
      height: 24px;
  }
  
  .mobile-only-credits {
      display: block !important;
  }
  
  .mobile-social-links {
      display: flex !important;
  }
  
  .home-credits {
      margin-top: 80px !important;
  }
}

/* Hide mobile-only elements on desktop by default */
.mobile-social-links {
    display: none;
}

/* --- Gallery Lightbox --- */
.gallery-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    transition: transform 0.2s, border-color 0.2s;
    cursor: zoom-in;
    background: #000;
}

.gallery-img:hover {
    transform: scale(1.02);
    border-color: var(--accent);
}

.lightbox {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

.lightbox-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 1080px;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
    border: 2px solid var(--accent);
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 1001;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: var(--accent);
    text-decoration: none;
    cursor: pointer;
}

@keyframes zoomIn {
  from {transform:scale(0)} 
  to {transform:scale(1)}
}

@keyframes fadeIn {
  from {opacity: 0} 
  to {opacity: 1}
}

/* --- Release Modal --- */
.modal { display: none; position: fixed; inset: 0; align-items: center; justify-content: center; background: rgba(0,0,0,0.6); z-index: 10000; }
.modal[aria-hidden="false"], .modal.show { display: flex; }

.modal-panel {
  background: var(--panel);
  width: min(720px, 95%);
  border-radius: 12px;
  padding: 18px 20px 20px 20px;
  position: relative;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  backdrop-filter: var(--glass);
  max-height: 90vh;
  overflow: auto; /* allow panel content to scroll on small screens */
}

.modal-close {
  position: absolute;
  right: 12px;
  top: 12px;
  background: transparent; /* blend with panel */
  border: 1px solid rgba(255,255,255,0.04);
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  width: 34px;
  height: 34px;
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-pixel);
  z-index: 12; /* ensure it sits above inner card borders */
  box-shadow: none; /* remove heavy drop-shadow to avoid separate box look */
  backdrop-filter: blur(4px) saturate(80%);
}

.modal-close:hover {
  color: var(--accent);
  transform: translateY(-1px);
}

.modal-close svg { display:block; width:14px; height:14px; color:var(--muted); }
.modal-close:hover svg { color: var(--accent); }

.modal-close:focus { outline: none; box-shadow: 0 0 0 6px rgba(200,147,59,0.10); border-radius: 8px; }

/* Smaller, subtle inner outline so the button reads as part of the panel */
.modal-close::after{
  content: '';
  position: absolute;
  left: -6px; top: -6px; right: -6px; bottom: -6px;
  border-radius: 12px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,0.02), rgba(255,255,255,0.01));
  z-index: 11; /* sits behind the svg but above panel minor seams */
}

.release-card {
  background: rgba(255,255,255,0.01);
  border-radius: 8px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.04);
  color: var(--muted);
}

.modal-footer {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

@media (max-width: 520px) {
  /* make modal narrower with side padding so it doesn't touch screen edges */
  .modal-panel { padding: 8px; width: auto; max-width: 360px; margin: 0 12px; }
  .modal-panel { max-height: 78vh; }
  .release-card { font-size: 12px; padding: 8px; }
  .modal-footer { flex-direction: column; gap: 8px; align-items: stretch; }
  .modal-footer .btn { width: 100%; padding: 9px 10px; box-sizing: border-box; font-size: 13px; }
  .modal-footer .btn + .btn { margin-top: 6px; }
  /* slightly reduce inner text sizes */
  .release-card .card-title, .release-card .card-desc { font-size: 12px; }
}
