/**
 * Homepage hero — interactive services grid
 * Horizontal alignment locked to Bootstrap `.container`
 * (same rail as Project Highlights / rest of page)
 * Colors: navy #253C74, accent #FFdf08, ink #000810
 */

/* ----- Homepage nav: transparent over hero; keep Bootstrap .container width ----- */
header[data-page="home"] .header_navbar {
    background: transparent;
}

header[data-page="home"] .header_navbar.sticky {
    background: #253C74;
}

@media screen and (min-width: 992px) {
    header[data-page="home"] .header_navbar {
        padding: 28px 0 0;
        background: transparent;
    }

    header[data-page="home"] .header_navbar.sticky {
        padding: 16px 0;
        background: #253C74;
    }

    /* Do not override .container max-width/padding — match sections below */
    header[data-page="home"] .header_navbar-nav {
        width: auto;
        margin-left: auto;
        flex: 1 1 auto;
        display: flex;
        justify-content: flex-end;
    }

    header[data-page="home"] .header_navbar-nav_list {
        justify-content: flex-end;
        margin-left: 0;
        gap: clamp(12px, 1.6vw, 24px);
    }

    header[data-page="home"] .header_navbar-nav_list .list-item {
        margin-right: 0;
    }

    header[data-page="home"] .header_navbar-nav .link--single {
        color: #fff;
        letter-spacing: 0.04em;
    }

    header[data-page="home"] .header_navbar-nav .link--single.current,
    header[data-page="home"] .header_navbar-nav .link--single.active {
        color: #FFdf08;
    }

    header[data-page="home"] .header_navbar-nav .link--single:before {
        background: #FFdf08;
    }
}

/* ----- Hero section ----- */
.hero-services {
    --hs-navy: #253C74;
    --hs-navy-deep: #0f1c38;
    --hs-accent: #FFdf08;
    --hs-ink: #000810;
    --hs-white: #fff;
    --hs-header-offset: 90px;
    --bg: none;

    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: var(--hs-white);
    background: linear-gradient(145deg, #1a2f5c 0%, var(--hs-navy) 45%, var(--hs-navy-deep) 100%);
    padding: calc(var(--hs-header-offset) + 8px) 0 48px;
}

.hero-services::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--bg) center / cover no-repeat;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.hero-services.is-has-bg::before {
    opacity: 1;
}

.hero-services::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(15, 28, 56, 0.78);
    pointer-events: none;
}

/* Uses Bootstrap .container for identical left/right rails */
.hero-services__inner.container {
    position: relative;
    z-index: 1;
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 42%);
    align-items: center;
    column-gap: clamp(20px, 3vw, 48px);
    padding-top: 12px;
    margin-left: auto;
    margin-right: auto;
}

.hero-services__panel {
    justify-self: start;
    max-width: 420px;
    min-width: 0;
}

.hero-services__label {
    display: flex;
    align-items: center;
    gap: 16px;
    font-family: Archivo, sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin: 0 0 14px;
    color: var(--hs-white);
}

.hero-services__label::before {
    content: "";
    width: clamp(40px, 12vw, 160px);
    height: 2px;
    background: var(--hs-accent);
    flex-shrink: 0;
}

.hero-services__title {
    font-family: Archivo, sans-serif;
    font-size: clamp(2rem, 4.6vw, 3.4rem);
    line-height: 1.08;
    font-weight: 700;
    letter-spacing: -0.01em;
    max-width: 14ch;
    margin: 0;
    color: var(--hs-white);
}

.hero-services__desc {
    margin: 20px 0 28px;
    max-width: 44ch;
    line-height: 1.55;
    font-size: clamp(0.95rem, 1.2vw, 1.05rem);
    color: rgba(255, 255, 255, 0.9);
}

.hero-services__cta {
    display: inline-block;
    background: var(--hs-accent);
    color: var(--hs-ink);
    font-family: Archivo, sans-serif;
    font-weight: 700;
    text-decoration: none;
    padding: 16px 28px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.hero-services__cta:hover,
.hero-services__cta:focus-visible {
    background: var(--hs-white);
    color: var(--hs-ink);
}

/* Grid flush to the right edge of the shared .container */
.hero-services__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(8px, 1.2vw, 14px);
    width: 100%;
    justify-self: end;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hero-services__tile {
    position: relative;
    aspect-ratio: 1;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background:
        var(--tile-bg, none) center / cover no-repeat,
        linear-gradient(160deg, #2a4580, #152746);
    color: var(--hs-white);
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: flex-end;
    padding: clamp(8px, 1vw, 14px);
    font-family: Archivo, sans-serif;
    font-weight: 700;
    font-size: clamp(0.62rem, 1.1vw, 0.95rem);
    line-height: 1.2;
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease, border-width 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
}

.hero-services__tile::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(8, 20, 38, 0.88), rgba(8, 20, 38, 0.2) 55%, rgba(8, 20, 38, 0.05));
    pointer-events: none;
}

.hero-services__tile span {
    position: relative;
    z-index: 1;
}

.hero-services__tile:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 223, 8, 0.45);
}

.hero-services__tile:focus-visible {
    outline: 3px solid var(--hs-white);
    outline-offset: 2px;
}

.hero-services__tile[aria-selected="true"] {
    border: 2px solid var(--hs-accent);
}

.hero-services__tile[aria-selected="true"]::after {
    content: "";
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--hs-accent);
    z-index: 1;
}

.hero-services__empty {
    grid-column: 1 / -1;
    padding: 24px 0;
    text-align: right;
}

@media (max-width: 991.98px) {
    .hero-services {
        --hs-header-offset: 80px;
        padding-bottom: 36px;
    }

    .hero-services__inner.container {
        grid-template-columns: 1fr;
        align-content: center;
        row-gap: 28px;
    }

    .hero-services__panel {
        max-width: none;
        justify-self: stretch;
    }

    .hero-services__grid {
        justify-self: stretch;
        width: 100%;
        max-width: 520px;
        margin-left: auto;
    }

    .hero-services__title {
        max-width: none;
    }
}

@media (max-width: 575.98px) {
    .hero-services {
        --hs-header-offset: 72px;
        min-height: auto;
        padding-bottom: 28px;
    }

    .hero-services__grid {
        max-width: none;
        margin-left: 0;
    }

    .hero-services__cta {
        width: 100%;
        text-align: center;
    }

    .hero-services__tile {
        font-size: clamp(0.58rem, 2.6vw, 0.78rem);
        padding: 8px;
    }

    .hero-services__empty {
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-services::before,
    .hero-services__tile,
    .hero-services__cta {
        transition: none !important;
    }

    .hero-services__tile:hover {
        transform: none;
    }
}
