/* Services Page Styles */
.services-header {
    position: relative;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    background: linear-gradient(to bottom, #0a0a0a, #1a1a1a);
}

#webgl-services {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.services-header-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #fff;
    pointer-events: none;
    /* Let clicks pass through to WebGL */
}

.services-header-content h1 {
    font-size: clamp(3rem, 10vw, 8rem);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -2px;
    margin: 0;
    opacity: 0;
}

.services-header-content p {
    font-size: 1.2rem;
    max-width: 600px;
    opacity: 0;
    margin-top: 20px;
}

/* Glass Flip Cards */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    padding: 60px 0;
}

.service-card-wrapper {
    background-color: transparent;
    height: auto;
    /* Changed from fixed height to fit content */
    /* perspective: 1000px; */
    /* Moved to .service-card-inner to prevent stacking context */
}

.service-card-inner {
    position: relative;
    width: 100%;
    height: auto;
    display: grid;
    grid-template-columns: 1fr;
    text-align: center;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    perspective: 1000px;
    /* Added here for flip effect without creating wrapper stacking context */
    z-index: 2;
    /* Keep cards on top of overlays */
}

.service-card-wrapper.flipped .service-card-inner {
    transform: rotateY(180deg);
}

/* service-card-inner spacing removed as requested to use Bootstrap Grid mb-5 instead */

.glass-card {
    grid-area: 1 / 1;
    position: relative;
    width: 100%;
    height: auto;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 24px;
    background: rgb(16 17 23 / 40%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    transition: border-color 0.3s, box-shadow 0.3s;
    overflow: hidden;
    /* Removed text-shadow: 2px 2px 2px black; for cleaner look, can re-add if needed */
}

.glass-card:hover {
    border-color: var(--clr);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.05);
}

/* .card-glow removed as it was empty */

/* Front Side */
.service-card-front {
    z-index: 2;
}

.card-icon {
    font-size: 3.5rem;
    color: var(--clr);
    margin-bottom: 20px;
    filter: drop-shadow(0 0 15px var(--clr));
}

.card-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: #fff;
    font-family: 'Nunito';
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-description {
    font-size: 0.95rem;
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 30px;
}

/* Back Side */
.service-card-back {
    transform: rotateY(180deg);
}

.back-title {
    font-size: 1.5rem;
    color: var(--clr);
    margin-bottom: 25px;
    text-transform: uppercase;
}

.features-list {
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
    text-align: left;
    width: 100%;
}

.features-list li {
    color: #eee;
    margin-bottom: 12px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.features-list li i {
    color: var(--clr);
    font-size: 1.1rem;
}

/* Buttons */
.btn-minimal {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 10px 24px;
    border-radius: 50px;
    font-size: 0.85rem;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-minimal:hover {
    background: var(--clr);
    border-color: var(--clr);
    color: var(--bg-main);
    transform: scale(1.05);
    box-shadow: 0 0 20px var(--clr);
}

.back-actions {
    display: flex;
    gap: 20px;
    align-items: center;
}

.quote-link {
    color: var(--clr);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.quote-link:hover {
    color: #fff;
    text-shadow: 0 0 10px var(--clr);
}

/* Zig-Zag Grid Wrapper refactored to Bootstrap Grid */
.services-list-wrapper {
    position: relative;
    z-index: 2;
    padding-top: 50px;
}

.service-row-img {
    transition: transform 0.5s ease;
    filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.2));
}

.service-row-img:hover {
    transform: scale(1.05);
}

.service-card-wrapper {
    width: 100%;
    height: auto;
    /* Allow cards to expand with content */
}

/* Motion Path & Plane */
#motionSvg {
    pointer-events: none;
    opacity: 0.4;
}

#paperPlane {
    pointer-events: none;
    z-index: 10;
    filter: drop-shadow(0 0 15px var(--clr, #a855f7));
}

/* Dynamic Positioning Classes */
.pos-top-start {
    top: -20px;
    left: -20px;
}

.pos-top-end {
    top: -20px;
    right: -20px;
}

.pos-bottom-start {
    bottom: -20px;
    left: -20px;
}

.pos-bottom-end {
    bottom: -20px;
    right: -20px;
}

.pos-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.card-overlay-img {
    z-index: 1;
    /* Keep overlays behind all cards */
    pointer-events: none;
    /* Let clicks pass through to cards */
}

@media (max-width: 991px) {
    .service-card-wrapper {
        height: auto;
    }
}

@media (max-width: 768px) {
    .services-list-wrapper {
        padding-top: 30px;
    }

    .service-card-wrapper {
        height: auto;
        min-height: auto;
        padding-bottom: 20px;
    }

    .glass-card {
        padding: 30px 20px;
    }

    .card-title {
        font-size: 1.5rem;
    }

    .card-icon {
        font-size: 3rem;
    }

    .features-list li {
        font-size: 0.9rem;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .service-card-wrapper {
        min-height: auto;
    }

    .glass-card {
        padding: 25px 15px;
    }
}