/* =========================================================
   VALOWERK
   HERO + OPENING
========================================================= */


/* =========================================================
   OPENING INTRO
========================================================= */

.site-intro {
    position: fixed;
    z-index: 1000;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--color-light);
    background: var(--color-dark);

    pointer-events: none;
    overflow: hidden;
}


.site-intro-logo {
    position: absolute;

    font-size: clamp(3rem, 9vw, 9rem);
    font-weight: 600;
    line-height: 0.8;
    letter-spacing: -0.07em;

    white-space: nowrap;

    transform: translate3d(0, 0, 0);
    transform-origin: left top;

    will-change: transform, opacity;
}


/* =========================================================
   HERO
========================================================= */

.hero {
    position: relative;

    display: flex;
    align-items: flex-end;

    min-height: 100vh;
    min-height: 100svh;

    padding-top: 150px;
    padding-bottom: clamp(40px, 6vh, 80px);

    overflow: hidden;

    isolation: isolate;
}


/* =========================================================
   ORGANIC WIREFRAME MESH
========================================================= */

.hero::before {
    content: "";

    position: absolute;
    z-index: -1;

    top: -23%;
    right: -15%;

    width: min(82vw, 1380px);
    aspect-ratio: 1.22;

    pointer-events: none;

    opacity: 0.2;

    background:
        repeating-radial-gradient(
            ellipse at 72% 58%,
            transparent 0 19px,
            rgba(17, 17, 17, 0.24) 20px 21px,
            transparent 22px 39px
        ),
        repeating-conic-gradient(
            from 214deg at 72% 58%,
            rgba(17, 17, 17, 0.22) 0deg 0.55deg,
            transparent 0.65deg 5.6deg
        );

    transform:
        perspective(1000px)
        rotate(-10deg)
        skewX(-8deg)
        scaleY(0.78);

    transform-origin: 72% 58%;

    -webkit-mask-image:
        radial-gradient(
            ellipse at 68% 55%,
            #000 0%,
            rgba(0, 0, 0, 0.96) 35%,
            rgba(0, 0, 0, 0.62) 56%,
            transparent 78%
        );

    mask-image:
        radial-gradient(
            ellipse at 68% 55%,
            #000 0%,
            rgba(0, 0, 0, 0.96) 35%,
            rgba(0, 0, 0, 0.62) 56%,
            transparent 78%
        );

    animation:
        hero-mesh-drift 18s ease-in-out infinite alternate;

    will-change: transform;
}


/* =========================================================
   WIREFRAME MOVEMENT
========================================================= */

@keyframes hero-mesh-drift {

    from {
        transform:
            perspective(1000px)
            rotate(-10deg)
            skewX(-8deg)
            scaleY(0.78)
            translate3d(0, 0, 0);
    }


    to {
        transform:
            perspective(1000px)
            rotate(-8.5deg)
            skewX(-7deg)
            scaleY(0.8)
            translate3d(-12px, 10px, 0);
    }

}


/* =========================================================
   HERO CONTENT
========================================================= */

.hero-content {
    position: relative;
    z-index: 1;

    display: flex;
    flex-direction: column;
    justify-content: flex-end;

    min-height: calc(100svh - 190px);
}


/* =========================================================
   HERO REVEAL STATES
========================================================= */

.hero-eyebrow,
.hero-title-line,
.hero-bottom {
    opacity: 0;

    transform: translate3d(0, 26px, 0);

    will-change: transform, opacity;
}


body.intro-complete .hero-eyebrow,
body.intro-complete .hero-title-line,
body.intro-complete .hero-bottom {
    opacity: 1;

    transform: translate3d(0, 0, 0);
}


body.intro-complete .hero-eyebrow {
    transition:
        opacity 700ms ease 100ms,
        transform 900ms cubic-bezier(0.16, 1, 0.3, 1) 100ms;
}


body.intro-complete .hero-title-line:nth-child(1) {
    transition:
        opacity 850ms ease 180ms,
        transform 1100ms cubic-bezier(0.16, 1, 0.3, 1) 180ms;
}


body.intro-complete .hero-title-line:nth-child(2) {
    transition:
        opacity 850ms ease 300ms,
        transform 1100ms cubic-bezier(0.16, 1, 0.3, 1) 300ms;
}


body.intro-complete .hero-bottom {
    transition:
        opacity 800ms ease 600ms,
        transform 1000ms cubic-bezier(0.16, 1, 0.3, 1) 600ms;
}


/* =========================================================
   EYEBROW
========================================================= */

.hero-eyebrow {
    margin-bottom: clamp(32px, 5vh, 72px);

    color: var(--color-text-soft);

    font-size: clamp(0.7rem, 0.7vw, 0.82rem);
    font-weight: 500;
    line-height: 1;

    letter-spacing: 0.09em;
    text-transform: uppercase;
}


/* =========================================================
   MAIN HEADLINE
========================================================= */

.hero-title {
    width: 100%;
    max-width: 1500px;

    font-size: clamp(4rem, 9.2vw, 10rem);
    font-weight: 500;

    line-height: 0.84;
    letter-spacing: -0.065em;
}


.hero-title-line {
    display: block;
}


.hero-title-line:first-child {
    color: var(--color-text);
}


.hero-title-line-dynamic {
    color: var(--color-text-soft);
}


/* =========================================================
   CHANGING WORD
========================================================= */

.hero-changing-word {
    position: relative;

    display: inline-block;

    min-width: 0;

    color: var(--color-text);

    white-space: nowrap;
}


/*
   Die Linie erscheint erst,
   wenn das finale Wort "Baukasten"
   erreicht wurde.
*/

.hero-changing-word::after {
    content: "";

    position: absolute;

    right: 0;
    bottom: -0.06em;
    left: 0;

    height: 0.035em;

    background: var(--color-accent);

    transform: scaleX(0);
    transform-origin: left center;

    transition:
        transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}


.hero-changing-word.is-final::after {
    transform: scaleX(1);
}


/* =========================================================
   HERO BOTTOM
========================================================= */

.hero-bottom {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(220px, 360px)
        auto;

    align-items: end;

    gap: clamp(30px, 5vw, 90px);

    margin-top: clamp(50px, 8vh, 110px);

    padding-top: 22px;

    border-top: 1px solid var(--color-line);
}


/* =========================================================
   DESCRIPTION
========================================================= */

.hero-description {
    grid-column: 2;

    max-width: 330px;

    color: var(--color-text-soft);

    font-size: clamp(0.9rem, 1vw, 1.05rem);

    line-height: 1.45;

    letter-spacing: -0.015em;
}


/* =========================================================
   HERO ACTIONS
========================================================= */

.hero-actions {
    grid-column: 3;

    display: flex;
    flex-direction: column;
    align-items: stretch;

    gap: 12px;

    min-width: 210px;
}


/* =========================================================
   HERO LINKS
========================================================= */

.hero-link {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;

    gap: 16px;

    padding-bottom: 3px;

    font-size: clamp(0.8rem, 0.85vw, 0.95rem);
    font-weight: 500;

    line-height: 1.2;

    white-space: nowrap;
}


.hero-link-contact {
    color: var(--color-accent);
}


/* =========================================================
   HERO LINK ARROW
========================================================= */

.hero-link span {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 34px;
    height: 34px;

    flex-shrink: 0;

    border: 1px solid var(--color-line);
    border-radius: 50%;

    font-size: 0.95rem;

    transition:
        transform var(--transition-default),
        background-color var(--transition-default),
        color var(--transition-default),
        border-color var(--transition-default);
}


/* =========================================================
   HERO LINK HOVER
========================================================= */

@media (hover: hover) and (pointer: fine) {

    .hero-link:hover span {
        color: #ffffff;

        background: var(--color-accent);
        border-color: var(--color-accent);

        transform: translateY(5px);
    }


    .hero-link-contact:hover span {
        color: #ffffff;

        background: var(--color-accent);
        border-color: var(--color-accent);

        transform: translate3d(4px, 4px, 0);
    }

}


/* =========================================================
   LARGE DESKTOP
========================================================= */

@media (min-width: 1800px) {

    .hero-title {
        font-size: 10rem;
    }


    .hero-bottom {
        margin-top: 110px;
    }

}


/* =========================================================
   MEDIUM SCREENS
========================================================= */

@media (max-width: 1100px) {

    .hero-title {
        font-size: clamp(
            4.5rem,
            9.5vw,
            7rem
        );
    }


    .hero-bottom {
        grid-template-columns:
            1fr
            minmax(220px, 320px)
            auto;

        gap: 30px;
    }


    .hero-actions {
        min-width: 190px;
    }

}


/* =========================================================
   TABLET / MOBILE
========================================================= */

@media (max-width: 800px) {

    /* =====================================================
       MOBILE WIREFRAME
    ====================================================== */

    .hero::before {
        top: 1%;
        right: -75%;

        width: 165vw;

        opacity: 0.12;

        background:
            repeating-radial-gradient(
                ellipse at 72% 58%,
                transparent 0 15px,
                rgba(17, 17, 17, 0.22) 16px 17px,
                transparent 18px 31px
            ),
            repeating-conic-gradient(
                from 214deg at 72% 58%,
                rgba(17, 17, 17, 0.2) 0deg 0.6deg,
                transparent 0.7deg 7deg
            );

        animation: none;
    }


    .site-intro-logo {
        font-size: clamp(
            3rem,
            16vw,
            6rem
        );
    }


    .hero {
        min-height: 100svh;

        padding-top: 110px;
        padding-bottom: 30px;
    }


    .hero-content {
        min-height: calc(100svh - 140px);
    }


    .hero-eyebrow {
        margin-bottom: auto;

        padding-bottom: 50px;

        font-size: 0.68rem;
    }


    .hero-title {
        max-width: 100%;

        font-size: clamp(
            3.4rem,
            15vw,
            6.5rem
        );

        line-height: 0.88;

        letter-spacing: -0.06em;
    }


    .hero-title-line-dynamic {
        line-height: 0.95;
    }


    .hero-changing-word {
        display: inline-block;
        min-width: 8.5ch;
        text-align: left;
    }


    .hero-bottom {
        display: flex;

        flex-direction: column;
        align-items: flex-start;

        gap: 28px;

        margin-top: 48px;

        padding-top: 18px;
    }


    .hero-description {
        max-width: 420px;

        font-size: 0.92rem;

        line-height: 1.5;
    }


    .hero-actions {
        width: 100%;

        gap: 14px;
    }


    .hero-link {
        width: 100%;

        justify-content: space-between;

        min-height: 44px;

        font-size: 0.82rem;
    }


    .hero-link span {
        width: 32px;
        height: 32px;
    }

}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 480px) {

    .hero {
        padding-top: 95px;
        padding-bottom: 24px;
    }


    .hero-content {
        min-height: calc(100svh - 119px);
    }


    .hero-title {
        font-size: clamp(
            3.1rem,
            15.2vw,
            4.6rem
        );

        line-height: 0.9;
    }


    .hero-bottom {
        margin-top: 38px;
    }


    .hero-description {
        max-width: 300px;

        font-size: 0.86rem;
    }


    .hero-actions {
        gap: 10px;
    }

}


/* =========================================================
   VERY SMALL MOBILE
========================================================= */

@media (max-width: 360px) {

    .hero-title {
        font-size: 2.9rem;
    }


    .hero-description {
        font-size: 0.82rem;
    }

}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    .hero::before {
        animation: none;
    }


    .site-intro {
        display: none;
    }


    .hero-eyebrow,
    .hero-title-line,
    .hero-bottom {
        opacity: 1;

        transform: none;

        transition: none !important;
    }


    .hero-changing-word::after {
        transform: scaleX(1);

        transition: none;
    }

}