/* Reset */

*, *::before, *::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

html {
    font-size: 18px;
}

body {
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    font-family: "Mulish", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

input, button, textarea, select {
    font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
}

h1 { 
    font-size: clamp(1.5rem, 3vw + 1rem, 2.5rem); 
    line-height: 1.2;
    font-weight: 700;
}

/* Custom styles */

body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    overflow: clip; 
    background-image: linear-gradient(rgba(55, 79, 83, 0.7), rgba(55, 79, 83, 0.7)), url('background.jpg');
    background-size: cover;
    background-position: center;
    padding: 0 20px;
}

.content-block {
    position: relative;
    padding-block: clamp(2rem, 5vw + 1rem, 3rem);
    padding-inline: clamp(2rem, 5vw + 1rem, 5rem);
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 1);
    border-radius: clamp(20px, 5vw, 60px) 0 clamp(20px, 5vw, 60px) 0;
    backdrop-filter: blur(10px);
    color: rgba(55, 152, 169, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    opacity: 0;
    /* Block finishes fading/sliding at 0.8s */
    animation: fadeSlideUp 0.8s ease-out forwards, float 6s ease-in-out infinite 0.8s;

    @media(min-width: 768px) {
        text-align: center;
    }

    & > h1, & > p, & > .logos {
        opacity: 0;
        animation: fadeSlideUp 0.8s ease-out forwards;
    }

    & > h1 { animation-delay: 0.2s; }
    & > p { animation-delay: 0.4s; }
    & > .logos { animation-delay: 0.6s; }

    p {
        font-size: clamp(1rem, 1vw + 0.8rem, 1.15rem);
        color: rgb(55 79 83);
        
        a {
            font-weight: 700;
            color: #F57453;
        }
    }

    a:has(img), > img {
        object-fit: contain;
        border-radius: 14px;
        width: 50%; 
        max-width: 240px;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    a:has(img) {
        display: inline-block;
        width: max-content;
        max-width: 100%;
        &:hover {
            transform: translateY(-4px);
        }

        img {
            max-width: 300px;
        }
    }

    .line {
        position: absolute;
        width: 40px;
        height: 40px;

        /* The Line */
        &::before {
            content: '';
            position: absolute;
            width: 100vw;
            height: 10px;
            background: var(--theme-color);
            border-radius: 10px;
            top: 50%;
        }

        /* The Circle */
        &::after {
            content: '';
            position: absolute;
            inset: 0;
            background: var(--theme-color);
            border-radius: 50%;
            opacity: 0;
            animation: popIn 0.6s ease-in-out forwards;
        }

        &.top-left {
            left: 80%;
            top: 0;
            transform: translate(-50%, -50%);
            --theme-color: #A2C619;

            &::before {
                left: calc(100% - 10px);
                transform: translate(100vw, -50%);
                /* Starts immediately, finishes precisely at 0.8s with the content block */
                animation: slideInRight 0.8s ease-out forwards;
            }
            &::after {
                /* Circle pops instantly when the line finishes */
                animation-delay: 0.8s;
            }
        }

        &.bottom-right {
            right: 80%;
            bottom: 0;
            transform: translate(50%, 50%);
            --theme-color: #F57453;

            &::before {
                right: calc(100% - 10px);
                transform: translate(-100vw, -50%);
                /* Slight 0.1s stagger, finishes almost concurrently at 0.9s */
                animation: slideInLeft 0.8s ease-out forwards 0.1s;
            }
            &::after {
                /* Circle pops instantly when the second line finishes */
                animation-delay: 0.9s;
            }
        }
    }
}

/* --- ANIMATION KEYFRAMES --- */

@keyframes fadeSlideUp {
    from { 
        opacity: 0; 
        transform: translateY(30px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(0px); }
}

@keyframes popIn {
    0% { 
        opacity: 0; 
        transform: scale(0); 
    }
    50% { 
        opacity: 1; 
        transform: scale(1.25); 
    }
    75% { 
        transform: scale(0.9);  
    }
    100% { 
        opacity: 1; 
        transform: scale(1);    
    }
}

@keyframes slideInRight {
    from { transform: translate(100vw, -50%); }
    to { transform: translate(0, -50%); }
}

@keyframes slideInLeft {
    from { transform: translate(-100vw, -50%); }
    to { transform: translate(0, -50%); }
}