@media (max-width: 768px) {
  html,
  body {
    max-width: 100%;
    overflow-x: clip;
  }

  .premium-portfolio-page,
  .portfolio-web-page {
    max-width: 100%;
    overflow-x: clip;
  }

  .portfolio-header {
    position: fixed;
    top: 14px;
    left: 14px;
    right: 14px;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    box-sizing: border-box;
  }

  .portfolio-back {
    flex: 0 0 auto;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 999px;
    font-size: 11px;
    letter-spacing: .06em;
  }

  .portfolio-header__mark {
    flex: 0 1 auto;
    min-width: 0;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 16px;
  }

  .portfolio-header__mark span {
    font-size: 12px;
    letter-spacing: .10em;
  }

  .portfolio-header__mark small {
    font-size: 9px;
    letter-spacing: .12em;
  }

  .portfolio-web-page .container {
    width: 100%;
    max-width: calc(100vw - 28px);
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
  }

  .web-hero {
    min-height: auto;
    padding-top: 110px;
    padding-bottom: 58px;
  }

  .web-hero__grid {
    grid-template-columns: 1fr;
    gap: 34px;
    align-items: stretch;
  }

  .web-hero__grid,
  .web-hero__content,
  .web-hero__visual,
  .lux-card,
  .stack-visual,
  .web-hero__stats {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .eyebrow {
    margin-bottom: 14px;
    font-size: 10px;
    letter-spacing: .18em;
  }

  .web-hero__title {
    max-width: 100%;
    font-size: 38px;
    line-height: 1.08;
    letter-spacing: -.035em;
    text-wrap: balance;
  }

  .web-hero__text {
    max-width: 100%;
    font-size: 15px;
    line-height: 1.72;
  }

  .web-hero__stats {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 32px;
  }

  .web-hero__stats div {
    min-height: auto;
    padding: 16px;
    box-sizing: border-box;
  }

  .web-hero__stats strong {
    font-size: 22px;
  }

  .web-hero__stats span {
    font-size: 11px;
    line-height: 1.55;
  }

  .web-hero__visual {
    width: 100%;
  }

  .lux-card {
    width: 100%;
    min-height: auto;
    padding: 18px;
    border-radius: 30px;
  }

  .stack-visual {
    min-height: 300px;
    padding: 18px;
    gap: 18px;
  }

  .stack-node {
    width: 100%;
    max-width: 260px;
    padding: 18px 16px;
  }

  .stack-node span {
    font-size: 11px;
  }

  .stack-node strong {
    font-size: 24px;
  }

  .stack-grid {
    width: 100%;
    max-width: 100%;
    grid-template-columns: 1fr;
    gap: 10px;
    box-sizing: border-box;
  }

  .stack-chip {
    min-height: 40px;
    font-size: 11px;
    box-sizing: border-box;
  }

  .lux-card__body {
    padding-top: 22px;
  }

  .lux-card__body p {
    font-size: 10px;
    letter-spacing: .16em;
  }

  .lux-card__body h2 {
    max-width: 280px;
    font-size: 34px;
    line-height: .95;
  }

  .lux-card__tags {
    justify-content: center;
    gap: 8px;
  }

  .lux-card__tags span {
    min-height: 30px;
    padding: 0 10px;
    font-size: 10px;
    box-sizing: border-box;
  }

  .portfolio-divider {
    padding: 42px 0 24px;
  }

  .portfolio-divider__inner {
    gap: 14px;
  }

  .portfolio-divider__title {
    font-size: 46px;
    line-height: 1;
  }

  .portfolio-divider__line {
    width: 64px;
  }

  .featured-case {
    padding-top: 42px;
    padding-bottom: 42px;
  }

  .autoservice-case__inner {
    grid-template-columns: 1fr;
    gap: 24px;
    min-width: 0;
    max-width: 100%;
    padding: 24px;
    border-radius: 28px;
    box-sizing: border-box;
  }

  .autoservice-case__inner::before {
    inset: 12px;
    border-radius: 22px;
  }

  .autoservice-case__content,
  .autoservice-case__meta {
    min-width: 0;
    max-width: 100%;
  }

  .autoservice-case__label {
    padding-left: 4px;
    margin-bottom: 18px;
    font-size: 10px;
    letter-spacing: .20em;
  }

  .autoservice-case__brand {
    display: flex;
    width: fit-content;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    gap: 10px;
    margin-bottom: 26px;
    padding: 10px 12px 10px 10px;
    border-radius: 22px;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
  }

  .autoservice-case__brand-mark {
    width: 36px;
    height: 36px;
  }

  .autoservice-case__brand-name {
    font-size: 13px;
    letter-spacing: .10em;
  }

  .autoservice-case__brand-subtitle {
    font-size: 9px;
    letter-spacing: .18em;
  }

  .autoservice-case__title {
    max-width: 100%;
    font-size: clamp(32px, 9vw, 46px);
    line-height: .95;
    letter-spacing: -.04em;
    text-align: center;
    text-wrap: balance;
  }

  .autoservice-case__title-accent {
    overflow-wrap: anywhere;
  }

  .autoservice-case__description {
    max-width: 100%;
    margin-top: 22px;
    font-size: 14px;
    line-height: 1.75;
    text-align: center;
  }

  .autoservice-case__actions {
    margin-top: 26px;
  }

  .autoservice-case__video-btn {
    width: 100%;
    min-height: 52px;
    padding: 0 18px;
    font-size: 11px;
    letter-spacing: .08em;
  }

  .autoservice-case__video-note {
    text-align: center;
    font-size: 11px;
  }

  .autoservice-case__meta {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 0;
    -webkit-overflow-scrolling: touch;
    padding: 2px 18px 10px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 31, 53, .48) rgba(255, 255, 255, .06);
  }

  .autoservice-case__meta::-webkit-scrollbar {
    height: 4px;
  }

  .autoservice-case__meta::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(255, 255, 255, .06);
  }

  .autoservice-case__meta::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(184, 15, 31, .72), rgba(255, 31, 53, .62));
  }

  .autoservice-case__meta-card {
    flex: 0 0 78%;
    min-width: 240px;
    max-width: 320px;
    scroll-snap-align: start;
    min-height: auto;
    padding: 16px;
    border-radius: 20px;
    box-sizing: border-box;
  }

  .autoservice-case__meta-card span {
    margin-bottom: 8px;
    font-size: 10px;
    letter-spacing: .14em;
  }

  .autoservice-case__meta-card strong {
    font-size: 16px;
    line-height: 1.22;
    overflow-wrap: anywhere;
  }

  .video-modal {
    padding: 14px;
  }

  .video-modal__dialog {
    width: 100%;
    border-radius: 24px;
  }

  .video-modal__head {
    padding: 16px;
    gap: 12px;
  }

  .video-modal__title {
    padding-right: 8px;
    font-size: 13px;
    line-height: 1.25;
    letter-spacing: .08em;
  }

  .video-modal__close {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }

  .case-separator {
    width: min(100%, calc(100vw - 56px));
    margin: 28px auto;
  }

  .future-case {
    padding-top: 42px;
    padding-bottom: 42px;
  }

  .future-case__shell {
    min-width: 0;
    max-width: 100%;
    padding: 24px;
    border-radius: 28px;
    box-sizing: border-box;
  }

  .future-case__head {
    min-width: 0;
    max-width: 100%;
  }

  .future-case__head h2 {
    max-width: 100%;
    font-size: 42px;
    line-height: 1;
    letter-spacing: -.04em;
    text-wrap: balance;
  }

  .future-case__head p:not(.section-kicker) {
    max-width: 100%;
    margin-top: 20px;
    font-size: 15px;
    line-height: 1.75;
  }

  .future-case__cards {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 18px;
  }

  .future-case__cards article {
    min-width: 0;
    max-width: 100%;
    min-height: auto;
    padding: 22px;
    border-radius: 24px;
    box-sizing: border-box;
  }

  .future-case__cards article h3 {
    font-size: 30px;
    line-height: 1.08;
  }

  .future-case__cards article p {
    max-width: 100%;
    font-size: 15px;
    line-height: 1.75;
  }

  .case-barbercore__shell {
    grid-template-columns: 1fr;
    gap: 24px;
    min-width: 0;
    max-width: 100%;
    padding: 24px;
    border-radius: 28px;
    box-sizing: border-box;
  }

  .case-barbercore__shell::before {
    inset: 12px;
    border-radius: 22px;
  }

  .case-barbercore__content,
  .case-barbercore__meta {
    min-width: 0;
    max-width: 100%;
  }

  .case-barbercore__label {
    margin-bottom: 18px;
    padding-left: 0;
    font-size: 10px;
    letter-spacing: .20em;
    text-align: center;
  }

  .case-barbercore__brand {
    display: flex;
    width: fit-content;
    max-width: 100%;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-right: auto;
    margin-bottom: 26px;
    margin-left: auto;
    padding: 10px 12px 10px 10px;
    border-radius: 22px;
    box-sizing: border-box;
  }

  .case-barbercore__brand-mark {
    width: 38px;
    height: 38px;
    font-size: 21px;
  }

  .case-barbercore__brand-name {
    font-size: 13px;
    letter-spacing: .11em;
  }

  .case-barbercore__brand-subtitle {
    font-size: 9px;
    letter-spacing: .16em;
  }

  .case-barbercore__title {
    max-width: 100%;
    font-size: clamp(38px, 11vw, 52px);
    line-height: .96;
    letter-spacing: -.035em;
    text-align: center;
    text-wrap: balance;
  }

  .case-barbercore__title-accent {
    overflow-wrap: anywhere;
  }

  .case-barbercore__description {
    max-width: 100%;
    margin-top: 22px;
    font-size: 14.5px;
    line-height: 1.75;
    text-align: center;
  }

  .case-barbercore__actions {
    width: 100%;
    margin-top: 26px;
  }

  .case-barbercore__video-btn {
    width: 100%;
    min-height: 52px;
    padding: 0 18px;
    font-size: 10.5px;
    line-height: 1.25;
    letter-spacing: .075em;
  }

  .case-barbercore__video-note {
    font-size: 10.5px;
    line-height: 1.4;
    text-align: center;
  }

  .case-barbercore__meta {
    display: flex;
    gap: 12px;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 2px 18px 10px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(216, 180, 106, .58) rgba(216, 180, 106, .08);
  }

  .case-barbercore__meta::-webkit-scrollbar {
    height: 4px;
  }

  .case-barbercore__meta::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(216, 180, 106, .08);
  }

  .case-barbercore__meta::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(169, 111, 37, .72), rgba(241, 209, 138, .62));
  }

  .case-barbercore__meta-card {
    flex: 0 0 min(260px, 78vw);
    min-width: 240px;
    max-width: 300px;
    min-height: auto;
    padding: 16px;
    border-radius: 20px;
    scroll-snap-align: start;
    text-align: center;
    box-sizing: border-box;
  }

  .case-barbercore__meta-card span {
    margin-bottom: 8px;
    font-size: 10px;
    letter-spacing: .14em;
  }

  .case-barbercore__meta-card strong {
    font-size: 16px;
    line-height: 1.24;
    overflow-wrap: anywhere;
  }

  .case-barbercore__cards {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 18px;
  }

  .case-barbercore__cards article {
    min-width: 0;
    max-width: 100%;
    min-height: auto;
    padding: 22px;
    border-radius: 24px;
    text-align: center;
    box-sizing: border-box;
  }

  .web-note {
    padding-top: 42px;
    padding-bottom: 46px;
  }

  .web-note__box {
    min-width: 0;
    max-width: 100%;
    padding: 24px;
    border-radius: 28px;
    overflow: hidden;
    box-sizing: border-box;
  }

  .web-note__box .section-kicker {
    margin-bottom: 18px;
    font-size: 10px;
    letter-spacing: .2em;
  }

  .web-note__box h2 {
    max-width: 100%;
    font-size: 42px;
    line-height: 1;
    letter-spacing: -.04em;
    text-wrap: balance;
  }

  .web-note__text {
    max-width: 100%;
    margin-top: 22px;
    font-size: 15px;
    line-height: 1.75;
  }

  .site-footer {
    padding: 28px 0 32px;
  }

  .footer-inner {
    min-height: auto;
    justify-content: center;
    text-align: center;
  }

  .footer-left {
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .footer-left p {
    max-width: 280px;
    margin: 0 auto;
    font-size: 20px;
    line-height: 1.35;
    text-align: center;
  }

  .footer-left p span {
    display: inline;
  }
}

@media (max-width: 390px) {
  .portfolio-web-page .container {
    max-width: calc(100vw - 24px);
  }

  .portfolio-back__text {
    font-size: 0;
  }

  .portfolio-back__text::after {
    content: "Главная";
    font-size: 11px;
  }

  .portfolio-header__mark {
    gap: 6px;
    padding: 8px 10px;
  }

  .portfolio-header__mark span {
    font-size: 11px;
    letter-spacing: .08em;
  }

  .portfolio-header__mark small {
    display: inline;
    font-size: 8px;
    letter-spacing: .10em;
  }

  .web-hero__title {
    font-size: 34px;
  }

  .stack-visual {
    min-height: 280px;
  }

  .lux-card__body h2 {
    font-size: 32px;
  }

  .portfolio-divider__title {
    font-size: 42px;
  }

  .portfolio-divider__line {
    width: 52px;
  }

  .autoservice-case__inner {
    padding: 20px;
    border-radius: 24px;
  }

  .autoservice-case__brand {
    align-items: center;
  }

  .autoservice-case__title {
    font-size: 32px;
  }

  .autoservice-case__brand-name {
    font-size: 12px;
  }

  .autoservice-case__brand-subtitle {
    font-size: 8px;
    letter-spacing: .14em;
  }

  .autoservice-case__video-btn {
    font-size: 10px;
    line-height: 1.25;
  }

  .future-case__head h2 {
    font-size: 38px;
  }

  .case-barbercore__shell {
    padding: 20px;
    border-radius: 24px;
  }

  .case-barbercore__brand {
    gap: 8px;
    padding: 9px 10px;
  }

  .case-barbercore__brand-mark {
    width: 34px;
    height: 34px;
    font-size: 19px;
  }

  .case-barbercore__brand-name {
    font-size: 12px;
    letter-spacing: .09em;
  }

  .case-barbercore__brand-subtitle {
    font-size: 8px;
    letter-spacing: .12em;
  }

  .case-barbercore__title {
    font-size: clamp(34px, 10.5vw, 42px);
    line-height: .98;
  }

  .case-barbercore__video-btn {
    font-size: 10px;
  }

  .web-note__box {
    padding: 22px;
    border-radius: 24px;
  }

  .web-note__box h2 {
    font-size: 36px;
    line-height: 1.02;
  }

  .web-note__text {
    font-size: 14.5px;
    line-height: 1.72;
  }

  .footer-left p {
    max-width: 260px;
    font-size: 18px;
    line-height: 1.35;
  }
}
