.site-body {
    --site-pattern-size: clamp(16rem, 22vw, 24rem);
    --site-pattern-on-dark: rgba(247, 240, 231, 0.052);
    --site-pattern-on-light: rgba(36, 25, 18, 0.026);
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    isolation: isolate;
    /* Тёмный, чтобы Safari красил зону overscroll в цвет шапки/подвала.
       Светлый фон страницы живёт на .site-frame. */
    background: #130f0e;
    color: var(--ink);
    overflow-x: hidden;
}

.site-body::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 100%;
    background: var(--site-pattern-on-dark);
    -webkit-mask-image: url("../../img/visuals/pattern-768.3e6fef19e1f0.webp");
    -webkit-mask-position: center top;
    -webkit-mask-repeat: repeat;
    -webkit-mask-size: var(--site-pattern-size);
    mask-image: url("../../img/visuals/pattern-768.3e6fef19e1f0.webp");
    mask-position: center top;
    mask-repeat: repeat;
    mask-size: var(--site-pattern-size);
    pointer-events: none;
    z-index: 1;
}

.site-body::after {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 100%;
    background: var(--site-pattern-on-light);
    -webkit-mask-image: url("../../img/visuals/pattern-768.3e6fef19e1f0.webp");
    -webkit-mask-position: center top;
    -webkit-mask-repeat: repeat;
    -webkit-mask-size: var(--site-pattern-size);
    mask-image: url("../../img/visuals/pattern-768.3e6fef19e1f0.webp");
    mask-position: center top;
    mask-repeat: repeat;
    mask-size: var(--site-pattern-size);
    pointer-events: none;
    z-index: 1;
}

.site-frame {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

.container {
    width: min(var(--container), calc(100% - 40px));
    margin: 0 auto;
}

.page-shell {
    position: relative;
    flex: 1 0 auto;
    padding-bottom: 0;
    overflow: hidden;
}

.site-body.page-contacts::before,
.site-body.page-contacts::after {
    bottom: 0;
    height: auto;
}

.content-section {
    position: relative;
    padding: clamp(48px, 7vw, 92px) 0;
}

.content-section--lifted {
    margin-top: 0;
}

.page-intro,
.hero {
    position: relative;
    padding: clamp(126px, 16vw, 170px) 0 clamp(58px, 7vw, 96px);
    background: #130f0e;
    color: var(--ink-inverse);
}

.page-intro {
    padding-top: clamp(96px, 11vw, 132px);
}

.page-intro .container,
.hero__grid,
.content-section > .container,
.site-footer__panel {
    position: relative;
    z-index: 2;
}

.page-intro__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.72fr);
    align-items: center;
    gap: clamp(24px, 5vw, 56px);
}

.page-intro__copy {
    min-width: 0;
}

.page-intro__visual {
    position: relative;
    justify-self: end;
    width: min(100%, 430px);
    margin: 0;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    border-radius: 34px 24px 34px 20px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(19, 15, 13, 0.46);
    box-shadow: var(--shadow-hero);
}

.page-intro__visual::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.04);
    pointer-events: none;
}

.page-intro__visual img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(0.98) contrast(1.04);
}

.page-intro__visual picture,
.hero-composition__picture,
.fallback-picture {
    display: block;
    width: 100%;
    height: 100%;
    line-height: 0;
}

.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    color: var(--resin-deep);
    font-size: 0.84rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.section-kicker::before {
    content: "";
    width: 32px;
    height: 1px;
    background: currentColor;
    opacity: 0.66;
}

.hero .section-kicker,
.page-intro .section-kicker,
.home-hero .section-kicker,
.studio-sidebar .section-kicker {
    color: var(--resin-soft);
}

.section-title {
    max-width: 18ch;
    font-size: clamp(2rem, 3.8vw, 3.7rem);
}

.page-intro .section-title {
    color: var(--ink-inverse);
    max-width: 22ch;
}

.section-copy {
    max-width: 60ch;
    margin-top: 18px;
    color: var(--ink-muted);
    font-size: 1.06rem;
}

.hero__lead,
.page-intro .section-copy {
    color: var(--ink-inverse-muted);
}

.site-header {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: 30;
    padding-top: 5px;
}

.site-header__backdrop {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: rgba(13, 10, 9, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
    backdrop-filter: blur(3px);
}

.site-header--menu-open .site-header__backdrop {
    opacity: 1;
    pointer-events: auto;
}

.site-header > .container {
    position: relative;
    z-index: 1;
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 9px 18px;
    border-radius: 34px;
    background: var(--surface-glass);
    border: 1px solid var(--line-strong);
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(22px) saturate(120%);
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-mark__emblem {
    position: relative;
    width: 38px;
    height: 44px;
    flex-shrink: 0;
}

.brand-mark__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.22));
}

.brand-mark__copy {
    display: grid;
    gap: 2px;
}

.brand-mark__title {
    color: var(--ink-inverse);
    font-size: 1.04rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.brand-mark__title span {
    color: var(--resin-soft);
}

.brand-mark__caption {
    color: var(--ink-inverse-muted);
    font-size: 0.62rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.site-header__menu-toggle {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    color: var(--ink-inverse);
}

.site-header__menu-toggle-box {
    display: grid;
    gap: 4px;
}

.site-header__menu-toggle-box span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform 0.24s ease, opacity 0.24s ease;
    transform-origin: center;
}

.site-header__menu-toggle-label {
    font-size: 0.9rem;
    font-weight: 500;
}

.site-header__dock,
.site-header__actions,
.site-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.site-header__dock {
    flex: 1;
    min-width: 0;
    justify-content: flex-end;
}

.site-nav {
    flex-shrink: 0;
    padding: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.site-nav a {
    padding: 7px 12px;
    border-radius: 999px;
    color: var(--ink-inverse-muted);
    font-size: 0.95rem;
    white-space: nowrap;
}

.site-nav a:hover,
.site-nav a:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    color: var(--ink-inverse);
}

.site-nav a.is-active,
.site-nav a[aria-current="page"] {
    background: rgba(255, 255, 255, 0.1);
    color: var(--ink-inverse);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.nav-pill {
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--ink-inverse);
    background: rgba(255, 255, 255, 0.06);
    background-clip: padding-box;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    white-space: nowrap;
}

.nav-pill--accent {
    background: #125a64;
    background-clip: padding-box;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.24);
}

.nav-pill:hover,
.nav-pill:focus-visible,
.nav-pill--accent:hover,
.nav-pill--accent:focus-visible {
    color: var(--ink-inverse);
}

.nav-pill.is-active,
.nav-pill[aria-current="page"] {
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.24), 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.nav-pill--utility {
    background: rgba(255, 255, 255, 0.08);
}

.header-avatar {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink-inverse);
    text-decoration: none;
}

.header-avatar__frame {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    flex: none;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition:
        border-color 180ms ease,
        box-shadow 180ms ease;
}

.header-avatar__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-avatar__initials {
    color: var(--ink-inverse);
    font-size: 0.86rem;
    letter-spacing: 0.02em;
}

.header-avatar__label {
    display: none;
}

/* Точка на аватаре и число в меню: по заявкам есть непрочитанное.
   Точка держится за кружок аватара, а не за всю строку: в мобильном меню
   рядом с ним появляется подпись, и строка становится во всю ширину. */
.header-avatar__stack {
    position: relative;
    display: inline-flex;
    flex: none;
}

.header-avatar__dot {
    position: absolute;
    top: -1px;
    right: -1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--danger);
    box-shadow: 0 0 0 2px rgba(20, 18, 16, 0.85);
}

.header-account__badge {
    margin-left: auto;
    min-width: 20px;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
}

.header-avatar:hover .header-avatar__frame,
.header-avatar:focus-visible .header-avatar__frame,
.header-avatar.is-active .header-avatar__frame {
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}

/* Меню аккаунта: на десктопе раскрывается при наведении на аватар,
   по фокусу с клавиатуры и по тапу (класс is-open ставит navigation.js). */
.header-account {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.header-account__menu {
    position: absolute;
    top: 100%;
    /* Панель выступает правее аватара, чтобы справа хватило места для дуги шейки. */
    right: -22px;
    z-index: 5;
    /* Ширина по самому длинному пункту: одинаковые поля слева и справа держат значки с текстом по центру. */
    width: max-content;
    /* Отступ до панели: под шапкой видна «шейка», которой меню вытекает из аватара.
       Заодно это невидимый мостик, чтобы меню не закрывалось по пути курсора. */
    padding-top: 20px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    /* Без transform: контур меню рисуется по точным координатам аватара. */
    transition:
        opacity 160ms ease 120ms,
        visibility 0s linear 280ms;
}

.header-account.is-open .header-account__menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s, 0s;
}

/* Отдельным правилом: браузер без :has() отбросит только его.
   :focus-visible — чтобы меню не «залипало» после клика мышью. */
.header-account:has(:focus-visible) .header-account__menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s, 0s;
}

@media (hover: hover) {
    .header-account:hover .header-account__menu {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition-delay: 0s, 0s;
    }
}

/* Escape закрывает меню, даже пока курсор или фокус остаются на аватаре. */
.header-account.header-account--dismissed .header-account__menu {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition-delay: 0s, 160ms;
}

.header-account__list {
    display: grid;
    gap: 2px;
    margin: 0;
    padding: 6px;
    list-style: none;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 22px;
    background: rgba(19, 15, 13, 0.97);
    box-shadow: var(--shadow-hero);
}

.header-account__item--logout {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.header-account__form {
    margin: 0;
}

.header-account__link {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 18px 10px 16px;
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: var(--ink-inverse-muted);
    font: inherit;
    font-size: 0.95rem;
    line-height: 1.3;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition:
        background-color 160ms ease,
        color 160ms ease;
}

.header-account__link:hover,
.header-account__link:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    color: var(--ink-inverse);
}

.header-account__link.is-active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--ink-inverse);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.header-account__link--logout:hover,
.header-account__link--logout:focus-visible {
    background: rgba(166, 63, 54, 0.22);
    color: #f3c9c3;
}

.header-account__icon {
    width: 18px;
    height: 18px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.85;
}

/* Меню-«облачко» на десктопе: navigation.js рисует общий SVG-контур
   аватара и панели и ставит класс header-account--shaped.
   Без JS остаётся обычная скруглённая панель. */
.header-account__shape {
    display: none;
}

@media (min-width: 1101px) {
    .header-account--shaped .header-avatar {
        position: relative;
        z-index: 6;
    }

    .header-account--shaped .header-avatar__frame {
        transition:
            border-color 160ms ease 120ms,
            box-shadow 160ms ease 120ms;
    }

    .header-account--shaped .header-account__shape {
        position: absolute;
        z-index: 0;
        display: block;
        overflow: visible;
        pointer-events: none;
        filter: drop-shadow(0 22px 34px rgba(0, 0, 0, 0.34));
    }

    .header-account__shape path {
        fill: #15100e;
        stroke: rgba(255, 255, 255, 0.2);
        stroke-width: 1;
        stroke-linejoin: round;
    }

    .header-account--shaped .header-account__list {
        position: relative;
        z-index: 1;
        border-color: transparent;
        background: transparent;
        box-shadow: none;
    }

    /* Анимация капли: пока она идёт, видимость меню держит navigation.js (класс drop-visible),
       а кликабельность по-прежнему зависит от состояния «открыто». */
    .header-account.header-account--shaped .header-account__menu {
        opacity: 1;
        visibility: hidden;
        transition: none;
    }

    .header-account.header-account--shaped.header-account--drop-visible .header-account__menu {
        visibility: visible;
    }

    .header-account--shaped .header-account__item {
        opacity: var(--drop-content, 1);
        transform: translateY(calc((1 - var(--drop-content, 1)) * -6px));
    }

    /* Пока меню открыто, кольцо аватара рисует общий контур, собственная рамка прячется. */
    .header-account--shaped.is-open:not(.header-account--dismissed) .header-avatar__frame {
        border-color: transparent;
        box-shadow: none;
        transition-delay: 0s, 0s;
    }

    .header-account--shaped:not(.header-account--dismissed):has(:focus-visible) .header-avatar__frame {
        border-color: transparent;
        box-shadow: none;
        transition-delay: 0s, 0s;
    }
}

@media (min-width: 1101px) and (hover: hover) {
    .header-account--shaped:not(.header-account--dismissed):hover .header-avatar__frame {
        border-color: transparent;
        box-shadow: none;
        transition-delay: 0s, 0s;
    }
}

.messages-stack {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 80;
    display: grid;
    gap: 12px;
    width: min(420px, calc(100vw - 32px));
}

.flash {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(20, 15, 13, 0.56);
    box-shadow: var(--shadow-card);
    color: var(--ink-inverse);
    backdrop-filter: blur(18px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.flash--closing {
    opacity: 0;
    transform: translateY(8px);
}

.flash__message {
    min-width: 0;
}

.flash__close {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: var(--ink-inverse);
    cursor: pointer;
    font: inherit;
    line-height: 1;
}

.flash__close:hover,
.flash__close:focus-visible {
    background: rgba(255, 255, 255, 0.16);
}

.flash__close:focus-visible {
    outline: 2px solid #cfc4b7;
    outline-offset: 2px;
}

.flash-success {
    border-color: rgba(47, 124, 99, 0.32);
}

.flash-error {
    border-color: rgba(166, 63, 54, 0.32);
}

.rich-panel,
.empty-panel {
    position: relative;
    padding: 28px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--line);
    background: rgba(255, 252, 247, 0.9);
    color: var(--ink);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.rich-panel::before,
.empty-panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 1px;
    background: rgba(255, 255, 255, 0.62);
}

.empty-panel {
    color: var(--ink-muted);
}

.rich-panel :where(h1, h2, h3, h4, h5, h6, label, legend, strong) {
    color: var(--ink);
}

.rich-panel :where(p, li, small) {
    color: var(--ink-muted);
}

.narrow-flow {
    display: grid;
    gap: 20px;
    max-width: 780px;
}

.card-grid,
.contact-card-grid,
.studio-panels,
.detail-form-layout,
.gallery-grid,
.detail-gallery,
.detail-layout,
.hero__grid,
.intro-split,
.section-head,
.cta-banner,
.detail-hero {
    display: grid;
    gap: 24px;
}

.card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card-grid.card-grid--listing {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    align-items: start;
}

.contact-card-grid,
.studio-panels,
.detail-form-layout,
.detail-layout,
.hero__grid,
.intro-split,
.cta-banner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.section-head,
.detail-hero {
    grid-template-columns: 1.3fr 0.7fr;
    align-items: end;
}

.section-head {
    position: relative;
    margin-bottom: 28px;
}

.section-head--with-stage {
    padding-left: 112px;
}

.section-stage {
    position: absolute;
    left: 0;
    top: -10px;
    color: rgba(31, 24, 18, 0.08);
    font-family: var(--display-font);
    font-size: clamp(3.4rem, 7vw, 5.2rem);
    line-height: 0.85;
}

.gallery-grid,
.detail-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gallery-grid > *,
.detail-gallery > * {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.gallery-grid > .fallback-picture,
.detail-gallery > .fallback-picture {
    background: #1c1513;
}

.gallery-grid img,
.detail-gallery img {
    display: block;
    width: 100%;
    aspect-ratio: 5 / 4;
    object-fit: cover;
    background: var(--surface);
}

.detail-specs,
.mini-stack {
    display: grid;
    gap: 12px;
}

.detail-specs div {
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.detail-specs span {
    display: block;
    margin-bottom: 6px;
    color: var(--ink-inverse-muted);
    font-size: 0.84rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    color: var(--wood-dark);
    transition: color 0.22s ease;
}

.button:focus-visible,
.nav-pill:focus-visible,
.site-nav a:focus-visible,
.site-header__menu-toggle:focus-visible,
.text-link:focus-visible,
.filter-chip:focus-visible,
.mini-link-card:focus-visible {
    outline: 2px solid #cfc4b7;
    outline-offset: 4px;
}

.text-link::after {
    content: "";
    width: 0.42rem;
    height: 0.42rem;
    border-top: 2px solid var(--resin-deep);
    border-right: 2px solid var(--resin-deep);
    transform: rotate(45deg);
    transition: transform 0.22s ease, border-color 0.22s ease;
}

.text-link:hover::after,
.text-link:focus-visible::after {
    border-color: currentColor;
    transform: translateX(2px) rotate(45deg);
}

.site-footer {
    position: relative;
    margin-top: auto;
    padding: 20px 0 22px;
    background: #110d0c;
    color: var(--ink-inverse);
}

/* Footer на всех ширинах один и тот же: по центру столбиком —
   бренд, соцсети, ссылки (переносятся, если не помещаются), ©. */
.site-footer__panel {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 14px;
    text-align: center;
}

.footer-brand,
.footer-social,
.footer-links,
.footer-meta {
    display: flex;
    align-items: center;
}

.footer-brand {
    gap: 10px;
    min-width: 0;
    color: var(--ink-inverse);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.footer-brand__mark {
    width: 30px;
    height: 30px;
    object-fit: contain;
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.24));
}

.footer-socials {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.footer-social {
    position: relative;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.045);
    color: rgba(247, 240, 231, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition:
        color 180ms ease,
        border-color 180ms ease,
        background 180ms ease,
        box-shadow 180ms ease,
        transform 180ms ease;
}

.footer-social:hover,
.footer-social:focus-visible {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.12);
    color: white;
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.24);
}

.footer-social:focus-visible {
    outline: 2px solid #cfc4b7;
    outline-offset: 4px;
}

.footer-social__icon {
    display: grid;
    place-items: center;
    width: 19px;
    height: 19px;
}

.footer-social__icon svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.footer-social--youtube .footer-social__icon svg,
.footer-social--telegram .footer-social__icon svg {
    fill: currentColor;
    stroke: none;
}

.footer-social--youtube .footer-social__icon svg path + path {
    fill: var(--surface-deeper);
}

.footer-social__icon--text {
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: uppercase;
}

.footer-social__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.footer-meta {
    display: grid;
    justify-items: center;
    gap: 8px;
    min-width: 0;
    color: rgba(247, 240, 231, 0.54);
    font-size: 0.84rem;
}

.footer-meta p {
    white-space: nowrap;
}

.footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 16px;
}

/* пункт меню не рвётся на две строки: «В наличии», «Обработка данных» */
.footer-links a {
    white-space: nowrap;
}

.footer-utility-link {
    color: rgba(247, 240, 231, 0.72);
}

.footer-links a:hover,
.footer-brand:hover {
    color: var(--ink-inverse);
}

.footer-brand:focus-visible,
.footer-links a:focus-visible {
    outline: 2px solid #cfc4b7;
    outline-offset: 4px;
}

@media (max-width: 1100px) {
    .card-grid,
    .contact-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .site-header__dock {
        justify-content: flex-start;
    }
}

@media (max-width: 820px) {
    .section-head,
    .page-intro__grid,
    .card-grid,
    .contact-card-grid,
    .detail-layout,
    .intro-split,
    .cta-banner,
    .detail-form-layout,
    .gallery-grid,
    .detail-gallery,
    .detail-hero {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1100px) {
    .site-header {
        top: 0;
        padding-top: 5px;
    }

    .site-header__inner {
        position: relative;
        flex-wrap: nowrap;
        align-items: center;
        gap: 14px;
        padding: 10px 14px;
        border-radius: 28px;
    }

    .brand-mark {
        flex: 1;
        min-width: 0;
    }

    .site-header__menu-toggle {
        display: inline-flex;
        margin-left: auto;
    }

    .site-header__dock {
        display: none;
        position: absolute;
        top: calc(100% + 8px);
        left: 0;
        right: 0;
        width: auto;
        padding: 12px;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        justify-content: flex-start;
        border-radius: 28px;
        border: 1px solid var(--line-strong);
        max-height: calc(100dvh - 94px);
        overflow: auto;
        background: rgba(19, 15, 13, 0.97);
        box-shadow: var(--shadow-hero);
        backdrop-filter: blur(22px) saturate(120%);
    }

    .site-header--menu-open .site-header__dock {
        display: flex;
    }

    .site-header--menu-open .site-header__menu-toggle-box span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .site-header--menu-open .site-header__menu-toggle-box span:nth-child(2) {
        opacity: 0;
    }

    .site-header--menu-open .site-header__menu-toggle-box span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    .site-nav {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        padding: 8px;
        border-radius: 28px;
    }

    .site-header__actions {
        width: 100%;
        flex-direction: column;
    }

    .site-nav a,
    .site-header__actions .nav-pill {
        width: 100%;
        flex: none;
        justify-content: center;
        text-align: center;
    }

    .site-header__actions .header-avatar {
        width: 100%;
        justify-content: center;
        padding: 8px 16px;
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.08);
    }

    .header-avatar__label {
        display: inline;
    }

    /* В мобильном меню выпадашки нет: под строкой «Профиль» — «Заявки» и «Выход». */
    .site-header__actions .header-account {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .site-header__actions .header-account .header-account__menu {
        position: static;
        width: auto;
        padding-top: 0;
        opacity: 1;
        visibility: visible;
        transform: none;
        pointer-events: auto;
        transition: none;
    }

    .site-header__actions .header-account__list {
        display: flex;
        gap: 10px;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: none;
        box-shadow: none;
    }

    .site-header__actions .header-account__item {
        flex: 1 1 0;
        min-width: 0;
    }

    .site-header__actions .header-account__item--profile {
        display: none;
    }

    .site-header__actions .header-account__item--logout {
        margin-top: 0;
        padding-top: 0;
        border-top: 0;
    }

    .site-header__actions .header-account__link {
        justify-content: center;
        padding: 8px 16px;
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.06);
        color: var(--ink-inverse);
        text-align: center;
    }

    .site-header__actions .header-account__link:hover,
    .site-header__actions .header-account__link:focus-visible,
    .site-header__actions .header-account__link.is-active {
        background: rgba(255, 255, 255, 0.12);
        border-color: rgba(255, 255, 255, 0.22);
    }

    .site-header__actions .header-account__link--logout:hover,
    .site-header__actions .header-account__link--logout:focus-visible {
        background: rgba(166, 63, 54, 0.22);
        border-color: rgba(243, 201, 195, 0.28);
    }

    .content-section--lifted {
        margin-top: 0;
    }

    .page-intro__visual {
        justify-self: stretch;
        width: min(100%, 34rem);
        max-height: 22rem;
    }

    .section-head--with-stage {
        padding-left: 74px;
    }

    .section-stage {
        top: -4px;
    }

    .container {
        width: min(var(--container), calc(100% - 24px));
    }

    .rich-panel,
    .empty-panel {
        padding: 24px;
    }
}

@media (max-width: 680px) {
    .section-title,
    .page-intro .section-title,
    .detail-section-head .section-title,
    .contacts-card__title {
        max-width: none;
    }
}

@media (max-width: 560px) {
    .site-body {
        --site-pattern-size: 18rem;
        --site-pattern-on-dark: rgba(247, 240, 231, 0.044);
        --site-pattern-on-light: rgba(36, 25, 18, 0.022);
    }

    .messages-stack {
        right: 16px;
        bottom: 16px;
        width: calc(100vw - 32px);
    }

    .site-header__inner {
        gap: 12px;
        padding: 10px 12px;
        border-radius: 26px;
    }

    .brand-mark {
        gap: 10px;
    }

    .brand-mark__emblem {
        width: 34px;
        height: 40px;
        border-radius: 14px;
    }

    .brand-mark__title {
        font-size: 0.96rem;
    }

    .brand-mark__caption {
        font-size: 0.58rem;
        letter-spacing: 0.04em;
    }

    .site-header__menu-toggle {
        gap: 8px;
        padding: 8px 12px;
    }

    .site-header__menu-toggle-label {
        font-size: 0.84rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
    }

    .button:hover,
    .showcase-card:hover,
    .product-card:hover,
    .mini-link-card:hover,
    .footer-social:hover {
        transform: none;
    }

    .text-link:hover::after {
        transform: rotate(45deg);
    }
}

/* На телефоне шапка уезжает вверх при прокрутке вниз и возвращается
   при прокрутке вверх (класс ставит navigation.js). */
@media (max-width: 760px) {
    .site-header {
        transition: transform 0.28s ease;
    }

    .site-header--hidden {
        transform: translateY(calc(-100% - 60px));
    }
}

@media (max-width: 420px) {
    .brand-mark__caption {
        display: none;
    }
}
