@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;900&family=Space+Grotesk:wght@500&display=swap');

/* ==== GLOBAL & SECTION SETUP ==== */
.risks-section {
    background: radial-gradient(ellipse at 60% 10%, #002354 0%, #001024 100%);
    min-height: 100vh;
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 48px 24px;
    overflow: hidden;
    z-index: 10;
}

.risks-bg-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    opacity: 0.9;
    pointer-events: none;
}

.video-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 12, 32, 0.34);
    pointer-events: none;
    z-index: 1;
}

.risks-section::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: radial-gradient(ellipse at 60% 10%, #002354 0%, #00081e 100%);
    opacity: 0.78;
}

/* --- Headings --- */
.risks-heading, .risks-grid {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 1220px;
    box-sizing: border-box;
}

.risks-heading {
    text-align: center;
    margin-bottom: 36px;
}

.risks-heading h2 {
    font-size: clamp(1.6rem, 4vw, 2.8rem);
    font-weight: 800;
    margin: 0 0 8px 0;
    color: #fff;
    letter-spacing: -0.01em;
    line-height: 1.07;
}

.risks-subtitle {
    font-size: clamp(0.95rem, 1.4vw, 1.14rem);
    color: #36d6ff;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    margin-bottom: 2px;
    font-weight: 600;
}

/* --- Risks Grid --- */
.risks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 28px;
    padding: 0 1vw;
}

/* --- Risk Card --- */
.risk-item {
    display: flex;
    background: none;
    perspective: 1200px;
    cursor: pointer;
    z-index: 1;
    transition: z-index 0s 0.28s;
}

.risk-item:hover {
    z-index: 10;
    transition: z-index 0s;
}

.risk-item-inner {
    width: 100%;
    height: 100%;
    transition: transform 0.57s cubic-bezier(.44,1.26,.42,1);
    transform-style: preserve-3d;
    will-change: transform;
    position: relative;
    display: flex;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* --- Card Glass --- */
.card-glass {
    position: relative;
    width: 100%;
    border-radius: 18px;
    border: 1.5px solid rgba(18,110,230,0.16);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 26px 20px;
    z-index: 2;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.card-glass::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(0,22,60,0.92), rgba(0,4,30,0.9));
    backdrop-filter: blur(26px) saturate(180%);
    border-radius: 18px;
    z-index: 1;
}

.card-glass::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--glow-x, 50%) var(--glow-y, 40px), #00458ec0 0px, #00307053 140px, transparent 95%);
    opacity: 0.18;
    z-index: 2;
    pointer-events: none;
    transition: opacity 0.32s, background 0.32s;
    border-radius: 18px;
}

.risk-item:hover .card-glass::before {
    background: radial-gradient(circle at var(--glow-x, 50%) var(--glow-y, 50%), #00e2ff8c 0px, #007fe799 110px, transparent 95%);
    opacity: 0.44;
}

/* --- Card Grid Pattern --- */
.card-cells {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: 24px 24px;
    z-index: 3;
    pointer-events: none;
    opacity: 0.22;
    border-radius: 18px;
}

/* --- Icon / Glow --- */
.icon-glow {
    margin-bottom: 24px;
    z-index: 5;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-circle {
    width: 88px;
    height: 88px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: background 0.26s, border-color 0.26s;
}

.risk-item:hover .icon-circle {
    background: rgba(0, 179, 255, 0.1);
    border-color: rgba(0, 179, 255, 0.34);
}

.icon-glow svg {
    width: 54px;
    height: 54px;
    transition: transform 0.7s cubic-bezier(.44,1.26,.42,1), filter 0.34s;
    will-change: transform, filter;
}

.icon-glow svg path {
    fill: #ffffff;
    transition: fill 0.34s ease-out;
}

.risk-item:hover .icon-glow svg {
    transform: scale(1.06) rotateY(360deg);
    filter: drop-shadow(0 0 16px #2af8ff) brightness(1.18);
}

.risk-item:hover .icon-glow svg path {
    fill: #2af8ff;
}

/* --- Card Text --- */
.card-glass h3, .card-glass p {
    text-align: center;
    z-index: 5;
    position: relative;
}

.card-glass h3 {
    font-size: 1.18rem;
    font-weight: 600;
    margin-bottom: 10px;
    margin-top: 0;
    color: #fff;
    line-height: 1.26;
}

.card-glass p {
    font-size: 0.96rem;
    color: #b8e5f6;
    font-weight: 400;
    margin-bottom: 0;
    line-height: 1.54;
    max-width: 95%;
}

/* --- Reflection Overlay --- */
.card-reflection {
    pointer-events: none;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 4;
    background: radial-gradient(circle at 50% 30%,rgba(255,255,255,0.14) 0,rgba(255,255,255,0.03) 28%,rgba(255,255,255,0.01) 52%,transparent 80%);
    opacity: 0.35;
    mix-blend-mode: lighten;
    transition: opacity 0.24s, background 0.24s;
    border-radius: 18px;
}

/* --- Responsive --- */
@media (max-width: 960px) {
    .risks-grid {
        /* This creates two columns of a maximum of 350px each */
        grid-template-columns: repeat(2, minmax(0, 350px));
        /* This centers the grid tracks (the columns) within the container */
        justify-content: center;
        gap: 20px;
        max-width: 720px;
        margin-left: auto;
        margin-right: auto;
    }
    /* We no longer need a special rule for the last item */
}

@media (max-width: 700px) {
    .risks-grid {
        /* Revert to auto-fit for smaller tablets and mobile */
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        max-width: 460px;
    }
}

@media (max-width: 500px) {
    .risks-section {
        padding: 32px 16px;
    }
    .risks-heading {
        margin-bottom: 24px;
    }
    .icon-circle {
        width: 72px;
        height: 72px;
    }
    .icon-glow svg {
        width: 44px;
        height: 44px;
    }
    .card-glass h3 {
        font-size: 1.05rem;
    }
    .card-glass p {
        font-size: 0.9rem;
    }
}
