/* ==========================================================================
   Home: "Projects We've Delivered" — published case studies, filterable by kind.
   Markup is written by js/projects-showcase.js. Class names avoid the "-card" suffix,
   which luxury.js would otherwise pick up and animate.
   Shared type sizes and section spacing come from css/home-scale.css.
   ========================================================================== */

.pdl-section {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 88px 0 96px;
  background: linear-gradient(180deg, #F8FAFD 0%, #F1F6FD 100%);
  font-family: var(--font-sans);
}

.pdl-wave {
  position: absolute;
  z-index: -1;
  pointer-events: none;
  border-radius: 50%;
}

.pdl-wave--left {
  top: -180px;
  left: -220px;
  width: 560px;
  height: 460px;
  background: radial-gradient(closest-side, rgba(191, 219, 254, 0.75), rgba(191, 219, 254, 0));
}

.pdl-wave--right {
  right: -200px;
  bottom: -200px;
  width: 560px;
  height: 480px;
  background: radial-gradient(closest-side, rgba(147, 197, 253, 0.55), rgba(147, 197, 253, 0));
}

/* ---- Heading ---- */
.pdl-header {
  max-width: 820px;
  margin: 0 auto 32px;
  text-align: center;
}

.pdl-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 22px;
  border: 1px solid #BFDBFE;
  border-radius: 999px;
  background: #E8F1FD;
  color: #1D4ED8;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pdl-pill svg {
  width: 18px;
  height: 18px;
}

.pdl-heading {
  margin: 18px 0 0;
  font-family: var(--font-display);
  font-size: clamp(34px, 4.4vw, 60px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: #071827;
  text-wrap: balance;
}

.pdl-accent {
  position: relative;
  display: inline-block;
  padding-bottom: 6px;
  color: #1D4ED8;
}

.pdl-swoosh {
  position: absolute;
  left: 2%;
  bottom: -8px;
  width: 100%;
  height: 16px;
}

.pdl-sub {
  max-width: 720px;
  margin: 20px auto 0;
  font-size: 18px;
  line-height: 1.6;
  color: #334155;
  text-wrap: pretty;
}

/* ---- Filter tabs ---- */
.pdl-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 0 auto 40px;
}

.pdl-tabs[hidden] {
  display: none;
}

.pdl-tab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 24px;
  border: 1px solid #E2E8F0;
  border-radius: 999px;
  background: #FFFFFF;
  color: #0B2239;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 16px -12px rgba(11, 34, 57, 0.35);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.pdl-tab svg {
  width: 20px;
  height: 20px;
  color: #1D4ED8;
}

.pdl-tab:hover {
  border-color: #93C5FD;
}

.pdl-tab[aria-pressed="true"] {
  border-color: #1D4ED8;
  background: #1D4ED8;
  color: #FFFFFF;
  box-shadow: 0 12px 24px -12px rgba(29, 78, 216, 0.65);
}

.pdl-tab[aria-pressed="true"] svg {
  color: #FFFFFF;
}

.pdl-tab:focus-visible {
  outline: 3px solid #2563EB;
  outline-offset: 3px;
}

.pdl-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---- Grid ---- */
.pdl-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pdl-grid.pdl-enter > .pdl-item {
  animation: pdl-in 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.pdl-grid.pdl-enter > .pdl-item:nth-child(2) { animation-delay: 40ms; }
.pdl-grid.pdl-enter > .pdl-item:nth-child(3) { animation-delay: 80ms; }
.pdl-grid.pdl-enter > .pdl-item:nth-child(4) { animation-delay: 120ms; }
.pdl-grid.pdl-enter > .pdl-item:nth-child(5) { animation-delay: 160ms; }
.pdl-grid.pdl-enter > .pdl-item:nth-child(6) { animation-delay: 200ms; }

@keyframes pdl-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---- Card ---- */
.pdl-item {
  --tone: #2563EB;
  --tone-soft: #E6F0FF;
  --tone-arc: #60A5FA;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  min-height: 268px;
  padding: 28px;
  border: 1px solid #E3EBF6;
  border-color: color-mix(in srgb, var(--tone) 18%, #FFFFFF);
  border-radius: 26px;
  background: linear-gradient(112deg, #FFFFFF 0%, #FFFFFF 40%, var(--tone-soft) 100%);
  box-shadow: 0 20px 44px -30px rgba(11, 34, 57, 0.45);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pdl-item[data-tone="violet"] { --tone: #7C3AED; --tone-soft: #F1EBFF; --tone-arc: #A78BFA; }
.pdl-item[data-tone="green"] { --tone: #15803D; --tone-soft: #E6F7EC; --tone-arc: #4ADE80; }
.pdl-item[data-tone="orange"] { --tone: #EA580C; --tone-soft: #FFEEE3; --tone-arc: #FB923C; }
.pdl-item[data-tone="sky"] { --tone: #0369A1; --tone-soft: #E3F2FB; --tone-arc: #38BDF8; }
.pdl-item[data-tone="pink"] { --tone: #DB2777; --tone-soft: #FDEAF3; --tone-arc: #F472B6; }

/* the large soft arc in the corner */
.pdl-item::before {
  content: "";
  position: absolute;
  z-index: -1;
  right: -24%;
  bottom: -42%;
  width: 80%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: linear-gradient(205deg, transparent 28%, var(--tone-arc) 100%);
  opacity: 0.55;
}

.pdl-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 52px -30px rgba(11, 34, 57, 0.55);
}

.pdl-text {
  display: flex;
  flex-direction: column;
  width: 54%;
}

.pdl-cat {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
}

.pdl-cat-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(140deg, var(--tone-arc), var(--tone));
  color: #FFFFFF;
  box-shadow: 0 8px 16px -8px var(--tone);
}

.pdl-cat-icon svg {
  width: 20px;
  height: 20px;
}

.pdl-cat-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdl-title {
  display: -webkit-box;
  margin: 16px 0 0;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -0.015em;
  color: #071827;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.pdl-desc {
  display: -webkit-box;
  margin: 10px 0 0;
  overflow: hidden;
  font-size: 14.5px;
  line-height: 1.5;
  color: #475569;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.pdl-link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 10px;
  margin-top: auto;
  padding-top: 18px;
  color: #1E3A8A;
  font-size: 15px;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}

/* the whole card opens the case study */
.pdl-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
}

.pdl-link:focus-visible {
  outline: none;
}

.pdl-link:focus-visible::after {
  outline: 3px solid #2563EB;
  outline-offset: -3px;
}

.pdl-link-arrow {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--tone);
  color: #FFFFFF;
  transition: transform 0.25s ease;
}

.pdl-link-arrow svg {
  width: 16px;
  height: 16px;
}

.pdl-item:hover .pdl-link-arrow {
  transform: translateX(3px);
}

/* ---- Device picture ---- */
.pdl-media {
  position: absolute;
  z-index: 1;
  right: 3%;
  bottom: 22px;
  width: 47%;
  pointer-events: none;
}

.pdl-laptop {
  display: block;
  transform: perspective(1000px) rotateY(-16deg) rotateX(3deg);
  transform-origin: 100% 100%;
  transition: transform 0.4s ease;
}

.pdl-item:hover .pdl-laptop {
  transform: perspective(1000px) rotateY(-10deg) rotateX(2deg) translateY(-4px);
}

.pdl-lid {
  display: block;
  aspect-ratio: 16 / 10.4;
  padding: 4%;
  border-radius: 12px 12px 4px 4px;
  background: linear-gradient(180deg, #1F2937, #0B1220);
  box-shadow: 0 0 0 1px #374151, 0 26px 40px -20px rgba(11, 34, 57, 0.6);
}

.pdl-base {
  position: relative;
  display: block;
  height: 9px;
  margin: 0 -9%;
  border-radius: 0 0 16px 16px;
  background: linear-gradient(180deg, #E5E7EB 0%, #9CA3AF 100%);
  box-shadow: 0 14px 22px -10px rgba(11, 34, 57, 0.5);
}

.pdl-base::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 16%;
  height: 4px;
  border-radius: 0 0 6px 6px;
  background: #9CA3AF;
  transform: translateX(-50%);
}

.pdl-screen {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 3px;
  background: #0F172A;
}

.pdl-screen img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.pdl-phones {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-right: 6%;
}

.pdl-phone {
  display: block;
  width: 44%;
  aspect-ratio: 9 / 19;
  padding: 4%;
  border-radius: 22px;
  background: #111827;
  box-shadow: 0 0 0 1px #374151, 0 24px 34px -18px rgba(11, 34, 57, 0.6);
  transform: rotate(-6deg);
}

.pdl-phone + .pdl-phone {
  margin-left: -6%;
  transform: rotate(8deg) translateY(-10%);
}

.pdl-phone .pdl-screen {
  border-radius: 16px;
}

/* No picture: a drawn dashboard in the card's colour */
.pdl-ui {
  display: none;
}

.pdl-blank {
  background: linear-gradient(160deg, #FFFFFF, var(--tone-soft));
}

.pdl-blank .pdl-ui {
  --bar: color-mix(in srgb, var(--tone) 60%, #FFFFFF);
  position: absolute;
  inset: 9%;
  display: grid;
  grid-template-columns: 20% 1fr;
  grid-template-rows: 14% 26% 1fr;
  gap: 6%;
}

.pdl-ui i {
  border-radius: 4px;
  background: color-mix(in srgb, var(--tone) 20%, #FFFFFF);
}

.pdl-ui i:nth-child(1) {
  grid-row: 1 / 4;
}

.pdl-ui i:nth-child(3) {
  background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--tone) 32%, #FFFFFF) 0 30%, transparent 30% 35%);
}

.pdl-ui i:nth-child(4) {
  background:
    linear-gradient(var(--bar), var(--bar)) 6% 100% / 9% 40% no-repeat,
    linear-gradient(var(--bar), var(--bar)) 22% 100% / 9% 65% no-repeat,
    linear-gradient(var(--bar), var(--bar)) 38% 100% / 9% 50% no-repeat,
    linear-gradient(var(--bar), var(--bar)) 54% 100% / 9% 85% no-repeat,
    linear-gradient(var(--bar), var(--bar)) 70% 100% / 9% 60% no-repeat,
    linear-gradient(var(--bar), var(--bar)) 86% 100% / 9% 95% no-repeat,
    color-mix(in srgb, var(--tone) 8%, #FFFFFF);
}

.pdl-phone .pdl-blank .pdl-ui {
  grid-template-columns: 1fr;
  grid-template-rows: 10% 22% 1fr;
}

.pdl-phone .pdl-ui i:nth-child(1) {
  display: none;
}

/* ---- Explore all ---- */
.pdl-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-top: 52px;
}

.pdl-more::before,
.pdl-more::after {
  content: "";
  width: 110px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, #3B82F6);
}

.pdl-more::after {
  background: linear-gradient(270deg, transparent, #3B82F6);
}

.pdl-explore {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 36px;
  border-radius: 999px;
  background: linear-gradient(135deg, #1D4ED8 0%, #0B2B6B 100%);
  color: #FFFFFF;
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: 0 18px 30px -16px rgba(29, 78, 216, 0.75);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pdl-explore svg {
  width: 20px;
  height: 20px;
  transition: transform 0.2s ease;
}

.pdl-explore:hover {
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 24px 36px -16px rgba(29, 78, 216, 0.8);
}

.pdl-explore:hover svg {
  transform: translateX(3px);
}

.pdl-explore:focus-visible {
  outline: 3px solid #2563EB;
  outline-offset: 3px;
}

/* ---- Responsive ---- */
@media (max-width: 1439px) {
  .pdl-text {
    width: 56%;
  }

  .pdl-media {
    right: 4%;
    width: 42%;
  }

  .pdl-title {
    font-size: 20px;
  }
}

@media (max-width: 1199px) {
  .pdl-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 859px) {
  .pdl-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .pdl-title {
    font-size: 22px;
  }
}

@media (max-width: 760px) {
  .pdl-section {
    padding: 72px 0 72px;
  }

  .pdl-sub {
    font-size: 16px;
  }

  .pdl-tabs {
    gap: 8px;
    margin-bottom: 28px;
  }

  .pdl-tab {
    height: 42px;
    padding: 0 16px;
    font-size: 14.5px;
  }

  .pdl-tab svg {
    width: 17px;
    height: 17px;
  }

  .pdl-more::before,
  .pdl-more::after {
    width: 40px;
  }
}

/* phones: picture below the text */
@media (max-width: 559px) {
  .pdl-item {
    flex-direction: column;
    min-height: 0;
    padding: 22px 20px 0;
  }

  .pdl-text {
    width: 100%;
  }

  .pdl-title {
    font-size: 20px;
  }

  .pdl-media {
    position: relative;
    right: auto;
    bottom: auto;
    width: 82%;
    margin: 22px 2% 20px auto;
  }

  .pdl-explore {
    padding: 0 28px;
    font-size: 16px;
  }

  .pdl-more::before,
  .pdl-more::after {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pdl-grid.pdl-enter > .pdl-item {
    animation: none;
  }

  .pdl-item,
  .pdl-laptop,
  .pdl-link-arrow,
  .pdl-explore,
  .pdl-explore svg {
    transition: none;
  }

  .pdl-item:hover,
  .pdl-item:hover .pdl-laptop {
    transform: none;
  }
}
