/* Hero */
.hero {
    min-height: 100svh;
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding-top: 74px;
    box-sizing: border-box;
}

.hero__video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    opacity: 1;
    pointer-events: none;
}

.hero__overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        radial-gradient(circle at 50% 26%, rgba(255, 102, 0, .18), transparent 18%),
        radial-gradient(circle at 78% 18%, rgba(99, 169, 255, .12), transparent 24%),
        linear-gradient(180deg, rgba(4, 8, 18, .44), rgba(4, 8, 18, .92));
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: .22;
}

.hero-inner {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 100px 0 72px
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .11);
    background: rgba(255, 255, 255, .06);
    color: #ffe0cc;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.hero-eyebrow span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--orange);
    box-shadow: 0 0 18px rgba(255, 102, 0, .8)
}

.hero h1 {
    max-width: 1080px;
    margin: 22px auto 16px;
    font-size: clamp(52px, 7vw, 96px);
    line-height: .94;
    letter-spacing: -.07em;
    background: linear-gradient(90deg, #fff, #e7edff 38%, #ffb47d 74%, #fff1e1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    max-width: 820px;
    margin: 0 auto;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.8
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 28px;
    flex-wrap: wrap
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 44px;
    align-items: center;
}

.hero-grid > * {
    position: relative;
    z-index: 2;
}

@media(max-width: 1120px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }
}

.btn {
    border: 0;
    border-radius: 16px;
    padding: 15px 20px;
    font-weight: 900;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    transition: .25s var(--ease);
}

.btn.orange {
    background: linear-gradient(180deg, var(--orange2), var(--orange));
    box-shadow: 0 16px 34px rgba(255, 102, 0, .3)
}

.btn.dark {
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .12)
}

.btn:hover {
    transform: translateY(-2px)
}

/* Hero Scroll-Motion State & Spinner */
html.is-hero-locked, html.is-hero-locked body {
    overflow: hidden;
    touch-action: none;
}

html.is-hero-locked .hero-inner > * {
    opacity: 0;
    transform: translateY(20px);
}

.hero-spinner-wrapper {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: grid;
    place-items: center;
    background: #040812;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.hero-spinner-wrapper.hidden {
    opacity: 0;
    visibility: hidden;
}

.hero-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 102, 0, 0.2);
    border-top-color: var(--orange, #ff6600);
    border-radius: 50%;
    animation: hero-spin 1s linear infinite;
}

@keyframes hero-spin {
    to { transform: rotate(360deg); }
}

/* Cards */
.grid {
    display: grid;
    gap: 20px
}

.grid-2 {
    grid-template-columns: 1fr 1fr
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr)
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr)
}

.card {
    position: relative;
    border-radius: 28px;
    padding: 26px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .065), rgba(255, 255, 255, .025));
    border: 1px solid rgba(255, 255, 255, .10);
    box-shadow: 0 20px 55px rgba(0, 0, 0, .22);
    overflow: hidden;
}

.card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 12% 12%, rgba(255, 102, 0, .10), transparent 22%), radial-gradient(circle at 86% 18%, rgba(91, 174, 255, .10), transparent 24%);
}

.card>* {
    position: relative;
    z-index: 1
}

.card h3 {
    font-size: 24px;
    letter-spacing: -.04em;
    margin: 0 0 10px
}

.card p {
    color: var(--muted);
    line-height: 1.72;
    margin: 0
}

.home-icon {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    margin-bottom: 18px;
    background: linear-gradient(180deg, rgba(255, 102, 0, .20), rgba(99, 169, 255, .10));
    border: 1px solid rgba(255, 255, 255, .10);
}

.home-icon svg {
    width: 26px;
    height: 26px;
    stroke: var(--orange)
}

.card-link {
    display: inline-flex;
    margin-top: 18px;
    gap: 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 900
}

.brand-logo {
    height: 34px;
    max-width: 138px;
    object-fit: contain;
    display: block;
    margin-bottom: 18px;
    filter: drop-shadow(0 0 14px rgba(255, 255, 255, .14));
}

/* V3 storytelling motion section */
.story-cinematic {
    position: relative;
    min-height: 420vh;
    background: 
        radial-gradient(circle at 18% 16%, rgba(255,102,0,.10), transparent 22%), 
        radial-gradient(circle at 82% 18%, rgba(88,124,255,.10), transparent 24%);
}

.story-cinematic::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.story-pin {
    position: sticky;
    top: 0;
    min-height: 100vh;
    display: grid;
    place-items: center;
    z-index: 3;
}

.story-stage {
    position: relative;
    width: min(1280px, calc(100% - 72px));
    min-height: 100vh;
    display: grid;
    grid-template-columns: .94fr 1.06fr;
    gap: 40px;
    align-items: center;
    padding: 84px 0;
}

.story-copy {
    position: relative;
    z-index: 4;
    max-width: 540px;
}

.story-copy .eyebrow {
    margin-bottom: 18px
}

.story-copy h2 {
    margin: 0 0 18px;
    font-size: clamp(2.6rem, 5.4vw, 5rem);
    letter-spacing: -.05em;
    line-height: .96;
}

.story-copy p {
    margin: 0 0 24px;
    color: var(--muted);
    line-height: 1.8;
    font-size: 1rem;
}

.story-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}

.story-progress span {
    width: 44px;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    overflow: hidden;
    position: relative;
}

.story-progress span::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--orange), var(--orange2));
    transform-origin: left center;
    transform: scaleX(var(--fillScale, 0));
}

.story-index {
    margin-top: 18px;
    font-size: 12px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .48);
}

.story-visual {
    position: relative;
    aspect-ratio: 1.04;
    width: min(740px, 100%);
    margin-left: auto;
}

.visual-shell {
    position: absolute;
    inset: 0;
    border-radius: 34px;
    border: 1px solid rgba(255, 255, 255, .10);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .02)),
        linear-gradient(135deg, rgba(22, 38, 72, .90), rgba(8, 13, 23, .84));
    box-shadow: 0 30px 100px rgba(0, 0, 0, .44), 0 0 0 1px rgba(255, 255, 255, .04) inset, 0 0 64px rgba(255, 102, 0, .08);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.visual-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(90deg, rgba(255, 255, 255, .03) 0 1px, transparent 1px 48px),
        repeating-linear-gradient(0deg, rgba(255, 255, 255, .024) 0 1px, transparent 1px 48px);
    opacity: .45;
}

.visual-shell::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 0 48%, rgba(255, 255, 255, .08) 50%, transparent 52%);
    opacity: .6;
}

.visual-rings,
.visual-rings::before,
.visual-rings::after {
    position: absolute;
    content: "";
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .06);
}

.visual-rings {
    inset: 14%
}

.visual-rings::before {
    inset: 10%
}

.visual-rings::after {
    inset: 24%
}

.story-card {
    position: absolute;
    inset: 0;
    padding: 34px;
    opacity: 0;
    transform: translateY(40px) scale(.96);
    border-radius: 34px;
    overflow: hidden;
}

.story-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, .06), transparent 38%, transparent 70%, rgba(255, 255, 255, .04));
    border-radius: 34px;
    pointer-events: none;
}

.story-card.chaos {
    background:
        radial-gradient(circle at 18% 18%, rgba(255, 150, 60, .18), transparent 24%),
        linear-gradient(135deg, rgba(42, 26, 16, .88), rgba(13, 20, 30, .82));
}

.story-card.structure {
    background:
        radial-gradient(circle at 80% 18%, rgba(104, 134, 255, .18), transparent 28%),
        linear-gradient(135deg, rgba(18, 31, 58, .88), rgba(9, 15, 24, .82));
}

.story-card.automation {
    background:
        radial-gradient(circle at 22% 18%, rgba(255, 102, 0, .16), transparent 24%),
        linear-gradient(135deg, rgba(18, 26, 40, .88), rgba(7, 12, 20, .84));
}

.story-card.system {
    background:
        radial-gradient(circle at 50% 20%, rgba(255, 102, 0, .20), transparent 24%),
        radial-gradient(circle at 65% 64%, rgba(114, 140, 255, .20), transparent 28%),
        linear-gradient(135deg, rgba(18, 24, 42, .92), rgba(9, 12, 24, .88));
}

.story-card .stage-tag {
    position: relative;
    display: inline-block;
    margin-bottom: 16px;
    font-size: 11px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .62);
}

.story-card h3 {
    position: relative;
    font-size: clamp(2rem, 4vw, 3rem);
    margin: 0 0 16px;
}

.story-card p {
    position: relative;
    max-width: 440px;
    margin: 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.8;
}

.story-card .meta {
    position: absolute;
    left: 34px;
    bottom: 34px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.story-card .meta span {
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .10);
    background: rgba(255, 255, 255, .05);
    font-size: 11px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .72);
}

.story-card .icon-orb {
    position: absolute;
    right: 34px;
    top: 34px;
    width: 82px;
    height: 82px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .05);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 0 34px rgba(255, 255, 255, .04);
}

.story-card .icon-orb::before {
    content: "";
    position: absolute;
    inset: 14px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .10);
}

.story-card .icon-orb::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background: var(--orange);
    box-shadow: 0 0 18px rgba(255, 102, 0, .7);
}

.story-bgfx,
.story-bgfx::before,
.story-bgfx::after {
    position: absolute;
    content: "";
    pointer-events: none
}

.story-card.chaos .story-bgfx {
    left: 0;
    right: 0;
    bottom: 52px;
    height: 92px;
    background:
        linear-gradient(90deg, transparent, rgba(255, 102, 0, .76), transparent),
        linear-gradient(90deg, transparent, rgba(255, 255, 255, .18), transparent);
    opacity: .55;
}

.story-card.chaos .story-bgfx::before,
.story-card.chaos .story-bgfx::after {
    height: 1px;
    left: 8%;
    right: 10%;
    background: linear-gradient(90deg, transparent, rgba(255, 210, 170, .46), transparent);
}

.story-card.chaos .story-bgfx::before {
    top: 18px
}

.story-card.chaos .story-bgfx::after {
    top: 58px
}

.story-card.structure .story-bgfx,
.story-card.structure .story-bgfx::before,
.story-card.structure .story-bgfx::after {
    height: 1px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(136, 168, 255, .7), transparent);
}

.story-card.structure .story-bgfx {
    left: 14%;
    right: 28%;
    top: 42%
}

.story-card.structure .story-bgfx::before {
    left: 10%;
    right: -16%;
    top: 38px
}

.story-card.structure .story-bgfx::after {
    left: -4%;
    right: 6%;
    top: 76px
}

.story-card.automation .story-bgfx,
.story-card.automation .story-bgfx::before,
.story-card.automation .story-bgfx::after {
    border-radius: 50%;
    border: 1px solid rgba(255, 102, 0, .28);
}

.story-card.automation .story-bgfx {
    width: 78px;
    height: 78px;
    right: 42px;
    bottom: 42px
}

.story-card.automation .story-bgfx::before {
    inset: -16px
}

.story-card.automation .story-bgfx::after {
    inset: -32px
}

.story-card.system .story-bgfx {
    left: 12%;
    right: 12%;
    top: 48%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .22), rgba(255, 102, 0, .55), rgba(112, 138, 255, .42), transparent);
}

.story-card.system .story-bgfx::before,
.story-card.system .story-bgfx::after {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    top: -4px;
    background: radial-gradient(circle, #fff 0%, var(--orange) 56%, rgba(255, 102, 0, .12) 100%);
    box-shadow: 0 0 16px rgba(255, 102, 0, .55);
}

.story-card.system .story-bgfx::before {
    left: 16%
}

.story-card.system .story-bgfx::after {
    right: 18%
}


/* Storyflow Services & Products Replacement */
.story-cinematic.xgate-services-story,
.story-cinematic.xgate-products-story {
    min-height: 420vh;
}

.story-section-label {
    position: absolute;
    top: 46px;
    left: 50%;
    transform: translateX(-50%);
    width: min(1280px, calc(100% - 72px));
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 16px;
}

.story-section-label .section-icon {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, rgba(129, 111, 255, .18), rgba(255, 255, 255, .04));
    border: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 0 18px 45px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .06);
}

.story-section-label h2 {
    font-size: clamp(38px, 4.4vw, 58px);
    line-height: .98;
    letter-spacing: -.06em;
    margin: 0;
}

.story-card .brand-logo-story {
    position: relative;
    display: block;
    max-width: 145px;
    max-height: 40px;
    object-fit: contain;
    margin-bottom: 18px;
    filter: drop-shadow(0 0 16px rgba(255, 255, 255, .16));
}

.story-card .story-mini-icon {
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    margin-bottom: 18px;
    background: linear-gradient(180deg, rgba(255, 102, 0, .20), rgba(99, 169, 255, .10));
    border: 1px solid rgba(255, 255, 255, .10);
    color: var(--orange);
}

.story-card .story-mini-icon svg {
    width: 26px;
    height: 26px;
    stroke: currentColor
}

@media(max-width:980px) {
    .story-section-label {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        margin: 0 auto 10px;
        padding-top: 34px
    }
}

/* WISPGate-style screenshot nav */
.nav-shell {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
    height: 74px;
    pointer-events: none;
}

.command-nav {
    pointer-events: auto;
    width: min(92%, 1120px);
    margin: 1px auto 0;
    min-height: 60px;
    border-radius: 999px;
    display: grid;
    grid-template-columns: 130px 1fr 230px;
    align-items: center;
    gap: 12px;
    padding: 0 14px 0 18px;
    background: rgba(8, 14, 28, .82);
    border: 1px solid rgba(255, 255, 255, .22);
    box-shadow: 0 18px 42px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .08);
    backdrop-filter: blur(18px);
}

.xgate-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    letter-spacing: -.03em;
}

.xgate-mark {
    width: 34px;
    height: 34px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, rgba(255, 102, 0, .22), rgba(255, 102, 0, .05));
    border: 1px solid rgba(255, 102, 0, .22);
    box-shadow: 0 0 24px rgba(255, 102, 0, .18);
}

.nav-menu {
    display: flex;
    justify-content: center;
    align-items: stretch;
    height: 58px;
    gap: 2px
}

.nav-item {
    min-width: 92px;
    height: 58px;
    border-radius: 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    position: relative;
    transition: .24s var(--ease);
}

.nav-item svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.8;
    opacity: .92
}

.nav-item .caret {
    position: absolute;
    right: 10px;
    top: 22px;
    width: 7px;
    height: 7px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    opacity: .75
}

.nav-item:hover,
.nav-item.active {
    color: var(--orange);
    background: linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .035));
}

.nav-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px
}

.nav-btn {
    height: 38px;
    border-radius: 999px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, .12);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 800;
    background: rgba(255, 255, 255, .05);
}

.nav-btn.primary {
    border: 0;
    background: linear-gradient(180deg, var(--orange2), var(--orange));
    box-shadow: 0 12px 28px rgba(255, 102, 0, .26)
}



/* CTA */
.cta {
    padding: 96px 0;
}

.cta-card {
    text-align: center;
    max-width: 980px;
    margin: auto;
    border-radius: 28px;
    padding: 42px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .028));
    border: 1px solid rgba(255, 255, 255, .11);
    box-shadow: 0 26px 75px rgba(0, 0, 0, .28);
}

.cta-card h2 {
    font-size: clamp(34px, 5vw, 62px);
    letter-spacing: -.06em;
    line-height: 1;
    margin: 0 0 12px
}

.cta-card p {
    color: var(--muted);
    line-height: 1.75;
    max-width: 720px;
    margin: 0 auto 26px
}

.footer {
    padding: 34px 0 48px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    color: var(--muted)
}

.footer-row {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap
}

.footer-links {
    display: flex;
    gap: 18px;
    flex-wrap: wrap
}

@media(max-width:1180px) {
    .command-nav {
        grid-template-columns: 120px 1fr 190px
    }

    .nav-item {
        min-width: 78px;
        font-size: 11px
    }

    .nav-btn {
        padding: 0 10px
    }

    .gp-grid,
    .contact-grid {
        grid-template-columns: 1fr
    }

    .gp-side {
        grid-template-rows: auto auto
    }
}

@media(max-width:900px) {
    .command-nav {
        width: calc(100% - 22px);
        grid-template-columns: 1fr auto
    }

    .nav-menu {
        display: none
    }

    .grid-4,
    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr
    }

    .hero h1 {
        font-size: 50px
    }

    .contact-grid {
        display: block
    }

    .direct-card,
    .contact-tile {
        margin-top: 18px
    }

    .form-grid {
        grid-template-columns: 1fr
    }

    .gp-map {
        min-height: 480px
    }
}


/* Hero metric boxes restored */
.hero-panel {
    position: relative;
    z-index: 3;
    margin: 44px auto 0;
    max-width: 1180px;
    padding: 18px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, .10);
    background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .025));
    backdrop-filter: blur(16px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .28), 0 0 40px rgba(255, 102, 0, .08);
}

.hero-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.metric {
    min-height: 136px;
    padding: 22px 18px;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, .09);
    background:
        radial-gradient(circle at 15% 10%, rgba(255, 102, 0, .10), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, .065), rgba(255, 255, 255, .026));
    text-align: left;
}

.metric strong {
    display: block;
    font-size: 30px;
    line-height: 1;
    letter-spacing: -.055em;
    color: #fff;
}

.metric span {
    display: block;
    margin-top: 12px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
}

.metric:nth-child(3) strong {
    color: #fff;
}

.metric:nth-child(3) strong::after {
    content: "";
}

@media(max-width:1080px) {
    .hero-metrics {
        grid-template-columns: repeat(2, 1fr)
    }
}

@media(max-width:640px) {
    .hero-metrics {
        grid-template-columns: 1fr
    }
}

