/* ==========================================================================
   Reset and Base Styles
   ========================================================================== */

* {
  margin: 0;
  padding: 0;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
    Cantarell, sans-serif;
  line-height: 1.6;
  color: #333;
  background: #f5f5f5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 320px;
  padding-bottom: 100px;
}

main {
  flex: 1;
  padding-bottom: 100px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

h1 {
  text-align: center;
  margin-bottom: 3rem;
  font-size: 2.5rem;
  color: #2c3e50;
}

/* ==========================================================================
   Navigation Bar
   ========================================================================== */

.navbar {
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 60px;
}

.nav-container {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2rem;
  justify-content: space-between;
  min-height: 60px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.nav-logo-link {
  display: flex;
  align-items: center;
  position: relative;
  z-index: 101;
}

.nav-brand-text {
  font-size: 1.5rem;
  font-weight: bold;
  color: #2c3e50;
  text-decoration: none;
  white-space: nowrap;
}

.nav-logo {
  height: 240px;
  width: auto;
  display: block;
  margin-top: -90px;
  margin-bottom: -90px;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
  flex-shrink: 0;
}

.nav-item {
  flex-shrink: 0;
}

.nav-item a {
  color: #333;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
  display: inline-block;
  padding: 0 1rem;
  border-radius: 4px;
}

.nav-item a:hover {
  color: #3498db;
  background-color: rgba(52, 152, 219, 0.1);
}

.gh-logo {
  height: 16px;
  width: auto;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  background: white;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
  padding: 1rem 0;
  z-index: 100;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  text-align: center;
}

.footer-content p {
  margin-bottom: 0;
  color: #666;
}

.footer-content a {
  color: #2c3e50;
  text-decoration: underline;
}

.footer-content a:hover {
  color: #3498db;
}

/* ==========================================================================
   Grid Layout
   ========================================================================== */

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

/* ==========================================================================
   Tile Styles
   ========================================================================== */

.tile {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}

.tile:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.tile-link {
  text-decoration: none !important;
  color: inherit;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.tile-link:hover,
.tile-link:focus,
.tile-link:active,
.tile-link:visited {
  text-decoration: none !important;
}

.tile-image {
  width: 100%;
  height: 200px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  background-color: white;
}

.tile-content {
  padding: 1.5rem;
  padding-bottom: 4rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  position: relative;
}

.tile-content h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: #2c3e50;
}

.tile-content p {
  color: #666;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  flex: 1;
}

.tile-label {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #000;
  background: #f0f0f0;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  width: fit-content;
}

.tile-license {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  text-decoration: none;
  transition: opacity 0.3s ease;
  z-index: 10;
}

.tile-license:hover {
  opacity: 0.7;
}

.tile-license img {
  height: 22px;
  width: auto;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 860px) {
  .nav-container {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0.5rem;
    gap: 0.5rem;
  }

  .nav-brand {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
    margin-bottom: 2rem;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 530px) {
  .nav-brand {
    flex-direction: column;
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  body {
    padding: 1rem 0.5rem;
  }

  h1 {
    font-size: 1.75rem;
  }

  .tile-image {
    height: 160px;
  }
}

/* ==========================================================================
   Dark Mode
   ========================================================================== */

@media (prefers-color-scheme: dark) {
  body {
    color: #e0e0e0;
    background: #1a1a1a;
  }

  h1 {
    color: #e0e0e0;
  }

  .navbar {
    background: #2a2a2a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }

  .nav-brand-text {
    color: #e0e0e0;
  }

  .nav-logo {
    filter: invert(1) hue-rotate(180deg);
  }

  .nav-item a {
    color: #e0e0e0;
  }

  .gh-logo {
    filter: invert(1) hue-rotate(180deg);
  }

  .footer {
    background: #2a2a2a;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.3);
  }

  .footer-content p {
    color: #e0e0e0;
  }

  .footer-content a {
    color: #5dade2;
    text-decoration: underline;
  }

  .footer-content a:hover {
    color: #85c1e9;
  }

  .tile {
    background: #2a2a2a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }

  .tile:hover {
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
  }

  .tile-link {
    color: #e0e0e0;
  }

  .tile-image {
    background-color: #d5d5d5;
    filter: invert(1) hue-rotate(180deg);
  }

  .tile-content h2 {
    color: #e0e0e0;
  }

  .tile-content p {
    color: #e0e0e0;
  }

  .tile-label {
    color: #e0e0e0;
    background: #1a1a1a;
  }
}
