.portfolio-page {
  position: relative;
  overflow: hidden;
  background: #13171b;
}

.portfolio-page::before {
  position: absolute;
  top: 100px;
  right: -260px;
  width: 800px;
  height: 800px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(83, 143, 176, 0.075), transparent 68%);
  pointer-events: none;
  content: "";
}

.portfolio-shell {
  position: relative;
  width: min(100% - 48px, 1160px);
  margin: 0 auto;
  padding: 86px 0 115px;
}

.portfolio-intro {
  margin-bottom: 120px;
  animation: portfolio-reveal 700ms ease both;
}

.portfolio-kicker {
  margin: 0 0 22px;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.portfolio-kicker span {
  margin: 0 9px;
  color: #697d88;
}

.portfolio-intro h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(4rem, 10vw, 8rem);
  font-weight: 400;
  letter-spacing: -0.06em;
  line-height: 1.02;
}

.portfolio-intro h1 span {
  color: var(--accent);
}

.portfolio-intro > p:last-child {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.14rem);
  line-height: 1.6;
}

.portfolio-section {
  padding-top: 32px;
  border-top: 1px solid rgba(128, 201, 237, 0.28);
}

.portfolio-section__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.portfolio-section__heading h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 3.7vw, 3.2rem);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.portfolio-section__heading p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.5;
}

.portfolio-carousel-controls {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
}

.portfolio-carousel-control {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(128, 201, 237, 0.4);
  border-radius: 50%;
  color: var(--accent);
  background: #1b2227;
  font: inherit;
  font-size: 1.45rem;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.portfolio-carousel-control:hover:not(:disabled),
.portfolio-carousel-control:focus-visible {
  border-color: var(--accent);
  color: #10171b;
  background: var(--accent);
}

.portfolio-carousel-control:disabled {
  opacity: 0.35;
  cursor: default;
}

.portfolio-categories {
  display: flex;
  gap: 18px;
  margin-top: 42px;
  padding: 0 0 18px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-color: rgba(128, 201, 237, 0.55) #253039;
  scrollbar-width: thin;
}

.portfolio-categories::-webkit-scrollbar {
  height: 6px;
}

.portfolio-categories::-webkit-scrollbar-track {
  background: #253039;
}

.portfolio-categories::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(128, 201, 237, 0.55);
}

.portfolio-category {
  flex: 0 0 clamp(280px, 32vw, 360px);
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(128, 201, 237, 0.19);
  border-radius: 8px;
  background: #1b2227;
  scroll-snap-align: start;
  transition: border-color 220ms ease, transform 220ms ease, box-shadow 220ms ease;
}

.portfolio-category:hover,
.portfolio-category:focus-within {
  border-color: rgba(128, 201, 237, 0.55);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
  transform: translateY(-4px);
}

.portfolio-category__link {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.portfolio-category__link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -3px;
}

.portfolio-category__visual {
  position: relative;
  height: clamp(240px, 25vw, 330px);
  overflow: hidden;
  border-bottom: 1px solid rgba(128, 201, 237, 0.13);
  background: radial-gradient(circle at 68% 24%, rgba(128, 201, 237, 0.12), transparent 42%), #151c21;
}

.portfolio-category:nth-child(2) .portfolio-category__visual {
  background: radial-gradient(circle at 28% 65%, rgba(128, 201, 237, 0.1), transparent 47%), #151b20;
}

.portfolio-category:nth-child(3) .portfolio-category__visual {
  background: radial-gradient(circle at 75% 70%, rgba(128, 201, 237, 0.09), transparent 45%), #141a1f;
}

.portfolio-category__visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.portfolio-category__placeholder {
  position: absolute;
  inset: 17px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 17px;
  border: 1px solid rgba(128, 201, 237, 0.16);
  color: #86a7b8;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-align: center;
  text-transform: uppercase;
}

.portfolio-category__focus {
  position: relative;
  width: 56px;
  height: 56px;
  border: 1px solid rgba(128, 201, 237, 0.38);
  border-radius: 50%;
}

.portfolio-category__focus::before,
.portfolio-category__focus::after {
  position: absolute;
  top: 50%;
  left: 50%;
  background: var(--accent);
  content: "";
  transform: translate(-50%, -50%);
}

.portfolio-category__focus::before {
  width: 19px;
  height: 1px;
}

.portfolio-category__focus::after {
  width: 1px;
  height: 19px;
}

.portfolio-category__content {
  padding: 24px 25px 25px;
}

.portfolio-category__content h3 {
  margin: 0 0 26px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 3vw, 2.75rem);
  font-weight: 400;
  letter-spacing: -0.03em;
}

.portfolio-category__button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  width: 100%;
  min-height: 57px;
  padding: 14px 20px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: #0d1920;
  background: var(--accent);
  font: inherit;
  font-size: 0.87rem;
  font-weight: 700;
  text-align: left;
  opacity: 1;
  cursor: pointer;
}

.portfolio-category__button span {
  font-size: 1.2rem;
  font-weight: 400;
}

.portfolio-photos {
  columns: 3 240px;
  column-gap: 18px;
  margin-top: 42px;
}

.portfolio-photo {
  position: relative;
  display: block;
  margin: 0 0 18px;
  overflow: hidden;
  break-inside: avoid;
  border: 1px solid rgba(128, 201, 237, 0.17);
  border-radius: 7px;
  background: #192127;
}

.portfolio-photo--portrait {
  aspect-ratio: 4 / 5;
}

.portfolio-photo--landscape {
  aspect-ratio: 3 / 2;
}

.portfolio-photo--square {
  aspect-ratio: 1;
}

.portfolio-photo--filled img {
  display: block;
  width: 100%;
  height: auto;
}

.portfolio-photo__placeholder {
  position: absolute;
  inset: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(128, 201, 237, 0.12);
  color: #7892a0;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.portfolio-photo:nth-child(3n + 2) {
  background: #172026;
}

.portfolio-photo:nth-child(3n) {
  background: #1b242a;
}

.portfolio-photo__cross {
  color: rgba(128, 201, 237, 0.48);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.2rem;
  font-weight: 400;
  line-height: 1;
}

.portfolio-category-page .portfolio-intro {
  margin-bottom: 52px;
}

.portfolio-kicker a,
.portfolio-kicker a:visited {
  color: var(--accent);
  text-decoration: none;
}

.portfolio-kicker a:hover,
.portfolio-kicker a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.portfolio-category-gallery {
  padding-top: 0;
  border: 0;
}

.portfolio-category-gallery .portfolio-photos {
  margin-top: 0;
}

.portfolio-category-gallery .portfolio-photo img {
  transition: filter 200ms ease;
}

.portfolio-category-gallery .portfolio-photo:hover img {
  filter: brightness(1.05);
}

@keyframes portfolio-reveal {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 760px) {
  .portfolio-shell {
    width: min(100% - 42px, 540px);
    padding: 124px 0 75px;
  }

  .portfolio-intro {
    margin-bottom: 78px;
  }

  .portfolio-category-page .portfolio-intro {
    margin-bottom: 38px;
  }

  .portfolio-intro h1 {
    font-size: clamp(3.5rem, 13vw, 6rem);
  }

  .portfolio-section {
    padding-top: 30px;
  }

  .portfolio-section__heading {
    gap: 16px;
  }

  .portfolio-categories {
    gap: 15px;
    margin-top: 32px;
  }

  .portfolio-category {
    flex-basis: min(84vw, 340px);
  }

  .portfolio-carousel-control {
    width: 42px;
    height: 42px;
  }

  .portfolio-category__visual {
    height: clamp(220px, 58vw, 310px);
  }

  .portfolio-photos {
    columns: 2 120px;
    column-gap: 10px;
    margin-top: 32px;
  }

  .portfolio-photo {
    margin-bottom: 10px;
  }

  .portfolio-photo__placeholder {
    inset: 7px;
  }
}

@media (max-width: 380px) {
  .portfolio-kicker {
    font-size: 0.62rem;
  }

  .portfolio-section__heading {
    flex-wrap: wrap;
  }

  .portfolio-carousel-controls {
    margin-left: auto;
  }

  .portfolio-category__content {
    padding: 22px;
  }
}
