/* ==========================================================================
   MATERIALS SECTION — Homepage Preview
   ========================================================================== */

.hp-materials-section {
    margin-bottom: 100px;
}

/* Grid of category cards */
.category-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

/* ── Category Card ── */
.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 28px 18px 24px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1.5px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 20px rgba(33, 40, 66, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    text-decoration: none;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(33, 40, 66, 0.03) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-card:hover {
    transform: translateY(-7px);
    border-color: rgba(33, 40, 66, 0.18);
    box-shadow: 0 16px 48px rgba(33, 40, 66, 0.13);
}

.category-card:hover::before {
    opacity: 1;
}

/* Icon box */
.icon-box {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    background: linear-gradient(135deg, #212842, #2f3d60);
    color: #fff;
    box-shadow: 0 8px 22px rgba(33, 40, 66, 0.28);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.category-card:hover .icon-box {
    transform: scale(1.08) rotate(-4deg);
}

/* Per-card accent colours */
.category-card:nth-child(1) .icon-box {
    background: linear-gradient(135deg, #212842, #2f3d60);
}

.category-card:nth-child(2) .icon-box {
    background: linear-gradient(135deg, #0c4a45, #14b8a6);
}

.category-card:nth-child(3) .icon-box {
    background: linear-gradient(135deg, #78400a, #f59e0b);
}

.category-card:nth-child(4) .icon-box {
    background: linear-gradient(135deg, #7c1d4c, #f43f5e);
}

.category-card:nth-child(5) .icon-box {
    background: linear-gradient(135deg, #1e3a5f, #3b82f6);
}

/* Card info text */
.card-info h3 {
    font-size: 0.95rem;
    font-weight: 800;
    color: #212842;
    letter-spacing: -0.3px;
    margin-bottom: 4px;
}

.card-info p {
    font-size: 0.78rem;
    color: rgba(33, 40, 66, 0.45);
    font-weight: 500;
}

/* Arrow */
.hover-arrow {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(33, 40, 66, 0.06);
    color: rgba(33, 40, 66, 0.4);
    font-size: 0.8rem;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.category-card:hover .hover-arrow {
    background: #212842;
    color: #fff;
    transform: translateX(3px);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1100px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 700px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .category-grid {
        grid-template-columns: 1fr 1fr;
    }
}