/* home animation */
.nk-bg-color-animated {
    background: linear-gradient(300deg, var(--nk-primary-color-x-lighter), var(--nk-primary-color), var(--nk-primary-color-xx-darker));
    background-size: 180% 180%;
    animation: gradient-animation 10s ease infinite;
}

@keyframes gradient-animation {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}


.nk-home-header-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding-left: var(--nk-spacing-default);

}

@media(min-width: 1024px) {
    .nk-home-header-slider {
        height: 80vh;
    }

}

.nk-svg-background {
    position: absolute;
    top: var(--nk-spacing-default);
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}


@media(min-width: 500px) {
    .nk-svg-background svg {
        height: 100%;
    }
}

@media(min-width: 1024px) {

    .nk-svg-background {
        top: 120px;
    }

    .nk-svg-background svg {
        height: 100%;
    }

    .nk-svg-background svg path {
        fill: revert-layer;
    }

    .nk-home-header-slider {
        height: 80vh;
    }

}

@media(min-width: 1600px) {
    .nk-svg-background svg {
        height: 100%;
    }
}

.nk-svg-background svg {
    width: auto !important;
    height: 90%;
    position: absolute;
    right: 20px;

    object-fit: fill;
}

.nk-svg-background svg path {

    fill: var(--nk-primary-color-x-darker);
}


/* Carousel */

/* Container styling */
.nk-home-header-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: var(--content-width);
    margin: 0 auto;
    padding-inline-start: 0;
    padding-inline-end: 0;
    min-height: 500px;
    display: flex;
    align-items: center;
    font-family: sans-serif;

}


/* Base styles for slides */
.nk-slider-item {
    position: absolute;
    left: 0;
    width: 100%;

    text-align: left;
    padding: 0;
    box-sizing: border-box;

    /* Start hidden and non-clickable */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 0;
    animation: fadeSlide 9s infinite;
}



@media(min-width: 1024px) {
    .nk-slider-item {
        top: 50%;
        transform: translateY(-50%);
    }
}




/* Assign each slide's animation delay so they show in sequence */
.nk-slider-item:nth-child(1) {
    animation-delay: 0s;
}

.nk-slider-item:nth-child(2) {
    animation-delay: 3s;
}

.nk-slider-item:nth-child(3) {
    animation-delay: 6s;
}

/* Text and button styles */
.nk-slider-item h1 {
    font-size: 2rem;
    color: white;
    line-height: 1;
    padding: 0;
    margin: 0;
    animation: h1Slide 9s infinite;
}

.nk-slider-item p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    color: white;
    animation: pSlide 9s infinite;
}

.nk-slider-item a.nk-btn-carousel {
    display: inline-block;
    color: var(--nk-primary-color);
    background-color: var(--nk-color-white);
    border: 1px solid var(--nk-color-white);
    font-family: var(--nk-font-headings);
  font-weight: var(--nk-font-headings-weight);
    text-decoration: none;
    border-radius: 0;
    padding: 12px 24px;
    line-height: 1;
    font-size: 15px;
    transition: all 0.3s;
    animation: aSlide 9s infinite;
}

.nk-slider-item a.nk-btn-carousel:hover {
    color: var(--nk-color-white);
    background-color: var(--nk-primary-color);
    border: 1px solid var(--nk-color-white);
}

@media(min-width: 500px) {

    .nk-slider-item h1 {
        font-size: 3.25rem;

    }
}

@media(min-width: 1024px) {

    .nk-slider-item h1 {
        font-size: 4rem;
    }


    .nk-slider-item p {
        width: 50%;
    }

}


@media(min-width: 1600px) {

    .nk-slider-item h1 {
        font-size: 6.2rem;
    }

}


/* Sync child animations with parent delays */
.nk-slider-item:nth-child(1) h1,
.nk-slider-item:nth-child(1) p,
.nk-slider-item:nth-child(1) a {
    animation-delay: 0s;
}

.nk-slider-item:nth-child(2) h1,
.nk-slider-item:nth-child(2) p,
.nk-slider-item:nth-child(2) a {
    animation-delay: 3s;
}

.nk-slider-item:nth-child(3) h1,
.nk-slider-item:nth-child(3) p,
.nk-slider-item:nth-child(3) a {
    animation-delay: 6s;
}

/* Keyframes */

/* fadeSlide: Controls overall visibility and clickability
     Timeline per slide (0%-33% for that slide window):
     - 0%: not visible, not clickable
     - 5%-28%: visible and clickable (pointer-events:auto)
     - 33%: fade out, no longer clickable
  */
@keyframes fadeSlide {

    /* Parent slide visible/clickable from 5% to 28% */
    0% {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        z-index: 0;
    }

    5% {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        z-index: 10;
    }

    28% {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        z-index: 10;
    }

    33% {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        z-index: 0;
    }

    100% {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        z-index: 0;
    }
}

/* h1: visible roughly during 5%-28% */
@keyframes h1Slide {
    0% {
        opacity: 0;
        transform: translateX(-50px);
    }

    5% {
        opacity: 1;
        transform: translateX(0);
    }

    70% {
        opacity: 1;
        transform: translateX(0);
    }

    /* Start fading out before 28% so there's no mismatch */
    25% {
        opacity: 1;
        transform: translateX(0);
    }

    28% {
        opacity: 0;
        transform: translateX(50px);
    }

    100% {
        opacity: 0;
        transform: translateX(50px);
    }
}

/* p: appears after h1, still within 5%-28% */
@keyframes pSlide {
    0% {
        opacity: 0;
        transform: translateX(50px);
    }

    10% {
        opacity: 1;
        transform: translateX(0);
    }

    25% {
        opacity: 1;
        transform: translateX(0);
    }

    28% {
        opacity: 0;
        transform: translateX(-50px);
    }

    100% {
        opacity: 0;
        transform: translateX(-50px);
    }
}

/* a: appear after p, still leave before 28% so hover works */
@keyframes aSlide {
    0% {
        opacity: 0;
        transform: translateX(-50px);
    }

    /* Make the button fully visible by ~15% and fade out by ~25% so it is hoverable in the clickable window */
    15% {
        opacity: 1;
        transform: translateX(0);
    }

    25% {
        opacity: 1;
        transform: translateX(0);
    }

    28% {
        opacity: 0;
        transform: translateX(50px);
    }

    100% {
        opacity: 0;
        transform: translateX(50px);
    }
}