/* Consistent vertical rhythm between front-page sections. */

body.home {
    --leven-home-section-gap: 50px;
}

body.home .leven-hero {
    margin-bottom: var(--leven-home-section-gap);
}

/* Featured portfolio directly below the hero. */
body.home .home-featured-portfolio {
    margin-bottom: var(--leven-home-section-gap);
}

body.home .home-featured-portfolio__grid {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    margin-bottom: 0;
}

body.home .home-featured-portfolio__grid > figure {
    float: none;
}

body.home .home-featured-portfolio__grid .leven-portfolio-card {
    display: flex;
    flex-direction: column;
}

body.home .home-featured-portfolio__grid .portfolio-item-img {
    height: auto;
}

body.home .home-featured-portfolio__grid .portfolio-item-img > picture {
    display: block;
    width: 100%;
}

body.home .home-featured-portfolio__grid .portfolio-item-img img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: initial;
}

body.home .home-featured-portfolio__placeholder {
    display: block;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 70% 25%, rgb(0 124 237 / 28%), transparent 42%),
        linear-gradient(145deg, #f5f8fb, #dfe9f2);
}

/* The third tile is covered by a muted veil; only the portfolio button stays above it. */
body.home .home-featured-portfolio__more .leven-portfolio-card__image img {
    object-fit: initial;
    opacity: 1;
    filter: none;
    transition: transform 0.3s ease;
}

body.home .home-featured-portfolio__more:hover .leven-portfolio-card__image img {
    transform: scale(1.06);
}

body.home .home-featured-portfolio__more .portfolio-item-img::after {
    display: none;
}

body.home .home-featured-portfolio__more:hover,
body.home .home-featured-portfolio__more:focus-within {
    border-color: #e8edf4;
}

body.home .home-featured-portfolio__more:hover .leven-portfolio-card__arrow,
body.home .home-featured-portfolio__more:focus-within .leven-portfolio-card__arrow {
    color: #007ced;
    background: transparent;
    transform: none;
}

body.home .home-featured-portfolio__veil {
    position: absolute;
    inset: 0;
    z-index: 3;
    border-radius: inherit;
    background: rgb(207 232 255 / 80%);
    pointer-events: none;
}

body.home .home-featured-portfolio__more-button {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 5;
    pointer-events: none;
    transform: translate(-50%, -50%);
}

body.home .home-featured-portfolio__more-label {
    --button-color: #007ced;
    --button-color-rgb: 0 124 237;
    --transition: 0.25s;
    --spark: 1.8s;
    --cut: 0.1em;
    --active: 0;
    --bg:
        radial-gradient(
            120% 120% at 126% 126%,
            rgb(255 255 255 / calc(var(--active) * 0.9)) 40%,
            transparent 50%
        ) calc(100px - (var(--active) * 100px)) 0 / 100% 100% no-repeat,
        radial-gradient(
            120% 120% at 120% 120%,
            rgb(var(--button-color-rgb) / calc(0.35 + (var(--active) * 0.65))) 30%,
            transparent 70%
        ) calc(100px - (var(--active) * 100px)) 0 / 100% 100% no-repeat,
        var(--button-color);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(96px, 10vw, 118px);
    padding: 0;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 50%;
    background: var(--bg);
    box-shadow:
        0 0 calc(var(--active) * 4em) calc(var(--active) * 1.5em) rgb(var(--button-color-rgb) / 0.45),
        0 0.05em 0 rgb(255 255 255 / calc(0.2 + (var(--active) * 0.55))) inset,
        0 -0.05em 0 rgb(var(--button-color-rgb) / calc(0.35 + (var(--active) * 0.35))) inset;
    color: #fff;
    font-size: clamp(0.95rem, 1.4vw, 1.25rem);
    font-weight: 500;
    line-height: 1;
    scale: calc(1 + (var(--active) * 0.08));
    transform-style: preserve-3d;
    perspective: 100vmin;
    transition:
        box-shadow var(--transition),
        scale var(--transition),
        background var(--transition);
}

body.home .home-featured-portfolio__more:hover .home-featured-portfolio__more-label,
body.home .home-featured-portfolio__more:focus-within .home-featured-portfolio__more-label {
    --active: 1;
}

body.home .home-featured-portfolio__more:focus-within .home-featured-portfolio__more-label {
    box-shadow:
        0 0 0 0.12em #fff,
        0 0 0 0.25em var(--button-color),
        0 0 4em 1.5em rgb(var(--button-color-rgb) / 0.45);
}

body.home .home-featured-portfolio__more-label .star {
    position: absolute;
    top: 50%;
    left: 50%;
    height: calc(var(--size) * 1px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: #fff;
    opacity: var(--alpha);
    transform: translate(-50%, -50%) rotate(10deg) rotate(0deg) translateY(calc(var(--distance) * 0.4px));
    animation: leven-hero-orbit calc(var(--duration) * 1s) calc(var(--delay) * -1s) infinite linear;
}

body.home .home-featured-portfolio__more-label .galaxy {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    opacity: var(--active);
    translate: -50% -50%;
    transition: opacity var(--transition);
}

body.home .home-featured-portfolio__more-label .galaxy__ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    border-radius: 50%;
    transform: translate(-28%, -40%) rotateX(-24deg) rotateY(-30deg) rotateX(90deg);
    transform-style: preserve-3d;
}

body.home .home-featured-portfolio__more-label .galaxy__container {
    position: absolute;
    inset: 0;
    opacity: var(--active);
    -webkit-mask: radial-gradient(#fff, transparent);
    mask: radial-gradient(#fff, transparent);
    transition: opacity var(--transition);
}

body.home .home-featured-portfolio__more-label .star--static {
    top: 50%;
    left: 50%;
    max-height: 4px;
    filter: brightness(4);
    opacity: 0.9;
    transform: translate(0, 0);
    animation:
        leven-hero-move-x calc(var(--duration) * 0.1s) calc(var(--delay) * -0.1s) infinite linear,
        leven-hero-move-y calc(var(--duration) * 0.2s) calc(var(--delay) * -0.2s) infinite linear;
}

body.home .home-featured-portfolio__more:hover .star--static {
    animation-play-state: paused;
}

body.home .home-featured-portfolio__more-label .spark {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: 50%;
    rotate: 0deg;
    -webkit-mask: linear-gradient(#fff, transparent 50%);
    mask: linear-gradient(#fff, transparent 50%);
    animation: leven-hero-flip calc(var(--spark) * 2) infinite steps(2, end);
}

body.home .home-featured-portfolio__more-label .spark::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    z-index: -1;
    width: 200%;
    aspect-ratio: 1;
    opacity: calc(var(--active) + 0.4);
    background: conic-gradient(from 0deg, transparent 0 340deg, #fff 360deg);
    translate: -50% -15%;
    rotate: 0deg;
    transform: rotate(-90deg);
    transition: opacity var(--transition);
    animation: leven-hero-spark-rotate var(--spark) linear infinite both;
}

body.home .home-featured-portfolio__more-label .spark::after {
    content: '';
    position: absolute;
    inset: var(--cut);
    border-radius: 50%;
}

body.home .home-featured-portfolio__more-label .backdrop {
    position: absolute;
    inset: var(--cut);
    border-radius: 50%;
    background: var(--bg);
    transition: background var(--transition);
}

body.home .home-featured-portfolio__more-label .text {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    flex-direction: column;
    color: #fff;
    font-size: clamp(13px, 1.1vw, 15px);
    font-weight: 500;
    letter-spacing: 0.01ch;
    line-height: 1.3;
}

body.home .home-featured-portfolio__more a:focus-visible {
    outline: none;
}

@media only screen and (max-width: 768px) {
    body.home .fw-page-builder-content .row:has(.info-block-w-icon)
        > [class*=col-]:last-child
        .info-block-w-icon:last-child {
        padding-bottom: 0;
    }

    body.home .home-featured-portfolio__grid.three-columns figure {
        width: 100%;
        margin-right: 0;
        margin-left: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.home .home-featured-portfolio__more-label *,
    body.home .home-featured-portfolio__more-label *::before,
    body.home .home-featured-portfolio__more-label *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* Unyson stores different spacer values inline; normalize only the home page. */
body.home .entry-content .fw-divider-space {
    height: auto;
    padding-top: var(--leven-home-section-gap) !important;
}

/* Some builder sections start in a new row without a divider (for example Fun Facts). */
body.home .fw-page-builder-content .fw-container > .row:nth-of-type(n + 3):has(.fw-col-inner > .block-title):not(:has(.fw-divider-space)) {
    margin-top: var(--leven-home-section-gap);
}

/* Tools and AI: Owl measures these fixed cells and fits as many as possible. */
body.home .block-title + .clients.leven-icon-carousel .client-block {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    min-height: 100px;
    margin: 0;
    padding: 0;
}

body.home .block-title + .clients.leven-icon-carousel .client-block a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

body.home .block-title + .clients.leven-icon-carousel .client-block img {
    width: 100px !important;
    height: 100px;
    max-width: none;
    max-height: none;
    object-fit: contain;
}

body.home .block-title + .clients.leven-icon-carousel .owl-stage {
    margin-right: auto;
    margin-left: auto;
}

body.home .block-title + .clients.leven-icon-carousel .owl-dots,
body.home .testimonials.owl-carousel .owl-dots {
    margin-top: 24px;
}

/* Experience: equal-height cards with company and dates pinned to the bottom. */
body.home .testimonials.owl-carousel .owl-stage {
    display: flex;
    align-items: stretch;
}

body.home .testimonials.owl-carousel .owl-item {
    display: flex;
    height: auto;
}

body.home .testimonials.owl-carousel .testimonial-item {
    display: flex;
    width: 100%;
    height: 100%;
}

body.home .testimonials.owl-carousel .testimonial-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    width: 100%;
}

body.home .testimonials.owl-carousel .testimonial-picture {
    overflow: hidden;
    border: 1px solid #e5e5e5;
    border-radius: 50%;
}

body.home .testimonials.owl-carousel .testimonial-text {
    flex: 1 1 auto;
}

body.home .testimonials.owl-carousel .testimonial-author-info {
    flex: 0 0 auto;
    margin-top: auto;
    padding-top: 15px;
}

/* Fun Facts: 4 columns -> 2 x 2 -> a single column. */
body.home .fw-page-builder-content .row:has(> [class*=col-] .lm-info-block) {
    display: flex;
    flex-wrap: wrap;
}

body.home .fw-page-builder-content .row:has(> [class*=col-] .lm-info-block)::before,
body.home .fw-page-builder-content .row:has(> [class*=col-] .lm-info-block)::after {
    display: none;
}

body.home .fw-page-builder-content .row:has(> [class*=col-] .lm-info-block) > [class*=col-] {
    display: flex;
    float: none;
}

body.home .fw-page-builder-content .row:has(> [class*=col-] .lm-info-block) .fw-col-inner {
    display: flex;
    width: 100%;
}

body.home .fw-page-builder-content .row:has(> [class*=col-] .lm-info-block) .lm-info-block {
    --leven-fact-value-size: 48px;
    --leven-fact-value-line-height: 52px;
    --leven-fact-value-bottom: 20px;
    --leven-fact-value-gap: 14px;
    flex: 1;
    padding-bottom: calc(
        var(--leven-fact-value-line-height) +
        var(--leven-fact-value-bottom) +
        var(--leven-fact-value-gap)
    );
}

body.home .fw-page-builder-content .row:has(> [class*=col-] .lm-info-block) .lm-info-block h4 {
    margin-bottom: 0;
}

body.home .fw-page-builder-content .row:has(> [class*=col-] .lm-info-block) .lm-info-block-value {
    position: absolute;
    right: 10px;
    bottom: var(--leven-fact-value-bottom);
    left: 10px;
    color: #007ced;
    font-size: var(--leven-fact-value-size);
    line-height: var(--leven-fact-value-line-height);
    margin: 0;
    text-align: center;
}

@media only screen and (max-width: 991px) {
    body.home .fw-page-builder-content .row:has(> [class*=col-] .lm-info-block) > [class*=col-] {
        flex: 0 0 50%;
        width: 50%;
        max-width: 50%;
    }

    body.home .fw-page-builder-content .row:has(> [class*=col-] .lm-info-block) .lm-info-block {
        --leven-fact-value-size: 36px;
        --leven-fact-value-line-height: 40px;
    }
}

@media only screen and (max-width: 480px) {
    body.home .fw-page-builder-content .row:has(> [class*=col-] .lm-info-block) > [class*=col-] {
        flex-basis: 100%;
        width: 100%;
        max-width: 100%;
    }

    body.home .fw-page-builder-content .row:has(> [class*=col-] .lm-info-block) .lm-info-block {
        --leven-fact-value-size: 32px;
        --leven-fact-value-line-height: 36px;
    }
}
