:root {
    --bg-color: #030712;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --card-bg: rgba(15, 23, 42, 0.4);
    --border-overlay: rgba(255, 255, 255, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
    /* Hide scrollbar for a cleaner look if possible, but keep functionality */
}

/* =========================================================================
   ANIMATED BACKGROUND & ORBS
   ========================================================================= */
.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: #030712;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s infinite alternate ease-in-out;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.8) 0%, rgba(59, 130, 246, 0) 70%);
    top: -100px;
    left: -100px;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(244, 63, 94, 0.6) 0%, rgba(244, 63, 94, 0) 70%);
    bottom: -50px;
    right: -100px;
    animation-delay: -5s;
    animation-duration: 25s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.5) 0%, rgba(245, 158, 11, 0) 70%);
    top: 40%;
    left: 60%;
    animation-delay: -10s;
    animation-duration: 30s;
}

.noise-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    pointer-events: none;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
    100% { transform: translate(0, 0) scale(1); }
}

/* =========================================================================
   MAIN LAYOUT & TYPOGRAPHY
   ========================================================================= */
.container {
    max-width: 1300px;
    width: 100%;
    padding: 3rem 2rem;
    z-index: 1;
}

.header {
    text-align: center;
    margin-bottom: 5rem;
    animation: slideDown 1.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.header h1 {
    font-size: clamp(3rem, 6vw, 5rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    display: inline-block;
}

.subtitle {
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    color: var(--text-secondary);
    font-weight: 300;
    max-width: 600px;
    margin: 0 auto;
}

/* =========================================================================
   MAGIC GLOW CARDS
   ========================================================================= */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    position: relative;
}

.service-card {
    text-decoration: none;
    color: var(--text-primary);
    background-color: var(--card-bg);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    /* Provide a basic border fallback */
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
    animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) both;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.service-card:nth-child(1) { animation-delay: 0.2s; }
.service-card:nth-child(2) { animation-delay: 0.4s; }
.service-card:nth-child(3) { animation-delay: 0.6s; }

/* The hover tilt effect */
.service-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

/* Magic Glow Border */
.service-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        800px circle at var(--mouse-x, -100%) var(--mouse-y, -100%),
        var(--card-color),
        transparent 40%
    );
    opacity: 0;
    transition: opacity 0.5s;
    z-index: 1;
}

/* Magic Glow Overlay (inside the card) */
.service-card::after {
    content: "";
    position: absolute;
    inset: 1px; /* Creates the border effect */
    background: inherit;
    border-radius: inherit;
    z-index: 2;
}

/* Illuminate glow on hover (grid container hover illuminates all minimally, card hover illuminates intensely) */
.services-grid:hover > .service-card::before {
    opacity: 0.1;
}

.service-card:hover::before {
    opacity: 0.6;
}

.card-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    z-index: 3;
    padding: 3rem 2.5rem;
    height: 100%;
    background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0) 100%);
    border-radius: inherit;
}

/* =========================================================================
   CARD INTERNALS
   ========================================================================= */
.card-logo {
    height: 65px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    margin-bottom: 2rem;
    align-self: flex-start;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.5s ease;
    filter: drop-shadow(0 0 0 rgba(0,0,0,0));
}

.service-card:hover .card-logo {
    transform: scale(1.1) rotate(-5deg);
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.3));
}

.service-card h2 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    font-weight: 700;
    color: #fff;
    transition: color 0.3s ease;
}

.service-card:hover h2 {
    color: var(--card-color);
}

.service-card p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 3rem;
    flex-grow: 1;
    font-size: 1.05rem;
}

.btn {
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.8rem;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.arrow {
    transition: transform 0.3s ease;
}

.service-card:hover .btn {
    background: var(--card-color);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.service-card:hover .arrow {
    transform: translateX(5px);
}

/* =========================================================================
   KEYFRAMES
   ========================================================================= */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-40px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================================================
   RESPONSIVE DESIGN
   ========================================================================= */
@media (max-width: 1024px) {
    .container { padding: 2rem 1.5rem; }
    .header { margin-bottom: 3rem; }
    .services-grid { gap: 1.5rem; }
}

@media (max-width: 768px) {
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .card-content {
        padding: 2.5rem 2rem;
    }

    .service-card:hover {
        transform: translateY(-5px); /* Less dramatic on mobile */
    }
}
