/* =========================================================
   WEBPLEX SOLUTION — 3D EFFECTS
   Shared by every page: brand logo, hero 3D scene,
   3D card tilt and icon flips.
   ========================================================= */

/* =========================================================
   BRAND LOCKUP (ZF LOGO + WORDMARK)
   ========================================================= */

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: #111827;
}

/* imgs/logo-mark.png is the WebPlex "W" cut from imgs/logo.png (wider than tall, so size by height).
   ".brand" prefix outranks the old ".logo img { width: 158px }" banner rule. */
.brand .brand-logo {
    width: auto;
    height: 36px;
    flex-shrink: 0;
    object-fit: contain;
    filter: drop-shadow(0 6px 12px rgba(139, 44, 240, 0.18));
    transform: perspective(500px) rotateY(0deg);
    transition: transform 1.1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.brand:hover .brand-logo {
    transform: perspective(500px) rotateY(360deg);
}

.brand-name {
    display: flex;
    flex-direction: column;
    font-family: "Inter", sans-serif;
    line-height: 1;
}

.brand-word {
    color: #111827;
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.brand-word b {
    font-weight: 800;
    background: linear-gradient(110deg, #f0209e 0%, #8b2cf0 45%, #1f63ea 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.brand-name small {
    margin-top: 5px;
    color: #667085;
    font-size: 8.5px;
    font-weight: 700;
    letter-spacing: 0.46em;
    text-transform: uppercase;
}

.brand--lg .brand-logo {
    width: auto;
    height: 46px;
}

.brand--lg .brand-word {
    font-size: 25px;
}

.brand--lg .brand-name small {
    font-size: 9.5px;
}

/* =========================================================
   NAV — keeps all seven links on one row on small laptops
   (below 993px every page switches to the full-screen menu)
   ========================================================= */

@media (min-width: 993px) and (max-width: 1240px) {
    .header {
        gap: 18px;
    }

    .nav-links {
        gap: 2px;
    }

    .nav-button {
        padding-inline: 10px;
        font-size: 13.5px;
    }

    .contact-us-btn {
        margin-left: 4px;
        padding-inline: 15px;
        font-size: 13.5px;
    }
}

/* =========================================================
   HERO 3D SCENE
   ========================================================= */

.has-scene-3d {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.has-scene-3d > .container {
    position: relative;
    z-index: 1;
}

.scene-3d {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    perspective: 1100px;
    animation: fx-fade-in 1.6s ease 0.2s backwards;
}

.scene-3d__rig {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    transform: rotateX(var(--scene-rx, 0deg)) rotateY(var(--scene-ry, 0deg));
    transition: transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* A floating group positioned with --x / --y and sized with --size */
.fx-group {
    --size: 100px;
    position: absolute;
    left: var(--x, 50%);
    top: var(--y, 50%);
    width: var(--size);
    height: var(--size);
    margin: calc(var(--size) / -2) 0 0 calc(var(--size) / -2);
    transform-style: preserve-3d;
    animation: fx-float var(--float, 9s) ease-in-out var(--delay, 0s) infinite;
}

/* -------------------------
   CUBE
   ------------------------- */

.cube3d {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    transform: rotateX(-22deg) rotateY(38deg);
    animation: fx-spin var(--spin, 26s) linear infinite;
}

.cube3d > i {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(139, 44, 240, 0.42);
    background: linear-gradient(135deg, rgba(139, 44, 240, 0.20), rgba(31, 99, 234, 0.06));
    box-shadow: inset 0 0 24px rgba(139, 44, 240, 0.12);
}

.cube3d > i:nth-child(1) { transform: translateZ(calc(var(--size) / 2)); }
.cube3d > i:nth-child(2) { transform: rotateY(180deg) translateZ(calc(var(--size) / 2)); }
.cube3d > i:nth-child(3) { transform: rotateY(90deg) translateZ(calc(var(--size) / 2)); }
.cube3d > i:nth-child(4) { transform: rotateY(-90deg) translateZ(calc(var(--size) / 2)); }
.cube3d > i:nth-child(5) { transform: rotateX(90deg) translateZ(calc(var(--size) / 2)); }
.cube3d > i:nth-child(6) { transform: rotateX(-90deg) translateZ(calc(var(--size) / 2)); }

.cube3d--solid > i {
    border-color: rgba(255, 255, 255, 0.55);
    background: linear-gradient(135deg, rgba(240, 32, 158, 0.45), rgba(139, 44, 240, 0.40) 50%, rgba(31, 99, 234, 0.30));
    box-shadow: inset 0 0 30px rgba(255, 255, 255, 0.22);
}

.cube3d--wire > i {
    border: 1.5px solid rgba(15, 180, 247, 0.55);
    background: transparent;
    box-shadow: none;
}

/* -------------------------
   RING (orbits its group)
   ------------------------- */

.ring3d {
    position: absolute;
    left: 50%;
    top: 50%;
    width: calc(var(--size) * 1.9);
    height: calc(var(--size) * 1.9);
    margin: calc(var(--size) * -0.95) 0 0 calc(var(--size) * -0.95);
    border: 1.5px solid rgba(31, 99, 234, 0.32);
    border-radius: 50%;
    animation: fx-orbit var(--orbit, 12s) linear infinite;
}

.ring3d::after {
    content: "";
    position: absolute;
    top: -5px;
    left: calc(50% - 5px);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f0209e, #8b2cf0);
    box-shadow: 0 0 14px rgba(139, 44, 240, 0.55);
}

/* -------------------------
   ORB
   ------------------------- */

.orb3d {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 28%, #ffffff 0%, #f6c4ea 18%, #e04fc0 45%, #8b2cf0 78%, #4f1a99 100%);
    box-shadow: 0 18px 40px rgba(139, 44, 240, 0.28);
    opacity: 0.9;
}

.orb3d--blue {
    background: radial-gradient(circle at 32% 28%, #ffffff 0%, #bdf0ff 18%, #33c3f8 48%, #1f63ea 80%, #163f9e 100%);
    box-shadow: 0 14px 30px rgba(31, 99, 234, 0.28);
}

/* -------------------------
   WIDE ORBIT + GRID FLOOR (home hero)
   ------------------------- */

.orbit3d {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(1100px, 125vw);
    aspect-ratio: 1;
    border: 1.5px solid rgba(139, 44, 240, 0.20);
    border-radius: 50%;
    animation: fx-orbit-wide 34s linear infinite;
}

.orbit3d::before,
.orbit3d::after {
    content: "";
    position: absolute;
    left: calc(50% - 6px);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f0209e, #8b2cf0);
    box-shadow: 0 0 18px rgba(139, 44, 240, 0.6);
}

.orbit3d::before { top: -6px; }
.orbit3d::after { bottom: -6px; background: #0fb4f7; box-shadow: 0 0 18px rgba(15, 180, 247, 0.55); }

.grid3d {
    position: absolute;
    left: -50%;
    bottom: -2px;
    width: 200%;
    height: 70%;
    overflow: hidden;
    transform-origin: 50% 100%;
    transform: rotateX(78deg);
    -webkit-mask-image: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0.55) 40%, transparent 85%);
    mask-image: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0.55) 40%, transparent 85%);
}

.grid3d::before {
    content: "";
    position: absolute;
    inset: -64px 0 0;
    background-image:
        linear-gradient(rgba(139, 44, 240, 0.30) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139, 44, 240, 0.30) 1px, transparent 1px);
    background-size: 64px 64px;
    animation: fx-grid-flow 3.2s linear infinite;
}

/* -------------------------
   DARK VARIANT (CTA box)
   ------------------------- */

.scene-3d--dark .cube3d > i {
    border-color: rgba(208, 170, 249, 0.45);
    background: linear-gradient(135deg, rgba(208, 170, 249, 0.16), rgba(255, 255, 255, 0.02));
    box-shadow: inset 0 0 24px rgba(208, 170, 249, 0.10);
}

.scene-3d--dark .ring3d {
    border-color: rgba(208, 170, 249, 0.35);
}

/* -------------------------
   KEYFRAMES
   ------------------------- */

@keyframes fx-fade-in {
    from { opacity: 0; }
}

@keyframes fx-float {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(0, -18px, 40px); }
}

@keyframes fx-spin {
    from { transform: rotateX(-22deg) rotateY(38deg); }
    to { transform: rotateX(338deg) rotateY(398deg); }
}

@keyframes fx-orbit {
    from { transform: rotateX(72deg) rotateY(-14deg) rotateZ(0deg); }
    to { transform: rotateX(72deg) rotateY(-14deg) rotateZ(360deg); }
}

@keyframes fx-orbit-wide {
    from { transform: translate(-50%, -50%) rotateX(76deg) rotateZ(0deg); }
    to { transform: translate(-50%, -50%) rotateX(76deg) rotateZ(360deg); }
}

@keyframes fx-grid-flow {
    to { transform: translateY(64px); }
}

/* =========================================================
   3D CARD TILT (classes added by effects-3d.js)
   ========================================================= */

.fx-tilt {
    position: relative;
}

.fx-tilt.is-tilting {
    will-change: transform;
}

.fx-glare {
    position: absolute;
    inset: 0;
    z-index: 3;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(520px circle at var(--gx, 50%) var(--gy, 50%), var(--fx-glare, rgba(139, 44, 240, 0.12)), transparent 45%);
    transition: opacity 0.35s ease;
}

.fx-tilt.is-tilting .fx-glare {
    opacity: 1;
}

.cta-box {
    --fx-glare: rgba(255, 255, 255, 0.12);
}

/* =========================================================
   3D ICON FLIPS
   ========================================================= */

.service-icon,
.feature-icon,
.why-icon,
.info-icon,
.technology-item img {
    transform: perspective(400px) rotateY(0deg);
    transition: transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.service-card:hover .service-icon,
.feature-card:hover .feature-icon,
.why-card:hover .why-icon,
.why-item:hover .why-icon,
.contact-info-card:hover .info-icon,
.technology-item:hover img {
    transform: perspective(400px) rotateY(360deg);
}

/* =========================================================
   RESPONSIVE + REDUCED MOTION
   ========================================================= */

@media (max-width: 1100px) {
    .scene-3d {
        opacity: 0.7;
    }
}

@media (max-width: 768px) {
    .scene-3d {
        opacity: 0.6;
    }

    /* Optional phone positions: --x-m / --y-m keep shapes clear of the text */
    .fx-group {
        left: var(--x-m, var(--x, 50%));
        top: var(--y-m, var(--y, 50%));
        scale: 0.62;
    }

    .fx-hide-mobile {
        display: none;
    }

    .grid3d {
        height: 55%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .scene-3d,
    .scene-3d *,
    .scene-3d *::before,
    .scene-3d *::after {
        animation: none !important;
    }

    .brand-logo,
    .service-icon,
    .feature-icon,
    .why-icon,
    .info-icon,
    .technology-item img {
        transition: none !important;
    }
}
