
.tech-grid-section {
    --tg-teal: #025b6b;
    --tg-teal-dark: #013e4a;
    --tg-teal-light: #e3f0f2;
    --tg-navy: #04123a;
    --tg-card-h: 460px;
    margin-top: 40px;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    align-items: start;
}

.tech-grid-card {
    position: relative;
    height: var(--tg-card-h);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(4, 18, 58, 0.08);
    background: var(--tg-navy);
    cursor: pointer;
    transition: box-shadow 0.3s ease;
}

.tech-grid-card:hover,
.tech-grid-card:focus-within {
    box-shadow: 0 10px 28px rgba(4, 18, 58, 0.14);
}

.tech-grid-card-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    transition: transform 0.5s ease;
}

.tech-grid-card:hover .tech-grid-card-image,
.tech-grid-card:focus-within .tech-grid-card-image {
    transform: scale(1.05);
}

.tech-grid-card-scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(4, 18, 58, 0) 0%, rgba(4, 18, 58, 0.22) 55%, rgba(2, 8, 22, 0.82) 100%);
    pointer-events: none;
    transition: background 0.3s ease;
}

.tech-grid-card:hover .tech-grid-card-scrim,
.tech-grid-card:focus-within .tech-grid-card-scrim {
    background: linear-gradient(180deg, rgba(4, 18, 58, 0.05) 0%, rgba(4, 18, 58, 0.4) 45%, rgba(2, 8, 22, 0.92) 100%);
}

.tech-grid-card-bottom {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 16px 24px 24px;
    text-align: center;
}

.tech-grid-card-details-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 12px auto 0;
    padding: 8px 18px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(4, 18, 58, 0.45);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    color: #ffffff;
    font-family: 'Raleway', sans-serif;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    opacity: 0;
    transform: translateY(6px);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, opacity 0.25s ease;
}

.tech-grid-card:hover .tech-grid-card-details-btn,
.tech-grid-card:focus-within .tech-grid-card-details-btn {
    opacity: 1;
    transform: translateY(0);
}

.tech-grid-card-details-btn i {
    font-size: 11px;
}

.tech-grid-card-details-btn:hover,
.tech-grid-card-details-btn:focus-visible {
    background: var(--tg-teal);
    border-color: var(--tg-teal);
    transform: translateY(-2px);
    outline: none;
}

.tech-grid-card-title {
    margin: 0;
    font-family: 'Raleway', sans-serif;
    font-weight: 800;
    font-size: 19px;
    line-height: 1.32;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 4px 14px rgba(0, 0, 0, 0.7);
}

.tech-grid-card-desc {
    margin: 8px 0 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    font-family: 'Open Sans', sans-serif;
    font-size: 13px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.9);
    transition: max-height 0.35s ease, opacity 0.3s ease;
}

.tech-grid-card:hover .tech-grid-card-desc,
.tech-grid-card:focus-within .tech-grid-card-desc {
    max-height: 100px;
    opacity: 1;
}

@media (max-width: 1024px) {
    .tech-grid-section {
        --tg-card-h: 400px;
    }
}

@media (max-width: 640px) {
    .tech-grid-section {
        --tg-card-h: 360px;
    }
    /* Hover has no equivalent on touch — keep the short description
       collapsed and always show the Details button instead of
       revealing it on hover. */
    .tech-grid-card-desc {
        display: none;
    }
    .tech-grid-card-details-btn {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tech-grid-card-image,
    .tech-grid-card-scrim,
    .tech-grid-card-desc,
    .tech-grid-card-details-btn {
        transition: none !important;
    }
}

/* ------------------------------------------------------------------ */
/* Details modal                                                       */
/* ------------------------------------------------------------------ */

.tech-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(4, 18, 58, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 10000;
}

.tech-modal-backdrop[hidden] {
    display: none;
}

.tech-modal {
    position: relative;
    background: #ffffff;
    border-radius: 14px;
    max-width: 560px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 40px;
    box-shadow: 0 10px 28px rgba(4, 18, 58, 0.14);
}

.tech-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #e3f0f2;
    color: #013e4a;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1;
}

.tech-modal-close:hover,
.tech-modal-close:focus-visible {
    background: var(--tg-teal, #025b6b);
    color: #ffffff;
    outline: none;
}

.tech-modal-media {
    height: 240px;
    border-radius: 14px;
    margin-bottom: 24px;
    background: linear-gradient(135deg, var(--tg-navy) 0%, var(--tg-teal) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.tech-modal-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
}

.tech-modal-title {
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 22px;
    color: #232323;
    margin-bottom: 16px;
}

.tech-modal-intro {
    font-family: 'Open Sans', sans-serif;
    font-size: 15px;
    color: #232323;
    line-height: 1.6;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e6e9ee;
}

.tech-modal-text {
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    color: #676767;
    line-height: 1.6;
    margin-bottom: 10px;
}

.tech-modal-text:last-child {
    margin-bottom: 0;
}
