/* Homepage hero — Web7 organic light/dark motion system */
.home-hero {
    --hero-spot-x: 72%;
    --hero-spot-y: 28%;
    position: relative;
    min-height: calc(100svh - 80px);
    display: flex;
    align-items: center;
    overflow: hidden;
    isolation: isolate;
    background:
        radial-gradient(circle at var(--hero-spot-x) var(--hero-spot-y), rgba(132, 87, 255, .20), transparent 28%),
        linear-gradient(118deg, #fbf9ff 0%, #f4f2ff 49%, #eaddff 100%);
    transition: background .45s ease, color .35s ease;
}

.dark .home-hero {
    background:
        radial-gradient(circle at var(--hero-spot-x) var(--hero-spot-y), rgba(103, 55, 226, .18), transparent 29%),
        linear-gradient(118deg, #0a0013 0%, #0e001c 52%, #21103c 100%);
}

.home-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    opacity: .38;
    background-image:
        linear-gradient(rgba(95, 61, 172, .04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(95, 61, 172, .04) 1px, transparent 1px);
    background-size: 54px 54px;
    mask-image: linear-gradient(to right, transparent 0%, black 40%, black 100%);
}

.dark .home-hero::before {
    opacity: .16;
    background-image:
        linear-gradient(rgba(182, 154, 255, .06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(182, 154, 255, .06) 1px, transparent 1px);
}

.home-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle at 7% 90%, rgba(49, 104, 255, .08), transparent 23%),
        radial-gradient(circle at 96% 5%, rgba(150, 77, 255, .12), transparent 26%);
}

.home-hero-inner {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: clamp(4.5rem, 8vw, 7rem) 1.5rem;
    display: grid;
    grid-template-columns: minmax(0, .98fr) minmax(460px, 1.02fr);
    align-items: center;
    gap: clamp(2rem, 5vw, 5rem);
}

.home-hero-copy {
    position: relative;
    z-index: 5;
    max-width: 650px;
}

.home-hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: .58rem;
    border: 1px solid rgba(109, 54, 242, .22);
    background: rgba(109, 54, 242, .07);
    color: #6f35ef;
    border-radius: 999px;
    padding: .58rem 1rem;
    font-size: .73rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
    backdrop-filter: blur(10px);
}

.dark .home-hero-kicker {
    border-color: rgba(156, 113, 255, .24);
    background: rgba(95, 48, 202, .13);
    color: #c7a9ff;
}

.home-hero-kicker-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3168ff, #9c4dff);
    box-shadow: 0 0 16px rgba(124, 58, 237, .75);
}

.home-hero-title {
    margin-top: 1.65rem;
    max-width: 680px;
    font-size: clamp(3.15rem, 5.7vw, 5.35rem);
    line-height: .99;
    letter-spacing: -.065em;
    font-weight: 800;
}

.home-hero-title .hero-gradient-text {
    display: inline;
    background: linear-gradient(94deg, #3168ff 0%, #6947ff 46%, #a24dff 100%);
    background-size: 180% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: web7GradientTravel 7s ease-in-out infinite alternate;
}

.home-hero-description {
    margin-top: 1.8rem;
    max-width: 610px;
    font-size: clamp(1rem, 1.4vw, 1.13rem);
    line-height: 1.8;
    color: var(--web7-muted);
}

.home-hero-actions {
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: .85rem;
}

.hero-action-primary,
.hero-action-secondary {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: .78rem 1.55rem;
    border-radius: 999px;
    font-size: .85rem;
    font-weight: 800;
    transition: border-color .25s ease, background .25s ease, box-shadow .25s ease, color .25s ease;
    will-change: transform;
}

.hero-action-primary {
    color: #fff;
    background: linear-gradient(105deg, #2169ff, #7440f5 62%, #8b42ff);
    box-shadow: 0 13px 30px rgba(83, 54, 231, .22);
}

.hero-action-primary::before {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    background: linear-gradient(110deg, rgba(255,255,255,.18), transparent 40%);
    pointer-events: none;
}

.hero-action-primary:hover {
    box-shadow: 0 18px 38px rgba(83, 54, 231, .34);
}

.hero-action-secondary {
    color: var(--web7-ink);
    border: 1px solid var(--web7-line);
    background: rgba(255,255,255,.54);
    backdrop-filter: blur(14px);
}

.dark .hero-action-secondary {
    color: #fff;
    background: rgba(255,255,255,.045);
    border-color: rgba(184, 153, 255, .18);
}

.home-hero-stage {
    --stage-perspective-x: 0deg;
    --stage-perspective-y: 0deg;
    position: relative;
    min-height: clamp(430px, 52vw, 570px);
    z-index: 2;
    perspective: 900px;
    transform-style: preserve-3d;
}

.home-hero-stage::before {
    content: "";
    position: absolute;
    width: 76%;
    height: 62%;
    left: 16%;
    top: 23%;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(106, 56, 221, .16), transparent 66%);
    filter: blur(30px);
    transform: translateZ(-30px);
    transition: opacity .4s ease;
}

.dark .home-hero-stage::before {
    background: radial-gradient(ellipse, rgba(104, 49, 226, .23), transparent 65%);
}

.hero-form,
.hero-ring {
    --motion-x: 0px;
    --motion-y: 0px;
    --motion-rotate: 0deg;
    --base-rotate: 0deg;
    position: absolute;
    will-change: transform;
    transform: translate3d(var(--motion-x), var(--motion-y), 0) rotate(calc(var(--base-rotate) + var(--motion-rotate)));
}

.hero-form {
    border: 1px solid rgba(101, 52, 210, .45);
    background:
        radial-gradient(circle at 40% 28%, rgba(255,255,255,.52), transparent 24%),
        radial-gradient(circle at 60% 65%, rgba(81, 37, 173, .66), transparent 52%),
        linear-gradient(145deg, rgba(185, 158, 238, .88), rgba(94, 48, 184, .86));
    box-shadow:
        inset 18px 18px 38px rgba(255,255,255,.23),
        inset -22px -20px 45px rgba(41, 10, 99, .24),
        0 28px 60px rgba(71, 38, 151, .14);
    backdrop-filter: blur(4px);
}

.dark .hero-form {
    border-color: rgba(105, 53, 223, .58);
    background:
        radial-gradient(circle at 59% 65%, rgba(120, 65, 240, .34), transparent 22%),
        radial-gradient(circle at 38% 22%, rgba(114, 64, 210, .25), transparent 30%),
        linear-gradient(145deg, rgba(52, 20, 103, .94), rgba(20, 2, 42, .96));
    box-shadow:
        inset 15px 14px 34px rgba(117, 68, 221, .14),
        inset -25px -22px 48px rgba(0,0,0,.34),
        0 30px 80px rgba(32, 4, 70, .35);
}

.hero-form-main {
    width: 58%;
    height: 42%;
    left: 27%;
    top: 31%;
    z-index: 4;
    border-width: 3px;
    border-radius: 49% 51% 52% 48% / 43% 47% 53% 57%;
    --base-rotate: -8deg;
}

.hero-form-back {
    width: 21%;
    height: 34%;
    left: 17%;
    top: 11%;
    z-index: 1;
    border-radius: 50% 50% 45% 55% / 40% 42% 58% 60%;
    --base-rotate: -18deg;
    opacity: .82;
}

.hero-form-left {
    width: 17%;
    height: 15%;
    left: 10%;
    top: 34%;
    z-index: 5;
    border-radius: 55% 45% 61% 39% / 49% 43% 57% 51%;
    --base-rotate: -23deg;
}

.hero-form-bottom {
    width: 31%;
    height: 28%;
    left: 34%;
    bottom: 8%;
    z-index: 6;
    border-width: 3px;
    border-radius: 48% 52% 53% 47% / 54% 42% 58% 46%;
    --base-rotate: 8deg;
}

.hero-form-top-right {
    width: 16%;
    height: 18%;
    right: 3%;
    top: 15%;
    z-index: 7;
    border-radius: 37% 63% 55% 45% / 38% 41% 59% 62%;
    --base-rotate: 22deg;
}

.hero-form-right {
    width: 19%;
    height: 16%;
    right: 4%;
    bottom: 21%;
    z-index: 7;
    border-radius: 59% 41% 55% 45% / 46% 57% 43% 54%;
    --base-rotate: -28deg;
}

.hero-ring {
    z-index: 3;
    border: 2px solid rgba(107, 52, 226, .58);
    border-radius: 50% 50% 45% 55% / 48% 42% 58% 52%;
    box-shadow: inset 0 0 40px rgba(104, 51, 218, .08), 0 0 30px rgba(100, 48, 209, .08);
}

.dark .hero-ring {
    border-color: rgba(104, 54, 222, .76);
    box-shadow: inset 0 0 45px rgba(92, 43, 197, .16), 0 0 36px rgba(97, 45, 210, .12);
}

.hero-ring-main {
    width: 58%;
    height: 40%;
    left: 27%;
    top: 32%;
    --base-rotate: -8deg;
}

.hero-ring-orbit {
    width: 46%;
    height: 25%;
    left: 31%;
    bottom: 12%;
    --base-rotate: 16deg;
    opacity: .7;
}

.hero-core-glow {
    position: absolute;
    left: 51%;
    top: 48%;
    width: 110px;
    height: 110px;
    z-index: 8;
    border-radius: 50%;
    background: rgba(112, 59, 238, .26);
    filter: blur(34px);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.hero-particles {
    position: absolute;
    inset: 4% 1% 2% 4%;
    z-index: 9;
    pointer-events: none;
    overflow: hidden;
}

.hero-particle {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background: rgba(104, 57, 220, .38);
    box-shadow: 0 0 12px rgba(110, 58, 230, .25);
    opacity: .45;
    animation: heroParticleFloat var(--duration) ease-in-out var(--delay) infinite alternate;
}

.dark .hero-particle {
    background: rgba(176, 137, 255, .62);
    box-shadow: 0 0 14px rgba(128, 76, 242, .38);
}

.hero-reveal {
    opacity: 0;
    transform: translateY(20px);
}

.home-hero.is-ready .hero-reveal {
    animation: heroReveal .78s cubic-bezier(.2,.7,.2,1) forwards;
    animation-delay: var(--reveal-delay, 0ms);
}

.home-hero-stage.theme-shift .hero-form-main,
.home-hero-stage.theme-shift .hero-form-bottom {
    animation: heroThemePulse .72s cubic-bezier(.2,.8,.2,1);
}

@keyframes heroReveal {
    from { opacity: 0; transform: translateY(20px); filter: blur(6px); }
    to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@keyframes web7GradientTravel {
    from { background-position: 0% 50%; }
    to { background-position: 100% 50%; }
}

@keyframes heroParticleFloat {
    from { transform: translate3d(0, 0, 0) scale(.85); opacity: .18; }
    to { transform: translate3d(9px, -14px, 0) scale(1.15); opacity: .62; }
}

@keyframes heroThemePulse {
    0%, 100% { filter: saturate(1); }
    45% { filter: saturate(1.35) brightness(1.12); }
}

@media (max-width: 1100px) {
    .home-hero-inner {
        grid-template-columns: 1fr .9fr;
        gap: 2rem;
    }

    .home-hero-title {
        font-size: clamp(3rem, 6.2vw, 4.7rem);
    }
}

@media (max-width: 900px) {
    .home-hero {
        min-height: auto;
    }

    .home-hero-inner {
        grid-template-columns: 1fr;
        padding-top: 4.5rem;
        padding-bottom: 3rem;
    }

    .home-hero-copy {
        max-width: 720px;
    }

    .home-hero-stage {
        width: min(100%, 660px);
        min-height: 430px;
        margin: -1rem auto 0;
    }
}

@media (max-width: 640px) {
    .home-hero-inner {
        padding: 3.5rem 1rem 2rem;
    }

    .home-hero-title {
        font-size: clamp(2.8rem, 13vw, 4rem);
        letter-spacing: -.06em;
    }

    .home-hero-description {
        margin-top: 1.35rem;
        line-height: 1.7;
    }

    .home-hero-stage {
        min-height: 330px;
        transform: scale(1.04);
        transform-origin: center top;
    }

    .hero-form-main,
    .hero-ring-main {
        width: 63%;
        left: 23%;
    }

    .hero-form-bottom {
        width: 35%;
        left: 31%;
    }

    .hero-form-back {
        left: 13%;
    }

    .hero-form-top-right {
        right: 1%;
    }

    .home-hero-actions {
        gap: .7rem;
    }

    .hero-action-primary,
    .hero-action-secondary {
        min-height: 46px;
        padding: .72rem 1.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-hero *,
    .home-hero *::before,
    .home-hero *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }

    .hero-reveal {
        opacity: 1;
        transform: none;
    }
}
