@font-face {
    font-family: Bold;
    src: url("/fonts/NeueHaasDisplayBoldItalic.ttf");
}

@font-face {
    font-family: Medium;
    src: url("/fonts/NeueHaasDisplayMediu.ttf");
}

@font-face {
    font-family: text;
    src: url("/fonts/InterVariable.woff2");
}

:root {
    --ff-title: Bold, sans-serif;
    --ff-font: Medium, sans-serif;
    --ff-text: text, sans-serif;
}

h1 {
    font-family: var(--ff-title);
    font-size: 4rem;
    text-transform: uppercase;

    line-height: 90%;
}

/* Define the base animation for all .word elements */
h1 .word:not(.overlay .word),
.left h2 .word,
.path h2 .word {
    position: relative;
    animation: loop 3s cubic-bezier(0.85, 0, 0, 1) infinite;
}

/* Dynamically calculate animation-delay for each .word based on its position */
h1 .word-wrapper:nth-child(1) .word,
.left h2 .word-wrapper:nth-child(1) .word,
.path h2 .word-wrapper:nth-child(1) .word {
    animation-delay: calc(0.1s * 1);
}
h1 .word-wrapper:nth-child(2) .word {
    animation-delay: calc(0.1s * 2);
}
h1 .word-wrapper:nth-child(3) .word {
    animation-delay: calc(0.1s * 3);
}
h1 .word-wrapper:nth-child(4) .word {
    animation-delay: calc(0.1s * 4);
}
h1 .word-wrapper:nth-child(5) .word {
    animation-delay: calc(0.1s * 5);
}
h1 .word-wrapper:nth-child(6) .word {
    animation-delay: calc(0.1s * 6);
}
/* Add more rules if you expect more words */

@keyframes loop {
    0% {
        top: 0;
    }

    50% {
        top: -1em;
    }

    100% {
        top: -1em;
    }
}

h2 {
    font-family: var(--ff-font);
    font-size: 2rem;
    text-transform: uppercase;

    line-height: 90%;
}

h3 {
    font-family: var(--ff-font);
    font-size: 1.5rem;
    text-transform: uppercase;

    line-height: 90%;

    .display-text .word-wrapper {
        padding-bottom: 0.3em;
    }
}

h4 {
    font-family: var(--ff-font);
    font-size: 1rem;
    text-transform: uppercase;

    line-height: 90%;
}

.list h4 .word-wrapper {
    padding-bottom: 0.2em;
}

p {
    font-family: var(--ff-text);
    font-size: 1rem;

    line-height: 90%;

    opacity: 0.5;

    .word-wrapper {
        padding-bottom: 0.2em;
    }
}

button {
    border: 1px solid #fffce1;
    border-radius: 4rem;

    z-index: 40;

    .animate-text {
        padding: 1rem 2rem 0.8rem 2rem;
    }

    h4 {
        color: #fffce1;
    }
}

button:hover {
    background-color: var(--clr-green);
    border: 1px solid var(--clr-green);

    h4 {
        color: var(--clr-black);
    }
}

.word-wrapper {
    display: inline-block;
    overflow: hidden;
    user-select: text;
}

.word {
    display: inline-block;
    transform: translateX(-100%);
    transition: transform 0.5s cubic-bezier(0, 0.75, 0.5, 1);
    padding: 0 0.1em;
}

.word.show {
    transform: translateX(0);
}

a .word:not(.list b a),
.list h4 .word,
.tool-list p .word,
.perso h3 .word,
.fullscreen-overlay h4 .word,
.overlay h1 .word {
    position: relative;
    cursor: pointer;
    text-shadow: 0 1em 0;
    top: 0;
    width: fit-content;
    transition: top 0s cubic-bezier(0.85, 0, 0, 1), transform 0.5s cubic-bezier(0, 0.75, 0.5, 1);
}

.overlay h1:hover {
    width: fit-content;
    color: var(--clr-green);
}

.list h4 .word.hovering,
.tool-list p .word.hovering,
.perso h3 .word.hovering,
.fullscreen-overlay h4 .word.hovering,
.overlay h1 .word.hovering {
    top: -1em;
    transition: top 0.7s cubic-bezier(0.85, 0, 0, 1);
    width: fit-content;
}

.word.hovering {
    top: -1em;
    transition: top 0.7s cubic-bezier(0.85, 0, 0, 1);
    width: fit-content;
}

.line-break {
    display: block;
}

.animate-text h1 {
    line-height: 0.2em; /* Larger space between lines for h1 */
}

.animate-text p .word-wrapper {
    margin: 2em 0;
    width: fit-content;
}

.animate-text {
    width: fit-content;
}

@media only screen and (min-width: 25em) {
}

@media only screen and (min-width: 60em) {
    h1 {
        font-size: clamp(6rem, 2rem, 6rem);
    }

    .overlay h1 {
        font-size: 6rem;
    }

    h2 {
        font-size: 2rem;
    }

    h3 {
        font-size: 2rem;
    }
}

@media only screen and (min-width: 100em) {
    h1 {
        font-size: 12rem;
    }

    h2 {
        font-size: 4rem;
    }
}
