.how-it-works {
    display: flex;
    flex-direction: column;
    align-items: center; /* Centers both header block and card grid */
    padding: 8vw 12vw;
    box-sizing: border-box;
    width: 100%;
}

.how-content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    width: calc(28vw * 3 + 3vw * 2); /* Matches total grid width: 3 cards + 2 gaps = 90vw */
}

.how-title {
    margin: 0;
    line-height: 1;
    display: flex;
    justify-content: flex-end;
}

.how-title-svg {
    height: 3.2vw; /* Exactly the same as the previous font-size */
    width: auto;
    display: block;
    margin: 0 0 1vw  0;
}

.how-subtitle {
    font-family: 'Arsenica Trial', serif;
    font-weight: 700;
    font-size: 7vw;
    color: #ffffff;
    margin: -1vw 0 0 0;
    text-align: right;
    white-space: nowrap;
    opacity: 0.9;
}

.how-subtitle span {
    display: inline;
}

.how-subtitle .script {
    font-family: 'Pinyon Script', cursive;
    font-size: 1.1em; 
    color: #000000;
    font-weight: 500;
}

/* ---- Glass Cards Grid ---- */
.pillars-grid {
    display: flex;
    gap: 3vw;
    margin-top: 4vw;
    width: 100%;
    justify-content: center;
}

.pillar-card {
    width: 28vw;
    height: 28vw;
    flex-shrink: 0;
    border-radius: 4vw;
    padding: 3vw;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    overflow: hidden; /* Added to ensure content doesn't force expansion */

    /* Nearly fully transparent glass — background visible but softly blurred */
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px) saturate(100%) contrast(110%);
    -webkit-backdrop-filter: blur(20px) saturate(100%) contrast(110%);

    /* Border handled by ::before for smooth gradient transition */
    border: none;
    position: relative;

    /* Subtle depth + soft surrounding shadow */
    box-shadow:
        0 0 80px rgba(0, 0, 0, 0.15),
        0 8px 32px 0 rgba(0, 0, 0, 0.03),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);

    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Smooth gradient border — transitions from dim (top-left) to bright (bottom-right) */
.pillar-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px; /* This is the border thickness */
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.08) 0%,
        rgba(255, 255, 255, 0.15) 30%,
        rgba(255, 255, 255, 0.35) 70%,
        rgba(255, 255, 255, 0.5) 100%
    );
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
}

.pillar-card:hover {
    transform: translateY(-0.5vw);
    box-shadow:
        0 15px 45px 0 rgba(0, 0, 0, 0.05),
        inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* Card number */
.pillar-number {
    font-family: 'Archivo Black', sans-serif;
    font-size: 3.5vw;
    color: transparent;
    -webkit-text-stroke: 0.08vw #ffffff;
    line-height: 1;
    margin-bottom: 1vw;
}

/* Card heading */
.pillar-heading {
    font-family: 'Abril Fatface', serif;
    font-size: 3.5vw;
    color: #ffffff;
    margin: 0 0 1.2vw 0;
    line-height: 1;
    opacity: 0.8;
}

/* Card body text */
.pillar-text {
    font-family: 'Source Code Pro', monospace;
    font-size: clamp(9px, 1.1vw, 18px); /* Holds at 11px minimum as cards shrink */
    color: #ffffff;
    line-height: 1.6;
    margin: 0;
    text-transform: uppercase;
}

/* ---- Mobile: stack cards vertically ---- */
@media (max-width: 768px) {
    .how-content-wrapper {
        width: 80vw;
        margin: 0 auto;
        align-items: flex-end; /* Standard CSS for right-alignment in flex column */
    }

    .how-subtitle {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        width: 100%;
        white-space: normal;
        margin-bottom: 20px;
    }

    .how-subtitle span {
        display: block;
        width: 100%;
        text-align: right;
    }

    .how-subtitle .line-1, 
    .how-subtitle .line-3 {
        font-size: 10vw; /* Same size as "Build" */
    }

    .how-subtitle .line-2.script {
        font-size: 16vw; /* Spans exactly ~80vw */
        margin: -2vw 0;
        text-align: right;
    }
    .pillars-grid {
        flex-direction: column;
        align-items: center;
        gap: 20px;
        margin-top: 40px;
    }
    .pillar-card {
        width: 80vw;
        height: 80vw;
        border-radius: 60px;
        padding: 40px;
        min-height: 320px;
    }
    .pillar-number {
        font-size: 10vw;
        -webkit-text-stroke: 1px #ffffff;
        margin-bottom: 15px;
    }
    .pillar-heading {
        font-size: 10vw;
        margin-bottom: 20px;
    }
    .pillar-text {
        font-size: 3.5vw;
    }
}
