/* =========================
   Nine Cards — Full CSS
   ========================= */

/* Base card */
.product-card {
  width: 440px;
  height: 314px;
  position: relative;
  overflow: hidden;
  border: none;
  border-radius: 12px;
  padding: 40px 30px;
  box-sizing: border-box;
  color: #fff;
  isolation: isolate;            /* for bg layers */
  will-change: transform;
  transition: transform .25s ease;
}

/* subtle lift */
.product-card:hover { transform: translateY(-4px); }

/* ---- Background cross-fade (uses CSS vars) ---- */
.product-card::before,
.product-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-size: cover;
  background-position: center;
  transition: opacity .35s ease;
  z-index: 0;
}
.product-card::before { background-image: var(--card-bg);       opacity: 1; }
.product-card::after  { background-image: var(--card-bg-hover); opacity: 0; }
.product-card:hover::after { opacity: 1; }
.product-card:hover::before{ opacity: 0; }

/* Ensure foreground content sits above bg layers */
.product-card .card-icon,
.product-card .card-title,
.product-card .bottom-line,
.product-card .extra-text { z-index: 1; position: relative; }

/* ---- Icon (disappears on hover) ---- */
.product-card .card-icon {
  position: absolute;
  top: 40px;
  left: 30px;
  width: 68px;
  height: 68px;
  border-radius: 6px;
}
.product-card .card-icon::before,
.product-card .card-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  transition: opacity .35s ease, transform .35s ease;
}
.product-card .card-icon::before { background-image: var(--card-icon);        opacity: 1; }
.product-card .card-icon::after  { background-image: var(--card-icon-hover);  opacity: 0; transform: translateY(4px); }

/* On hover: icon disappears entirely */
.product-card:hover .card-icon {
  opacity: 0;
  transform: scale(.95);
  transition: opacity .35s ease, transform .35s ease;
}
.product-card:hover .card-icon::before,
.product-card:hover .card-icon::after {
  opacity: 0;
  transform: translateY(-2px) scale(.95);
}

/* ---- Title (slides up on hover) ---- */
.product-card .card-title {
  position: absolute;
  top: 60%;
  left: 30px;
  transform: translateY(-50%);
  margin: 0;
  font-family: 'Host Grotesk', sans-serif;
  font-weight: 700;
  font-size: 24px;
  line-height: 32px;
  letter-spacing: 0;
  text-shadow: 0 1px 3px rgba(0,0,0,.5);
  transition: top .35s ease;
}
.product-card:hover .card-title { top: 28%; }

/* Title font variants */
.product-card.card-2 .card-title,
.product-card.card-3 .card-title,
.product-card.card-5 .card-title,
.product-card.card-6 .card-title,
.product-card.card-8 .card-title,
.product-card.card-9 .card-title {
  font-family: 'Space Grotesk', sans-serif;
}

/* ---- Underline (slides up) ---- */
.product-card .bottom-line {
  position: absolute;
  left: 30px;
  right: 30px;
  bottom: 40px;
  height: 1px;
  background: linear-gradient(90deg, #D7E128 0%, rgba(255,255,255,0) 100%);
  transition: bottom .35s ease;
}
.product-card:hover .bottom-line { bottom: 185px; }

/* ---- Hidden content (reveals from bottom on hover) ---- */
.product-card .extra-text {
  position: absolute;
  left: 30px;
  right: 30px;
  bottom: 50px;
  margin: 0;
  font-size: 16px;
  line-height: 24px;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .35s ease .05s, transform .35s ease .05s;
}
.product-card:hover .extra-text {
  opacity: 1;
  transform: translateY(0);
}

/* Bullet styling when .extra-text contains a <ul> */
.product-card .extra-text ul {
  list-style: disc;
  margin: 0;
  padding-left: 18px;
}
.product-card .extra-text li {
  margin: 2px 0;
}

/* ---- Touch devices: DO NOT auto-show hidden text ---- */
@media (hover: none) and (pointer: coarse) {
  .product-card .extra-text {      /* keep hidden until press/hover */
    opacity: 0;
    transform: translateY(14px);
  }
  .product-card .card-icon { opacity: 1; transform: none; }
}

/* ---- Respect reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .product-card,
  .product-card::before,
  .product-card::after,
  .product-card .card-icon,
  .product-card .card-icon::before,
  .product-card .card-icon::after,
  .product-card .card-title,
  .product-card .bottom-line,
  .product-card .extra-text {
    transition: none !important;
  }
}

/* =========================================
   MOBILE (≤640px) — fit screen, keep shape
   ========================================= */
@media (max-width: 640px){
  /* Fill viewport width (even inside narrow columns) */
  .product-card{
    width: min(440px, 84vw);
    max-width: 92vw;
    height: auto;
    aspect-ratio: 440 / 314;   /* preserve original proportions */
    padding: 20px 16px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 12px;
  }

  /* Internal spacing/typography scaled for phones */
  .product-card .card-icon{
    top: 16px; left: 16px;
    width: 50px; height: 50px;
  }
  .product-card .card-title{
    left: 16px;
    font-size: 18px; line-height: 26px;
    word-break: break-word; hyphens: auto;
  }

  /* Use percentages of the original 314px height,
     so the hover/reveal lands correctly when scaled */
  .product-card .bottom-line{
    left: 16px; right: 16px;
    bottom: 12.74%;           /* 40 / 314 */
  }
  .product-card:hover .bottom-line{ bottom: 58.92%; } /* 185 / 314 */

  .product-card .extra-text{
    left: 16px; right: 16px;
    bottom: 15.92%;           /* 50 / 314 */
    font-size: 14px; line-height: 22px;
    max-height: 46%;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Optional: show content while pressing on touch */
@media (hover: none) and (pointer: coarse){
  .product-card:active .extra-text{ opacity:1; transform:none; }
  .product-card:active .bottom-line{ bottom:58.92%; }
}