.portfolio-section {
  position: relative;
  z-index: 3;
  isolation: isolate;
  width: 100%;
  padding: clamp(39px, 3.5vw, 60px) 0 clamp(82px, 8vw, 132px);
  overflow: visible;
  color: var(--ink);
  background: #fff;
  scroll-margin-top: 82px;
}

.portfolio-section::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: radial-gradient(circle 560px at 88% 8%, rgba(7, 88, 248, 0.055), transparent 66%);
  content: "";
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.72), transparent 92%);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.72), transparent 92%);
  pointer-events: none;
}

.portfolio-section::after {
  display: none;
}

.portfolio-shell {
  position: relative;
  z-index: 2;
  display: grid;
  gap: clamp(30px, 3.2vw, 50px);
}

.portfolio-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
}

.portfolio-copy .portfolio-kicker {
  width: auto;
  margin: 0;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #60708b;
  background: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.portfolio-copy h2 {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(44px, 4vw, 64px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
}

.portfolio-copy > p:last-child {
  width: min(760px, 100%);
  margin: 0;
  color: var(--muted);
  font-size: clamp(14px, 1vw, 17px);
  font-weight: 500;
  line-height: 1.6;
  text-wrap: balance;
}

.portfolio-mosaic {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: clamp(20px, 1.8vw, 28px);
  counter-reset: portfolio-card;
}

.portfolio-case {
  --portfolio-accent: #0758f8;
  position: relative;
  display: flex;
  min-width: 0;
  height: 100%;
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;
  padding: 0;
  border: 1px solid rgba(164, 194, 241, 0.58);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(7, 88, 248, 0.08) 0%, transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(245, 249, 255, 0.98) 58%, rgba(239, 246, 255, 0.96) 100%);
  box-shadow:
    0 18px 42px rgba(7, 22, 47, 0.08),
    0 9px 24px rgba(7, 88, 248, 0.055),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  counter-increment: portfolio-card;
  transition:
    border-color 300ms ease,
    box-shadow 300ms ease,
    transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

.portfolio-case[data-case-unpublished] {
  display: none !important;
}

.portfolio-case__target {
  position: absolute;
  z-index: 6;
  inset: 0;
  border-radius: inherit;
  cursor: pointer;
}

.portfolio-case__target:focus-visible {
  outline: 3px solid rgba(7, 88, 248, 0.56);
  outline-offset: -4px;
}

.portfolio-case::after {
  display: none;
}

.portfolio-case:hover {
  border-color: rgba(7, 88, 248, 0.28);
  box-shadow:
    0 24px 54px rgba(7, 22, 47, 0.11),
    0 10px 28px rgba(7, 88, 248, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
  transform: translateY(-4px);
}

.portfolio-case:hover::after {
  opacity: 1;
}

.portfolio-shot {
  position: relative;
  z-index: 1;
  min-height: 250px;
  aspect-ratio: 16 / 10;
  flex: 0 0 auto;
  margin: 0;
  overflow: hidden;
  border: 0;
  border-radius: 17px 17px 0 0;
  background: #eef5ff;
  box-shadow:
    0 16px 30px rgba(7, 22, 47, 0.09),
    0 6px 18px rgba(7, 88, 248, 0.055),
    inset 0 0 0 1px rgba(145, 184, 246, 0.16);
}

.portfolio-shot::after {
  position: absolute;
  z-index: 3;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 68%, rgba(2, 8, 23, 0.12)),
    radial-gradient(circle 260px at 18% 0%, rgba(7, 88, 248, 0.08), transparent 62%);
  content: "";
  opacity: 0.38;
  pointer-events: none;
  transition: opacity 300ms ease;
}

.portfolio-shot img {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transform: scale(1.001);
  transition: transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
}

.portfolio-case:hover .portfolio-shot img {
  transform: scale(1.03);
}

.portfolio-case:hover .portfolio-shot::after {
  opacity: 0.2;
}

.portfolio-case-info {
  position: relative;
  z-index: 1;
  min-height: 158px;
  padding: 22px 20px 24px;
  flex: 1 1 auto;
}

.portfolio-case-info::after {
  display: none;
}

.portfolio-case-info > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(7, 88, 248, 0.18);
  border-radius: 999px;
  color: var(--blue);
  background: rgba(242, 247, 255, 0.96);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portfolio-case-info > span::before {
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px rgba(7, 88, 248, 0.4);
  content: "";
}

.portfolio-case h3 {
  max-width: 470px;
  margin: 13px 0 0;
  color: var(--ink);
  font-family: "Golos Text", "Manrope", Arial, sans-serif;
  font-size: clamp(22px, 1.45vw, 27px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: 0;
}

.portfolio-case p {
  max-width: 430px;
  margin: 9px 0 0;
  color: #4e5d76;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.65;
}

.portfolio-all {
  position: relative;
  display: inline-flex;
  width: auto;
  min-width: 250px;
  min-height: 54px;
  padding: 0 24px;
  justify-self: center;
  align-items: center;
  justify-content: center;
  gap: 14px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  box-shadow:
    0 14px 30px rgba(7, 88, 248, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition:
    transform 300ms ease,
    box-shadow 300ms ease;
}

.portfolio-all svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
  transition: transform 300ms ease;
}

.portfolio-all:hover {
  box-shadow:
    0 20px 40px rgba(7, 88, 248, 0.28),
    0 0 22px rgba(7, 88, 248, 0.1);
  transform: translateY(-2px);
}

.portfolio-all:hover svg {
  transform: translateX(5px);
}

.portfolio-all:focus-visible {
  outline: 4px solid rgba(18, 174, 234, 0.24);
  outline-offset: 4px;
}

@media (max-width: 1180px) {
  .portfolio-mosaic {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .portfolio-section {
    padding: 32px 0 74px;
  }

  .portfolio-shell {
    gap: 26px;
  }

  .portfolio-copy h2 {
    font-size: clamp(40px, 12vw, 56px);
  }

  .portfolio-copy > p:last-child {
    font-size: 13px;
  }

  .portfolio-mosaic {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .portfolio-shot {
    min-height: 220px;
    aspect-ratio: 4 / 3;
  }

  .portfolio-case-info {
    min-height: auto;
    padding: 18px 18px 22px;
  }

  .portfolio-all {
    width: 100%;
    min-height: 54px;
    border-radius: 8px;
    font-size: 14px;
  }
}

