/* ============================================
   Lab page — hover card grid for side projects.
   Sits over the site's default sunset background.
   ============================================ */

.lab-main {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 100vh;
    padding: 20vh 5vw 10vh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 3.5rem;
}

.lab-hero,
.lab-grid-section { width: 100%; }

.lab-hero {
    max-width: 900px;
}

.lab-label {
    display: block;
    font-family: var(--font-geist);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.lab-title {
    font-family: var(--font-geist);
    font-weight: 800;
    font-size: clamp(2.6rem, 9vw, 7.5rem);
    line-height: 0.92;
    letter-spacing: -0.04em;
    text-transform: uppercase;
    color: var(--text-primary);
    margin-top: 0.5rem;
}

.lab-intro {
    margin-top: 1.3rem;
    max-width: 48ch;
    font-family: var(--font-geist);
    font-size: clamp(1rem, 1.4vw, 1.2rem);
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Card grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 24px;
    width: 100%;
}
@media (min-width: 600px) {
    .card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
    .card-grid { grid-template-columns: repeat(4, 1fr); }
}

.card {
    position: relative;
    display: block;
    text-decoration: none;
    border-radius: 20px;
    overflow: hidden;
    background: #14120f;
}
.card:before {
    content: "";
    display: block;
    padding-bottom: 140%;
}

.card__background {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: brightness(0.72) saturate(1.1);
    transform: scale(1) translateZ(0);
    transform-origin: center;
    transition: filter 300ms ease, transform 450ms ease;
}
.card:hover .card__background {
    transform: scale(1.06) translateZ(0);
    filter: brightness(0.85) saturate(1.2);
}
.card-grid:hover > .card:not(:hover) .card__background {
    filter: brightness(0.45) saturate(0.6) blur(8px);
}

/* readability gradient */
.card:after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0) 58%);
    pointer-events: none;
    z-index: 1;
}

.card__content {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 22px;
}
.card__category {
    font-family: var(--font-geist);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.82);
    margin-bottom: 8px;
}
.card__heading {
    font-family: var(--font-geist);
    font-weight: 800;
    font-size: 1.9rem;
    line-height: 1.05;
    color: #ffffff;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
}

/* override the index-only "main locked to 100vh / no scroll" rule so Lab scrolls */
@media (max-width: 768px) {
    main.lab-main {
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }
}

@media (max-width: 600px) {
    .lab-main { padding: 16vh 5vw 8vh; }
    .card:before { padding-bottom: 75%; }
}

/* ============================================
   Works / homepage featured — card grid variants
   ============================================ */
main.works-section { align-items: stretch; justify-content: flex-start; }

.card-grid.cards-wide { grid-template-columns: 1fr; }
@media (min-width: 600px)  { .card-grid.cards-wide { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .card-grid.cards-wide { grid-template-columns: repeat(3, 1fr); } }
.cards-wide .card:before { padding-bottom: 72%; }

.card-grid.home-featured { grid-template-columns: 1fr; }
@media (min-width: 600px)  { .card-grid.home-featured { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .card-grid.home-featured { grid-template-columns: repeat(4, 1fr); } }
.home-featured .card:before { padding-bottom: 78%; }

.works-card-grid { margin-top: 3rem; }
