:root {
    --color-reddish: #ff6b6b;
    --color-white: #ffffff;
    --color-black: #121212;
    --color-grayish: #1e1f26;

    --color-text-default: var(--color-white);
    --color-text-accent: var(--color-reddish);
    --color-text-inverted: var(--color-black);

    --color-background-default: var(--color-black);
    --color-background-card: var(--color-grayish);
    --color-background-accent: var(--color-reddish);
    --color-background-inverted: var(--color-white);

    --font-size-base: calc(1rem + 0.25vw);
    --font-weight-regular: 300;
    --font-weight-bold: 800;
    --font-family: "DM Sans", "Helvetica Neue", "Helvetica", "Arial", sans-serif;

    --font-title: normal var(--font-weight-bold) clamp(3em, 15vw, 4em)/1.1em var(--font-family);
    --font-h2: normal var(--font-weight-bold) clamp(1em, 19vw, 2.3em)/1.2em var(--font-family);
    --font-h3: normal var(--font-weight-bold) 1.5em/1.2em var(--font-family);
    --font-regular: normal var(--font-weight-regular) clamp(1.2em, 5.5vw, 1.5em)/1.22em var(--font-family);
    --font-small: normal var(--font-weight-regular) 1em/1.2em var(--font-family);
}

@font-face {
    font-family: "DM Sans";
    src: url("DMSans-VariableFont.ttf") format("truetype-variations");
    font-weight: 100 900;
    font-stretch: 75% 125%;
    font-display: swap;
}

*,
::after,
::before {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
    hyphens: auto;
}

body {
    background: var(--color-background-default);
    color: var(--color-text-default);
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    font: normal var(--font-weight-regular) var(--font-size-base) var(--font-family);
    font-optical-sizing: auto;

    ::selection {
        background-color: var(--color-background-inverted);
        color: var(--color-text-inverted);
    }
}

header {
    height: 100vh;
    width: 100%;
    display: grid;
    place-items: center;
    grid-template-areas: "stack";
    position: relative;
    overflow: hidden;

    & video, & img {
        grid-area: stack;
        object-fit: cover;
        width: 100%;
        height: 100%;
        filter: brightness(0.5);
        z-index: 1;
    }

    .hero-text {
        grid-area: stack;
        max-width: 700px;
        text-align: center;
        z-index: 2;
        padding: 50px;

        & h1 {
            font: var(--font-title);
            color: var(--color-text-accent);
            text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
        }

        & p {
            font: var(--font-regular);
            margin-top: 1em;
        }
    }

    & .language-switch {
        grid-area: stack;
        z-index: 3;
        justify-self: end;
        align-self: start;
        display: flex;

        & button {
            background: transparent;
            border: none;
            color: var(--color-text);
            font: var(--font-small);
            cursor: pointer;
            padding: .5em;
            transition: background 0.3s;

            &:hover,
            &[data-selected="true"] {
                background: rgba(255, 255, 255, 0.1);
            }
        }
    }
}

footer{
    margin-top: 5rem;
    background: black;
    width: 100%;
    padding: 5rem 8vw;

    a {
        color: var(--color-text-accent);
        text-decoration: none;
        font: var(--font-small);
        transition: color 0.3s;

        &:hover {
            color: var(--color-text-default);
            text-decoration: underline;
        }
    }
}

section {
    padding: 5rem 2rem;
    max-width: 1000px;
    margin-bottom: 2rem;

    & h2 {
        font: var(--font-h2);
        margin-bottom: .3em;
    }

    & h3 {
        font: var(--font-h3);
        margin: .5em 0;
    }

    & p {
        font: var(--font-regular)
    }
}

.parallax {
    background: url('media/surroundings-03.webp') no-repeat center center;
    background-size: cover;
    background-attachment: fixed;
    height: 40vh;
    width: 100%;
    position: relative;
}

.card {
    background: var(--color-background-card);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.05);
}

.big-image {
    display: grid;
    grid-template-areas: "stack";
    place-items: center;
    width: 100%;
    border-radius: 50px;
    overflow: hidden;
    padding: 0;
    transform: perspective(1200px) rotate3d(1, .5, .2, 40deg);
    transition: transform .8s ease-out;

    >* {
        grid-area: stack;
    }

    &.auto-hover {
        transform: perspective(1200px) rotate3d(0, 0, 0, 0deg);
    }

    img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

.facts {
    justify-content: start !important;
}

.fact {
    flex: 0 1 40%;
    display: grid;
    grid-template-columns: min-content max-content;
    grid-template-rows: min-content min-content;
    gap: .3em;
    grid-template-areas:
        "value unit"
        "description description";

    justify-items: start;
    align-items: center;
    margin-bottom: 2em;

    & .value {
        grid-area: value;
        font: var(--font-title);
        color: var(--color-text-accent);
    }

    & .unit {
        grid-area: unit;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        background: var(--color-background-inverted);
        border-radius: 10%;
        aspect-ratio: 1 / 1;
        height: 70%;
        overflow: hidden;

        & .name {
            color: var(--color-text-inverted);
            font: var(--font-regular);
        }

        & .icon {
            width: 1.4em;
            filter: invert(1);
        }
    }

    & .description {
        font: var(--font-regular);
        grid-area: description;
        line-height: 0.3em;
    }
}

.features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;

    & .card {
        flex: 1 1 250px;
        min-width: 250px;
        max-width: 400px;
        transition: transform 0.3s ease;

        &:hover {
            transform: translateY(-5px);
        }
    }
}

.gallery {
    display: flex;
    gap: 1rem;
    max-width: none;
    width: 100%;
    overflow-x: scroll;


    & img {
        flex: 1 1 400px;
        width: 400px;
        max-width: 100%;
        aspect-ratio: 3.5 / 2;
        border-radius: 10px;
        transition: transform 0.4s ease;
        object-fit: cover;

        &:hover {
            transform: scale(1.05);
        }
    }
}

.cta {
    text-align: center;
    margin: 2rem !important;

    & a {
        display: inline-block;
        text-decoration: none;
        background: var(--color-background-accent);
        border: none;
        color: white;
        padding: 1rem 2rem;
        font: var(--font-small);
        border-radius: 50px;
        cursor: pointer;
        margin-top: 2rem;
        transition: background 0.3s;

        &:hover {
            background: #fa5252;
        }
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in-animation {
    animation: fadeIn 2s ease-in-out;
}

.slide-in-animation {
    animation: slideIn 1s ease forwards;
}

.image-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.2s;

    &[style*="display: none"] {
        opacity: 0;
        pointer-events: none;
    }

    .image-overlay-content {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        max-width: 90vw;
        max-height: 90vh;
    }

    .image-overlay-img {
        max-width: 80vw;
        max-height: 80vh;
        border-radius: 12px;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.7);
        background: #222;
        z-index: 1;
    }

    .image-overlay-arrow {
        background: rgba(0, 0, 0, 0.5);
        border: none;
        position: fixed;
        top: 50%;
        transform: translateY(-50%);
        width: 48px;
        height: 48px;
        cursor: pointer;
        z-index: 2;
        opacity: 0.8;
        transition: opacity 0.2s;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
    }

    .image-overlay-arrow.left {
        left: 32px;
        right: auto;
    }

    .image-overlay-arrow.right {
        right: 32px;
        left: auto;
    }

    .image-overlay-arrow img {
        width: 28px;
        height: 28px;
        display: block;
    }

    .image-overlay-arrow:hover {
        opacity: 1;
    }

    .image-overlay-close {
        position: fixed;
        top: 32px;
        right: 32px;
        background: rgba(0, 0, 0, 0.5);
        border: none;
        width: 48px;
        height: 48px;
        cursor: pointer;
        z-index: 3;
        opacity: 0.8;
        transition: opacity 0.2s;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
    }

    .image-overlay-close img {
        width: 28px;
        height: 28px;
        display: block;
    }

    .image-overlay-close:hover {
        opacity: 1;
    }

    .image-overlay-caption {
        margin-top: 1.5rem;
        color: #fff;
        text-align: center;
        font-size: 1.1em;
        font-family: var(--font-family);
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
        max-width: 80vw;
        word-break: break-word;
    }

    @media (max-width: 700px) {
        .image-overlay-arrow.left {
            left: 0;
        }

        .image-overlay-arrow.right {
            right: 0;
        }

        .image-overlay-close {
            top: 8px;
            right: 8px;
        }

        .image-overlay-img {
            max-width: 98vw;
            max-height: 60vh;
        }
    }
}