/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

h1, h2, nav {
  font-family: 'Press Start 2P', monospace;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  color: #1a1a2e;
  background: #e8f4f8;
  padding: 0 5%; /* adds 5% padding on left and right */
  max-width: 1400px; /* prevents it from getting too wide on huge screens */
  margin: 0 auto; /* centers the whole site */
  min-height: 100vh; /* full viewport height */
  display: flex; 
  flex-direction: column; /* stacks nav, main, and footer vertically */
}

/* Navigation */
nav {
  background: #d4e8f0;
  padding: 1rem 0;
  border-bottom: 2px solid #b8dce8;
  border-radius: 0 0 15px 15px; /* rounds bottom corners */
}

.nav-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between; /* pushes logo left, links right */
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: #1a1a2e;
  text-decoration: none;
}

.nav-links {
  display: flex;
  list-style: none; /* removes bullets */
  gap: 2rem; /* space between links */
  margin: 0; /* removes default margin */
  padding: 0; /* removes default padding */
}

.nav-links a {
  color: #1a1a2e;
  text-decoration: none;
  font-weight: 500;
}

.nav-links a:hover {
  color: #ff6b35;
}

/* Main content */
main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
}

section {
  margin: 3rem 0;
}

/* Hero section */
.hero {
  text-align: center;
  padding: 3rem 0;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.2rem;
  color: #2d2d3d;
}

/* About section */
.about h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

/* Footer */
footer {
  background: #d4e8f0;
  padding: 2rem;
  text-align: center;
  border-top: 2px solid #b8dce8;
  border-radius: 15px 15px 0 0; /* rounds top corners */
  margin-top: auto;
}

.social-links {
  margin-top: 1rem;
  display: flex;
  gap: 1.5rem;
  justify-content: center;
}

.social-links a {
  color: #1a1a2e;
  text-decoration: none;
}

.social-links a:hover {
  color: #ff6b35;
}

/* Gallery */
/* Gallery Grid */
.gallery-grid {
  display: grid;
  /* grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); */
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
  margin-top: 2rem;
}

.gallery-item {
  text-decoration: none;
  color: inherit;
  text-align: center;
  transition: transform 0.2s;
}

.gallery-item:hover {
  transform: scale(1.05);
}

.gallery-item img {
  width: 100%;
  height: auto;
  border: 2px solid #b8dce8;
  border-radius: 8px;
  background: white; /* helps pixel art visibility */
  image-rendering: pixelated; /* Changes from default of "smooth" upscaling */
  image-rendering: -moz-crisp-edges; /* Firefox fallback */
  image-rendering: crisp-edges; /* Other browsers */
}

.gallery-item p {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
  background-color: #e8f4f8;
  margin: 2% auto;
  padding: 2rem;
  border: 2px solid #b8dce8;
  border-radius: 15px;
  width: 90%;
  max-width: 1000px;
  max-height: 90vh;
  overflow-y: auto;
}

.close {
  color: #1a1a2e;
  float: right;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
}

.close:hover {
  color: #ff6b35;
}

.modal-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 1rem;
}

.modal-image {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-image img {
  min-width: 400px; /* forces upscale */
  max-width: 100%;
  max-height: 600px; /* limits vertical size */
  width: auto;
  height: auto;
  image-rendering: pixelated;
  border: 2px solid #b8dce8;
  border-radius: 8px;
  background: white;
}

.modal-info h2 {
  margin-bottom: 0.5rem;
}

.modal-resolution {
  color: #2d2d3d;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.modal-palette h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.color-swatch {
  width: 40px;
  height: 40px;
  border: 2px solid #1a1a2e;
  border-radius: 4px;
  cursor: pointer;
  position: relative;
}

.color-swatch:hover::after {
  content: attr(data-hex);
  position: absolute;
  bottom: -25px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a2e;
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.7rem;
  white-space: nowrap;
}

.modal-description {
  margin-top: 1rem;
}

/* Responsive modal */
@media (max-width: 768px) {
  .modal-layout {
    grid-template-columns: 1fr;
  }
}