/* Finance Hexagon Animation Styles */
.finance-hex-container {
    position: relative;
    width: 100%;
    min-height: 600px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    padding: 4rem 0;
}

#financeCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.hex-grid {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    /* Spacing between hexes */
    max-width: 1000px;
    z-index: 1;
}

.hex-item {
    position: relative;
    width: 220px;
    height: 250px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    /* Removed All transition to avoid lag on transform, split properties */
    transition: box-shadow 0.3s ease, background 0.3s ease;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    padding: 2px;
    /* Initialize vars */
    --tx: 0px;
    --ty: 0px;
    /* Apply parallax */
    transform: translate(var(--tx), var(--ty));
    /* Smooth out the parallax movement slightly */
    will-change: transform;
}

/* Inner content wrapper to simulate border */
.hex-content {
    background: #ffffff;
    width: 100%;
    height: 100%;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    transition: background 0.3s ease, border-color 0.3s ease;
}

/* Pseudo-element for the Gold Border */
.hex-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #e2e8f0;
    /* Default border color */
    z-index: -1;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    transition: background 0.3s ease;
}

.hex-item:hover::before {
    background: var(--primary-color);
    /* Gold border on hover */
}

/* Composed transform on hover: Keep parallax (tx, ty) and add lift/scale */
.hex-item:hover {
    transform: translate(var(--tx), calc(var(--ty) - 10px)) scale(1.05);
}

.hex-item:hover .hex-content {
    background: #fafafc;
}

/* Center Hub Styling */
.hex-center {
    width: 260px;
    /* Slightly larger */
    height: 290px;
}

.hex-center::before {
    background: var(--secondary-color);
    /* Navy border for center */
}

.hex-center .hex-icon {
    color: var(--secondary-color);
}

.hex-center:hover::before {
    background: var(--primary-color);
}

/* Content Styles */
.hex-icon {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    transition: transform 0.4s ease;
}

.hex-item:hover .hex-icon {
    transform: scale(1.2) rotate(15deg);
}

.hex-content h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.hex-content p {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0;
}

/* Responsive Arrangements */
/* We want a honeycomb pattern: 2 top, 1 center, 2 bottom, or similar */
.hex-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 1rem;
}

/* Specific Grid Placement */
.hex-item:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
    margin-top: 3rem;
}

.hex-item:nth-child(2) {
    grid-column: 3;
    grid-row: 1;
    margin-top: 3rem;
}

.hex-item:nth-child(3) {
    grid-column: 2;
    grid-row: 1;
    grid-row: 1 / span 2;
    align-self: center;
    z-index: 2;
}

/* Center */
.hex-item:nth-child(4) {
    grid-column: 1;
    grid-row: 2;
    margin-bottom: 3rem;
}

.hex-item:nth-child(5) {
    grid-column: 3;
    grid-row: 2;
    margin-bottom: 3rem;
}


@media (max-width: 900px) {
    .hex-grid {
        display: flex;
        flex-direction: column;
    }

    .hex-item,
    .hex-center {
        width: 100%;
        max-width: 300px;
        height: 180px;
        /* Squashed hex for mobile list or just use cards? */
        /* Revert to card-like for mobile for usability? Or keep hex stack? */
        /* Let's keep hex but stack them with overlap */
        margin: -1rem 0;
    }

    .finance-hex-container {
        padding: 2rem 0;
        min-height: auto;
    }
}