﻿*,
*::before,
*::after {
    box-sizing: border-box;
}

@property --rotate {
    syntax: "<angle>";
    initial-value: 132deg;
    inherits: false;
}

/* ==========================================================================
   1. Base Color & Theme Definitions
   ========================================================================== */
:root {
    --light-blue: #48cae4;
    --sunset-amber: #FDC25B;
    --coral-orange: #F98563;
    --cloud-white: #EAEBF5;
    --dark-bg-main: #131314;
    --dark-bg-secondary: #1E1F20;
    --border-color: #3c4043;
    --text-body: var(--cloud-white);
    --text-dim: var(--cloud-white);
}

/* ==========================================================================
   2. General Site Styles
   ========================================================================== */
body {
    font-family: 'Open Sans', sans-serif;
    margin: 0;
    line-height: 1.6;
    background-color: var(--dark-bg-main);
    color: var(--text-body);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================================================
   3. HEADER STYLES
   ========================================================================== */
header {
    background-color: var(--dark-bg-main);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content-wrapper {
    position: relative;
    overflow: hidden;
    padding: 20px 0;
}

    .header-content-wrapper::after {
        content: '';
        position: absolute;
        left: 0;
        bottom: 0;
        height: 2px;
        width: 200%;
        background: linear-gradient(90deg, var(--sunset-amber), #FF006E, var(--light-blue), #FF006E, var(--sunset-amber));
        animation: slide 4s linear infinite;
    }

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    font-size: 20px;
    font-weight: 700;
    color: var(--cloud-white);
}

.logo img {
    height: 45px;
    width: auto;
}

nav {
    display: flex;
    justify-content: center;
}

    nav ul {
        list-style: none;
        padding: 0;
        margin: 0;
        display: flex;
        gap: 40px;
    }

        nav ul li {
            position: relative;
        }

            nav ul li:not(:first-child)::before {
                content: '';
                position: absolute;
                left: -20px;
                top: 50%;
                transform: translateY(-50%);
                width: 2px;
                height: 1.2em;
                background-color: var(--light-blue);
                opacity: 0.5;
            }

            nav ul li a {
                color: var(--text-body);
                text-decoration: none;
                font-weight: 600;
                transition: color 0.3s ease;
                padding: 5px 0;
                position: relative;
                font-size: 1.1rem;
            }

                nav ul li a:hover {
                    color: var(--light-blue);
                }

                nav ul li a::after {
                    content: '';
                    position: absolute;
                    width: 100%;
                    transform: scaleX(0);
                    height: 2px;
                    bottom: 0;
                    left: 0;
                    background-color: var(--light-blue);
                    transform-origin: bottom right;
                    transition: transform 0.25s ease-out;
                }

                nav ul li a:hover::after {
                    transform: scaleX(1);
                    transform-origin: bottom left;
                }

/* ==========================================================================
   4. Hero & Section Styles
   ========================================================================== */

.hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(#0a0d11 0%, #0d1117 100%);
    text-align: center;
    padding: 100px 0;
}

#dots-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

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

    .hero-content h1 {
        font-size: clamp(2.5rem, 6vw, 3.5rem);
        margin: 0 0 .8rem;
        line-height: 1.2;
    }

    .hero-content .lead {
        font-size: clamp(1rem, 2.5vw, 1.2rem);
        max-width: 40rem;
        margin: 0 auto 30px auto;
        color: var(--text-dim);
    }


.section {
    padding: 80px 0;
}

    .section .container {
        text-align: center;
    }

    .section.primary-bg {
        background-color: var(--dark-bg-secondary);
    }

.section-logo {
    height: 80px;
    width: auto;
    margin-bottom: 0;
}

section#services {
    background-image: url('images/background.jpg');
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
}

    section#services h2,
    section#services p,
    section#services h3,
    section#services h4,
    section#services h5,
    section#services li {
        text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
    }

.section h2 {
    color: var(--cloud-white);
    font-size: 2.8em;
    text-align: center;
    margin-top: 0;
    margin-bottom: 40px;
}

.section p {
    color: var(--text-dim);
    line-height: 1.8;
    max-width: 600px;
    margin: 0 auto 40px auto;
}

section#about .container > p {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 20px;
    text-align: left;
}

.button {
    display: inline-block;
    padding: 14px 32px;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    letter-spacing: 0.5px;
    margin-top: 20px;
}

    .button.primary {
        background-color: var(--sunset-amber);
        color: var(--dark-bg-main);
    }

        .button.primary:hover {
            background-color: var(--coral-orange);
            transform: translateY(-3px);
        }

    .button.secondary {
        background-color: var(--light-blue);
        color: var(--dark-bg-main);
        border-color: var(--light-blue);
    }

        .button.secondary:hover {
            background-color: var(--coral-orange);
            border-color: var(--coral-orange);
            color: var(--dark-bg-main);
            transform: translateY(-3px);
        }

.hero-video-wrapper {
    max-width: 900px;
    width: 100%;
    margin: 60px auto 0 auto;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    line-height: 0;
}

    .hero-video-wrapper video {
        width: 100%;
        height: auto;
        display: block;
    }

.image-separator {
    height: 10px;
    background-image: url('images/background.jpg');
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
}

/* ==========================================================================
   5. Service & Client Card Styles
   ========================================================================== */
.services-grid {
    display: grid;
    gap: 30px;
    margin-top: 30px;
    grid-template-columns: repeat(auto-fit, 360px);
    justify-content: center;
    position: relative;
}

    .services-grid.expanded::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(5px);
        z-index: 899;
        opacity: 0;
        transition: opacity 0.4s ease-in-out;
    }

    .services-grid.expanded::before {
        opacity: 1;
    }

.service-item {
    background: transparent;
    padding: 2px;
    position: relative;
    border-radius: 12px;
    cursor: pointer;
    opacity: 1;
    transition: opacity 0.4s ease-out, transform 0.3s ease-out;
}

.services-grid.expanded .service-item:not(.active-card) {
    opacity: 0;
}

.service-item.is-animating {
    transition: all 0.4s ease-in-out;
}

.service-item:not(.active-card):hover {
    transform: translateY(-5px);
    background: linear-gradient(var(--rotate), #FF006E, #48cae4, var(--sunset-amber));
    animation: spin 2.5s linear infinite;
}

.service-item-content {
    background-color: var(--dark-bg-main);
    background-image: linear-gradient(180deg, color-mix(in srgb, var(--dark-bg-main) 80%, black 20%) 0%, var(--dark-bg-main) 100%);
    border: 1px solid var(--cloud-white);
    border-radius: 10px;
    padding: 30px;
    height: 100%;
    text-align: left;
    transition: border-color 0.4s ease-out;
    position: relative;
    overflow: hidden;
}

.service-item:hover .service-item-content {
    border-color: transparent;
}

.service-item::after {
    content: "";
    position: absolute;
    z-index: -1;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: linear-gradient(var(--rotate), #FF006E, #48cae4, var(--sunset-amber));
    border-radius: 12px;
    filter: blur(20px);
    opacity: 0;
    transition: opacity 0.4s ease-out;
    animation: spin 2.5s linear infinite paused;
}

.service-item:hover::after {
    opacity: 1;
    animation-play-state: running;
}

/* --- UPDATED --- New rule for the clickable arrow element */
.card-arrow {
    position: absolute;
    bottom: 25px;
    right: 25px;
    font-size: 2.5em;
    font-weight: bold;
    color: var(--light-blue);
    opacity: 0;
    transition: opacity 0.3s ease-out, transform 0.3s ease-in-out;
    line-height: 1;
    z-index: 2; /* Ensure it's above other content */
}

    .card-arrow::before {
        content: '→';
    }

.service-item:hover .card-arrow {
    opacity: 1;
}

.active-card .card-arrow::before {
    content: '←';
}

.service-icon {
    height: 60px;
    width: auto;
    display: block;
    margin: 0 auto 25px auto;
}

.service-item h3 {
    color: var(--sunset-amber);
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.4em;
    text-align: center;
}

.service-item ul {
    list-style: none;
    padding: 0;
    margin: 15px 0 0 0;
}

.service-item li {
    color: var(--text-body);
    margin-bottom: 10px;
    padding-left: 25px;
    position: relative;
    font-size: 0.95em;
}

    .service-item li::before {
        content: '✓';
        color: var(--light-blue);
        font-weight: bold;
        position: absolute;
        left: 0;
        top: 0;
    }

.client-logos-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 60px;
    margin-top: 40px;
}

.client-logo-item a {
    display: block;
    transition: all 0.3s ease-out;
}

.client-logo-item:hover a {
    transform: scale(1.1);
}

.client-logo-item img {
    max-height: 90px;
    width: auto;
    max-width: 220px;
}

/* ==========================================================================
   5a. Service Card Expansion Styles
   ========================================================================== */

.service-summary {
    transition: opacity 0.2s ease-out;
}

.service-detail-content {
    display: block;
    opacity: 0;
    transition: opacity 0.2s ease-in;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 30px;
    overflow-y: auto;
}

    .service-detail-content h4 {
        color: var(--sunset-amber);
        font-size: 1.8em;
        margin-bottom: 15px;
        text-align: center;
    }

    .service-detail-content h5 {
        font-size: 1.2em;
        color: var(--sunset-amber);
        margin-top: 25px;
        margin-bottom: 10px;
        text-align: left;
    }

    .service-detail-content p {
        color: var(--text-dim);
        text-align: left;
        max-width: 100%;
        margin-bottom: 0;
    }

.service-item.active-card {
    position: fixed;
    cursor: default; /* Changed from pointer for the active card */
    z-index: 900;
}

.active-card .service-summary {
    opacity: 0;
    pointer-events: none;
}

.active-card.visible .service-detail-content {
    opacity: 1;
}

.active-card .service-item-content > .service-icon {
    opacity: 0;
    transition: opacity 0.2s ease-out;
}

.service-detail-content .service-icon {
    display: block;
    margin: 0 auto 12px auto;
    height: 70px;
    width: auto;
}

.service-icon {
    transition: opacity 0.3s ease-in-out;
}

.service-detail-content .service-icon {
    opacity: 0;
}

.active-card.visible .service-detail-content .service-icon {
    opacity: 1;
}


/* ==========================================================================
   6. Footer & Responsive Styles
   ========================================================================== */
footer {
    background-color: var(--dark-bg-secondary);
    color: var(--text-dim);
    border-top: 1px solid var(--border-color);
    text-align: center;
    padding: 40px 0;
    font-size: 0.9em;
}

.contact-details {
    margin-bottom: 30px;
    line-height: 1.8;
    text-align: center;
}

    .contact-details a {
        color: var(--sunset-amber);
    }

.contact-form {
    display: grid;
    gap: 20px;
    max-width: 600px;
    margin: 40px auto 0;
}

    .contact-form input, .contact-form textarea {
        background-color: var(--dark-bg-main);
        color: var(--text-body);
        border: 1px solid var(--border-color);
        padding: 15px;
        border-radius: 5px;
        font-size: 1em;
    }

.hamburger {
    display: none;
    cursor: pointer;
}

    .hamburger span {
        display: block;
        width: 25px;
        height: 3px;
        margin: 5px auto;
        transition: all 0.3s ease-in-out;
        background-color: var(--text-body);
        border-radius: 3px;
    }

@media (max-width: 992px) {
    nav {
        display: none;
    }

    .hamburger {
        display: block;
    }

    nav ul li::before {
        display: none;
    }

    .hero {
        padding: 60px 0;
    }

    .hero-content h1 {
        font-size: 2.5em;
    }

    .hero-video-wrapper {
        margin-top: 40px;
    }

    .section {
        padding: 60px 0;
    }

        .section h2 {
            font-size: 2.2em;
        }

    .service-item {
        cursor: default; /* Clicks are now handled by the arrow on mobile */
    }

    .card-arrow {
        cursor: pointer; /* The arrow is the specific clickable target */
    }


    nav.active {
        display: flex;
        position: absolute;
        top: 85px;
        left: 0;
        background-color: var(--dark-bg-secondary);
        width: 100%;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    }

        nav.active ul {
            flex-direction: column;
            width: 100%;
            padding: 0;
            margin: 0;
            gap: 0;
        }

            nav.active ul li {
                margin: 0;
                text-align: center;
                border-bottom: 1px solid color-mix(in srgb, var(--light-blue) 40%, transparent);
                transition: background-color 0.3s ease;
            }

                nav.active ul li a {
                    display: block;
                    padding: 20px;
                }

                nav.active ul li:last-child {
                    border-bottom: none;
                }

                nav.active ul li:hover {
                    background-color: var(--dark-bg-main);
                }

    .hamburger.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
}

/* Accessibility and Performance Fallbacks */
@media (prefers-reduced-motion: reduce) {
    #dots-bg, .hero-video-wrapper video, .header-content-wrapper::after {
        display: none;
    }
}

/* ==========================================================================
   7. Phone-Specific Styles
   ========================================================================== */
@media (max-width: 600px) {
    /* Reduce typography size */
    .section h2 {
        font-size: 2.1em;
    }

    .service-item h3 {
        font-size: 1.1em;
    }

    .service-detail-content h4 {
        font-size: 1.4em;
    }

    .service-detail-content h5 {
        font-size: 1.1em;
    }

    /* Reduce spacing */
    .section {
        padding: 60px 0;
    }

    .services-grid {
        gap: 20px;
    }

    /* Reduce element sizes */
    .logo img {
        height: 38px;
    }

    .section-logo {
        height: 60px;
    }

    .button {
        padding: 12px 28px;
        font-size: 0.9em;
    }

    .service-icon {
        height: 50px;
    }

    .service-detail-content .service-icon {
        height: 60px;
    }

    .client-logo-item img {
        max-height: 70px;
    }
}

@keyframes spin {
    0% {
        --rotate: 0deg;
    }

    100% {
        --rotate: 360deg;
    }
}

/* Added for the smooth sliding header gradient */
@keyframes slide {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}
