/* Chroma Grid + Magnet + Gradual Blur for subpage cards (articles.html / works.html) */

.cards .card {
  position: relative;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #151715;
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.35s ease,
    box-shadow 0.35s ease;
  will-change: transform;
}
.cards .card::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    circle 260px at var(--mx, 50%) var(--my, 50%),
    rgba(243, 244, 240, 0.085),
    transparent 70%
  );
  transition: opacity 0.35s ease;
}
.cards .card:hover::after,
.cards .card.is-chroma-lit::after {
  opacity: 1;
}
.cards .card:hover,
.cards .card.is-chroma-lit {
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.35);
}
.cards .card h2 {
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (hover: hover) {
  .cards .card img,
  .cards .card video {
    filter: grayscale(100%) contrast(1.04) brightness(0.76);
    transition: filter 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .cards .card:hover img,
  .cards .card:hover video,
  .cards .card:focus-within img,
  .cards .card:focus-within video,
  .cards .card.is-chroma-lit img,
  .cards .card.is-chroma-lit video {
    filter: grayscale(0%) contrast(1) brightness(1);
  }
}

.gradual-blur-bottom {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 60px;
  z-index: 14;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.gradual-blur-bottom.is-hidden {
  opacity: 0;
}
.gradual-blur-bottom i {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.gradual-blur-bottom i:nth-child(1) {
  backdrop-filter: blur(1.5px);
  -webkit-backdrop-filter: blur(1.5px);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 35%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 35%);
}
.gradual-blur-bottom i:nth-child(2) {
  backdrop-filter: blur(3.5px);
  -webkit-backdrop-filter: blur(3.5px);
  mask-image: linear-gradient(to bottom, transparent 35%, #000 72%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 35%, #000 72%);
}
.gradual-blur-bottom i:nth-child(3) {
  backdrop-filter: blur(6.5px);
  -webkit-backdrop-filter: blur(6.5px);
  mask-image: linear-gradient(to bottom, transparent 62%, #000 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 62%, #000 100%);
}

@media (prefers-reduced-motion: reduce) {
  .cards .card,
  .cards .card h2,
  .cards .card img,
  .cards .card video {
    transition: none;
    transform: none !important;
    filter: none !important;
  }
  .cards .card::after,
  .gradual-blur-bottom { display: none; }
}
