

.portfolio {
  --portfolio-red: #c00000;
  --portfolio-red-light: #ef1b2d;
  --portfolio-black: #050505;
  --portfolio-card: #111113;
  --portfolio-white: #ffffff;
  --portfolio-gray: #a5a5aa;
  --portfolio-border: rgba(255, 255, 255, 0.09);

  position: relative;
  overflow: hidden;
  padding: 120px 5%;
  background:
    radial-gradient(circle at 12% 18%, rgba(192, 0, 0, 0.11), transparent 28%),
    radial-gradient(circle at 88% 82%, rgba(192, 0, 0, 0.07), transparent 26%),
    var(--portfolio-black);
  color: var(--portfolio-white);
}

.portfolio::before {
  width: 520px;
  height: 520px;
  position: absolute;
  top: -260px;
  right: -200px;
  content: "";
  border-radius: 50%;
  background: rgba(192, 0, 0, 0.08);
  filter: blur(110px);
  pointer-events: none;
}

.portfolio::after {
  width: 440px;
  height: 440px;
  position: absolute;
  bottom: -220px;
  left: -180px;
  content: "";
  border-radius: 50%;
  background: rgba(192, 0, 0, 0.06);
  filter: blur(100px);
  pointer-events: none;
}



.portfolio .section-title {
  max-width: 860px;
  position: relative;
  z-index: 2;
  margin: 0 auto 80px;
  text-align: center;
}

.portfolio .section-title span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--portfolio-red-light);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.38em;
  text-transform: uppercase;
}

.portfolio .section-title span::before,
.portfolio .section-title span::after {
  width: 34px;
  height: 1px;
  content: "";
  background: currentColor;
}

.portfolio .section-title h2 {
  margin: 18px 0 0;
  color: var(--portfolio-white);
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(4rem, 9vw, 8rem);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.portfolio .section-title p {
  max-width: 690px;
  margin: 24px auto 0;
  color: var(--portfolio-gray);
  font-size: 15px;
  line-height: 1.85;
}



.gallery {
  width: 100%;
  max-width: 1540px;
  position: relative;
  z-index: 2;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 610px;
  gap: 28px;
}



.gallery-item {
  min-width: 0;
  min-height: 500px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--portfolio-border);
  border-radius: 30px;
  display: block;
  background: var(--portfolio-card);
  color: var(--portfolio-white);
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.35);
  isolation: isolate;
  opacity: 0;
  filter: blur(8px);
  transform: translateY(90px) scale(0.94) rotateX(7deg);
  transform-origin: center bottom;
  transition:
    opacity 0.9s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.9s cubic-bezier(0.22, 0.61, 0.36, 1),
    filter 0.9s ease,
    border-color 0.4s ease,
    box-shadow 0.4s ease;
}

.gallery-item.show {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0) scale(1) rotateX(0);
}

.gallery-item:hover {
  border-color: rgba(239, 27, 45, 0.42);
  box-shadow:
    0 38px 95px rgba(0, 0, 0, 0.5),
    0 20px 60px rgba(192, 0, 0, 0.16);
  transform: translateY(-10px);
}

.gallery-item.show:hover {
  transform: translateY(-10px) scale(1);
}



.gallery-item img {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  display: block;
  object-fit: cover;
  object-position: center;
  transition:
    transform 1s cubic-bezier(0.2, 0.7, 0.2, 1),
    filter 0.6s ease;
}

.gallery-item:hover img {
  transform: scale(1.1);
  filter: brightness(0.62) saturate(0.9);
}



.gallery-item::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.02) 20%,
    rgba(0, 0, 0, 0.15) 48%,
    rgba(0, 0, 0, 0.92) 100%
  );
  transition: background 0.45s ease;
  pointer-events: none;
}

.gallery-item:hover::after {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.05) 12%,
    rgba(0, 0, 0, 0.38) 48%,
    rgba(0, 0, 0, 0.96) 100%
  );
}



.gallery-item::before {
  width: 0;
  height: 4px;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 5;
  content: "";
  background: linear-gradient(
    90deg,
    var(--portfolio-red),
    var(--portfolio-red-light)
  );
  box-shadow: 0 0 22px rgba(239, 27, 45, 0.5);
  transition: width 0.5s ease;
}

.gallery-item:hover::before {
  width: 100%;
}



.gallery-overlay {
  position: absolute;
  right: 32px;
  bottom: 32px;
  left: 32px;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  flex-direction: column;
  color: var(--portfolio-white);
  opacity: 1;
  pointer-events: none;
}

.gallery-category {
  margin-bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--portfolio-red-light);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  opacity: 0.8;
  transform: translateY(12px);
  transition:
    opacity 0.45s ease,
    transform 0.45s ease;
}

.gallery-category::before {
  width: 22px;
  height: 2px;
  content: "";
  background: currentColor;
}

.gallery-overlay h3 {
  margin: 0;
  color: var(--portfolio-white);
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(2.8rem, 4vw, 4.8rem);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  opacity: 0.96;
  transform: translateY(12px);
  transition:
    opacity 0.5s ease,
    transform 0.5s ease;
}

.gallery-overlay p {
  max-width: 390px;
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 13px;
  line-height: 1.75;
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.5s ease,
    transform 0.5s ease;
}

.gallery-link {
  margin-top: 24px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--portfolio-white);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.5s ease,
    transform 0.5s ease;
}

.gallery-link i {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.28);
  color: var(--portfolio-red-light);
  backdrop-filter: blur(10px);
  transition:
    transform 0.3s ease,
    border-color 0.3s ease,
    background 0.3s ease;
}



.gallery-item:hover .gallery-category {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.08s;
}

.gallery-item:hover .gallery-overlay h3 {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.14s;
}

.gallery-item:hover .gallery-overlay p {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.22s;
}

.gallery-item:hover .gallery-link {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.3s;
}

.gallery-item:hover .gallery-link i {
  border-color: var(--portfolio-red-light);
  background: rgba(192, 0, 0, 0.2);
  transform: translateX(5px);
}



.gallery-item.delay-1 {
  transition-delay: 0.1s;
}

.gallery-item.delay-2 {
  transition-delay: 0.2s;
}

.gallery-item.delay-3 {
  transition-delay: 0.3s;
}

.gallery-item.delay-4 {
  transition-delay: 0.4s;
}

.gallery-item.delay-5 {
  transition-delay: 0.5s;
}

.gallery-item.delay-6 {
  transition-delay: 0.6s;
}



.portfolio-styles {
  width: 100%;
  max-width: 1540px;
  position: relative;
  z-index: 2;
  margin: 90px auto 0;
  padding: 48px;
  border: 1px solid var(--portfolio-border);
  border-radius: 32px;
  display: grid;
  grid-template-columns: minmax(280px, 0.7fr) minmax(0, 1.3fr);
  align-items: start;
  gap: 70px;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.055),
    rgba(255, 255, 255, 0.015)
  );
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(18px);
  opacity: 0;
  filter: blur(7px);
  transform: translateY(75px) scale(0.97);
  transition:
    opacity 0.9s ease,
    transform 0.9s ease,
    filter 0.9s ease;
}

.portfolio-styles.show {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0) scale(1);
}

.portfolio-styles__heading span {
  color: var(--portfolio-red-light);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.portfolio-styles__heading h3 {
  max-width: 460px;
  margin: 16px 0 0;
  color: var(--portfolio-white);
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(3rem, 5vw, 5rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.portfolio-styles__links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 36px;
}

.portfolio-styles__links a {
  min-height: 64px;
  padding: 0 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #d0d0d5;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.045em;
  text-decoration: none;
  transition:
    color 0.3s ease,
    padding 0.3s ease,
    border-color 0.3s ease,
    background 0.3s ease;
}

.portfolio-styles__links a i {
  color: var(--portfolio-red-light);
  font-size: 11px;
  transition:
    transform 0.3s ease,
    color 0.3s ease;
}

.portfolio-styles__links a:hover {
  padding-right: 4px;
  padding-left: 16px;
  border-color: rgba(239, 27, 45, 0.4);
  color: var(--portfolio-white);
  background: linear-gradient(90deg, rgba(192, 0, 0, 0.1), transparent);
}

.portfolio-styles__links a:hover i {
  color: var(--portfolio-white);
  transform: translateX(6px);
}



.no-js .gallery-item,
.no-js .portfolio-styles {
  opacity: 1;
  filter: none;
  transform: none;
}



@media (max-width: 1180px) {
  .portfolio {
    padding-right: 4%;
    padding-left: 4%;
  }

  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 570px;
  }

  .portfolio-styles {
    grid-template-columns: 1fr;
    gap: 38px;
  }

  .portfolio-styles__heading h3 {
    max-width: 620px;
  }
}



@media (max-width: 760px) {
  .portfolio {
    padding: 85px 18px;
  }

  .portfolio .section-title {
    margin-bottom: 55px;
  }

  .portfolio .section-title span {
    font-size: 10px;
    letter-spacing: 0.28em;
  }

  .portfolio .section-title span::before,
  .portfolio .section-title span::after {
    width: 22px;
  }

  .portfolio .section-title h2 {
    font-size: clamp(3.8rem, 18vw, 6rem);
  }

  .portfolio .section-title p {
    font-size: 14px;
  }

  .gallery {
    grid-template-columns: 1fr;
    grid-auto-rows: 540px;
    gap: 22px;
  }

  .gallery-item {
    min-height: 540px;
    border-radius: 25px;
    transform: translateY(70px) scale(0.96);
  }

  .gallery-overlay {
    right: 24px;
    bottom: 25px;
    left: 24px;
  }

  .gallery-overlay h3 {
    font-size: 3.4rem;
  }

  .gallery-overlay p {
    max-width: 100%;
    opacity: 1;
    transform: translateY(0);
  }

  .gallery-link {
    opacity: 1;
    transform: translateY(0);
  }

  .gallery-category,
  .gallery-overlay h3 {
    transform: translateY(0);
  }

  .portfolio-styles {
    margin-top: 60px;
    padding: 32px 24px;
    border-radius: 26px;
  }

  .portfolio-styles__links {
    grid-template-columns: 1fr;
  }

  .portfolio-styles__heading h3 {
    font-size: 3.5rem;
  }
}



@media (max-width: 460px) {
  .portfolio {
    padding-right: 14px;
    padding-left: 14px;
  }

  .gallery {
    grid-auto-rows: 460px;
  }

  .gallery-item {
    min-height: 460px;
    border-radius: 22px;
  }

  .gallery-overlay {
    right: 20px;
    bottom: 21px;
    left: 20px;
  }

  .gallery-overlay h3 {
    font-size: 2.8rem;
  }

  .gallery-overlay p {
    font-size: 12px;
    line-height: 1.65;
  }

  .gallery-link {
    margin-top: 18px;
    font-size: 10px;
  }

  .gallery-link i {
    width: 34px;
    height: 34px;
  }

  .portfolio-styles {
    padding: 28px 20px;
  }

  .portfolio-styles__heading h3 {
    font-size: 3rem;
  }

  .portfolio-styles__links a {
    min-height: 58px;
    font-size: 12px;
  }
}



@media (prefers-reduced-motion: reduce) {
  .gallery-item,
  .portfolio-styles,
  .gallery-item img,
  .gallery-overlay h3,
  .gallery-overlay p,
  .gallery-category,
  .gallery-link,
  .gallery-link i {
    transition: none;
  }

  .gallery-item,
  .portfolio-styles {
    opacity: 1;
    filter: none;
    transform: none;
  }
}
