/* ============================================
   SKILL CARDS CONTAINER
   Flexbox layout for skill cards
   ============================================ */

.cards {
  position: relative;
  margin-bottom: 2.5rem;
  width: 100%;
  padding: 0 1rem;
}

.cards__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  position: relative;
  justify-content: center;
}


/* ============================================
   CARD COMPONENT
   Individual skill card styling
   ============================================ */

.card {
  /* CSS Variables for HSL color manipulation */
  --flow-space: 0.5rem;
  --hsl: var(--hue), var(--saturation), var(--lightness);
  
  /* Layout - flex basis allows cards to wrap naturally */
  flex: 1 1 14rem;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  align-items: start;
  gap: 1.25rem;
  padding: 1.5rem 2rem;
  box-sizing: border-box;
  
  /* Visual */
  color: var(--text-color);
  background-color: var(--card-skill-bg);
  border: 0.0625rem solid #eceff133;
  border-radius: 0.9375rem;
  
  /* Animation */
  transition: background 0.4s ease, transform 0.3s ease;
  will-change: background;
}


/* ============================================
   CARD COLOR VARIANTS
   HSL-based color system for each card
   ============================================ */

.card:nth-child(1) {
  --hue: var(--accent-hue);
  --saturation: 82.26%;
  --lightness: 51.37%;
}

.card:nth-child(2) {
  --hue: var(--accent-hue);
  --saturation: 95.9%;
  --lightness: 61.76%;
}

.card:nth-child(3) {
  --hue: var(--accent-hue);
  --saturation: 100%;
  --lightness: 48.04%;
}


/* ============================================
   CARD ELEMENTS
   Logo, heading, and content styling
   ============================================ */

.card__logo {
  width: 5rem;
  height: 5rem;
  display: block;
  margin: 0 auto;
  padding-bottom: 0.5rem;
}

.card__heading {
  font-size: 1.3rem;
  font-weight: 700;
  text-align: center;
}

.card__skills {
  display: grid;
  place-items: center;
  grid-template-columns: repeat(1, minmax(17.5rem, 1fr));
  column-gap: 0.1rem;
  font-size: 1.2rem;
  font-weight: 700;
}


/* ============================================
   PROGRESS BAR
   Skill level indicator
   ============================================ */

.card__bar {
  position: relative;
  background: var(--card-skill-bar-bg);
  border-radius: 62.4375rem;
  height: 1.25rem;
  margin: 1rem 0;
  overflow: hidden;
}

.card__bar-fill {
  background: var(--card-skill-bar-fill);
  width: 50%;
  height: 100%;
  border-radius: inherit;
  box-shadow: 
    0 0 0.5rem #eceff133,
    0 0 1.25rem #eceff133;
  transition: width 0.5s ease;
}

.card__exp {
  position: absolute;
  width: 100%;
  top: 0;
  left: 0;
  height: 100%;
  font-size: 0.9rem;
  color: var(--text-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  z-index: 1;
}


/* ============================================
   BULLET LIST
   Checkmark list styling
   ============================================ */

.card__bullets {
  line-height: 1.4;
}

.card__bullets li::before {
  display: inline-block;
  content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512' width='16' title='check' fill='%23dddddd'%3E%3Cpath d='M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z' /%3E%3C/svg%3E");
  transform: translateY(0.25ch);
  margin-right: 1ch;
}


/* ============================================
   CALL-TO-ACTION BUTTON
   Card action button
   ============================================ */

.cta {
  display: block;
  align-self: end;
  margin: 1rem 0 0.5rem 0;
  padding: 0.7rem;
  
  /* Typography */
  text-align: center;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  color: var(--btn-text-color);
  
  /* Visual */
  background-color: var(--btn-bg);
  border-radius: 0.625rem;
  
  /* Animation */
  transition: all 0.3s ease;
}

.cta:hover {
  transform: translateY(-0.125rem);
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.2);
}


/* ============================================
   HOVER OVERLAY EFFECT
   Interactive hover mask
   ============================================ */

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
  opacity: var(--opacity, 0);
  
  /* Match card flexbox layout */
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  justify-content: center;
  padding: 0 1rem;
  
  /* Radial gradient mask */
  -webkit-mask: radial-gradient(
    25rem 25rem at var(--x) var(--y),
    #000 1%,
    transparent 50%
  );
  mask: radial-gradient(
    25rem 25rem at var(--x) var(--y),
    #000 1%,
    transparent 50%
  );
}

.overlay .card {
  position: relative;
  flex: 1 1 14rem;
  background-color: hsla(var(--hsl), 0.15);
  border-color: hsla(var(--hsl), 1);
  box-shadow: 0 0 0 0.0625rem inset hsl(var(--hsl));
}

.overlay .cta {
  display: block;
  grid-row: -1;
  width: 100%;
  background-color: hsl(var(--hsl));
  box-shadow: 0 0 0 0.0625rem hsl(var(--hsl));
}


/* ============================================
   CARD HOVER STATES
   Non-overlay card interactions
   ============================================ */

:not(.overlay) > .card:hover {
  --lightness: 95%;
  background: hsla(var(--hsl), 0.1);
}


/* ============================================
   RESPONSIVE DESIGN
   Mobile: Stack cards vertically with consistent proportions
   ============================================ */

@media (max-width: 64rem) {
  .cards {
    padding: 0 1.5rem;
  }

  .cards__inner {
    flex-direction: column;
    gap: 1.5rem;
    align-items: center; /* Center cards horizontally */
  }

  .card {
    /* Maintain desktop card width for consistent proportions */
    flex: 0 0 auto;
    width: 100%;
    max-width: 24rem; /* Limit width to maintain aspect ratio */
  }

  .overlay {
    flex-direction: column;
    padding: 0 1.5rem;
    gap: 1.5rem;
    align-items: center;
  }

  .overlay .card {
    flex: 0 0 auto;
    width: 100%;
    max-width: 24rem;
  }
}

@media (max-width: 48rem) {
  .cards {
    padding: 0 1.25rem;
  }

  .card {
    max-width: 22rem; /* Slightly smaller on mobile */
    padding: 1.25rem 1.5rem;
  }

  .card__logo {
    width: 4rem;
    height: 4rem;
  }

  .card__heading {
    font-size: 1.1rem;
  }

  .card__skills {
    font-size: 1rem;
    grid-template-columns: 1fr;
  }

  .overlay {
    padding: 0 1.25rem;
  }

  .overlay .card {
    max-width: 22rem;
  }
}

@media (max-width: 36rem) {
  .cards {
    padding: 0 1rem;
  }

  .cards__inner {
    gap: 1rem;
  }

  .card {
    max-width: 20rem; /* Smaller on very small screens */
    padding: 1rem 1.25rem;
  }

  .overlay {
    padding: 0 1rem;
    gap: 1rem;
  }

  .overlay .card {
    max-width: 20rem;
  }
}
