:root {
    --color-text: #111111;
    --footer-text: #ffffff;
    --color-background: #ffffff;
    --color-highlight: #EA0000;
    --color-panel: #F5F5F5;
    --color-border: #DDDDDD;
}

* {
    box-sizing: border-box;
}

body {
    position: relative;
    min-height: 100vh;
    margin: 0;
    padding-right: 30vw;
    overflow-x: hidden;
    color: var(--color-text);
    background-color: var(--color-background);
    font-family: Arial, sans-serif;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
}

body::after {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    width: 30vw;
    background-image: url("./images/home/right_side_optimized.jpg");
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    content: "";
    pointer-events: none;
}

body > * {
    position: relative;
    z-index: 1;
}

img {
    max-width: 100%;
    height: auto;
}

main {
    width: 100%;
    margin: 0;
    padding: 2rem 5%;
    background-color: #f7f7f7;
    flex: 1;
}

header,
.main-header {
    padding: 1rem 5%;
    background-color: #f7f7f7;
    text-align: center;
}

nav ul {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

nav a {
    color: var(--color-text);
    text-decoration: none;
}

nav a:hover,
nav a:focus {
    color: var(--color-highlight);
}

.logo,
#logo {
    display: block;
    width: 180px;
    margin: 1.5rem auto;
}

.main-heading,
.sub-heading {
    display: block;
    font-weight: bold;
}

.main-heading {
    max-width: 650px;
    margin: 1rem auto 0;
    font-size: 2.5rem;
    line-height: 1.1;
    color: var(--color-text);
}

.sub-heading {
    margin: 0.5rem 0 0;
    color: var(--color-highlight);
    font-size: 1.25rem;
    font-weight: bold;
}

.hero-content {
    max-width: 760px;
    margin: 0 auto;
}

.hero-intro {
    max-width: 600px;
    margin: 1rem auto 0;
    font-size: 1.1rem;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.button-primary,
.button-secondary,
.section-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
}

.button-primary,
.section-button {
    background-color: var(--color-highlight);
    color: var(--color-background);
}

.button-secondary {
    border: 2px solid var(--color-text);
    color: var(--color-text);
}

.button-primary:hover,
.button-primary:focus,
.section-button:hover,
.section-button:focus {
    background-color: var(--color-text);
}

.button-secondary:hover,
.button-secondary:focus {
    border-color: var(--color-highlight);
    color: var(--color-highlight);
}

.section-heading {
    margin-top: 0;
    text-align: center;
}

.about-copy {
    max-width: 820px;
    margin: 1rem auto 0;
    padding: 1.25rem 1.5rem;
    border: 1px solid #d6d6d6;
    border-radius: 6px;
    background-color: var(--color-background);
    line-height: 1.6;
    text-align: center;
}

.images-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.images-bottom img {
    width: 150px;
    object-fit: contain;
}

.page-header {
    padding-bottom: 2.5rem;
}

.services-page {
    background-color: #f7f7f7;
}

.page-hero {
    max-width: 760px;
    margin: 0 auto;
}

.page-hero .logo {
    margin-bottom: 1rem;
}

.page-kicker {
    margin: 0;
    color: var(--color-highlight);
    font-size: 0.85rem;
    font-weight: bold;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.page-hero h1 {
    margin: 0.5rem 0 0;
    font-size: 2.5rem;
    line-height: 1.1;
}

.page-hero > p:last-child {
    max-width: 600px;
    margin: 1rem auto 0;
    font-size: 1.1rem;
}

.services-main {
    width: min(100%, 1100px);
    margin: 0 auto;
    padding: 3rem 5% 4rem;
}

.project-intro {
    max-width: 760px;
    margin: 0 auto 2.5rem;
    text-align: center;
}

.project-intro h2,
.project-card h2,
.project-note h2 {
    margin: 0;
    font-size: 1.75rem;
}

.project-intro p {
    margin: 0.75rem 0 0;
}

.project-list {
    display: grid;
    gap: 3rem;
}

.project-card {
    padding: 1.5rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background-color: var(--color-background);
}

.project-card-header {
    max-width: 700px;
    margin: 0 auto 1.5rem;
    text-align: center;
}

.project-number {
    margin: 0;
    color: var(--color-highlight);
    font-size: 0.85rem;
    font-weight: bold;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.project-card-header h2 {
    margin-top: 0.5rem;
}

.project-card-header p:last-child {
    margin: 0.75rem 0 0;
}

.project-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}

.photo-card {
    position: relative;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background-color: var(--color-background);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.photo-card img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.photo-card figcaption {
    padding: 0.75rem 1rem;
    font-weight: bold;
}

.photo-label {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    padding: 0.35rem 0.75rem;
    border-radius: 0 0 4px 0;
    background-color: var(--color-highlight);
    color: var(--color-background);
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}

.photo-card-after .photo-label {
    background-color: var(--color-text);
}

.project-note {
    margin-top: 3.5rem;
    padding: 1.5rem;
    border-top: 3px solid var(--color-highlight);
    background-color: var(--color-background);
    text-align: center;
}

.project-note p {
    margin: 0.75rem 0 0;
}

.page-cta {
    margin-top: 3rem;
    text-align: center;
}

.page-cta p {
    margin: 0 0 1rem;
    font-size: 1.1rem;
}

.contact-page {
    background-color: #f7f7f7;
}

.contact-main {
    width: min(100%, 1000px);
    margin: 0 auto;
    padding: 3rem 5% 4rem;
    background-color: #f7f7f7;
}

.contact-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
    align-items: start;
}

.contact-details,
.contact-form {
    padding: 1.5rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background-color: var(--color-background);
}

.contact-details h2,
.contact-form h2 {
    margin: 0;
    font-size: 1.5rem;
}

.contact-details > p {
    margin: 0.75rem 0 0;
}

.contact-methods {
    display: grid;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.contact-methods p {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.contact-methods img {
    width: 1.25rem;
    height: 1.25rem;
}

.contact-methods a {
    color: var(--color-text);
}

.contact-form {
    display: grid;
    gap: 0.5rem;
}

.contact-form h2 {
    margin-bottom: 0.5rem;
}

.contact-form label {
    font-weight: bold;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    color: var(--color-text);
    font: inherit;
}

.contact-form textarea {
    resize: vertical;
}

.contact-form button {
    margin-top: 0.75rem;
    border: 0;
    cursor: pointer;
    font: inherit;
}

.contact-form button:hover,
.contact-form button:focus {
    background-color: var(--color-text);
}

.our-services {
    width: 100%;
    margin: 2rem 0 0;
}

.our-services .section-heading {
    text-align: center;
}

.our-services .section-heading > a {
    display: block;
    width: min(100%, 520px);
    padding: 0.75rem 1rem;
    margin: 0 0 1rem;
    background-color: #EA0000;
    border-radius: 20px;
    color: var(--color-background);
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
}

.service-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    width: min(100%, 760px);
    margin: 0 auto;
    padding: 0;
}

.service-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 8rem;
    padding: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background-color: var(--color-background);
    text-align: left;
}

.service-card:last-child {
    grid-column: 1 / -1;
    width: calc(50% - 0.5rem);
    justify-self: center;
}

.service-card img {
    flex: 0 0 1.25rem;
    width: 1.25rem;
    height: 1.25rem;
}

.service-card h3 {
    margin: 0;
    font-size: 1rem;
}

.service-card p {
    margin: 0.35rem 0 0;
    font-size: 0.9rem;
}

.cta {
    width: min(100%, 520px);
    margin: 1.5rem auto 0;
}

.cta > a {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background-color: #EA0000;
    border-radius: 20px;
    color: var(--color-background);
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
}
.machine-gallery {
    position: absolute;
    top: 50%;
    right: 30vw;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5rem;
    width: 180px;
    margin: 0;
    transform: translate(50%, -50%);
}

.machine-circle {
    flex: 0 0 180px;
    width: 180px;
    height: 180px;
    overflow: hidden;
    border: 8px solid var(--color-background);
    border-radius: 50%;
    background-color: var(--color-background);
    box-shadow: 0 0 0 3px var(--color-text);
}

.machine-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.contact-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 2rem 1.5rem;
    width: min(90%, 1100px);
    margin: 0 auto;
    padding: 1rem 0;
    text-align: center;
}

.contact-info p {
    margin: 0;
}

.contact-info img {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.4rem;
    vertical-align: middle;
    filter: invert(1);
}

.trust-section {
    margin-top: 4rem;
    text-align: center;
}

.trust-section h2 {
    margin: 0 0 1rem;
    font-size: 1.25rem;
}

.trust-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.trust-card {
    display: grid;
    min-height: 100px;
    place-items: center;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background-color: var(--color-background);
}

.trust-card img {
    width: 100%;
    max-width: 150px;
    max-height: 75px;
    object-fit: contain;
}

.footer-section {
    align-self: flex-start;
    width: 100vw;
    padding: 1rem 5%;
    color: var(--footer-text);
    background-color: var(--color-text);
    text-align: center;
}

.footer-bottom p {
    margin: 0.25rem 0;
}

.footer-bottom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
}

.footer-bottom > p {
    grid-column: 2;
}

.footer-bottom .contact-info {
    grid-row: span 2;
    grid-column: 1;
    width: auto;
    margin: 0;
    text-align: left;
}

.footer-bottom a {
    color: var(--footer-text);
}

.error-page {
    padding-right: 0;
    background-color: var(--color-panel);
}

.error-page::after {
    width: 40vw;
    opacity: 0.35;
}

.error-header {
    background-color: transparent;
}

.error-main {
    display: grid;
    width: 100%;
    min-height: calc(100vh - 220px);
    margin: 0;
    padding: 3rem 5%;
    place-items: center;
    background-color: transparent;
}

.error-card {
    width: min(100%, 620px);
    padding: 2.5rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background-color: var(--color-background);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    text-align: center;
}

.error-card .logo {
    width: 140px;
    margin: 0 auto 1rem;
}

.error-code {
    margin: 0;
    color: var(--color-highlight);
    font-size: 4rem;
    font-weight: bold;
    line-height: 1;
}

.error-card h1 {
    margin: 0.75rem 0 0;
    font-size: 2rem;
}

.error-card > p:not(.error-code) {
    margin: 1rem auto 0;
    max-width: 32rem;
}

.error-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

@media (max-width: 900px) {
    body {
        padding-right: 25vw;
    }

    body::after {
        width: 25vw;
    }

    .error-page {
        padding-right: 0;
    }

    .machine-gallery {
        right: 25vw;
        gap: 2.5rem;
        width: 150px;
    }

    .machine-circle {
        flex-basis: 150px;
        width: 150px;
        height: 150px;
    }

    .service-list {
        grid-template-columns: 1fr;
        width: min(100%, 600px);
    }

    .service-card:last-child {
        grid-column: auto;
        width: 100%;
    }

    .contact-layout {
        grid-template-columns: 1fr;
    }

    .trust-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .project-gallery {
        grid-template-columns: 1fr;
    }

    .project-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    body {
        padding-right: 0;
    }

    body::after {
        position: absolute;
        top: auto;
        bottom: 0;
        width: 100%;
        height: 220px;
        opacity: 0.25;
    }

    nav ul {
        flex-direction: column;
        gap: 0.5rem;
    }

    .main-heading {
        font-size: 2rem;
    }

    .page-header {
        padding-bottom: 2rem;
    }

    .page-hero h1 {
        font-size: 2rem;
    }

    .services-main {
        padding: 2rem 5% 3rem;
    }

    .project-gallery {
        grid-template-columns: 1fr;
    }

    .project-card {
        padding: 1rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .button-primary,
    .button-secondary {
        width: min(100%, 280px);
    }

    .error-page::after {
        width: 100%;
        height: 260px;
        opacity: 0.15;
    }

    .error-main {
        min-height: auto;
        padding: 2rem 5%;
    }

    .error-card {
        padding: 2rem 1.25rem;
    }

    .error-actions {
        flex-direction: column;
        align-items: center;
    }

    .machine-gallery {
        position: relative;
        top: auto;
        right: auto;
        flex-wrap: nowrap;
        width: 100%;
        gap: 2rem;
        margin: 2rem 0;
        transform: none;
    }

    .machine-circle {
        flex-basis: 150px;
        width: 150px;
        height: 150px;
    }

    .service-list {
        grid-template-columns: 1fr;
    }

    .service-card:last-child {
        grid-column: auto;
        width: 100%;
    }

    .trust-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-bottom {
        display: block;
    }

    .footer-bottom .contact-info {
        text-align: center;
    }
}

