@import 'https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700;800;900&display=swap';

.card-section-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;  
  min-height: 90svh;       
  width: 100%;
  padding: 6rem 0rem 0rem 0rem;
  gap: 20px;
}

.card-section {
  display: flex;
  flex-wrap: wrap;     
  justify-content: center; 
}

/* Hide all body content except modal, overlay, and canvas when a card is open */
body.modal-open > *:not(#cardModal):not(#cardOverlay):not(canvas) {
    opacity: 0;
    pointer-events: none;
    user-select: none;
    transition: opacity 0.3s ease;
}

/* Overlay behind the modal */
#cardOverlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0,0,0,0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 900;
}

body.modal-open #cardOverlay {
    opacity: 1;
    pointer-events: all;
}

/* Modal itself */
#cardModal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    z-index: 1000;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    perspective: 1000px; /* Smaller = stronger 3D effect */
}

body.modal-open #cardModal {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.card-overlay .modal-close-btn {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: transparent;
    border: 1px solid #C084FC;
    padding: 0.7em 1.4em;
    border-radius: 2rem;
    margin: 0.5em;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease, transform 0.2s ease;
    z-index: 10000;
    font-family: 'Poppins', sans-serif;
}

.card-overlay .modal-close-btn:hover {
    background: #C084FC22;
    transform: translateX(-50%) translateY(-3px);
}

/* CARD MODAL */
.card-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s ease;
    z-index: 9999;
}

.card-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.card-modal {
    transform: scale(0.8);
    transition: 0.3s ease;
}

.card-overlay.active .card-modal {
    transform: scale(1);
}

body.modal-open {
    overflow: hidden;
}