:root {
  --cases-card-height: 512px;
}

.cases-page .cases-catalog {
  padding-bottom: 128px;
}

.cases-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 34px;
}

.catalog-case-card {
  position: relative;
  min-width: 0;
  height: var(--cases-card-height);
  min-height: var(--cases-card-height);
  overflow: hidden;
  color: #f4efe6;
  border: 1px solid rgba(16, 24, 32, 0.13);
  border-radius: 16px;
  background: #0b1418;
  box-shadow: 0 12px 36px rgba(18, 58, 66, 0.07);
  transition:
    border-color 180ms ease,
    box-shadow 220ms ease,
    transform 220ms var(--ease-out);
}

.catalog-case-card:hover {
  border-color: rgba(8, 127, 146, 0.34);
  box-shadow: 0 20px 50px rgba(18, 58, 66, 0.13);
  transform: translateY(-3px);
}

.catalog-case-card--link {
  display: block;
  color: #f4efe6;
  text-decoration: none;
  cursor: pointer;
}

.catalog-case-card--link:visited {
  color: #f4efe6;
}

.catalog-case-card--link:focus-visible {
  outline: 3px solid rgba(8, 127, 146, 0.48);
  outline-offset: 4px;
}

@media (hover: hover) and (pointer: fine) {
  .catalog-case-card--link:hover .participant-case-front {
    opacity: 0;
    transform: translateY(-12px);
  }

  .catalog-case-card--link:hover .participant-case-detail {
    opacity: 1;
    transform: translateY(0);
  }
}

.catalog-case-card.is-entering {
  animation: case-card-enter 340ms var(--ease-out) both;
}

.participant-case-front {
  height: 100%;
  display: grid;
  grid-template-rows: 56% 44%;
  transition:
    opacity 220ms ease,
    transform 220ms ease;
}

.participant-case-photo {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #1c2025;
}

.participant-case-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  border-bottom: 1px solid rgba(244, 239, 230, 0.16);
  pointer-events: none;
}

.participant-case-photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.participant-case-photo--contain img {
  object-fit: contain;
  object-position: center top;
}

.participant-case-photo--contain {
  background: linear-gradient(90deg, #244650 0%, #36585a 56%, #667b70 100%);
}

.participant-case-photo--lawico {
  background: #111822;
}

.participant-case-photo--contain::before {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  height: 46px;
  pointer-events: none;
  background: inherit;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 48%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 48%);
}

.participant-case-photo--materia img {
  object-position: center 46%;
}

.participant-case-photo--cover {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: #071014;
  background:
    radial-gradient(circle at 22% 20%, rgba(8, 127, 146, 0.14), transparent 32%),
    #dfe9e6;
}

.participant-case-cover-mark {
  position: absolute;
  top: 50%;
  right: 20px;
  color: rgba(7, 16, 20, 0.1);
  font-size: 128px;
  font-weight: 850;
  line-height: 0.8;
  transform: translateY(-50%);
}

.participant-case-cover-title {
  position: relative;
  z-index: 1;
  max-width: 270px;
  font-size: 29px;
  font-weight: 820;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.participant-case-summary {
  min-height: 0;
  padding: 18px 21px 20px;
  display: flex;
  flex-direction: column;
}

.participant-case-role,
.participant-case-type {
  margin: 0;
  color: var(--cyan);
  font-size: 10px;
  font-weight: 820;
  line-height: 1.3;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.participant-case-summary h3,
.participant-case-detail h3 {
  margin: 5px 0 0;
  font-size: 25px;
  font-weight: 760;
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.participant-case-project {
  margin: 5px 0 0;
  color: #aebbb7;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.participant-case-result {
  margin: auto 0 0;
  color: #f4efe6;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.42;
}

.participant-case-action,
.participant-case-read {
  width: fit-content;
  margin-top: 10px;
  padding: 0 0 3px;
  border: 0;
  border-bottom: 1px solid currentColor;
  border-radius: 0;
  color: var(--cyan);
  background: transparent;
  font: inherit;
  font-size: 11px;
  font-weight: 820;
  line-height: 1.3;
  cursor: pointer;
  transition:
    color 160ms ease,
    transform 180ms var(--ease-out);
}

.participant-case-action:hover,
.participant-case-read:hover {
  color: #a8f5f7;
}

.participant-case-action:focus-visible,
.participant-case-read:focus-visible {
  outline: 3px solid rgba(37, 217, 231, 0.34);
  outline-offset: 4px;
}

.participant-case-detail {
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 25px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  overflow: hidden;
  color: #101820;
  background:
    radial-gradient(circle at 92% 7%, rgba(8, 127, 146, 0.09), transparent 26%),
    #e9efed;
  pointer-events: none;
  transform: translateY(18px);
  transition:
    opacity 220ms ease,
    transform 220ms ease;
}

.participant-case-detail .participant-case-type {
  color: #087d88;
}

.participant-case-detail h3 {
  margin-top: 17px;
  color: #101820;
  font-size: 28px;
  line-height: 1.1;
}

.participant-case-story {
  margin-top: 22px;
  border-top: 1px solid rgba(16, 24, 32, 0.2);
}

.participant-case-story > div {
  padding: 13px 0;
  border-bottom: 1px solid rgba(16, 24, 32, 0.14);
}

.participant-case-story span {
  color: #087d88;
  font-size: 9px;
  font-weight: 820;
  line-height: 1.3;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.participant-case-story p {
  margin: 5px 0 0;
  color: #52615f;
  font-size: 12px;
  line-height: 1.43;
}

.participant-case-story > div:last-child p {
  color: #101820;
  font-weight: 700;
}

.participant-case-read {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  color: #075f6d;
}

.participant-case-read:hover,
.participant-case-read:focus-visible {
  color: #034a55;
  transform: translateX(2px);
}

.participant-case-action--close {
  margin-top: auto;
  color: #087d88;
}

.participant-case-read + .participant-case-action--close {
  margin-top: 12px;
}

.catalog-case-card.is-open .participant-case-front {
  opacity: 0;
  transform: translateY(-12px);
}

.catalog-case-card.is-open .participant-case-detail {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.cases-empty {
  margin-top: 36px;
  color: #5f6d77;
}

.cases-mentorship {
  position: relative;
  margin-top: 70px;
  padding: clamp(30px, 4vw, 46px);
  overflow: hidden;
  border-radius: 18px;
  color: rgba(255, 255, 255, 0.74);
  background:
    radial-gradient(circle at 87% 35%, rgba(37, 217, 231, 0.14), transparent 25%),
    #07131a;
}

.cases-mentorship::after {
  content: "07";
  position: absolute;
  right: 22px;
  bottom: -45px;
  color: rgba(168, 245, 247, 0.045);
  font-size: 170px;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}

.cases-mentorship > * {
  position: relative;
  z-index: 1;
}

.cases-mentorship > p {
  margin: 0;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.cases-mentorship h2 {
  max-width: 720px;
  margin: 16px 0 0;
  color: #ffffff;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.cases-mentorship > span {
  max-width: 760px;
  display: block;
  margin-top: 16px;
  font-size: 15px;
  line-height: 1.58;
}

.cases-mentorship > a {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 720;
  text-decoration-line: underline;
  text-decoration-color: rgba(37, 217, 231, 0.52);
  text-underline-offset: 5px;
  transition:
    color 160ms ease,
    transform 180ms var(--ease-out);
}

.cases-mentorship > a b {
  color: var(--cyan);
  font-size: 18px;
  font-weight: 500;
}

.cases-mentorship > a:hover,
.cases-mentorship > a:focus-visible {
  color: var(--cyan-soft);
  transform: translateX(3px);
}

@keyframes case-card-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@media (max-width: 760px) {
  :root {
    --cases-card-height: 500px;
  }

  .cases-page .cases-catalog {
    padding-bottom: 92px;
  }

  .cases-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 26px;
  }

  .participant-case-front {
    grid-template-rows: 55% 45%;
  }

  .participant-case-summary {
    padding: 18px 20px 20px;
  }

  .participant-case-detail {
    padding: 22px;
  }

  .cases-mentorship {
    margin-top: 54px;
  }
}

@media (max-width: 360px) {
  .participant-case-detail {
    padding: 18px;
  }

  .participant-case-detail h3 {
    margin-top: 12px;
    font-size: 24px;
  }

  .participant-case-story {
    margin-top: 17px;
  }

  .participant-case-story > div {
    padding: 11px 0;
  }

  .participant-case-story p {
    font-size: 11.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .catalog-case-card,
  .participant-case-front,
  .participant-case-detail,
  .participant-case-action,
  .participant-case-read,
  .cases-mentorship > a {
    animation: none !important;
    transition: none !important;
  }
}
