* {
    box-sizing: border-box;
    scroll-behavior: smooth;
}

:root {
    /*Layout*/
    --margin: 1.5rem;
    --grid-column-width: var(--margin) auto var(--margin);
    --grid-gap: 0rem;
    --grid-row-gap: 3.75rem;

    /*Farben*/
    --color-primary-PreLoader: #6c72b9;
    --color-accent-PreLoader: white;
    --color-accent-daim: #99b96c;
    --color-text: black;

    /*Typografie*/
    --font-size-text: 1rem;
    --font-size-h1: 4rem;
    --font-size-h2: 1rem;
    --font-weight: 300;

    /*Animation*/
    --animation-timing-function-preloader: linear(
        0,
        0.002 0.5%,
        0.008 1.1%,
        0.017 1.7%,
        0.031 2.3%,
        0.048 2.9%,
        0.068 3.5%,
        0.094 4.2%,
        0.124 4.9%,
        0.18 6.1%,
        0.248 7.4%,
        0.529 12.4%,
        0.651 14.7%,
        0.71 15.9%,
        0.765 17.1%,
        0.811 18.2%,
        0.854 19.3%,
        0.893 20.4%,
        0.928 21.5%,
        0.959 22.6%,
        0.989 23.8%,
        1.012 24.9%,
        1.034 26.1%,
        1.052 27.3%,
        1.067 28.6%,
        1.081 30.3%,
        1.09 32.2%,
        1.093 34.2%,
        1.091 36.4%,
        1.086 38.2%,
        1.078 40.2%,
        1.034 48.7%,
        1.016 53.1%,
        1.001 58%,
        0.994 63.1%,
        0.992 66.7%,
        0.992 70.8%,
        0.999 88.4%,
        1
    );
}

/*PreLoader*/
#PreLoader {
    background: var(--color-primary-PreLoader);
    height: 100vh; /*volle Bildschirmhöhe*/
    width: 100vw; /*volle Bildschirmbreite*/
    display: flex;
    justify-content: center; /* horizontal zentrieren */
    align-items: center; /*vertikal zentriert*/
    position: relative;
    z-index: 2; /*in den Vordergrund*/
}

.Logo {
    position: relative;
    width: fit-content; /*genauso hoch und weit wie der Inhalt, in dem Fall .white*/
    height: fit-content;
}

.big-rectangle {
    opacity: 0; /*zu Beginn der Animation nicht sichtbar*/
    height: 13.625rem;
    width: 10.6875rem;
    background-color: var(--color-accent-PreLoader);
    transform-origin: 100% 0%; /*Drehpunkt für Rotation*/
    animation: rotate-big-rectangle 1.5s
        var(--animation-timing-function-preloader) 1;
    animation-delay: 1s; /*Verzögerung der Animation*/
    animation-fill-mode: forwards; /*Zustand der Animation wird übernommen*/
}

.small-rectangle {
    opacity: 0; /*vor Animation nicht sichtbar*/
    position: absolute; /*Position innerhalb .white*/
    top: 3.6875rem;
    left: 0;
    width: 8.625rem;
    height: 6.25rem;
    background-color: var(--color-primary-PreLoader);
    transform-origin: 0% 0%;
    animation: rotate-small-rectangle 1.5s
        var(--animation-timing-function-preloader) 1;
    animation-delay: 1800ms; /*Verzögerung der Animation*/
    animation-fill-mode: forwards; /*Zustand der Animation wird übernommen*/
}

/*Animation PreLoader*/
@keyframes rotate-big-rectangle {
    0% {
        opacity: 0;
        transform: rotate(-150deg) scale(0.5);
    }
    100% {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
}

@keyframes rotate-small-rectangle {
    0% {
        opacity: 0;
        transform: rotate(60deg) scale(0.5);
    }
    100% {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
}

/*allgemeine Regeln*/
body {
    font-family: "Figtree Variable", sans-serif;
    color: var(--color-text);
    font-size: var(--font-size-text); /* entspricht 16px*/
    font-weight: var(--font-weight); /*Schriftschnitt*/
    letter-spacing: 0.03em; /* Abstand zwischen Buchstaben*/
    line-height: 1.3125rem; /* Zeilenabstand*/
    margin: 0;
}

a {
    text-decoration: none; /*kein sichtbarere Link*/
    color: var(--color-text);
    transition: opacity 0.3s ease;

    &:hover {
        opacity: 0.6;
    }
}

h1 {
    font-size: var(--font-size-h1); /*Schriftgröße*/
    font-weight: var(--font-weight); /*Schriftschnitt Light*/
    text-transform: uppercase; /*Versalien*/
    letter-spacing: -0.52rem; /* Abstand zwischen Buchstaben*/
}

ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.0625rem; /* Abstand zwischen Links */
}

p {
    margin: 0;
}

.container-header.grid {
    display: flex;
    flex-direction: column;
    margin-inline: var(--margin);
    height: 100vh;
}

header {
    & .goldschneiderei-svg {
        width: 100%;
        height: fit-content;
        margin-top: auto;
        margin-bottom: 3.25rem;
        z-index: 1;
        order: 2;
    }
    & nav {
        margin-top: var(--margin);
        order: 1;
        & ul {
            display: flex;
            flex-direction: row;
            justify-content: space-between;
        }
    }
}

.back-to-Top {
    display: none;
}

.container-works {
    &.grid {
        display: grid;
        grid-template-columns: var(--grid-column-width);
        gap: var(--grid-gap);
        row-gap: var(--grid-row-gap);
        width: 100vw;
        margin: 0;
    }
    & svg {
        position: relative;
        left: -6.25rem; /* 100px */
        top: -25rem; /* 400px */
        transform: rotate(56.29deg);
        width: 22rem;
        height: 22rem;
        z-index: -1;
    }
    & .item-1 {
        grid-column: 2;
        grid-row: 1;
        margin-top: 6.8125rem;
    }
    & .item-2 {
        grid-column: 2;
        grid-row: 2;
    }
    & .item-3 {
        grid-column: 2;
        grid-row: 3;
    }
    & .item-4 {
        grid-column: 2;
        grid-row: 4;
    }
    & .item-5 {
        grid-column: 2;
        grid-row: 5;
    }
    & .item-6 {
        grid-column: 2;
        grid-row: 6;
    }
}

figure {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0;

    & img {
        order: 1; /*kommt vor der Bildunterschrift*/
        width: 100%; /*nimmt vollen Platz ein, den es hat*/
        aspect-ratio: 100/69;
        height: auto;
        object-fit: cover; /* Bild wird beschnitten */
        object-position: center; /*Ausschnitt, der gewählt wird, ist die Mitte*/
    }

    & figcaption {
        width: 100%;
        display: flex;
        justify-content: space-between; /*verteilt sich über den ganzen Platz*/
        order: 2; /*kommt nach dem Bild*/
        margin-top: 1rem;
    }
}

.container-about {
    &.grid {
        display: flex;
        flex-direction: column;
        margin-inline: var(--margin);
        gap: 0rem;
    }
    & h1 {
        margin-top: 10rem;
    }
    & p {
        margin-top: 3.75rem;
        flex: 1; /*nimmt die komplette zur verfügung stehende Breite ein*/
        max-width: 27.5rem; /*wird aber nie breiter als 440px*/
    }
}

.container-contact {
    &.grid {
        display: flex;
        flex-direction: column;
        margin-inline: var(--margin);
        gap: 0rem;
    }
    & p {
        margin-top: 3.75rem;
        flex: 1;
        max-width: 27.5rem;
    }
}

.h1-contact-mobil {
    display: flex;
    flex-direction: row; /* nebeneinander */
    flex-wrap: wrap; /* svg bricht nach unten um, wenn kein Platz */
    margin-top: 10rem;
    align-items: center;

    & h1 {
        margin-right: 2rem;
    }
}

.container-contact-list {
    gap: 0.5rem;
    margin-top: var(--margin);
}

footer {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    margin-inline: var(--margin);
    margin-top: 10rem;
    margin-bottom: 0.6rem;

    & svg {
        max-width: 100%;
    }
    & nav ul {
        gap: 0.5rem;
        margin-top: 2rem;
    }
}

/* ---------- Projektseite ---------- */
.container-project-header {
    display: grid;
    grid-template-columns: var(--grid-column-width);
    grid-template-rows: auto 1fr auto;
    height: 100vh;

    & section {
        width: 100%;
        height: 100%;
        grid-column: 2;
        grid-row: 2;
        overflow: hidden;
    }
    & h1 {
        grid-column: 2;
        grid-row: 3;
        margin-bottom: 2rem;
        margin-top: 2rem;
    }
}

.container-project-header-button {
    grid-column: 2;
    grid-row: 1;
    width: fit-content;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.header-img-2 {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

.header-img-1,
.header-img-4,
.header-img-3 {
    display: none;
}

.container-project-main {
    display: grid;
    grid-template-columns: var(--grid-column-width);
    gap: var(--grid-gap);
    row-gap: var(--grid-row-gap);
    width: 100%;
    margin: 0;

    & p {
        grid-column: 2;
        grid-row: 1;
        margin-top: 8rem;
        flex: 1;
        max-width: 27.5rem;
    }
    & .image1 {
        grid-column: 2;
        grid-row: 2;
    }
    & .image2 {
        grid-column: 2;
        grid-row: 3;
        & img {
            object-position: bottom;
        }
    }
    & .image3 {
        grid-column: 2;
        grid-row: 4;
    }
    & .image4 {
        grid-column: 2;
        grid-row: 5;
    }
    & .image5 {
        grid-column: 2;
        grid-row: 6;
    }
    & .image6 {
        grid-column: 2;
        grid-row: 7;
        object-fit: cover; /* Bild wird beschnitten */
        object-position: center;
    }
}

/* ---------- Datenschutz/Impressum ---------- */
.daim {
    background-color: var(--color-accent-daim);
}

.container-daim {
    display: flex;
    flex-direction: column;
    margin-inline: var(--margin);
    height: 100vh;
}

.rechtliches-svg {
    width: 100%;
    height: fit-content;
    margin-top: auto;
    margin-bottom: 3.25rem;
}

.container-impressum {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-inline: var(--margin);

    & h1 {
        font-size: 3rem;
        letter-spacing: -0.4rem;
    }

    & h2 {
        font-size: var(--font-size-h2);
        margin: 0;
    }
}

.impressum-list {
    width: fit-content;

    & li {
        width: fit-content;

        & p {
            width: fit-content;
            margin: 0;
        }
    }
}

.container-datenschutz {
    margin-top: 10rem;
    margin-inline: var(--margin);

    & h1 {
        font-size: 3rem;
        letter-spacing: -0.4rem;
        line-height: 3.875rem;
    }

    & p {
        flex: 1;
        max-width: 27.5rem;
    }
}

/*------------Barrierefreiheit--------------*/
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important; /*Läuft quasi so schnell ab, dass man es nicht merkt*/ /*Important überschreibt alles, was davor war*/
        transition-duration: 0.01ms !important; /*Läuft quasi so schnell ab, dass man es nicht merkt*/
        scroll-behavior: auto;
    }
}
