/* -------------------------------------- */
/* DARK MODE ROOT VARIABLES               */
/* -------------------------------------- */

:root {
  --bg-main: #1a1a1a;              /* deep grey background */
  --text-main: #f2f2f2;            /* near-white text */
  --text-soft: #d0d0d0;            /* softer white for descriptions */
  --card-bg: #242424;              /* dark card surface */
  --accent-purple: #3a1f5d;        /* deep purple accent */
}

/* -------------------------------------- */
/* GLOBAL BASE                            */
/* -------------------------------------- */

body {
  background: var(--bg-main);
  color: var(--text-main);
  margin: 0;
  font-family: sans-serif;
}

.app-H1 {
  text-align: center;
  font-size: 1.5em;
  color: #e8f0ff;
  text-shadow:
    -2px -2px 0 var(--accent-purple),
     2px -2px 0 var(--accent-purple),
    -2px  2px 0 var(--accent-purple),
     2px  2px 0 var(--accent-purple),
     0px  0px 6px var(--accent-purple);
}

/* -------------------------------------- */
/* CARD SYSTEM (HTML #1)                  */
/* -------------------------------------- */

.card-column {
  width: 60%;
  margin: 2rem auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  background: var(--card-bg);
  border-radius: 14px;
  border: 1px solid var(--accent-purple);
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.4),
    0 0 0 1px var(--accent-purple);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card-container:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.6),
    0 0 0 1px var(--accent-purple);
}

.card-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-main);
  margin: 0;
}

.card-description {
  font-size: 0.95rem;
  color: var(--text-soft);
  line-height: 1.45;
  margin: 0.25rem 0 0.75rem;
}

.card-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 3%;
  margin-top: auto;
}

/* -------------------------------------- */
/* BUTTONS (Repo / App / Video / Download)*/
/* -------------------------------------- */

.card-button-repo,
.card-button-app,
.card-button-video,
.card-button-download {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  transition: opacity 0.2s ease, transform 0.15s ease;
}

/* Individual colours */
.card-button-repo     { background: rgb(187, 61, 7); }
.card-button-app      { background: rgb(5, 124, 5); }
.card-button-video    { background: #6a2bbf; } /* purple */
.card-button-download { background: #a2266a; } /* magenta-purple */

/* Unified hover behaviour */
.card-button-repo:hover,
.card-button-app:hover,
.card-button-video:hover,
.card-button-download:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

/* -------------------------------------- */
/* GRID SYSTEM (HTML #2 + keep 3/4)       */
/* -------------------------------------- */

.nav-link {
  color: greenyellow;
  font-size: 1.4em;
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.2s ease;
}

.nav-link:hover {
  opacity: 0.7;
}

.grid-container {
  display: grid;
  gap: 1rem;
  margin-bottom: 2rem;
}

.grid-container.one   { grid-template-columns: 1fr; }
.grid-container.two   { grid-template-columns: repeat(2, 1fr); }
.grid-container.three { grid-template-columns: repeat(3, 1fr); }
.grid-container.four  { grid-template-columns: repeat(4, 1fr); }

.grid-container .cell {
  padding: 0.75rem;
  background-color: var(--card-bg);
  border-radius: 10px;
  border: 1px solid var(--accent-purple);
  color: var(--text-main);
  box-shadow:
    0 1px 4px rgba(0, 0, 0, 0.4),
    0 0 0 1px var(--accent-purple);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.grid-container .cell img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

.hover-enabled .cell:hover {
  background-color: #2e2e2e;
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.6),
    0 0 0 1px var(--accent-purple);
}

/* -------------------------------------- */
/* PAGE WRAPPER (HTML #2)                 */
/* -------------------------------------- */

.page-wrapper {
  width: 75%;
  margin: 2rem auto;
  padding: 1.5rem;
  background: #1f1f1f;
  border-radius: 14px;
  border: 1px solid var(--accent-purple);
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.5),
    0 0 0 1px var(--accent-purple);
  color: var(--text-main);
  box-sizing: border-box;
}

/* -------------------------------------- */
/* DOWNLOAD LINK (HTML #2)                */
/* -------------------------------------- */

.download-link {
  color: #c7a6ff;
  text-decoration: none;
  padding-bottom: 2px;
  transition: color 0.15s ease;
}

.download-link:hover {
  color: #e0c8ff;
}

/* -------------------------------------- */
/* RESPONSIVE RULES                       */
/* -------------------------------------- */

@media (max-width: 768px),
       (orientation: portrait) and (max-aspect-ratio: 3/2) {

  body {
    padding: 0.75rem;
  }

  .page-wrapper {
    width: 95%;
    margin: 1rem auto;
    padding: 1rem;
    border-radius: 10px;
  }

  .grid-container.two,
  .grid-container.three,
  .grid-container.four {
    grid-template-columns: 1fr;
  }

  .card-column {
    width: 95%;
    margin: 1rem auto;
  }
}
