/* -------------------------------- Variables ------------------------------- */

:root {
    --red: #981A13;
    --gray-light: #EDEDED;
    --max-width: 1200px;
    --font-weight-light: 300;
    --header-bg-scale: 200px;
}


/* ---------------------------------- Base ---------------------------------- */

html, body {
    min-height: 100vh;
    overflow-x: hidden;
}

body {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #F6F6F6;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--red);
    line-height: 1;
}

h2 {
    margin: 0 0 1em;
    padding: 0 0 0.5em;
    font-weight: var(--font-weight-light);
    font-size: 1.875em;
    border-bottom: 2px solid var(--gray-light);
}

h3 {
    margin: 0 0 0.25em;
    text-transform: uppercase;
}

p {
    margin: 0;
    line-height: 1.4;
}

a {
    text-decoration: none;
    color: #333
}

ul {
    font-weight: bold;
    text-transform: uppercase;
    list-style: none;
    margin: 0;
    padding: 0;
}

li {
    padding: 0.375em 0;
}


/* --------------------------------- Common --------------------------------- */

.container {
    max-width: var(--max-width);
    margin-inline: auto;
    padding: 0 2em;
}

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


/* --------------------------------- Header --------------------------------- */

header {
    background: var(--red) 0 0 repeat url('pallet-pattern.svg');
    background-size: 200px;
    color: white;
    padding: 2em;
    text-align: center;
    font-weight: bold;
    letter-spacing: 0.2em;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.15);
    animation: 20s linear infinite slide;
}

header .container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1em
}

.logo {
    width: 150px;
    height: auto;
}

.logo svg {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.estd {
    font-size: x-small;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}


/* --------------------------------- Content -------------------------------- */

.content {
    height: 100%;
    padding-top: 1em;
    display: flex;
    flex-grow: 1;
    align-items: center;
}

section {
    background-color: white;
    margin: 2em 0;
    padding: 2em;
    border-radius: 1em;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
    position: relative;
}


/* --------------------------------- Footer --------------------------------- */

footer {
    text-align: center;
    padding: 1em 0 4em;
    clip-path: margin-box;
    position: relative;
    overflow: hidden;
    min-height: 110px;
}

footer .container {
    display: grid;
    gap: 2em;
}


/* ---------------------------- Background Images --------------------------- */

.background-image {
    position: absolute;
    z-index: -1;
    min-width: 400px;
    width: 25vw;
    animation: 5s ease-in-out infinite alternate bob;
}

.products .background-image {
    top: 0;
    left: 0;
    transform: translate(-50%, -25%);
    
}

.services .background-image {
    bottom: 0;
    right: 0;
    transform: translate(48%, 42%);
    animation-delay: 1s;
}

footer .background-image {
    bottom: 0;
    left: 50%;
    transform: translate(-50%, 25%);
    animation-delay: 2s;
}


/* ---------------------------- Responsive Styles --------------------------- */

@media screen and (min-width: 360px) {
    .estd {
        font-size: small;
    }
}

@media screen and (min-width: 450px) {
    .estd {
        font-size: initial;
    }
    header .container {
        gap: 2em;
    }
    .products ul {
        display: grid;
        grid-template-columns: auto auto;
        column-gap: 2em;
    }
}

@media screen and (min-width: 750px) {
    .content .container {
        display: flex;
        gap: 4em;
    }
    .content section {
        flex-basis: 100%;
    }
    footer .container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 4em;
    }
    footer .container div:last-child:nth-child(odd) {
        grid-column: 1 / span 2;
    }
}

@media screen and (min-width: 900px) {
    body {
        font-size: 1.25em;
    }
}

@media screen and (min-width: 1200px) {
    footer .container {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    footer .container div:last-child:nth-child(odd) {
        grid-column: auto / auto;
    }
    footer .background-image {
        bottom: auto;
        top: 0;
        transform: translate(-50%, 10%);
    }
}

@media screen and (min-width: 1400px) {
    body {
        font-size: 1.5em;
    }
}


/* ------------------------------- Animations ------------------------------- */

@keyframes bob {
    from {
        translate: 0 0;
    }
    to {
        translate: 0 5%;
    }
}

@keyframes slide {
    from {
        background-position: 0 0;
    }
    to {
        background-position: calc(-0.5 * var(--header-bg-scale) ) calc(-0.5 * ( ( var(--header-bg-scale) / 138 ) * 78.47 ));
    }
    
}