/* Base Variables */
:root {
  --bg-dark: #0d0d0d;
  --bg-light: #121212;
  --accent: #e53e3e;
  --accent-light: #e85c52;
  --text: #f0f0f0;
  --card-bg: rgba(255,255,255,0.05);
  --card-hover: rgba(255,255,255,0.1);
}

/* Global Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Montserrat', sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
}

/* Navigation Bar */
nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  z-index: 1000;
}
nav .logo a {
  color: var(--accent);
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: 1px;
}
nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
}
nav ul li a {
  color: var(--text);
  font-weight: 600;
  position: relative;
  padding: 0.25rem 0;
  transition: color 0.3s;
}
nav ul li a:hover {
  color: var(--accent);
}
nav ul li a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background: var(--accent-light);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s;
}
nav ul li a:hover::after {
  transform: scaleX(1);
}

/* Hero Section */
.hero {
  min-height: 100vh;
  width: 100vw;
  max-width: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  background: url('https://cdn.apexlegendsrenders.com/file/ApexLegendsRenders/Noir+Path.png') no-repeat center center;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.2) 40%, rgba(0,0,0,0) 70%);
  pointer-events: none;
}
.hero h1 {
  font-size: 3rem;
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 1rem;
  z-index: 1;
}
.hero p {
  font-size: 1.2rem;
  max-width: 600px;
  margin: 0 auto 1.5rem;
  z-index: 1;
}
.hero a.cta {
  display: inline-block;
  padding: 0.8rem 2rem;
  border: 2px solid var(--accent);
  border-radius: 40px;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  transition: all 0.3s;
  z-index: 1;
}
.hero a.cta:hover {
  background: var(--accent);
  color: var(--bg-dark);
}

/* Generic Sections */
section {
  padding: 4rem 2rem;
  max-width: 1000px;
  margin: 0 auto;
}
section h2 {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 1rem;
  text-transform: uppercase;
  color: var(--accent);
  text-align: center; /* Center the text */
  position: relative; /* Ensure it stays visible */
  z-index: 10; /* Bring it above other elements */
}
section p {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}
.join-btn {
  display: inline-block;
  padding: 0.8rem 2rem;
  background: var(--accent);
  color: var(--bg-dark);
  font-weight: 700;
  border-radius: 40px;
  text-transform: uppercase;
  transition: background 0.3s;
}
.join-btn:hover {
  background: #c53030;
}

/* Ensure h2 is properly positioned and visible */
h2 {
  position: relative; /* Ensure it is positioned relative to its parent */
  z-index: 20; /* Bring it above the header */
  margin-top: 8rem; /* Add spacing to move it below the header */
  text-align: center; /* Center the text horizontally */
}

/* Legend Header (Section) for sub-pages */
#legend-header {
  margin-top: 6rem;
  text-align: center;
  padding: 2rem 1rem;
  background: linear-gradient(180deg, #111 0%, #1a1a1a 100%);
  position: relative; /* Ensure it stays in the correct layer */
  z-index: 10; /* Bring it above other elements */
}
#legend-header h1 {
  font-size: 2.75rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
  text-align: center; /* Center the title */
}
#legend-header p {
  font-size: 1.125rem;
  max-width: 600px;
  margin: 0 auto;
  color: #ccc;
}

/* Gallery Styles */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.gallery-item {
  background: none;
  border-radius: 0;
  box-shadow: none;
  transition: transform 0.3s;
  overflow: hidden;
  text-align: center;
  display: flex;
  flex-direction: column;
}

.gallery-item:hover {
  transform: translateY(-5px);
}

.gallery-item img {
  width: 80%;
  height: auto;
  display: block;
  border-radius: 50%;
  margin: 0 auto;
}

.caption {
  padding: 1rem;
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
}

.download-btn {
  display: inline-block;
  margin: 0.5rem auto;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--bg-dark);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 700;
  text-transform: uppercase;
  transition: background 0.3s, transform 0.3s;
}

.download-btn:hover {
  background: var(--accent-light);
  transform: scale(1.05);
}

/* Collection Button */
.collection-btn {
  display: inline-block;
  margin: 0.5rem auto;
  padding: 0.6rem 1.2rem;
  background: var(--accent);
  color: var(--bg-dark);
  text-decoration: none;
  border-radius: 0;
  font-weight: 700;
  text-transform: uppercase;
  border: none;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: background 0.3s, box-shadow 0.3s;
}

.collection-btn:hover {
  background: var(--accent-light);
  box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

/* Collection Container */
.collection {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
  justify-content: center;
}

.collection img {
  width: 120px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  transition: transform 0.3s;
}

.collection img:hover {
  transform: scale(1.05);
}

/* Ensure card links open in a new window */
.gallery-item a {
  text-decoration: none;
}
.gallery-item a[target="_blank"] {
  cursor: pointer;
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem 1rem;
  color: #777;
  font-size: 0.9rem;
}

/* Legend Grid Styles */
.legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  margin: 2rem auto;
  max-width: 1000px;
  padding: 0 1rem;
}

/* Legend Card Styles */
.legend-card {
  background-color: transparent;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: none;
  text-align: center;
  transition: transform 0.3s;
}
.legend-card:hover {
  transform: translateY(-5px);
}
.legend-card img {
  width: 80%;
  height: auto;
  display: block;
  border-radius: 50%;
  margin: 0 auto;
}
.legend-card .info {
  padding: 1.5rem; /* Adjusted padding for better spacing */
}
.legend-card .info h3 {
  margin: 0.5rem 0;
  font-size: 1.2rem;
  color: var(--accent);
}
.legend-card .info .collection-btn {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.6rem 1.2rem;
  background-color: var(--accent);
  color: var(--bg-dark);
  text-decoration: none;
  border-radius: 0;
  font-weight: 700;
  text-transform: uppercase;
  border: none;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: background 0.3s, box-shadow 0.3s;
}
.legend-card .info .collection-btn:hover {
  background: var(--accent-light);
  box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}
