/* ==========================================================================
   Homepage modules
   Loaded after pages.css on the front page only. Reuses the design tokens
   defined in main.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Hero
   -------------------------------------------------------------------------- */
.home-hero {
    position: relative;
    /* Keep the hero at its content height instead of stretching to the
       viewport, which leaves large empty gaps on high-resolution screens. */
    min-height: 640px;
    overflow: hidden;
    background:
        radial-gradient(760px 560px at 76% 24%, rgba(47, 107, 255, .26), transparent 70%),
        radial-gradient(540px 400px at 96% 74%, rgba(33, 212, 196, .16), transparent 70%),
        linear-gradient(90deg, #03060C 0%, #050A16 34%, #081226 58%, #0B1B39 78%, #0F2550 100%);
    color: var(--text-dark-bg);
}

.home-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(80% 80% at 60% 40%, #000 0%, transparent 100%);
    mask-image: radial-gradient(80% 80% at 60% 40%, #000 0%, transparent 100%);
    pointer-events: none;
}

.home-hero__slides {
    position: relative;
    z-index: 1;
    display: grid;
}

.home-hero__slide {
    position: relative;
    grid-area: 1 / 1;
    display: grid;
    grid-template-columns: 54% 46%;
    min-height: 640px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .8s var(--ease), visibility .8s var(--ease);
}

.home-hero__slide.is-active {
    z-index: 1;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.home-hero__copy {
    position: relative;
    display: flex;
    align-items: center;
    color: var(--text-dark-bg);
}

.home-hero__copy-inner {
    width: 100%;
    padding: calc(var(--header-height) + 50px) 24px 110px max(var(--gutter), calc((100vw - var(--container-max)) / 2 + var(--gutter)));
}

.home-hero__eyebrow {
    color: var(--cyan);
}

.home-hero__eyebrow .eyebrow__line {
    background: var(--cyan);
}

.home-hero__title {
    max-width: 11em;
    color: var(--text-dark-bg);
    font-size: clamp(40px, 5.2vw, 80px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: .015em;
}

.home-hero__subtitle {
    max-width: 34ch;
    margin-top: 24px;
    color: var(--text-on-dark-muted);
    font-size: clamp(15px, 1.4vw, 19px);
    line-height: 1.8;
}

.home-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 32px;
}

.home-hero__action {
    display: flex;
}

.home-hero .btn--solid {
    border-color: var(--red);
    background: var(--red);
    color: #FFFFFF;
}

.home-hero .btn--solid:hover {
    border-color: var(--red-deep);
    background: var(--red-deep);
    color: #FFFFFF;
}

.home-hero .btn--outline {
    border-color: rgba(255, 255, 255, .35);
    color: var(--text-dark-bg);
}

.home-hero .btn--outline:hover {
    border-color: var(--cyan);
    background: rgba(33, 212, 196, .08);
    color: var(--text-dark-bg);
}

.home-hero__visual {
    position: relative;
    width: 100%;
    max-width: 520px;
    margin: calc(var(--header-height) + 12px) max(var(--gutter), calc((100vw - var(--container-max)) / 2 + var(--gutter))) 56px auto;
    overflow: visible;
}

.home-hero__visual::before {
    content: "";
    position: absolute;
    top: -80px;
    right: -60px;
    z-index: 0;
    width: 340px;
    height: 340px;
    border: 1px solid rgba(33, 212, 196, .35);
    border-radius: 50%;
}

.home-hero__visual::after {
    content: "";
    position: absolute;
    top: -30px;
    right: -10px;
    z-index: 0;
    width: 240px;
    height: 240px;
    border: 1px dashed rgba(47, 107, 255, .45);
    border-radius: 50%;
}

.home-hero__bg {
    display: none;
}

.home-hero__overlay {
    display: none;
}

.hero-architecture {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 32px clamp(16px, 2vw, 28px) 24px;
}

.hero-architecture__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.hero-architecture__label {
    color: var(--cyan);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .2em;
}

.hero-architecture__caption {
    color: var(--text-on-dark-muted);
    font-size: 12px;
}

.hero-layers {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hero-layers::before {
    content: "";
    position: absolute;
    top: 20px;
    bottom: 20px;
    left: 27px;
    width: 2px;
    background: linear-gradient(180deg, var(--cyan), var(--red));
    opacity: .7;
}

.hero-layer {
    position: relative;
    display: grid;
    grid-template-columns: 44px minmax(100px, 130px) minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-height: 54px;
    padding: 10px 14px 10px 12px;
    background: none;
}

.hero-layer::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .04) 62%, transparent 88%);
}

.hero-layer.is-focus {
    background: radial-gradient(420px 150px at 4% 50%, rgba(33, 212, 196, .18), rgba(47, 107, 255, .08) 44%, transparent 78%);
}

.hero-layer.is-focus .hero-layer__name,
.hero-layer.is-focus .hero-layer__desc {
    color: var(--paper);
}

.hero-layer__num {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(33, 212, 196, .7);
    border-radius: 50%;
    background: var(--indigo-900);
    color: var(--cyan);
    font-family: var(--font-latin);
    font-size: 9.5px;
    font-weight: 700;
}

.hero-layer__name {
    color: var(--text-dark-bg);
    font-size: 16px;
    font-weight: 600;
}

.hero-layer__desc {
    color: var(--text-on-dark-muted);
    font-size: 13px;
    line-height: 1.55;
}

.hero-architecture__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.hero-chip {
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, .16);
    background: rgba(255, 255, 255, .05);
    color: var(--text-on-dark-muted);
    font-size: 11px;
}

.hero-chip--red {
    border-color: rgba(33, 212, 196, .45);
    color: var(--cyan);
}

.hero-architecture__footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-top: auto;
    padding-top: 20px;
}

.hero-architecture__foot {
    color: var(--text-on-dark-muted);
    font-size: 11px;
    letter-spacing: .08em;
    line-height: 1.7;
}

.hero-architecture__index {
    flex: none;
    color: rgba(244, 247, 252, .09);
    font-family: var(--font-latin);
    font-size: clamp(64px, 7vw, 104px);
    font-weight: 700;
    line-height: .8;
    letter-spacing: -.02em;
}

.home-hero__controls {
    position: absolute;
    right: 0;
    bottom: 26px;
    left: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding-inline: max(var(--gutter), calc((100vw - var(--container-max)) / 2 + var(--gutter)));
}

.home-hero__dots {
    display: flex;
    align-items: center;
    gap: 4px;
}

.home-hero__dot {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
}

.home-hero__dot::before {
    content: "";
    width: 10px;
    height: 10px;
    border: 1px solid rgba(245, 245, 255, .35);
    border-radius: 50%;
    transition: width var(--transition), background-color var(--transition), border-color var(--transition), border-radius var(--transition);
}

.home-hero__dot:hover::before {
    border-color: var(--text-dark-bg);
}

.home-hero__dot.is-active::before {
    width: 30px;
    border-color: var(--cyan);
    border-radius: 2px;
    background: var(--cyan);
}

.home-hero__arrows {
    display: flex;
    gap: 10px;
}

.home-hero__arrow {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 50%;
    color: var(--text-dark-bg);
    transition: border-color var(--transition), background-color var(--transition), color var(--transition);
}

.home-hero__arrow:hover,
.home-hero__arrow:focus-visible {
    border-color: var(--cyan);
    background: var(--cyan);
    color: var(--indigo-900);
}

.home-hero__arrow-icon {
    width: 20px;
    height: 20px;
}

/* --------------------------------------------------------------------------
   2. Stats
   -------------------------------------------------------------------------- */
.home-stats {
    padding-block: clamp(48px, 5.4vw, 78px);
    border-top: 1px solid rgba(47, 107, 255, .18);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    background:
        radial-gradient(760px 320px at 82% -10%, rgba(47, 107, 255, .18), transparent 70%),
        linear-gradient(180deg, #050A14 0%, #0B1B39 100%);
}

.home-stats__grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.home-stats__item {
    --stat-accent: var(--red);
    --stat-soft: rgba(47, 107, 255, .12);
    position: relative;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    min-width: 0;
    padding: 22px 20px 24px;
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 4px;
    background: rgba(255, 255, 255, .04);
    transition: transform var(--transition), box-shadow var(--transition);
}

.home-stats__item:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, .28);
}

.home-stats__item:nth-child(1) {
    --stat-accent: #2F6BFF;
    --stat-soft: rgba(47, 107, 255, .12);
}

.home-stats__item:nth-child(2) {
    --stat-accent: #14B8A6;
    --stat-soft: rgba(20, 184, 166, .14);
}

.home-stats__item:nth-child(3) {
    --stat-accent: #10B981;
    --stat-soft: rgba(16, 185, 129, .14);
}

.home-stats__item:nth-child(4) {
    --stat-accent: #D99A16;
    --stat-soft: rgba(217, 154, 22, .16);
}

.home-stats__item:nth-child(5) {
    --stat-accent: #0FA79A;
    --stat-soft: rgba(33, 212, 196, .18);
}

.home-stats__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .06);
    color: var(--stat-accent);
}

.home-stats__icon svg {
    width: 22px;
    height: 22px;
}

.home-stats__suffix {
    color: var(--stat-accent);
}

.home-products,
.home-cases,
.home-honors {
    background-image:
        linear-gradient(rgba(26, 20, 64, .06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(26, 20, 64, .06) 1px, transparent 1px);
    background-size: 48px 48px;
}

.home-scenarios {
    background-image:
        linear-gradient(rgba(26, 20, 64, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(26, 20, 64, .045) 1px, transparent 1px);
    background-size: 48px 48px;
}

.home-stats__value {
    display: flex;
    align-items: baseline;
    gap: 7px;
    margin: 0;
}

.home-stats__number {
    color: var(--paper);
    font-family: var(--font-latin);
    font-size: clamp(44px, 5vw, 72px);
    font-weight: 600;
    line-height: 1;
    letter-spacing: -.01em;
    font-variant-numeric: tabular-nums;
}

.home-stats__suffix {
    color: var(--red);
    font-size: clamp(14px, 1.2vw, 18px);
    font-weight: 500;
    white-space: nowrap;
}

.home-stats__label {
    color: var(--text-on-dark-muted);
    font-size: 14px;
    letter-spacing: .08em;
}

/* --------------------------------------------------------------------------
   4. Products
   -------------------------------------------------------------------------- */
.home-products__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}

.home-products__grid > .card {
    height: 100%;
}

.home-products .card--product .card__body {
    padding: 24px;
}

.home-products .card--product .card__title {
    font-size: 18px;
}

.home-products .card--product .card__excerpt {
    font-size: 13px;
}

/* --------------------------------------------------------------------------
   5. Scenarios
   -------------------------------------------------------------------------- */
.home-scenarios__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}

.home-scenarios__grid > .card {
    height: 100%;
}

.home-scenarios__grid .card__body {
    padding: 24px;
}

.home-scenarios__grid .card__title {
    font-size: 18px;
}

.home-scenarios__grid .solution-card__media .card__media-link {
    padding: 28px;
}

/* --------------------------------------------------------------------------
   6. Cases
   -------------------------------------------------------------------------- */
.home-cases__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px;
}

/* --------------------------------------------------------------------------
   7. Partners
   -------------------------------------------------------------------------- */
.home-partners .partner-wall {
    border-color: var(--line-light);
}

/* --------------------------------------------------------------------------
   8. Honors
   -------------------------------------------------------------------------- */
.home-honors__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 40px;
}

.home-honors__head .section-head {
    flex: 1;
    margin-bottom: 0;
}

.home-honors__nav {
    display: flex;
    flex: none;
    gap: 12px;
}

.home-honors__button {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 1px solid var(--line-light);
    background: var(--paper);
    color: var(--ink-900);
    transition: border-color var(--transition), background-color var(--transition), color var(--transition), opacity var(--transition);
}

.home-honors__button:hover:not(:disabled) {
    border-color: var(--red);
    background: var(--red);
    color: var(--paper);
}

.home-honors__button:disabled {
    opacity: .35;
    cursor: not-allowed;
}

.home-honors__icon {
    width: 20px;
    height: 20px;
}

.home-honors__track {
    display: flex;
    gap: 24px;
    padding-bottom: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: var(--line-light) transparent;
    overscroll-behavior-x: contain;
}

.home-honors__track:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: 4px;
}

.home-honors__track .honor-card {
    flex: 0 0 clamp(240px, 26vw, 320px);
    scroll-snap-align: start;
}

.home-honors__track.is-dragging {
    scroll-snap-type: none;
    cursor: grabbing;
}

.home-honors__track.is-dragging a {
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   9. News
   -------------------------------------------------------------------------- */
.home-news__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
}

/* --------------------------------------------------------------------------
   10. Bottom CTA
   -------------------------------------------------------------------------- */
.home-cta {
    position: relative;
    padding-block: clamp(96px, 10vw, 150px);
    overflow: hidden;
    background: linear-gradient(120deg, #1D4FD8 0%, #14367F 52%, #0A1730 100%);
    color: var(--paper);
}

.home-cta__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .34;
}

.home-cta::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(29, 79, 216, .12) 0%, rgba(10, 23, 48, .55) 100%);
}

.home-cta__inner {
    position: relative;
    z-index: 1;
    max-width: 920px;
}

.home-cta__eyebrow {
    color: var(--paper);
}

.home-cta__title {
    max-width: 18ch;
    font-size: clamp(32px, 4.5vw, 60px);
    line-height: 1.14;
}

.home-cta__desc {
    max-width: 58ch;
    margin-top: 22px;
    color: rgba(255, 255, 255, .82);
    font-size: clamp(16px, 1.4vw, 19px);
    line-height: 1.8;
}

.home-cta__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 40px;
}

.home-cta .btn--outline {
    border-color: rgba(255, 255, 255, .7);
    color: var(--paper);
}

.home-cta .btn--outline:hover {
    border-color: var(--paper);
    background: rgba(255, 255, 255, .12);
    color: var(--paper);
}

/* --------------------------------------------------------------------------
   11. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1199px) {
    .home-hero__visual {
        max-width: none;
        margin-right: 24px;
    }

    .hero-architecture {
        padding: 32px 20px 24px;
    }

    .hero-layers::before {
        left: 25px;
    }

    .hero-layer {
        grid-template-columns: 40px minmax(90px, 110px) minmax(0, 1fr);
        gap: 10px;
        min-height: 52px;
        padding: 9px 12px;
    }

    .hero-layer__num {
        width: 28px;
        height: 28px;
        font-size: 9px;
    }

    .hero-layer__name {
        font-size: 15px;
    }

    .hero-layer__desc {
        font-size: 12.5px;
    }

    .home-products__grid,
    .home-scenarios__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

}

@media (max-width: 1023px) {
    .home-hero__slide {
        grid-template-columns: minmax(0, 1fr);
    }

    .home-hero__copy-inner {
        padding: calc(var(--header-height) + 56px) var(--gutter) 56px;
    }

    .home-hero__visual {
        /* width:100% plus horizontal margins would overflow the viewport. */
        width: auto;
        max-width: none;
        margin: 0 24px 84px;
        min-height: 520px;
    }

    .hero-architecture {
        padding: 36px 24px 56px;
    }

    .home-hero__controls {
        width: 100%;
        padding-inline: var(--gutter);
    }

    .home-stats__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }


    .home-products__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .home-scenarios__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-cases__grid {
        gap: 28px;
    }

    .home-news__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px;
    }

    .home-honors__head {
        gap: 24px;
    }
}

@media (max-width: 767px) {
    .home-hero__copy-inner {
        padding: calc(var(--header-height) + 40px) var(--gutter) 48px;
    }

    .home-hero__title {
        max-width: 11em;
        font-size: clamp(36px, 10vw, 50px);
    }

    .home-hero__subtitle {
        margin-top: 18px;
        font-size: 15px;
        line-height: 1.75;
    }

    .home-hero__actions {
        gap: 12px;
        margin-top: 28px;
    }

    .home-hero__action {
        flex: 1 1 auto;
    }

    .home-hero__action .btn {
        width: 100%;
    }

    .home-hero__visual {
        margin: 0 18px 76px;
        min-height: 560px;
    }

    .hero-architecture {
        padding: 32px 18px 52px;
    }

    .hero-architecture__head {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .hero-layer {
        grid-template-columns: 36px minmax(0, 1fr);
        gap: 4px 10px;
        padding: 10px 12px;
    }

    .hero-layer__desc {
        grid-column: 2;
    }

    .home-hero__controls {
        bottom: 20px;
    }

    /* Five 44px dot targets plus the arrows overflow a phone-width row. */
    .home-hero__dots {
        gap: 0;
    }

    .home-hero__dot {
        width: 30px;
        height: 30px;
    }

    .home-hero__arrow {
        width: 42px;
        height: 42px;
    }

    .home-stats {
        padding-block: 48px;
    }

    .home-stats__grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .home-stats__number {
        font-size: clamp(38px, 11vw, 52px);
    }


    .home-products__grid,
    .home-scenarios__grid,
    .home-cases__grid,
    .home-news__grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }

    .home-honors__head {
        align-items: flex-start;
        flex-direction: column;
        gap: 18px;
    }

    .home-honors__track {
        gap: 16px;
    }

    .home-honors__track .honor-card {
        flex-basis: min(78vw, 300px);
    }

    .home-cta__title {
        max-width: 16ch;
    }

    .home-cta__actions .btn {
        flex: 1 1 auto;
    }
}

@media (max-width: 479px) {
    .home-hero__action {
        flex: 1 1 100%;
    }

    .home-stats__item {
        padding-inline: 14px;
    }

    .home-stats__suffix {
        font-size: 13px;
    }

    .home-honors__nav {
        width: 100%;
    }

    .home-honors__button {
        width: 44px;
        height: 44px;
    }
}

/* --------------------------------------------------------------------------
   12. Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .home-hero__bg {
        transform: none;
        will-change: auto;
    }

    [data-reveal],
    [data-reveal].is-revealed {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* --------------------------------------------------------------------------
   13. Tighter homepage vertical rhythm (user acceptance)
   -------------------------------------------------------------------------- */
body.home .section {
    padding-block: clamp(56px, 5vw, 80px);
}

body.home .home-cta {
    padding-block: clamp(56px, 5vw, 80px);
}

@media (max-width: 1023px) {
    body.home .section,
    body.home .home-cta {
        padding-block: 64px;
    }
}

@media (max-width: 767px) {
    body.home .section,
    body.home .home-cta {
        padding-block: 48px;
    }
}
