/* =========================================================
   MIRIDEA · Портфолио v1.0 (/portfolio/)
   Отступы как на остальных страницах: 60px между блоками, 36px от заголовка до содержимого.
   ========================================================= */
.m-pf-hero, .m-pf-works, .m-pf-cta { --ease: cubic-bezier(.22, 1, .36, 1); --back: cubic-bezier(.34, 1.56, .64, 1); --gap: 60px; }
.m-pf-works, .m-pf-cta { padding-block: var(--gap); }
@media (max-width: 768px) { .m-pf-hero, .m-pf-works, .m-pf-cta { --gap: 40px; } }
.m-sec-head { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 12px 60px; align-items: end; margin-bottom: 36px; }
.m-sec-head .title2 { width: auto; margin: 0; line-height: 1.2; }
.m-sec-head__text { margin: 0; padding-bottom: 4px; font-size: 15px; line-height: 1.65; color: #8090aa; max-width: 62ch; }
.m-sec-head__text b { color: #39404b; font-weight: 500; }
@media (max-width: 992px) { .m-sec-head { grid-template-columns: 1fr; } }
.m-band { position: relative; isolation: isolate; }
.m-band--b { background: radial-gradient(60% 90% at 90% 0%, #2a3170, transparent 70%), radial-gradient(50% 80% at 0% 100%, #3a1748, transparent 70%), #141a3c; }
.m-band--b .title2.m-title-duo span { color: #fff; -webkit-text-fill-color: #fff; }

/* ---------- 1. Главный экран ---------- */
.m-pf-hero { position: relative; overflow: hidden; padding: 140px 0 var(--gap); }
@media (max-width: 992px) { .m-pf-hero { padding-top: 100px; } }
.m-pf-hero__bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.m-pf-hero__lines {
  position: absolute; inset: -44px; background-image: linear-gradient(rgba(63, 85, 195, .08) 1px, transparent 1px), linear-gradient(90deg, rgba(63, 85, 195, .08) 1px, transparent 1px);
  background-size: 44px 44px; animation: m-pf-gridmove 18s linear infinite;
  -webkit-mask-image: radial-gradient(70% 80% at 70% 40%, #000 30%, transparent 80%); mask-image: radial-gradient(70% 80% at 70% 40%, #000 30%, transparent 80%);
}
@keyframes m-pf-gridmove { to { transform: translate(44px, 44px); } }
.m-pf-hero__code { position: absolute; inset: 90px 0 0; display: grid; align-content: space-evenly; font: 500 13px/1.4 ui-monospace, Consolas, monospace; color: rgba(91, 75, 214, .15); white-space: nowrap; }
.m-pf-hero__code span { display: block; animation: m-pf-code 40s linear infinite; }
.m-pf-hero__code span:nth-child(2n) { animation-duration: 48s; animation-direction: reverse; color: rgba(249, 60, 60, .11); }
.m-pf-hero__code span:nth-child(3n) { animation-duration: 56s; }
@keyframes m-pf-code { from { transform: translateX(-15%); } to { transform: translateX(55%); } }

/* сетка первого экрана: текст + иллюстрация */
.m-pf-hero__grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 30px 50px; align-items: center; }
@media (max-width: 992px) { .m-pf-hero__grid { grid-template-columns: 1fr; } }
.m-pf-hero__title { margin: 0 0 20px; font-size: clamp(28px, 3.1vw, 46px); line-height: 1.15; font-weight: 500; text-transform: uppercase; color: #39404b; }
.m-pf-hero__title span {
  display: inline; padding-bottom: .06em; font-weight: 700; -webkit-box-decoration-break: clone; box-decoration-break: clone;
  background: linear-gradient(169deg, #f93c3c, #cd0973); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.m-pf-hero__sub { margin: 0; font-size: 16px; line-height: 1.65; color: #8090aa; max-width: 60ch; }
.m-pf-hero__stats { display: flex; flex-wrap: wrap; gap: 14px 34px; margin: 30px 0 0; padding: 0; list-style: none; }
.m-pf-hero__stats li { display: flex; align-items: center; gap: 12px; }
.m-pf-hero__stats b {
  font-size: 40px; line-height: 1.15; padding-bottom: .04em; font-weight: 700;
  background: linear-gradient(120deg, #a068f8, #3f55c3); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.m-pf-hero__stats span { font-size: 13px; line-height: 1.35; color: #8090aa; }
.m-pf-hero__pic img { display: block; width: 100%; max-width: 620px; height: auto; margin-left: auto; animation: m-pf-float 6s ease-in-out infinite; }
@keyframes m-pf-float { 50% { transform: translateY(-12px); } }
html.m-js .m-pf-up { opacity: 0; transform: translateY(24px); }
html.m-js .m-pf-hero.is-ready .m-pf-up { animation: m-pf-up .8s var(--ease) both; animation-delay: calc(var(--i, 0) * 120ms); }
@keyframes m-pf-up { to { opacity: 1; transform: none; } }
html.m-js .m-pf-hero__pic { opacity: 0; transform: translateX(50px); }
html.m-js .m-pf-hero.is-ready .m-pf-hero__pic { animation: m-pf-right 1.1s var(--ease) .3s both; }
@keyframes m-pf-right { to { opacity: 1; transform: none; } }

/* ---------- 2. Плавающая панель фильтров ---------- */
.m-pf-filters-slot { min-height: 104px; margin-bottom: 26px; }
.m-pf-filters {
  display: grid; gap: 10px; padding: 12px; border-radius: 12px 28px 12px 28px;
  background: rgba(255, 255, 255, .72); border: 1px solid rgba(201, 182, 255, .55); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 20px 40px -34px rgba(63, 85, 195, .6);
}
.m-pf-tabs, .m-pf-techs { display: flex; flex-wrap: wrap; gap: 8px; }
.m-pf-filters button {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; border: 1px solid #e4e7f0; border-radius: 8px 18px 8px 18px;
  background: #fff; cursor: pointer; font: inherit; font-size: 14px; font-weight: 500; color: #39404b; transition: background .3s, color .3s, border-color .3s;
}
.m-pf-filters button sup { font-size: 11px; color: #8090aa; vertical-align: 0; }
.m-pf-filters button:hover { border-color: #c9b6ff; }
.m-pf-tabs button.is-on { background: linear-gradient(120deg, #f93c3c, #cd0973); border-color: transparent; color: #fff; }
.m-pf-techs button { min-height: 34px; padding: 0 13px; font-size: 13px; background: #f5f6fb; }
.m-pf-techs button.is-on { background: linear-gradient(120deg, #a068f8, #3f55c3); border-color: transparent; color: #fff; }
.m-pf-filters button.is-on sup { color: rgba(255, 255, 255, .8); }
.m-pf-filters.is-float button:not(.is-on) { background: #fff; }
.m-pf-filters.is-float { background: #fff !important; backdrop-filter: none; -webkit-backdrop-filter: none;
  position: fixed; left: 50%; bottom: 18px; z-index: 60; width: min(1100px, calc(100% - 32px)); transform: translateX(-50%);
  background: #fff; box-shadow: 0 24px 50px -20px rgba(20, 26, 60, .5); animation: m-pf-float-in .45s var(--ease);
}
@keyframes m-pf-float-in { from { opacity: 0; transform: translate(-50%, 30px); } }
@media (max-width: 768px) {
  .m-pf-tabs, .m-pf-techs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .m-pf-tabs::-webkit-scrollbar, .m-pf-techs::-webkit-scrollbar { display: none; }
  .m-pf-filters button { flex: none; }
}

/* ---------- 3. Сетка работ «Pinterest» — как блок «Кейсы» на главной ---------- */
.m-pf-grid { --gap: clamp(14px, 1.8vw, 28px); column-count: 3; column-gap: var(--gap); }
@media (max-width: 1000px) { .m-pf-grid { column-count: 2; } }
@media (max-width: 600px)  { .m-pf-grid { column-count: 1; } }
.m-pf-grid.is-js { column-count: auto; display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.m-pf-col { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.m-pf-card {
  position: relative; display: block; break-inside: avoid; margin-bottom: var(--gap); overflow: hidden; isolation: isolate;
  border-radius: 10px 26px 10px 26px; background: #fff;
  box-shadow: 0 2px 4px rgba(29, 31, 51, .04), 0 18px 40px -24px rgba(29, 31, 51, .35);
  transition: transform .6s var(--ease), box-shadow .6s var(--ease);
}
.m-pf-grid.is-js .m-pf-card { margin-bottom: 0; }
.m-pf-card[hidden] { display: none; }
.m-pf-card:hover { transform: translateY(-6px); box-shadow: 0 2px 4px rgba(29, 31, 51, .04), 0 34px 60px -28px rgba(63, 85, 195, .45); }
html.m-js .m-pf-card.is-pre { opacity: 0; }
.m-pf-card.is-entering { animation: m-pf-in .6s var(--ease) both; }
@keyframes m-pf-in { from { opacity: 0; transform: translateY(24px) scale(.97); } to { opacity: 1; transform: none; } }

/* окно браузера */
.m-pf-card__bar { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px 0 14px; background: #f6f7fb; border-bottom: 1px solid #e4e7f0; }
.m-pf-card__bar i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.m-pf-card__bar i:nth-child(1) { background: #ff6b6b; }
.m-pf-card__bar i:nth-child(2) { background: #ffc94d; }
.m-pf-card__bar i:nth-child(3) { background: #3ccf8e; }
.m-pf-card__bar span { flex: 1; min-width: 0; margin-left: 8px; padding: 4px 10px; border-radius: 6px; background: #fff; font-size: 11px; color: #8090aa; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-pf-views { display: inline-flex; align-items: center; gap: 5px; flex: none; padding: 3px 8px; border-radius: 999px; background: #fff; font-size: 11px; font-weight: 500; color: #39404b; }
.m-pf-views svg { width: 14px; height: 14px; fill: none; stroke: #8090aa; stroke-width: 2; }
.m-pf-views em { font-style: normal; }
.m-pf-views[hidden] { display: none; }

/* скриншот: при наведении сайт прокручивается */
.m-pf-card__screen { position: relative; display: block; overflow: hidden; aspect-ratio: 4 / 4.2; background: #eef0f6; }
.m-pf-card--tall .m-pf-card__screen { aspect-ratio: 4 / 5.2; }
.m-pf-card--short .m-pf-card__screen { aspect-ratio: 4 / 3.2; }
.m-pf-card--flat .m-pf-card__screen { aspect-ratio: 8 / 5; }
.m-pf-card__screen img {
  position: absolute; left: 0; top: 0; display: block; width: 100%; height: auto; max-width: none;
  transform: translateY(0); will-change: transform; transition: transform var(--dur, 6s) cubic-bezier(.45, .05, .35, 1);
}
.m-pf-card.is-back .m-pf-card__screen img { transition-duration: .9s; transition-timing-function: var(--ease); }
.m-pf-card__screen::after { content: ""; position: absolute; inset: auto 0 0 0; height: 30%; background: linear-gradient(to top, rgba(29, 31, 51, .28), transparent); pointer-events: none; transition: opacity .5s; }
.m-pf-card:hover .m-pf-card__screen::after { opacity: 0; }
.m-pf-card__ph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; font-weight: 700; color: #c9b6ff; background: radial-gradient(70% 90% at 70% 10%, #2a3170, #141a3c); }

/* подпись */
.m-pf-card__info { padding: 18px 20px 20px; }
.m-pf-card__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.m-pf-card__tags span { padding: 4px 10px; border-radius: 999px; background: #f2f3f8; font-size: 12px; line-height: 1.3; color: #8090aa; }
.m-pf-cms { font-weight: 600; }
.m-pf-card__tags .m-pf-cms--bitrix { background: rgba(216, 60, 60, .1); color: #c42e3a; }
.m-pf-card__tags .m-pf-cms--wordpress { background: rgba(33, 117, 155, .1); color: #1d6a8d; }
.m-pf-card__tags .m-pf-cms--modx { background: rgba(62, 143, 79, .12); color: #2f7a40; }
.m-pf-card__tags .m-pf-cms--opencart { background: rgba(42, 159, 214, .12); color: #1f7fae; }
.m-pf-card__tags .m-pf-cms--django { background: rgba(12, 75, 51, .1); color: #0c4b33; }
.m-pf-card__tags .m-pf-cms--rails { background: rgba(179, 38, 30, .1); color: #a3231c; }
.m-pf-card__tags .m-pf-cms--drupal { background: rgba(6, 120, 190, .1); color: #0668a5; }
.m-pf-card__name { margin: 0 0 6px; font-size: 20px; line-height: 1.25; font-weight: 700; color: #1d1f33; }
.m-pf-card__name a { color: inherit; text-decoration: none; }
.m-pf-card__name a:hover { color: #f93c3c; }
.m-pf-card__text { margin: 0; font-size: 14px; line-height: 1.5; color: #8090aa; }
.m-pf-card__btns { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-top: 16px; }
.m-pf-btn { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #1d1f33; text-decoration: none; transition: color .3s; }
.m-pf-btn svg, .m-pf-live svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .4s var(--ease); }
.m-pf-card:hover .m-pf-btn, .m-pf-btn:focus-visible { color: #f93c3c; }
.m-pf-card:hover .m-pf-btn svg { transform: translateX(6px); }
.m-pf-live { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border: 1px solid #e4e7f0; border-radius: 8px 16px 8px 16px; font-size: 13px; color: #39404b; text-decoration: none; transition: border-color .3s, color .3s; }
.m-pf-live svg { width: 15px; height: 15px; }
.m-pf-live:hover { border-color: #a068f8; color: #3f55c3; }
.m-pf-live:hover svg { transform: translate(2px, -2px); }
.m-pf-empty { margin: 10px 0 0; padding: 30px; text-align: center; border-radius: 10px 26px 10px 26px; background: #f5f6fb; color: #8090aa; }

/* курсор «Смотреть кейс» над скриншотом */
.m-pf-cursor {
  position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none; width: 108px; height: 108px; margin: -54px 0 0 -54px; border-radius: 50%;
  display: grid; place-items: center; text-align: center; background: linear-gradient(135deg, #f93c3c, #cd0973); color: #fff;
  font-size: 13px; font-weight: 600; line-height: 1.15; letter-spacing: .04em; text-transform: uppercase; box-shadow: 0 16px 34px -12px rgba(205, 9, 115, .7);
  transform: translate3d(var(--x, -200px), var(--y, -200px), 0) scale(0); transition: transform .35s cubic-bezier(.22, 1, .36, 1);
}
.m-pf-cursor.is-on { transform: translate3d(var(--x), var(--y), 0) scale(1); }
@media (hover: none), (pointer: coarse) { .m-pf-cursor { display: none; } }
@media (hover: hover) and (pointer: fine) { .m-pf-works.has-cursor .m-pf-card__screen { cursor: none; } }

/* ---------- 4. «Загрузить ещё» ---------- */
.m-pf-more-wrap { display: flex; justify-content: center; margin-top: 40px; }
.m-pf-more-wrap[hidden] { display: none; }
.m-pf-more {
  --mx: 0px; --my: 0px; position: relative; min-width: 300px; min-height: 64px; padding: 0 34px; border: 2px solid #c9b6ff; border-radius: 12px 30px 12px 30px;
  background: #fff; cursor: pointer; font: inherit; font-size: 16px; font-weight: 700; color: #39404b;
  transform: translate(var(--mx), var(--my)); transition: transform .35s var(--ease), border-color .3s, box-shadow .3s;
}
.m-pf-more:hover { border-color: #a068f8; box-shadow: 0 18px 36px -22px rgba(63, 85, 195, .7); }
.m-pf-more__txt { display: inline-flex; align-items: center; gap: 12px; transition: opacity .2s; }
.m-pf-more__txt i { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-style: normal; font-size: 20px; color: #fff; background: linear-gradient(135deg, #f93c3c, #cd0973); transition: transform .4s var(--back); }
.m-pf-more:hover .m-pf-more__txt i { transform: rotate(90deg); }
.m-pf-more__term { position: absolute; inset: 0; display: grid; place-items: center; font: 600 14px ui-monospace, Consolas, monospace; color: #5b4bd6; opacity: 0; }
.m-pf-more.is-loading .m-pf-more__txt { opacity: 0; }
.m-pf-more.is-loading .m-pf-more__term { opacity: 1; }
@property --a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.m-pf-more.is-loading { border-color: transparent; background: linear-gradient(#fff, #fff) padding-box, conic-gradient(from var(--a), #f93c3c, #a068f8, #3f55c3, transparent 70%) border-box; animation: m-pf-spin .8s linear infinite; }
@keyframes m-pf-spin { to { --a: 360deg; } }

/* ---------- 5. Призыв ---------- */
.m-pf-cta__box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 40px; }
.m-pf-cta__box .title2 { margin: 0 0 12px; line-height: 1.2; }
.m-pf-cta__box p { margin: 0; font-size: 16px; line-height: 1.65; color: #c3cbf2; max-width: 56ch; }
.m-pf-cta__btn {
  display: inline-flex; align-items: center; gap: 12px; min-height: 60px; padding: 0 32px; border-radius: 10px 26px 10px 26px; text-decoration: none;
  font-size: 16px; font-weight: 700; color: #fff; background: linear-gradient(120deg, #f93c3c, #cd0973); box-shadow: 0 18px 36px -16px rgba(249, 60, 60, .9);
  transition: transform .3s var(--ease), box-shadow .3s;
}
.m-pf-cta__btn:hover { color: #fff; transform: scale(1.04); box-shadow: 0 24px 44px -16px rgba(249, 60, 60, 1); }
.m-pf-cta__btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }


.header__menu a[aria-current="page"] { color: #f93c3c; }

@media (prefers-reduced-motion: reduce) {
  .m-pf-hero *, .m-pf-works *, .m-pf-cta * { animation: none !important; transition: none !important; }
  html.m-js .m-pf-up, html.m-js .m-pf-hero__pic, html.m-js .m-pf-card.is-pre { opacity: 1; transform: none; }
}
