.home-wrap {
    width: 100%;
}

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .home-back-to-top {
        transition: none;
    }
}

.home-container {
    box-sizing: border-box;
    max-width: 1920px;
    margin: 0 auto;
    padding-left: 120px;
    padding-right: 120px;
}

.home-header {
    position: relative;
    z-index: 20;
    padding: 56px 0 24px;
    background-image: url("../img/header_bg_with_tear_below.png");
    background-image: image-set(
        url("../img/header_bg_with_tear_below.avif") type("image/avif") 1x,
        url("../img/header_bg_with_tear_below.webp") type("image/webp") 1x,
        url("../img/header_bg_with_tear_below.png") type("image/png") 1x
    );
    background-position: center bottom;
    background-repeat: no-repeat;
    background-size: cover;
}

.page-template-tpl-home .home-header,
.post-type-archive-portfolio .home-header {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    background-image: none;
}

.page-template-tpl-home .home-header::after,
.post-type-archive-portfolio .home-header::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    bottom: clamp(-170px, -9vw, -90px);
    z-index: 1;
    pointer-events: none;
    background-image: url("../img/header_bg_with_tear_below.png");
    background-image: image-set(
        url("../img/header_bg_with_tear_below.avif") type("image/avif") 1x,
        url("../img/header_bg_with_tear_below.webp") type("image/webp") 1x,
        url("../img/header_bg_with_tear_below.png") type("image/png") 1x
    );
    background-position: center top;
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

.home-header__inner {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    column-gap: 28px;
}

.page-template-tpl-home .home-header__inner,
.post-type-archive-portfolio .home-header__inner {
    padding-bottom: 60px;
}

.home-social.home-social--header {
    justify-self: start;
    gap: 40px;
}

.home-logo {
    justify-self: center;
}

.home-nav {
    justify-self: end;
}

.home-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    text-decoration: none;
    flex-shrink: 0;
}

.home-logo-mark svg {
    display: block;
    width: min(304px, 32vw);
    height: auto;
}

.home-social {
    display: flex;
    align-items: center;
    gap: 24px;
}

.home-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    text-decoration: none;
    border-radius: 4px;
    line-height: 0;
    transition: color 220ms ease;
}

.home-icon-link svg {
    display: block;
    width: 34px;
    height: 34px;
}

.home-icon-link--mail svg {
    width: 33px;
    height: 27px;
}

.home-nav {
    display: flex;
    align-items: center;
    gap: 42px;
}

.home-nav a {
    font-family: "Bricolage Grotesque", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-size: 20px;
    font-weight: 500;
    line-height: 1.2;
    color: #000;
    text-decoration: none;
    border-radius: 4px;
    transition: color 220ms ease;
}

.home-nav a:hover {
    color: #9e8460;
}

.home-social--header .home-icon-link {
    color: #000;
}

.home-social--header .home-icon-link:hover {
    color: #9e8460;
}

.home-social--header .home-icon-link svg [fill]:not([fill="none"]) {
    fill: currentColor;
}

.home-social--header .home-icon-link svg [stroke]:not([stroke="none"]) {
    stroke: currentColor;
}

.home-mobile-nav {
    display: none;
}

.home-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.home-mobile-nav__toggle {
    list-style: none;
}

.home-main {
    min-height: 40vh;
    padding: 48px 0 72px;
}

.home-main p {
    margin: 0;
    font-family: "Bricolage Grotesque", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-size: 18px;
    color: #000;
}

.home-footer {
    background: #e8ddc8;
}

.home-footer__divider {
    height: 2px;
    background: #938266;
}

.home-footer__social-row {
    display: flex;
    justify-content: center;
    padding: 58px 0 46px;
}

.home-footer__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    padding: 31px 0 78px;
}

.home-footer__copyright {
    margin: 0;
    font-family: "Bricolage Grotesque", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    font-weight: 300;
    line-height: 1.3;
    color: #000;
}

.home-social--footer {
    gap: 30px;
}

.home-social--footer .home-icon-link {
    color: #000;
}

.home-social--footer .home-icon-link svg {
    width: auto;
    height: 34px;
}

.home-social--footer .home-icon-link:hover {
    color: #9e8460;
}

.home-social--footer .home-icon-link svg [fill]:not([fill="none"]) {
    fill: currentColor;
}

.home-social--footer .home-icon-link svg [stroke]:not([stroke="none"]) {
    stroke: currentColor;
}

.home-legal {
    display: flex;
    align-items: center;
    gap: clamp(24px, 4vw, 90px);
}

.home-legal a {
    font-family: "Bricolage Grotesque", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    font-weight: 300;
    line-height: 1.3;
    color: #000;
    text-decoration: none;
    border-radius: 4px;
    transition: color 220ms ease;
}

.home-legal a:hover {
    color: #9e8460;
}

.home-back-to-top {
    position: fixed;
    right: clamp(18px, 2.8vw, 40px);
    bottom: clamp(18px, 3vw, 40px);
    z-index: 90;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border: 0;
    border-radius: 50%;
    width: 47px;
    height: 47px;
    padding: 0;
    background: #9e8460;
    color: #fdf6e7;
    box-shadow: 0 10px 24px #00000033;
    cursor: pointer;
    transform: translateY(16px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 220ms ease, transform 220ms ease, background-color 220ms ease, visibility 0ms linear 220ms;
}

.home-back-to-top.is-visible {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 220ms ease, transform 220ms ease, background-color 220ms ease;
}

.home-back-to-top:hover {
    background: #c38e45;
}

.home-back-to-top__icon {
    width: 22px;
    height: 13px;
    display: block;
}

.home-logo:focus-visible,
.home-icon-link:focus-visible,
.home-mobile-nav__toggle:focus-visible,
.home-mobile-nav__menu a:focus-visible,
.home-nav a:focus-visible,
.home-legal a:focus-visible,
.home-back-to-top:focus-visible {
    outline: 2px solid #111;
    outline-offset: 3px;
}

@media (max-width: 1280px) {
    .home-container {
        padding-left: 72px;
        padding-right: 72px;
    }

    .home-nav {
        gap: 28px;
    }
}

@media (max-width: 1024px) {
    :root {
        --home-logo-mobile-width: clamp(188px, 57.2vw, 322px);
        --home-mobile-edge-offset: clamp(16px, 10vw, 90px);
        --home-hamburger-size: clamp(34px, 8vw, 60px);
        --home-hamburger-height: calc(var(--home-hamburger-size) * 0.78);
        --home-hamburger-line-width: calc(var(--home-hamburger-size) * 0.92);
        --home-hamburger-line-height: clamp(4px, calc(var(--home-hamburger-size) * 0.12), 8px);
        --home-hamburger-line-gap: clamp(5px, calc(var(--home-hamburger-size) * 0.14), 8px);
        --home-hamburger-line-shift: calc(var(--home-hamburger-line-height) + var(--home-hamburger-line-gap));
    }

    .home-container {
        padding-left: 24px;
        padding-right: 24px;
    }

    .home-header {
        padding: 44px 0 16px;
        background-image: url("../img/mobile_bg_with_tear.png");
        background-image: image-set(
            url("../img/mobile_bg_with_tear.avif") type("image/avif") 1x,
            url("../img/mobile_bg_with_tear.webp") type("image/webp") 1x,
            url("../img/mobile_bg_with_tear.png") type("image/png") 1x
        );
        background-position: center top;
        background-repeat: no-repeat;
        background-size: cover;
    }

    .page-template-tpl-home .home-header::after,
    .post-type-archive-portfolio .home-header::after {
        bottom: -72px;
        background-image: url("../img/mobile_bg_with_tear.png");
        background-image: image-set(
            url("../img/mobile_bg_with_tear.avif") type("image/avif") 1x,
            url("../img/mobile_bg_with_tear.webp") type("image/webp") 1x,
            url("../img/mobile_bg_with_tear.png") type("image/png") 1x
        );
    }

    .home-header__inner {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        column-gap: clamp(8px, 2.2vw, 16px);
        padding-left: var(--home-mobile-edge-offset);
        padding-right: var(--home-mobile-edge-offset);
    }

    .page-template-tpl-home .home-header__inner,
    .post-type-archive-portfolio .home-header__inner {
        padding-bottom: 28px;
    }

    .home-logo-mark {
        display: block;
        width: 100%;
    }

    .home-logo-mark svg {
        width: 100%;
        height: auto;
    }

    .home-logo {
        width: 100%;
        max-width: var(--home-logo-mobile-width);
        height: auto;
        justify-content: flex-start;
        margin-bottom: 30px;
        margin-left: 0;
    }

    .home-social--header,
    .home-nav {
        display: none;
    }

    .home-mobile-nav {
        display: flex;
        align-items: center;
        position: relative;
        justify-self: end;
        align-self: center;
        margin-left: 0;
        margin-right: 0;
        margin-top: 15px;
        margin-bottom: 30px;
        z-index: 120;
    }

    .home-mobile-nav__toggle {
        width: var(--home-hamburger-size);
        height: var(--home-hamburger-height);
        border: 0;
        border-radius: 0;
        background: transparent;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: var(--home-hamburger-line-gap);
        flex-direction: column;
        cursor: pointer;
        user-select: none;
        position: relative;
        overflow: visible;
        z-index: 140;
    }

    .home-mobile-nav__line {
        width: var(--home-hamburger-line-width);
        height: var(--home-hamburger-line-height);
        background: #1c1b1f;
        border-radius: 999px;
        transform-origin: center;
        transition: transform 180ms ease, opacity 180ms ease;
    }

    .home-mobile-nav.is-open .home-mobile-nav__line:nth-child(2),
    .home-mobile-nav[open] .home-mobile-nav__line:nth-child(2) {
        transform: translateY(var(--home-hamburger-line-shift)) rotate(45deg);
    }

    .home-mobile-nav.is-open .home-mobile-nav__line:nth-child(3),
    .home-mobile-nav[open] .home-mobile-nav__line:nth-child(3) {
        opacity: 0;
    }

    .home-mobile-nav.is-open .home-mobile-nav__line:nth-child(4),
    .home-mobile-nav[open] .home-mobile-nav__line:nth-child(4) {
        transform: translateY(calc(var(--home-hamburger-line-shift) * -1)) rotate(-45deg);
    }

    .home-mobile-nav__menu {
        position: fixed;
        inset: 0;
        padding: max(108px, 12vh) 24px 40px;
        background: #fdf6e7;
        display: grid;
        justify-items: center;
        align-content: center;
        gap: 52px;
        transform: translateX(100%);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: transform 360ms ease, opacity 280ms ease, visibility 0ms linear 360ms;
        z-index: 110;
    }

    .home-mobile-nav.is-open .home-mobile-nav__menu,
    .home-mobile-nav[open] .home-mobile-nav__menu {
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition: transform 360ms ease, opacity 280ms ease;
    }

    .home-mobile-nav.is-open.is-closing .home-mobile-nav__menu {
        transform: translateX(100%);
        opacity: 0;
        visibility: visible;
        pointer-events: none;
        transition: transform 360ms ease, opacity 280ms ease;
    }

    .home-mobile-nav__links {
        width: min(100%, 312px);
        display: grid;
        gap: 16px;
    }

    .home-mobile-nav__links a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: min(100%, 300px);
        justify-self: center;
        min-height: 52px;
        border-radius: 30px;
        background: #9e8460;
        box-shadow: 0 4px 4px 0 #00000040;
        text-decoration: none;
        color: #fff;
        font-family: "Bricolage Grotesque", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
        font-size: 20px;
        font-weight: 600;
        line-height: 1;
        transition: background-color 220ms ease, transform 180ms ease;
    }

    .home-mobile-nav__links a:hover {
        background: #c38e45;
    }

    .home-mobile-nav__social {
        display: grid;
        justify-items: center;
        gap: 18px;
    }

    .home-mobile-nav__social-label {
        margin: 0;
        font-family: "Bricolage Grotesque", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
        font-size: 20px;
        font-weight: 500;
        line-height: 1.2;
        color: #000;
        text-align: center;
    }

    .home-social--mobile {
        gap: 40px;
    }

    .home-social--mobile .home-icon-link svg {
        width: 54px;
        height: 54px;
    }

    .home-social--mobile .home-icon-link {
        color: #000;
    }

    .home-social--mobile .home-icon-link:hover {
        color: #9e8460;
    }

    .home-social--mobile .home-icon-link svg [fill]:not([fill="none"]) {
        fill: currentColor;
    }

    .home-social--mobile .home-icon-link svg [stroke]:not([stroke="none"]) {
        stroke: currentColor;
    }

    body:has(.home-mobile-nav.is-open),
    body:has(.home-mobile-nav[open]) {
        overflow: hidden;
    }

    .home-footer__social-row {
        padding: 34px 0 24px;
    }

    .home-footer__meta {
        flex-direction: column;
        gap: 18px;
        text-align: center;
        padding: 18px 0 30px;
    }

    .home-social--footer {
        justify-content: center;
    }

    .home-legal {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 12px;
        order: 1;
    }

    .home-footer__copyright {
        order: 2;
    }

    .home-back-to-top {
        right: 14px;
        bottom: 14px;
        width: 60px;
        height: 60px;
    }

    .home-back-to-top__icon {
        width: 29px;
        height: 17px;
    }
}

@media (min-width: 701px) and (max-width: 1024px) {
    .home-header__inner {
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    }

    .home-logo {
        grid-column: 2;
        justify-self: center;
        justify-content: center;
        margin-left: auto;
        margin-right: auto;
    }

    .home-mobile-nav {
        grid-column: 3;
        justify-self: end;
    }
}
