/* Background + Page Layout */
body {
  margin: 0;
  padding: 0;
  min-height: 100svh; /* mobile-friendly viewport height */
  background: url('background.jpg') center center / cover no-repeat fixed;
  font-family: Arial, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto; /* allow scrolling if content exceeds viewport */
}

.overlay {
  position: fixed; /* fixed overlay so it covers while scrolling */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.container {
  z-index: 2;
  text-align: center;
  color: white;
  width: 100%;
  max-width: 1100px;
}

/* ---------------------- */
/*   TITLE (Dark Tile)    */
/* ---------------------- */

.title-frame-dark {
  display: inline-block;
  padding: 25px 55px;
  margin: 40px 0 40px;
  background: rgba(20,20,20,0.75); /* same shade as the cards */
  border-radius: 22px;
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 26px rgba(0,0,0,0.45);
}

.title-wordmark {
  font-size: 3.4rem;
  font-weight: 700;
  letter-spacing: 1.4px;
  margin: 0;
  padding: 0;
  color: white;
  text-shadow: 0 3px 10px rgba(0,0,0,0.8);
}

/* ---------------------- */
/*       CARD GRID        */
/* ---------------------- */

.grid {
  display: flex;
  gap: 50px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0 12px 40px; /* bottom padding so last tile isn't cut off */
  box-sizing: border-box;
}

.card {
  width: 320px;
  height: 360px;
  background: rgba(20,20,20,0.75);
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* lets image take more space */
  align-items: center;
  text-decoration: none;
  color: white;
  transition: 0.2s;
  padding: 10px;
  backdrop-filter: blur(8px);
  box-sizing: border-box;
}

.card:hover {
  background: rgba(40,40,40,0.85);
  transform: scale(1.05);
}

.card-icon {
  width: 92%;
  height: auto;
  flex: 1 1 auto;
  object-fit: contain;
  margin-top: 6px;
  margin-bottom: 10px;
}

.label {
  font-size: 1.6rem;
  font-weight: bold;
  margin-bottom: 10px;
}

/* ---------------------- */
/*        MOBILE          */
/* ---------------------- */

@media (max-width: 900px) {
  body {
    align-items: flex-start;               /* allow content to start at top */
    justify-content: center;
    background-attachment: scroll;         /* fixes iOS scroll jank */
    padding: 16px 12px;
    padding-top: calc(16px + env(safe-area-inset-top));
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }

  .container {
    max-width: 520px;
  }

  .title-frame-dark {
    padding: 18px 26px;
    margin: 16px 0 22px;
  }

  .title-wordmark {
    font-size: 2.2rem;
  }

  .grid {
    flex-direction: column;
    gap: 18px;
    align-items: center;
    padding-bottom: 24px;
  }

  .card {
    width: 100%;
    max-width: 420px;
    height: auto;          /* key: allows page to grow and scroll */
    padding: 12px;
  }

  .card-icon {
    width: 96%;
    max-width: 360px;
    height: auto;
    margin-bottom: 12px;
  }

  .label {
    font-size: 1.4rem;
    margin-bottom: 6px;
  }
}

/* Phones */
@media (max-width: 480px) {
  .title-wordmark {
    font-size: 1.9rem;
  }
}

/* Touch devices: avoid sticky hover */
@media (hover: none) {
  .card:hover { transform: none; }
  .card:active { transform: scale(0.98); }
}
