.agency-projects {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(72px, 8vw, 108px) 0;
  color: #f5f1ff;
  background:
    radial-gradient(circle at 14% 10%, rgba(129, 74, 255, 0.25), transparent 31rem),
    radial-gradient(circle at 88% 74%, rgba(88, 42, 166, 0.22), transparent 34rem),
    #090711;
}

.agency-projects::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: 0.12;
  background-image: linear-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

.agency-projects__container {
  position: relative;
}

.agency-projects__head {
  max-width: 850px;
  margin-bottom: clamp(38px, 6vw, 72px);
}

.agency-projects__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 20px;
  color: #bca4ff;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.agency-projects__eyebrow::before {
  content: "";
  width: 30px;
  height: 1px;
  background: currentColor;
}

.agency-projects__head h2 {
  max-width: 800px;
  color: #fff;
  font-size: clamp(2.35rem, 5.2vw, 4.7rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.agency-projects__head h2 span {
  color: #a982ff;
}

.agency-projects__head p {
  max-width: 680px;
  margin-top: 24px;
  color: #aaa3b9;
  font-size: clamp(1rem, 1.5vw, 1.15rem);
}

.agency-projects__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px;
}

.agency-project {
  grid-column: span 5;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(204, 181, 255, 0.16);
  border-radius: 24px;
  background: rgba(22, 17, 34, 0.92);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.22);
  transition: transform 300ms ease, border-color 300ms ease, box-shadow 300ms ease;
}

.agency-project:first-child,
.agency-project:last-child {
  grid-column: span 7;
}

.agency-project:hover {
  transform: translateY(-8px);
  border-color: rgba(179, 142, 255, 0.45);
  box-shadow: 0 34px 85px rgba(0, 0, 0, 0.42), 0 0 38px rgba(118, 67, 232, 0.1);
}

.agency-project__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #211831;
}

.agency-project__media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(145deg, rgba(70, 23, 146, 0.48), rgba(17, 8, 32, 0.08) 48%, rgba(11, 7, 17, 0.72));
}

.agency-project__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 650ms cubic-bezier(0.2, 0.7, 0.2, 1), filter 300ms ease;
}

.agency-project:hover .agency-project__media img {
  transform: scale(1.065);
  filter: saturate(1.08);
}

.agency-project__badges {
  position: absolute;
  z-index: 1;
  inset: 20px 20px auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.agency-project__demo,
.agency-project__category {
  display: inline-flex;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.045em;
  backdrop-filter: blur(12px);
}

.agency-project__demo {
  color: #fff;
  background: rgba(108, 57, 216, 0.86);
  text-transform: uppercase;
}

.agency-project__category {
  color: #e7ddff;
  background: rgba(10, 7, 16, 0.7);
  text-align: right;
}

.agency-project__body {
  display: flex;
  flex-direction: column;
  min-height: 295px;
  padding: clamp(24px, 3vw, 34px);
}

.agency-project__body h3 {
  max-width: 720px;
  color: #fff;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  line-height: 1.12;
}

.agency-project__problem {
  margin-top: 20px;
}

.agency-project__problem > span {
  display: block;
  margin-bottom: 7px;
  color: #a982ff;
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.agency-project__problem p {
  color: #b6afc3;
  font-size: 0.94rem;
  line-height: 1.65;
}

.agency-project__modules {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 25px;
}

.agency-project__modules li {
  padding: 7px 10px;
  border: 1px solid rgba(184, 152, 255, 0.18);
  border-radius: 8px;
  color: #d6c9ef;
  background: rgba(122, 75, 224, 0.08);
  font-size: 0.75rem;
  font-weight: 700;
}
.agency-project__detail { display: inline-flex; align-items: center; gap: 8px; width: max-content; margin-top: 22px; color: #c6a8ff; font-size: 12px; font-weight: 800; text-decoration: none; transition: gap .2s ease, color .2s ease; }
.agency-project__detail:hover { gap: 12px; color: #fff; }

.agency-projects__asset-guide {
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: 820px;
  margin: 34px auto 0;
  padding: 20px 22px;
  border: 1px dashed rgba(187, 157, 255, 0.28);
  border-radius: 16px;
  color: #aca5ba;
  background: rgba(153, 106, 255, 0.05);
}

.agency-projects__guide-icon {
  flex: 0 0 auto;
  padding: 8px 9px;
  border-radius: 7px;
  color: #d7c6ff;
  background: #392363;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.agency-projects__asset-guide strong {
  display: block;
  margin-bottom: 3px;
  color: #ede7fa;
  font-size: 0.88rem;
}

.agency-projects__asset-guide p {
  font-size: 0.82rem;
  line-height: 1.55;
}

.agency-projects__asset-guide code {
  color: #cdbaff;
}

.agency-projects__cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin-top: clamp(52px, 7vw, 86px);
  padding-top: 34px;
  border-top: 1px solid rgba(255, 255, 255, 0.11);
}

.agency-projects__cta p {
  max-width: 520px;
  color: #fff;
  font-family: var(--font-display, sans-serif);
  font-size: clamp(1.3rem, 2.5vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
}

.agency-projects__cta button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex: 0 0 auto;
  padding: 16px 22px;
  border: 1px solid #a77cff;
  border-radius: 12px;
  color: #fff;
  background: #7041d8;
  box-shadow: 0 15px 38px rgba(94, 48, 194, 0.34);
  font-weight: 800;
  transition: transform 200ms ease, background 200ms ease, box-shadow 200ms ease;
}

.agency-projects__cta button:hover {
  transform: translateY(-3px);
  background: #8251e9;
  box-shadow: 0 20px 44px rgba(94, 48, 194, 0.46);
}

.agency-projects__cta button:focus-visible {
  outline: 3px solid rgba(200, 178, 255, 0.75);
  outline-offset: 4px;
}

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

  .agency-project,
  .agency-project:first-child,
  .agency-project:last-child {
    grid-column: auto;
  }

  .agency-project__badges {
    align-items: flex-start;
    flex-direction: column;
  }

  .agency-project__body {
    min-height: 330px;
  }
}

@media (max-width: 620px) {
  .agency-projects__grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .agency-project {
    border-radius: 18px;
  }

  .agency-project__body {
    min-height: 0;
  }

  .agency-project__modules {
    margin-top: 0;
  }

  .agency-projects__asset-guide,
  .agency-projects__cta {
    align-items: flex-start;
    flex-direction: column;
  }

  .agency-projects__cta button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .agency-project,
  .agency-project__media img,
  .agency-projects__cta button {
    transition: none;
  }
}
