/* Cinematic sticky case-study stack. */
.section--work.work-stack-section {
  overflow: visible !important;
  padding: 64px 36px 180px;
  background:
    radial-gradient(circle at 86% 7%, rgba(183, 154, 255, 0.12), transparent 27rem),
    linear-gradient(145deg, rgba(31, 44, 57, 0.48), rgba(10, 19, 28, 0.36));
}

.section-heading--work {
  max-width: 1110px;
  margin-right: auto;
  margin-left: auto;
}

.section-heading--work h2 {
  font-size: clamp(48px, 6vw, 78px);
}

.work-stack__start,
.work-stack__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #e8ecf2;
  font-size: 11px;
  font-weight: 700;
}

.work-stack__start {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(7, 16, 24, 0.38);
  backdrop-filter: blur(14px);
  transition: border-color 0.25s ease, background 0.25s ease;
}

.work-stack__start:hover {
  border-color: rgba(183, 154, 255, 0.55);
  background: rgba(183, 154, 255, 0.1);
}

.work-stack__start svg,
.work-stack__link svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
  transition: transform 0.25s ease;
}

.work-stack__start:hover svg,
.work-stack__link:hover svg {
  transform: translateX(4px);
}

.work-stack {
  position: relative;
  z-index: 2;
  display: grid;
  gap: clamp(70px, 10vh, 110px);
  max-width: 1110px;
  margin: 0 auto;
  padding-bottom: 12vh;
  perspective: 1400px;
}

.work-stack__card {
  --accent: #b79aff;
  --accent-rgb: 183, 154, 255;
  position: sticky;
  top: 104px;
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(360px, 0.86fr);
  min-height: min(720px, calc(100vh - 135px));
  overflow: hidden;
  border: 1px solid rgba(var(--accent-rgb), 0.34);
  border-radius: 38px;
  background: #0b141e;
  box-shadow:
    0 45px 100px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.025) inset,
    0 1px 0 rgba(255, 255, 255, 0.08) inset;
  transform-origin: top center;
  will-change: transform, opacity;
}

.work-stack__card:nth-child(1) {
  z-index: 1;
}

.work-stack__card:nth-child(2) {
  z-index: 2;
  top: 118px;
}

.work-stack__card:nth-child(3) {
  z-index: 3;
  top: 132px;
}

.work-stack__card--blue {
  --accent: #87bfff;
  --accent-rgb: 135, 191, 255;
}

.work-stack__card--mint {
  --accent: #86e8db;
  --accent-rgb: 134, 232, 219;
}

.work-stack__card::before {
  position: absolute;
  z-index: 5;
  top: 0;
  right: 8%;
  left: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.86), transparent);
  content: "";
  pointer-events: none;
}

.work-stack__visual {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: #081018;
}

.work-stack__visual::before {
  position: absolute;
  z-index: 2;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 58%, rgba(11, 20, 30, 0.8) 88%, #0b141e 100%),
    linear-gradient(0deg, rgba(5, 12, 18, 0.56), transparent 42%);
  content: "";
  pointer-events: none;
}

.work-stack__visual::after {
  position: absolute;
  z-index: 2;
  right: 25px;
  bottom: 26px;
  width: 92px;
  height: 92px;
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  border-radius: 50%;
  box-shadow: 0 0 0 18px rgba(var(--accent-rgb), 0.035), 0 0 40px rgba(var(--accent-rgb), 0.13);
  content: "";
  pointer-events: none;
}

.work-stack__visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.72) contrast(1.08);
  transform: scale(1.015);
  transition: transform 1.1s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.55s ease;
}

.work-stack__visual--poster {
  display: grid;
  place-items: center;
  padding: clamp(20px, 3vw, 34px);
  background:
    radial-gradient(circle at 50% 34%, rgba(var(--accent-rgb), .18), transparent 43%),
    linear-gradient(145deg, #101c29, #071019);
}

.work-stack__visual--poster img {
  width: 90%;
  height: 92%;
  object-fit: contain;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 65px rgba(0, 0, 0, .34), 0 0 0 8px rgba(255, 255, 255, .035);
}

.work-stack__card:hover .work-stack__visual img {
  filter: saturate(0.98) contrast(1.06);
  transform: scale(1.065);
}

.work-stack__number {
  position: absolute;
  z-index: 3;
  top: 26px;
  left: 28px;
  color: rgba(255, 255, 255, 0.8);
  font: 500 11px/1 'DM Mono', monospace;
  letter-spacing: 0.12em;
}

.work-stack__number::after {
  display: inline-block;
  width: 46px;
  height: 1px;
  margin: 0 0 3px 12px;
  background: var(--accent);
  content: "";
}

.work-stack__featured {
  position: absolute;
  z-index: 3;
  bottom: 28px;
  left: 28px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(7, 16, 24, 0.58);
  color: #e7ebf1;
  font: 500 8px/1 'DM Mono', monospace;
  letter-spacing: 0.09em;
  backdrop-filter: blur(13px);
}

.work-stack__content {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(38px, 4.2vw, 61px) clamp(31px, 4vw, 55px) 40px;
  background:
    radial-gradient(circle at 85% 14%, rgba(var(--accent-rgb), 0.15), transparent 15rem),
    linear-gradient(145deg, rgba(17, 29, 41, 0.99), rgba(8, 16, 24, 0.99));
}

.work-stack__content::after {
  position: absolute;
  right: -80px;
  bottom: -80px;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(var(--accent-rgb), 0.12);
  border-radius: 50%;
  box-shadow: 0 0 0 25px rgba(var(--accent-rgb), 0.02), 0 0 0 50px rgba(var(--accent-rgb), 0.012);
  content: "";
  pointer-events: none;
}

.work-stack__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--accent);
  font: 500 8px/1.4 'DM Mono', monospace;
  letter-spacing: 0.1em;
}

.work-stack__meta span:last-child {
  color: #72808e;
}

.work-stack__content h3 {
  margin: clamp(39px, 6vh, 62px) 0 20px;
  color: #f2f4f8;
  font-size: clamp(43px, 4.5vw, 65px);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.work-stack__content h3 em {
  color: var(--accent);
  font-style: normal;
  font-weight: 500;
  text-shadow: 0 0 28px rgba(var(--accent-rgb), 0.14);
}

.work-stack__content > p {
  max-width: 410px;
  margin: 0;
  color: #a8b3bf;
  font-size: 12px;
  line-height: 1.75;
}

.work-stack__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 24px;
}

.work-stack__tags span {
  padding: 7px 10px;
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.055);
  color: #b9c3ce;
  font: 8px/1 'DM Mono', monospace;
}

.work-stack__details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: auto 0 25px;
  padding-top: 27px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.work-stack__details div {
  min-width: 0;
}

.work-stack__details dt,
.work-stack__details dd {
  margin: 0;
}

.work-stack__details dt {
  margin-bottom: 7px;
  color: #6f7d8b;
  font: 8px/1 'DM Mono', monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.work-stack__details dd {
  color: #e3e7ed;
  font-size: 11px;
  font-weight: 600;
}

.work-stack__link {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  min-height: 43px;
  padding: 0 17px;
  border: 1px solid rgba(var(--accent-rgb), 0.44);
  border-radius: 999px;
  color: var(--accent);
  transition: color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.work-stack__link:hover {
  background: var(--accent);
  box-shadow: 0 12px 30px rgba(var(--accent-rgb), 0.17);
  color: #0a131d;
}

@media (max-width: 900px) {
  .section--work.work-stack-section {
    overflow: hidden !important;
    padding: 50px 25px 75px;
  }

  .work-stack {
    gap: 22px;
    padding-bottom: 0;
  }

  .work-stack__card,
  .work-stack__card:nth-child(2),
  .work-stack__card:nth-child(3) {
    position: relative;
    top: auto;
    grid-template-columns: 1fr;
    min-height: 0;
    border-radius: 30px;
    filter: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .work-stack__visual {
    height: 390px;
  }

  .work-stack__visual::before {
    background: linear-gradient(0deg, #0b141e 0%, transparent 35%), linear-gradient(90deg, transparent 70%, rgba(11, 20, 30, 0.2));
  }

  .work-stack__content {
    min-height: 490px;
    padding: 40px;
  }

  .work-stack__content h3 {
    margin-top: 40px;
  }
}

@media (max-width: 520px) {
  .section--work.work-stack-section {
    padding: 38px 18px 55px;
  }

  .section-heading--work {
    align-items: flex-start;
    gap: 25px;
  }

  .section-heading--work h2 {
    font-size: clamp(42px, 13vw, 58px);
  }

  .work-stack__card,
  .work-stack__card:nth-child(2),
  .work-stack__card:nth-child(3) {
    border-radius: 25px;
  }

  .work-stack__visual {
    height: 250px;
  }

  .work-stack__number {
    top: 19px;
    left: 19px;
  }

  .work-stack__featured {
    bottom: 18px;
    left: 18px;
  }

  .work-stack__visual::after {
    right: 17px;
    bottom: 18px;
    width: 65px;
    height: 65px;
  }

  .work-stack__content {
    min-height: 500px;
    padding: 28px 23px 25px;
  }

  .work-stack__content h3 {
    margin: 32px 0 17px;
    font-size: clamp(40px, 12vw, 53px);
  }

  .work-stack__content > p {
    font-size: 11px;
  }

  .work-stack__details {
    margin-top: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .work-stack__card,
  .work-stack__visual img,
  .work-stack__start svg,
  .work-stack__link svg {
    transition: none;
  }
}
