.portfolio-main {
  padding: 2rem 0 4.75rem;
}

.portfolio-shell {
  position: relative;
  overflow: hidden;
  padding: 1.5rem;
  color: #17192b;
  border: 1px solid #e3e6f1;
  border-radius: 1.75rem;
  background: #f6f7fc;
}

.portfolio-shell::before {
  position: absolute;
  z-index: 0;
  top: -13.125rem;
  right: -11.25rem;
  width: 22.5rem;
  height: 22.5rem;
  border-radius: 50%;
  background: rgb(109 93 251 / 11%);
  content: "";
  pointer-events: none;
}

.portfolio-intro,
.portfolio-directions,
.portfolio-panel {
  position: relative;
  z-index: 1;
}

.portfolio-intro {
  max-width: 48.75rem;
  margin-bottom: 1.75rem;
}

.portfolio-kicker {
  margin-bottom: 0.625rem;
  color: var(--color-accent);
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.portfolio-intro h1 {
  margin-bottom: 0.75rem;
  color: #17192b;
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.25;
}

.portfolio-intro > p:last-child { color: #6f768b; }

.portfolio-directions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.875rem;
  margin-bottom: 1.125rem;
}

.portfolio-direction {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.125rem;
  min-height: 6.75rem;
  padding: 1.25rem;
  color: #17192b;
  border: 1px solid #dfe2ed;
  border-radius: 1.375rem;
  background: #fff;
  text-align: left;
  transition: transform 0.2s ease, color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.portfolio-direction:hover { transform: translateY(-2px); }
.portfolio-direction.is-active { color: #fff; border-color: var(--color-accent); background: var(--color-accent); }
.portfolio-direction__copy { display: flex; align-items: flex-start; gap: 0.875rem; }
.portfolio-direction__icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.75rem;
  height: 2.75rem;
  color: var(--color-accent);
  border-radius: 0.8125rem;
  background: #efedff;
}

.portfolio-direction.is-active .portfolio-direction__icon { color: #fff; background: rgb(255 255 255 / 16%); }
.portfolio-direction strong { display: block; margin-bottom: 0.3125rem; color: #17192b; font-weight: 500; }
.portfolio-direction small { display: block; color: #71788e; font-size: 0.875rem; line-height: 1.5; }
.portfolio-direction.is-active strong,
.portfolio-direction.is-active small { color: rgb(255 255 255 / 78%); }
.portfolio-direction.is-active strong { color: #fff; }
.portfolio-direction > .icon { flex: 0 0 auto; }

.portfolio-filter-shell {
  margin-bottom: 1.75rem;
  padding: 0.875rem;
  border: 1px solid #e1e4ef;
  border-radius: 1.375rem;
  background: #fff;
}

.portfolio-filter-label { display: block; margin-bottom: 0.625rem; color: #777e94; }
.portfolio-filters { display: flex; align-items: stretch; flex-wrap: wrap; gap: 0.5rem; }
.portfolio-filter {
  min-height: 2.625rem;
  padding: 0.5625rem 0.875rem;
  color: #454b60;
  border: 1px solid #dfe2ed;
  border-radius: 0.75rem;
  background: #f7f8fc;
}

.portfolio-filter.is-active { color: #fff; border-color: var(--color-accent); background: var(--color-accent); }

.portfolio-cases-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.125rem;
  margin-bottom: 1rem;
}

.portfolio-cases-head h2 { margin-bottom: 0.3125rem; color: #17192b; font-size: 1.25rem; font-weight: 500; line-height: 1.25; }
.portfolio-cases-head p { color: #777e94; }
.portfolio-demo-note {
  flex: 0 0 auto;
  padding: 0.4375rem 0.625rem;
  color: #5f667b;
  border-radius: 999px;
  background: #eceef5;
  white-space: nowrap;
}

.portfolio-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.875rem; }
.portfolio-case {
  overflow: hidden;
  min-width: 0;
  color: #17192b;
  border: 1px solid #dfe2ed;
  border-radius: 1.375rem;
  background: #fff;
}

.portfolio-case__preview {
  min-height: 11.25rem;
  padding: 1rem;
  color: #fff;
  background: linear-gradient(145deg, #6d5dfb, #4b3ece);
}

.portfolio-case:nth-child(3n+2) .portfolio-case__preview { background: linear-gradient(145deg, #171e3a, #344070); }
.portfolio-case:nth-child(3n+3) .portfolio-case__preview { background: linear-gradient(145deg, #2d3153, #7869ff); }
.portfolio-case__preview-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 1.5rem; }
.portfolio-case__preview-kind { color: rgb(255 255 255 / 78%); }
.portfolio-case__preview-kind,
.portfolio-case__meta small { font-size: 0.75rem; line-height: 1rem; }
.portfolio-case__window { padding: 0.875rem; border-radius: 0.9375rem; background: rgb(255 255 255 / 14%); backdrop-filter: blur(0.625rem); }
.portfolio-case__dots { margin-bottom: 0.75rem; color: rgb(255 255 255 / 64%); letter-spacing: 0.18em; }
.portfolio-case__line { width: 86%; height: 0.5625rem; margin-bottom: 0.5rem; border-radius: 999px; background: rgb(255 255 255 / 86%); }
.portfolio-case__line--short { width: 56%; background: rgb(255 255 255 / 44%); }
.portfolio-case__stats { display: flex; align-items: center; gap: 0.4375rem; margin-top: 1.125rem; }
.portfolio-case__stat { flex: 1 1 0; height: 1.5rem; border-radius: 0.5rem; background: rgb(255 255 255 / 14%); }
.portfolio-case__body { padding: 1.125rem; }
.portfolio-case__meta { display: flex; align-items: center; justify-content: space-between; gap: 0.625rem; margin-bottom: 0.75rem; color: #777e94; }
.portfolio-case h3 { margin-bottom: 0.625rem; color: #17192b; font-size: 1.125rem; font-weight: 500; line-height: 1.3; }
.portfolio-case__body > p { min-height: 2.625rem; margin-bottom: 1.125rem; color: #6f768b; }
.portfolio-case__link { display: flex; align-items: center; justify-content: space-between; color: #5d4cf4; font-weight: 500; }
.portfolio-empty { padding: 1.5rem; color: #6f768b; border: 1px dashed #cfd4e3; border-radius: 1.125rem; background: #fff; }

[data-theme="dark"] .portfolio-shell { color: #f7f8fc; border-color: #1d2440; background: #080b1d; }
[data-theme="dark"] .portfolio-shell::before { background: rgb(109 93 251 / 18%); }
[data-theme="dark"] .portfolio-intro h1,
[data-theme="dark"] .portfolio-cases-head h2,
[data-theme="dark"] .portfolio-case h3,
[data-theme="dark"] .portfolio-direction strong { color: #f7f8fc; }
[data-theme="dark"] .portfolio-intro > p:last-child,
[data-theme="dark"] .portfolio-direction small,
[data-theme="dark"] .portfolio-filter-label,
[data-theme="dark"] .portfolio-cases-head p,
[data-theme="dark"] .portfolio-case__meta,
[data-theme="dark"] .portfolio-case__body > p { color: #aeb5ca; }
[data-theme="dark"] .portfolio-direction,
[data-theme="dark"] .portfolio-filter-shell,
[data-theme="dark"] .portfolio-case,
[data-theme="dark"] .portfolio-empty { color: #f7f8fc; border-color: #252d4c; background: #11162c; }
[data-theme="dark"] .portfolio-direction.is-active,
[data-theme="dark"] .portfolio-filter.is-active { color: #fff; border-color: #7464ff; background: var(--color-accent); }
[data-theme="dark"] .portfolio-direction.is-active strong { color: #fff; }
[data-theme="dark"] .portfolio-direction__icon { background: #20284a; }
[data-theme="dark"] .portfolio-direction.is-active .portfolio-direction__icon { background: rgb(255 255 255 / 15%); }
[data-theme="dark"] .portfolio-filter { color: #dbe0ee; border-color: #2a3354; background: #171e3a; }
[data-theme="dark"] .portfolio-demo-note { color: #c8cee0; background: #20263e; }
[data-theme="dark"] .portfolio-case__link,
[data-theme="dark"] .portfolio-kicker { color: #9a8fff; }

@media (max-width: 53.75rem) {
  .portfolio-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 41.25rem) {
  .portfolio-shell { padding: 1.125rem; }
  .portfolio-cases-head { align-items: stretch; flex-direction: column; }
  .portfolio-directions,
  .portfolio-grid { grid-template-columns: 1fr; }
  .portfolio-demo-note { align-self: flex-start; white-space: normal; }
}

@media (max-width: 35rem) {
  .portfolio-main { padding: 1.5rem 0 3.625rem; }
}
