:root {
    --page-bg: #FFFFFF;
    --text-color: #1f1f1f;
    --body-text: #707070;
    --heading-color: #1A6A74;
    --header-bg: #1A6A74;
    --surface-border: #d9d0be;
    --tile-bg: #fffcf6;
    --menu-bg: #DCDCDC;
    --menu-collapsed-width: 90px;
    --menu-expanded-width: 300px;
    --header-height: 177px;
    --shell-offset: var(--menu-collapsed-width);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "proxima-nova", "Proxima Nova", Arial, sans-serif;
    color: var(--body-text);
    background-color: var(--page-bg);
    position: relative;
    overflow-x: hidden;
    font-size: 16px;
    line-height: 1.45;
}

/* Keep a white page while rendering the centered SVG as a subtle global backdrop. */
body::before {
    content: "";
    position: fixed;
    left: var(--menu-collapsed-width);
    right: 0;
    top: var(--header-height);
    bottom: 0;
    z-index: -1;
    background-color: var(--page-bg);
    background-image: url('/assets/images/background_image.svg');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: min(560px, 62vw) auto;
}

.site-menu {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 20;
    width: var(--menu-collapsed-width);
    height: 100vh;
    background: var(--menu-bg);
    border-right: 1px solid #c5c5c5;
    transition: width 0.28s ease;
    overflow: hidden;
}

.menu-toggle-wrap {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-toggle {
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    background: transparent;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.menu-toggle-bar {
    width: 30px;
    height: 3px;
    background: #1f1f1f;
    display: block;
    transition: transform 0.28s ease, opacity 0.28s ease;
}

.menu-nav {
    height: calc(100vh - var(--header-height));
    padding: 12px 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s ease;
}

.menu-group {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.menu-group-footer {
    margin-top: auto;
    gap: 8px;
}

.menu-link {
    color: #494949;
    text-decoration: none;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 1.5rem;
    font-weight: 600;
    white-space: nowrap;
}

.menu-link:hover,
.menu-link.is-active {
    background: transparent;
    border: 0;
}

.menu-link.is-active {
    color: var(--heading-color);
}

.menu-link-footer {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--body-text);
}

.menu-link-footer.is-active {
    color: var(--body-text);
}

.page-shell {
    margin-left: var(--menu-collapsed-width);
    transition: margin-left 0.28s ease;
}

.site-header {
    height: var(--header-height);
    background: var(--header-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-inner {
    width: 100%;
    max-width: 900px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 100px;
}

.header-image {
    width: auto;
    display: block;
}

.header-logo {
    max-height: 105px;
    width: auto;
    display: block;
}

.wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 18px 24px 14px;
    min-height: calc(100vh - var(--header-height));
    display: flex;
    flex-direction: column;
}

h1,
h2 {
    margin-top: 0;
    margin-bottom: 0;
    color: var(--heading-color);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.45;
}

.content {
    line-height: 1.65;
    flex: 1;
}

.home-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.95fr);
    gap: 40px;
    align-items: center;
    min-height: calc(100vh - var(--header-height) - 32px);
}

.wrap-home {
    max-width: 1120px;
}

.home-copy {
    font-size: 1.1rem;
    line-height: 1.6;
}

.home-title,
.home-heading {
    letter-spacing: 0.06em;
    font-size: 1.1rem;
}

.home-title {
    margin-bottom: 12px;
}

.home-heading {
    margin-top: 18px;
    margin-bottom: 10px;
}

.home-cta {
    margin-top: 50px;
}

.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 14px;
    padding: 10px 24px;
    min-height: 42px;
    background: #1f1f1f;
    color: #FFFFFF;
    text-decoration: none;
    letter-spacing: 0.08em;
}

.button-link:hover {
    background: #1A6A74;
}

.home-visual {
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-image {
    width: min(100%, 420px);
    height: auto;
    display: block;
}

.services-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(220px, 0.75fr);
    gap: 34px;
    align-items: center;
}

.services-copy {
    font-size: 1.05rem;
    line-height: 1.6;
}

.services-copy li {
    color: #494949;
    font-weight: 700;
}

.services-title {
    margin-bottom: 12px;
    letter-spacing: 0.06em;
}

.services-visual {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    align-self: end;
}

.services-image {
    width: min(100%, 260px);
    height: auto;
    display: block;
}

.services-page {
    min-height: calc(100vh - var(--header-height) - 32px);
    display: grid;
    grid-template-rows: 1fr auto;
}

.services-page .services-layout {
    align-self: center;
}

.services-gallery {
    --services-gallery-width: min(90vw, calc(100vw - var(--shell-offset) - 16px));
    margin-top: 0;
    margin-bottom: 16px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    width: var(--services-gallery-width);
    margin-left: calc((100% - var(--services-gallery-width)) / 2);
    margin-right: calc((100% - var(--services-gallery-width)) / 2);
    max-width: none;
    justify-items: center;
    align-items: center;
    transition: width 0.28s ease, margin-left 0.28s ease, margin-right 0.28s ease;
}

.services-gallery-image {
    width: min(100%, 280px);
    object-fit: cover;
    display: block;
    transition: width 0.28s ease, transform 0.28s ease;
}

.contact-page {
    min-height: calc(100vh - var(--header-height) - 32px);
    display: grid;
    align-content: center;
    gap: 28px;
}

.contact-info-block,
.contact-form-block {
    padding: 8px 0;
}

.contact-title {
    margin-bottom: 18px;
}

.contact-info-block {
    text-align: center;
}

.contact-master {
    margin-top: 22px;
    margin-bottom: 6px;
}

.contact-address {
    margin-top: 0;
    margin-bottom: 16px;
}

.contact-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 10px 0;
    color: #494949;
}

.contact-icon {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: #dcdcdc;
    color: #1f1f1f;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex: 0 0 30px;
}

.contact-form {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 10px 14px;
    max-width: 840px;
}

.contact-form > input,
.contact-form > button {
    grid-column: 1;
}

.contact-form > textarea {
    grid-column: 2;
    grid-row: 1 / span 4;
    height: 100%;
    min-height: 178px;
}

.references-section {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    min-height: calc(100vh - var(--header-height) - 32px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.references-title {
    margin-bottom: 14px;
    text-align: center;
}

.references-carousel {
    width: calc(100vw - var(--shell-offset));
    margin-left: calc((100% - (100vw - var(--shell-offset))) / 2);
    margin-right: calc((100% - (100vw - var(--shell-offset))) / 2);
    max-width: none;
}

.references-carousel-stage {
    position: relative;
    height: 430px;
    overflow: hidden;
}

.references-carousel-item {
    --offset: 0;
    --abs-offset: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 420px;
    height: 270px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    padding: 0;
    box-shadow: none;
    line-height: 0;
    overflow: visible;
    cursor: pointer;
    transform: translate(-50%, -50%) translateX(calc(var(--offset) * 300px)) scale(0.82);
    transition: transform 0.28s ease, opacity 0.28s ease;
    opacity: 0;
    z-index: 1;
}

.references-carousel-label {
    position: absolute;
    left: 50%;
    top: -34px;
    transform: translateX(-50%);
    color: var(--heading-color);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.references-carousel-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.references-carousel-item.is-active {
    transform: translate(-50%, -50%) translateX(0) scale(1);
    opacity: 1;
    z-index: 6;
}

.references-carousel-item.is-active .references-carousel-label {
    opacity: 1;
}

.references-carousel-item.is-side {
    transform: translate(-50%, -50%) translateX(calc(var(--offset) * 300px)) scale(0.82);
    opacity: 1;
    z-index: 5;
}

.references-carousel-item.is-far {
    transform: translate(-50%, -50%) translateX(calc(var(--offset) * 300px)) scale(0.55);
    opacity: 0;
    pointer-events: none;
    z-index: 1;
}

.references-dots {
    margin-top: 12px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.references-dot {
    width: 40px;
    height: 12px;
    border: 0;
    border-radius: 999px;
    background: #bcbcbc;
    cursor: pointer;
    padding: 0;
}

.references-dot.is-active {
    background: var(--heading-color);
}

.references-lightbox[hidden] {
    display: none;
}

.references-lightbox {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(16, 20, 24, 0.7);
}

.references-lightbox-inner {
    width: min(1320px, 97vw);
}

.references-lightbox-view {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 52px;
    gap: 14px;
    align-items: center;
}

.references-lightbox-figure {
    margin: 0;
    width: 100%;
}

.references-lightbox-image {
    width: 100%;
    max-height: 86vh;
    object-fit: contain;
    display: block;
    border-radius: 10px;
}

.references-lightbox-arrow {
    width: 52px;
    height: 52px;
    border-radius: 999px;
    border: 0;
    background: rgba(255, 255, 255, 0.88);
    color: #1f1f1f;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    line-height: 1;
    padding: 0;
}

.references-lightbox-dots {
    margin-top: 14px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.references-lightbox-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    border: 0;
    padding: 0;
    background: rgba(255, 255, 255, 0.45);
}

.references-lightbox-dot.is-active {
    background: #FFFFFF;
}

body.lightbox-open {
    overflow: hidden;
}

.grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.tile {
    padding: 14px;
    border: 1px solid var(--surface-border);
    background: var(--tile-bg);
}

.flash {
    padding: 10px 12px;
    margin-bottom: 16px;
    border: 1px solid;
}

.flash.success {
    background: #e9f5ea;
    border-color: #70a878;
}

.flash.error {
    background: #fdecec;
    border-color: #d27878;
}

form {
    display: grid;
    gap: 10px;
}

input,
textarea,
button {
    padding: 10px;
    font: inherit;
    border: 1px solid #b9b0a0;
    background: #fff;
}

button {
    cursor: pointer;
    background: #1f1f1f;
    color: #fff;
}

footer {
    margin-top: 16px;
    font-size: 0.9rem;
    color: var(--body-text);
}

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

.menu-open .site-menu {
    width: var(--menu-expanded-width);
}

.menu-open {
    --shell-offset: var(--menu-expanded-width);
}

.menu-open .menu-nav {
    opacity: 1;
    pointer-events: auto;
}

.menu-open .page-shell {
    margin-left: var(--menu-expanded-width);
}

.menu-open .menu-toggle-bar:nth-child(2) {
    transform: translateY(9px) rotate(45deg);
}

.menu-open .menu-toggle-bar:nth-child(3) {
    opacity: 0;
}

.menu-open .menu-toggle-bar:nth-child(4) {
    transform: translateY(-9px) rotate(-45deg);
}

@media (max-width: 700px) {
    :root {
        --mobile-menu-height: 72px;
        --header-height: 128px;
        --mobile-header-compact-height: 66px;
        --shell-offset: 0px;
    }

    body::before {
        left: 0;
    }

    .menu-open {
        --shell-offset: 0px;
    }

    .site-menu {
        top: 0;
        left: 0;
        width: 100vw;
        max-width: 100vw;
        height: var(--mobile-menu-height);
        border-right: 0;
        border-bottom: 1px solid #c5c5c5;
        overflow: visible;
    }

    .menu-toggle-wrap {
        height: var(--mobile-menu-height);
        justify-content: flex-end;
        padding-right: max(14px, env(safe-area-inset-right));
        padding-left: 12px;
    }

    .menu-nav {
        position: absolute;
        top: var(--mobile-menu-height);
        left: 0;
        width: 100vw;
        max-width: 100vw;
        height: auto;
        max-height: calc(100vh - var(--mobile-menu-height));
        padding: 14px 18px 16px;
        background: var(--menu-bg);
        border-bottom: 1px solid #c5c5c5;
        opacity: 0;
        transform: translateY(-10px);
        pointer-events: none;
        overflow-y: auto;
        transition: opacity 0.18s ease, transform 0.22s ease;
    }

    .menu-group-main {
        gap: 10px;
        align-items: center;
    }

    .menu-group-footer {
        margin-top: 18px;
        padding-top: 12px;
        border-top: 1px solid rgba(73, 73, 73, 0.18);
        gap: 6px;
        align-items: flex-end;
        text-align: right;
    }

    .menu-group-main .menu-link {
        text-align: center;
    }

    .menu-group-footer .menu-link {
        text-align: right;
    }

    .page-shell {
        margin-left: 0;
        padding-top: calc(var(--mobile-menu-height) + var(--header-height));
    }

    .menu-open .site-menu {
        width: 100vw;
    }

    .menu-open .menu-nav {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    .menu-open .page-shell {
        margin-left: 0;
    }

    .site-header {
        position: fixed;
        top: var(--mobile-menu-height);
        left: 0;
        width: 100vw;
        z-index: 15;
        height: var(--header-height);
        transition: height 0.24s ease;
    }

    .header-inner {
        height: 100%;
        justify-content: center;
        gap: 0;
    }

    .header-image {
        display: none;
    }

    .header-logo {
        max-height: 78px;
        max-width: min(78vw, 260px);
        transition: max-height 0.24s ease;
    }

    .mobile-header-compact .site-header {
        height: var(--mobile-header-compact-height);
    }

    .mobile-header-compact .header-logo {
        max-height: 36px;
    }

    .wrap {
        padding: 16px 18px 14px;
        min-height: calc(100vh - var(--header-height) - var(--mobile-menu-height));
    }

    .home-layout {
        grid-template-columns: 1fr;
        gap: 18px;
        min-height: auto;
    }

    .home-copy {
        font-size: 1rem;
    }

    .home-title,
    .home-heading {
        font-size: 1rem;
    }

    .home-cta {
        margin-top: 16px;
    }

    .home-visual {
        order: 2;
    }

    .home-image {
        width: min(100%, 250px);
    }

    .services-layout {
        grid-template-columns: 1fr;
        gap: 18px;
        min-height: auto;
    }

    .services-page {
        min-height: auto;
        display: block;
    }

    .services-copy {
        font-size: 1rem;
    }

    .services-image {
        width: min(100%, 190px);
    }

    .services-gallery {
        margin-top: 18px;
        margin-bottom: 0;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .services-gallery-image {
        width: 100%;
    }

    .contact-page {
        min-height: auto;
        gap: 18px;
    }

    .contact-info-block,
    .contact-form-block {
        padding: 0;
    }

    .contact-form {
        grid-template-columns: 1fr;
        max-width: 100%;
        gap: 10px;
    }

    .contact-form > textarea {
        grid-column: 1;
        grid-row: auto;
        min-height: 120px;
    }

    .references-carousel {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .references-section {
        min-height: auto;
        justify-content: flex-start;
    }

    .references-carousel-stage {
        height: 310px;
    }

    .references-carousel-item {
        width: 260px;
        height: 165px;
        transform: translate(-50%, -50%) translateX(calc(var(--offset) * 165px)) scale(0.8);
    }

    .references-carousel-label {
        top: -24px;
        font-size: 0.82rem;
    }

    .references-carousel-item.is-side {
        transform: translate(-50%, -50%) translateX(calc(var(--offset) * 165px)) scale(0.8);
    }

    .references-carousel-item.is-far {
        transform: translate(-50%, -50%) translateX(calc(var(--offset) * 165px)) scale(0.55);
        opacity: 0;
        pointer-events: none;
    }

    .references-lightbox {
        padding: 12px;
    }

    .references-lightbox-inner {
        width: min(96vw, 520px);
    }

    .references-lightbox-view {
        grid-template-columns: 42px minmax(0, 1fr) 42px;
        gap: 8px;
    }

    .references-lightbox-arrow {
        width: 42px;
        height: 42px;
        font-size: 1.2rem;
    }

    .references-lightbox-image {
        max-height: 72vh;
    }
}
