/**
 * Copyright (c) 2026 KDTech
 * Author: david@KDTech
 * All rights reserved.
 *
 * KDTechGroup website — portfolio (stacked product cards)
 *
 * Each product is a large sticky card. As you scroll, the next card slides up
 * over the previous one, which shrinks and dims (fx.js sets --scale/--dim).
 * Each card's accent comes from its product's colours (--p-grad, --p-1).
 * The animated product visuals inside the cards are in product-visuals.css.
 */

.stack {
  display: grid;
  gap: 32px;
  padding-block-end: 8vh;
}

.stack-card {
  --x: 50%;
  --y: 50%;
  position: sticky;
  top: calc(var(--nav-h) + 20px + var(--n, 0) * 14px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(24px, 4vw, 56px);
  min-height: min(580px, 78vh);
  padding: clamp(24px, 3.4vw, 48px);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 32px;
  background:
    radial-gradient(700px circle at var(--x) var(--y), rgb(255 255 255 / 0.04), transparent 40%),
    linear-gradient(180deg, var(--ink-3), var(--ink-2));
  box-shadow:
    0 -20px 60px -30px rgb(0 0 0 / 0.9),
    var(--highlight);
  transform: scale(var(--scale, 1));
  transform-origin: 50% 0;
  will-change: transform;
}

/* Product-coloured wash in the corner. */
.stack-card::before {
  content: "";
  position: absolute;
  inset-block-start: -30%;
  inset-inline-end: -20%;
  z-index: 0;
  width: 70%;
  height: 90%;
  border-radius: 50%;
  background: var(--p-grad);
  filter: blur(120px);
  opacity: 0.22;
  pointer-events: none;
}

/* Dim layer as the card gets covered. */
.stack-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  border-radius: inherit;
  background: rgb(5 5 8 / var(--dim, 0));
  pointer-events: none;
}

.stack-card > * {
  position: relative;
  z-index: 1;
}

.p-info {
  display: flex;
  flex-direction: column;
}

.p-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-block-end: 22px;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.p-index {
  color: var(--text-2);
}

.stage {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text-1);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.stage::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--stage-c, var(--text-3));
  box-shadow: 0 0 10px var(--stage-c, transparent);
}

.stage[data-stage="live"] {
  --stage-c: var(--ok);
}

.stage[data-stage="early"] {
  --stage-c: var(--cyan);
}

.stage[data-stage="building"] {
  --stage-c: var(--violet);
}

.stage[data-stage="soon"] {
  --stage-c: var(--pink);
}

.stage[data-stage="exploring"] {
  --stage-c: var(--amber);
}

.p-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(38px, 5vw, 68px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
  background: var(--p-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.p-tagline {
  margin: 14px 0 0;
  font-size: clamp(19px, 1.8vw, 24px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.p-desc {
  margin: 14px 0 0;
  color: var(--text-2);
  font-size: 16px;
  line-height: 1.6;
}

.p-points {
  display: grid;
  gap: 10px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  color: var(--text-2);
  font-size: 15px;
}

.p-points li {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
}

.p-points li::before {
  content: "";
  width: 14px;
  height: 14px;
  margin-block-start: 4px;
  border-radius: 4px;
  background: var(--p-grad);
}

.p-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-block-start: auto;
  padding-block-start: 28px;
}

.platform {
  padding: 5px 10px;
  border-radius: 8px;
  background: rgb(255 255 255 / 0.05);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 500;
}

.p-foot .btn {
  margin-inline-start: auto;
}

/* Visual panel. */
.p-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 320px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(ellipse at 50% 0%, rgb(255 255 255 / 0.05), transparent 60%),
    var(--ink-1);
}

@media (max-width: 900px) {
  .stack-card {
    position: relative;
    top: 0;
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    transform: none;
  }

  .stack-card::after {
    display: none;
  }

  .p-visual {
    min-height: 280px;
  }
}
