/*
 * Home page v2. Depends on the tokens in theme.css.
 */

/* ---------- Hero ---------- */
.hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 100vh;
    min-height: 100svh;
    padding: 7.5rem 0 6.5rem;
    overflow: hidden;
    color: #fff;
    background: var(--v2-navy-900);
    isolation: isolate;
}

.hero-media,
.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.hero-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: heroZoom 18s ease-out both;
}

video.hero-video {
    animation: none;
}

@keyframes heroZoom {
    from { transform: scale(1.08); }
    to { transform: scale(1); }
}

.hero-overlay {
    background:
        linear-gradient(to top, rgba(4, 18, 46, .85) 0%, rgba(4, 18, 46, 0) 35%),
        linear-gradient(var(--hero-dir, to left), rgba(7, 28, 69, .92) 0%, rgba(11, 42, 99, .7) 45%, rgba(11, 42, 99, .15) 100%);
}

[dir="ltr"] .hero-overlay {
    --hero-dir: to right;
}

.hero-content {
    position: relative;
}

.hero-eyebrow {
    margin-bottom: .75rem;
    color: rgba(255, 255, 255, .9);
    font-size: clamp(1rem, .9rem + .4vw, 1.25rem);
    font-weight: 600;
}

.hero-title {
    max-width: 760px;
    margin-bottom: 1.25rem;
    color: #fff;
    font-size: clamp(2.6rem, 1.6rem + 4.6vw, 5.25rem);
    font-weight: 900 !important;
    line-height: 1.15;
    text-shadow: 0 6px 30px rgba(0, 0, 0, .25);
}

.text-gradient {
    background: linear-gradient(90deg, var(--v2-sky) 0%, #4f9dff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: none;
}

.hero-desc {
    max-width: 560px;
    margin-bottom: 2.25rem;
    color: rgba(255, 255, 255, .88);
    font-size: clamp(1rem, .95rem + .35vw, 1.25rem);
    line-height: 1.9;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.hero .animated:nth-child(2) { animation-delay: .1s; }
.hero .animated:nth-child(3) { animation-delay: .2s; }
.hero .animated:nth-child(4) { animation-delay: .3s; }

.hero-spotlight {
    position: absolute;
    inset-inline-end: max(1rem, calc((100vw - 1320px) / 2 + 1rem));
    bottom: 2.25rem;
    display: flex;
    align-items: center;
    gap: .85rem;
    max-width: min(360px, calc(100% - 2rem));
    padding: .85rem 1.15rem;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 12px;
    background: rgba(4, 18, 46, .45);
    backdrop-filter: blur(10px);
    color: #fff;
    text-decoration: none;
    transition: background-color .25s var(--v2-ease), transform .25s var(--v2-ease);
}

.hero-spotlight:hover {
    background: rgba(4, 18, 46, .7);
    color: #fff;
    transform: translateY(-3px);
}

.hero-spotlight > i {
    font-size: 1.5rem;
    color: var(--v2-sky);
}

.hero-spotlight strong,
.hero-spotlight small {
    display: block;
}

.hero-spotlight strong {
    font-size: .95rem;
}

.hero-spotlight small {
    color: rgba(255, 255, 255, .7);
    font-size: .8rem;
}

.hero-video-toggle {
    position: absolute;
    inset-inline-start: max(1rem, calc((100vw - 1320px) / 2 + 1rem));
    bottom: 2.25rem;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 50%;
    background: rgba(4, 18, 46, .35);
    color: #fff;
    backdrop-filter: blur(6px);
    transition: background-color .2s var(--v2-ease);
}

.hero-video-toggle:hover {
    background: var(--v2-blue);
}

.hero-scroll {
    position: absolute;
    left: 50%;
    bottom: 2.25rem;
    width: 26px;
    height: 42px;
    border: 2px solid rgba(255, 255, 255, .6);
    border-radius: 14px;
    transform: translateX(-50%);
}

.hero-scroll span {
    position: absolute;
    top: 7px;
    left: 50%;
    width: 4px;
    height: 8px;
    border-radius: 2px;
    background: #fff;
    transform: translateX(-50%);
    animation: heroScroll 1.8s ease-in-out infinite;
}

@keyframes heroScroll {
    0% { opacity: 0; transform: translate(-50%, 0); }
    30% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, 14px); }
}

@media (max-width: 991.98px) {
    .hero {
        padding-bottom: 8.5rem;
    }

    .hero-overlay {
        background: linear-gradient(to top, rgba(4, 18, 46, .95) 0%, rgba(7, 28, 69, .75) 55%, rgba(11, 42, 99, .35) 100%);
    }

    .hero-scroll {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .hero {
        align-items: flex-end;
    }

    .hero-actions .btn-v2 {
        flex: 1 1 100%;
    }

    .hero-spotlight {
        inset-inline: 1rem;
        max-width: none;
        bottom: 1.25rem;
    }

    .hero-video-toggle {
        bottom: auto;
        top: 6rem;
        inset-inline-start: auto;
        inset-inline-end: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-video,
    .hero-scroll span {
        animation: none;
    }
}

/* ---------- Featured projects (rotating banner) ---------- */
.featured-projects {
    position: relative;
    padding: 4.5rem 0;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(800px 420px at 85% 120%, rgba(31, 111, 235, .45), transparent 65%),
        radial-gradient(600px 300px at 0% 0%, rgba(121, 194, 255, .18), transparent 60%),
        linear-gradient(135deg, var(--v2-navy-900) 0%, var(--v2-navy-800) 60%, var(--v2-navy-700) 100%);
}

.featured-projects::before {
    content: "";
    position: absolute;
    inset-inline-start: -10%;
    top: -40%;
    width: 60%;
    height: 180%;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .06);
    pointer-events: none;
}

.fp-wrapper {
    position: relative;
    display: grid;
}

.fp-slide {
    grid-area: 1 / 1;
    opacity: 0;
    visibility: hidden;
    transition: opacity .8s var(--v2-ease), visibility .8s;
}

.fp-slide.is-active {
    opacity: 1;
    visibility: visible;
}

.fp-slide .fp-text > * {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .6s var(--v2-ease), transform .6s var(--v2-ease);
}

.fp-slide.is-active .fp-text > * {
    opacity: 1;
    transform: none;
}

.fp-slide.is-active .fp-text > :nth-child(2) { transition-delay: .08s; }
.fp-slide.is-active .fp-text > :nth-child(3) { transition-delay: .16s; }
.fp-slide.is-active .fp-text > :nth-child(4) { transition-delay: .24s; }
.fp-slide.is-active .fp-text > :nth-child(5) { transition-delay: .32s; }

.fp-title {
    margin-bottom: 1rem;
    color: #fff;
    font-size: clamp(1.75rem, 1.2rem + 2vw, 2.75rem);
    font-weight: 800 !important;
    line-height: 1.3;
}

.fp-desc {
    max-width: 520px;
    margin-bottom: 1.25rem;
    color: rgba(255, 255, 255, .82);
    font-size: 1.05rem;
    line-height: 1.9;
}

.fp-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 0 0 1.75rem;
    padding: 0;
    list-style: none;
}

.fp-meta li {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .35rem .8rem;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 999px;
    background: rgba(255, 255, 255, .06);
    color: rgba(255, 255, 255, .88);
    font-size: .85rem;
}

.fp-meta i {
    color: var(--v2-sky);
}

.fp-image {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    box-shadow: 0 30px 60px rgba(0, 0, 0, .35), 0 0 0 1px rgba(255, 255, 255, .12);
}

.fp-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.06);
    transition: transform 6s ease-out;
}

.fp-slide.is-active .fp-image img {
    transform: scale(1);
}

.fp-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 2.25rem;
}

.fp-nav {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 50%;
    background: rgba(255, 255, 255, .06);
    color: #fff;
    transition: background-color .2s var(--v2-ease), border-color .2s var(--v2-ease);
}

.fp-nav:hover {
    background: #fff;
    border-color: #fff;
    color: var(--v2-navy-800);
}

.fp-dots {
    display: flex;
    gap: .5rem;
}

/* Each dot doubles as a progress bar for the 30s rotation */
.fp-dot {
    position: relative;
    width: 10px;
    height: 6px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: rgba(255, 255, 255, .3);
    overflow: hidden;
    transition: width .35s var(--v2-ease);
}

.fp-dot.is-active {
    width: 44px;
}

.fp-dot span {
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    width: 0;
    background: #fff;
    border-radius: inherit;
}

.fp-dot.is-active span {
    animation: fpProgress var(--fp-interval, 30000ms) linear forwards;
}

.featured-projects.is-paused .fp-dot.is-active span {
    animation-play-state: paused;
}

@keyframes fpProgress {
    from { width: 0; }
    to { width: 100%; }
}

@media (max-width: 991.98px) {
    .fp-slide .row {
        flex-direction: column-reverse;
    }
}

/* ---------- Testimonials ---------- */
.testimonials-v2 {
    background: #fff;
}

.testimonials-carousel .owl-stage {
    display: flex;
}

.testimonials-carousel .owl-item {
    display: flex;
    padding: .5rem .25rem 1.5rem;
}

.testimonial-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0;
    padding: 2rem 1.75rem 1.5rem;
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius);
    background: #fff;
    box-shadow: var(--v2-shadow);
    transition: transform .3s var(--v2-ease), box-shadow .3s var(--v2-ease);
}

.testimonial-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--v2-shadow-lg);
}

.testimonial-quote {
    position: absolute;
    top: 1.25rem;
    inset-inline-end: 1.5rem;
    color: rgba(31, 111, 235, .12);
    font-size: 2.75rem;
}

.testimonial-card blockquote {
    flex: 1;
    margin: 0 0 1.5rem;
    color: var(--v2-text);
    font-size: 1.02rem;
    line-height: 1.9;
}

.testimonial-card figcaption {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--v2-border);
}

.testimonials-carousel .owl-item .testimonial-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    background: linear-gradient(135deg, var(--v2-blue), var(--v2-navy-700));
    color: #fff;
    font-weight: 700;
}

.testimonial-card figcaption strong,
.testimonial-card figcaption small {
    display: block;
}

.testimonial-card figcaption strong {
    color: var(--v2-navy-800);
}

.testimonial-card figcaption small {
    color: var(--v2-muted);
}

.testimonials-carousel .owl-dots {
    display: flex;
    justify-content: center;
    gap: .4rem;
    margin-top: .5rem;
}

.testimonials-carousel .owl-dot span {
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 8px;
    background: var(--v2-border);
    transition: width .3s var(--v2-ease), background-color .3s var(--v2-ease);
}

.testimonials-carousel .owl-dot.active span {
    width: 26px;
    background: var(--v2-blue);
}

/* Landscape phones / short screens: let the hero size to its content */
@media (max-height: 520px) and (orientation: landscape) {
    .hero {
        align-items: center;
        min-height: auto;
        padding: 6.5rem 0 3.5rem;
    }

    .hero-spotlight,
    .hero-scroll {
        display: none;
    }

    .hero-video-toggle {
        top: auto;
        bottom: 1rem;
    }
}
