/* GRID */
@keyframes orbFloat {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0.55;
    }

    33% {
        transform: translate(3%, -4%) scale(1.08);
        opacity: 0.70;
    }

    66% {
        transform: translate(-3%, 3%) scale(0.94);
        opacity: 0.50;
    }

    100% {
        transform: translate(2%, 2%) scale(1.04);
        opacity: 0.60;
    }
}

@keyframes shimmerSweep {
    0% {
        transform: translateX(-120%) skewX(-12deg);
    }

    100% {
        transform: translateX(220%) skewX(-12deg);
    }
}

.grid {
    padding: clamp(4rem, 12vw, 10rem) 0;
    background: #fffbf9;
    position: relative;
    overflow: hidden;
}

/* Background glows */
.grid::before,
.grid::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(clamp(60px, 10vw, 120px));
    z-index: 0;
}

/* Violet orb */
.grid::before {
    width: clamp(250px, 40vw, 620px);
    height: clamp(250px, 40vw, 620px);
    bottom: -10%;
    left: -8%;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.10) 0%, rgba(168, 85, 247, 0.06) 50%, transparent 70%);
    animation: orbFloat 20s ease-in-out infinite alternate;
}

/* Amber orb */
.grid::after {
    width: clamp(200px, 32vw, 500px);
    height: clamp(200px, 32vw, 500px);
    top: -8%;
    right: -6%;
    background: radial-gradient(circle, rgba(251, 146, 60, 0.09) 0%, rgba(245, 158, 11, 0.05) 45%, transparent 70%);
    animation: orbFloat 26s ease-in-out infinite alternate-reverse;
}

/* Sweep overlay */
.grid-shimmer {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.grid-shimmer::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 40%;
    background: linear-gradient(105deg, transparent 20%, rgba(255, 255, 255, 0.45) 50%, transparent 80%);
    animation: shimmerSweep 10s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    animation-delay: 4s;
}

/* Noise overlay */
.grid-noise {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 70% 20%, rgba(168, 85, 247, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 30% 80%, rgba(244, 63, 94, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 50% 45%, rgba(251, 146, 60, 0.035) 0%, transparent 45%);
}

.grid .items {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(1.25rem, 3vw, 2.25rem);
    position: relative;
    z-index: 1;
}

/* Card base */
.items .card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: 28px;
    padding: clamp(1.75rem, 4vw, 3rem);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: clamp(0.85rem, 2vw, 1.4rem);
    transition: all 0.55s cubic-bezier(0.2, 1, 0.3, 1);
    z-index: 0;
}

/* Subtle gradient mesh background per card */
.items .card::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.55s ease;
    pointer-events: none;
}

.items .card.iot::before {
    background:
        radial-gradient(ellipse at 10% 90%, rgba(16, 185, 129, 0.09) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 10%, rgba(13, 148, 136, 0.07) 0%, transparent 50%);
}

.items .card.realtime::before {
    background:
        radial-gradient(ellipse at 10% 90%, rgba(59, 130, 246, 0.09) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 10%, rgba(37, 99, 235, 0.07) 0%, transparent 50%);
}

.items .card.ai::before {
    background:
        radial-gradient(ellipse at 10% 90%, rgba(244, 63, 94, 0.09) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 10%, rgba(225, 29, 72, 0.07) 0%, transparent 50%);
}

.items .card:hover::before {
    opacity: 1;
}

/* Floating decorative orb */
.items .card::after {
    content: '';
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    filter: blur(50px);
    opacity: 0;
    z-index: 0;
    top: -30px;
    right: -30px;
    transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.2, 1, 0.3, 1);
    pointer-events: none;
}

.items .card.iot::after {
    background: rgba(16, 185, 129, 0.22);
}

.items .card.realtime::after {
    background: rgba(59, 130, 246, 0.22);
}

.items .card.ai::after {
    background: rgba(244, 63, 94, 0.22);
}

.items .card:hover::after {
    opacity: 1;
    transform: translate(-10px, 10px) scale(1.2);
}

/* Colour-accent top bar */
.items .card .bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 28px 28px 0 0;
    transition: height 0.5s cubic-bezier(0.2, 1, 0.3, 1), opacity 0.5s;
}

.items .card.iot .bar {
    background: linear-gradient(90deg, #10b981, #0d9488);
}

.items .card.realtime .bar {
    background: linear-gradient(90deg, #3b82f6, #2563eb);
}

.items .card.ai .bar {
    background: linear-gradient(90deg, #f43f5e, #e11d48);
}

/* Hover effects */
.items .card:hover {
    transform: translateY(-10px);
    border-color: transparent;
}

.items .card.iot:hover {
    box-shadow:
        0 28px 60px -14px rgba(16, 185, 129, 0.22),
        0 0 0 1px rgba(16, 185, 129, 0.24),
        0 0 40px -10px rgba(13, 148, 136, 0.12);
}

.items .card.realtime:hover {
    box-shadow:
        0 28px 60px -14px rgba(59, 130, 246, 0.22),
        0 0 0 1px rgba(59, 130, 246, 0.24),
        0 0 40px -10px rgba(37, 99, 235, 0.12);
}

.items .card.ai:hover {
    box-shadow:
        0 28px 60px -14px rgba(244, 63, 94, 0.22),
        0 0 0 1px rgba(244, 63, 94, 0.24),
        0 0 40px -10px rgba(225, 29, 72, 0.12);
}

.items .card:hover .bar {
    height: 100%;
    opacity: 0.035;
    border-radius: 0;
}

/* Chip / badge Ã¢â‚¬â€ solid gradient style */
.items .card .chip {
    display: inline-block;
    font-size: clamp(0.62rem, 1vw, 0.76rem);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    padding: 0.35em 1em;
    border-radius: 99px;
    width: fit-content;
    color: #fff;
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.items .card.iot .chip {
    background: linear-gradient(135deg, #10b981, #0d9488);
    box-shadow: 0 2px 12px rgba(16, 185, 129, 0.32);
}

.items .card.realtime .chip {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 2px 12px rgba(59, 130, 246, 0.32);
}

.items .card.ai .chip {
    background: linear-gradient(135deg, #f43f5e, #e11d48);
    box-shadow: 0 2px 12px rgba(244, 63, 94, 0.32);
}

/* Title */
.items .card .title {
    font-size: clamp(1.2rem, 3vw, 1.9rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: #1e1b4b;
    position: relative;
    z-index: 1;
}

/* Description */
.items .card .desc {
    font-size: clamp(0.82rem, 1.4vw, 0.97rem);
    color: #64748b;
    line-height: 1.70;
    flex-grow: 1;
    position: relative;
    z-index: 1;
}

/* Footer / tags */
.items .card .foot {
    margin-top: auto;
    position: relative;
    z-index: 1;
}

.items .card .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.6rem;
    padding-top: clamp(0.75rem, 2vw, 1.25rem);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.items .card .tags span {
    font-size: clamp(0.65rem, 1vw, 0.78rem);
    font-weight: 700;
    color: #94a3b8;
    font-family: 'Courier New', monospace;
    background: #f8fafc;
    padding: 0.2em 0.65em;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

/* Tag hover colors per card type */
.items .card.iot:hover .tags span {
    color: #0d9488;
    border-color: rgba(16, 185, 129, 0.22);
    background: rgba(16, 185, 129, 0.07);
}

.items .card.realtime:hover .tags span {
    color: #2563eb;
    border-color: rgba(59, 130, 246, 0.22);
    background: rgba(59, 130, 246, 0.07);
}

.items .card.ai:hover .tags span {
    color: #e11d48;
    border-color: rgba(244, 63, 94, 0.22);
    background: rgba(244, 63, 94, 0.07);
}

@media (max-width: 1024px) {
    .grid .items {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .grid .items {
        grid-template-columns: 1fr;
    }
}