﻿/* Home page: a CSS grid of tiles. 4 columns on desktop, 2 on tablet, 1 on phones. */
.main-element {
    display: grid;
    grid-template-columns: 1.25fr 1fr 1fr 1fr;
    grid-template-rows: 1fr auto;
    grid-template-areas:
        "intro featured featured side"
        "intro p1 p2 p3";
    gap: 16px;
    padding-top: 1rem;
}

/* On desktop the home page fills exactly one screen: the grid stretches to the space left
   between the header and footer, and the featured screenshot takes up the slack. */
@media screen and (min-width: 1101px) {
    body.fill-screen > .container,
    body.fill-screen main {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    body.fill-screen .main-element {
        flex: 1;
        max-height: 960px;
    }

    body.fill-screen .featured-image {
        flex: 1 1 0;
        min-height: 120px;
        aspect-ratio: auto;
    }
}

.intro { grid-area: intro; }
.featured { grid-area: featured; }
.side-column { grid-area: side; }
.c1 { grid-area: c1; }
.c2 { grid-area: c2; }
.c3 { grid-area: c3; }
.contact-tile { grid-area: contact; }
.p1 { grid-area: p1; }
.p2 { grid-area: p2; }
.p3 { grid-area: p3; }

/* Certifications and "Get in touch" stack in one column; each tile only needs its own
   height, and spare height is shared out evenly. */
.side-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

    .side-column > .main-page-element {
        flex: 1 1 0;
        padding: 0.75rem 1rem;
    }

@media screen and (max-width: 1100px) {
    /* Below desktop the tiles join the main grid individually */
    .side-column {
        display: contents;
    }

    .main-element {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: none;
        grid-template-areas:
            "intro intro"
            "featured featured"
            "p1 p2"
            "p3 c1"
            "c2 c3"
            "contact contact";
    }
}

@media screen and (max-width: 640px) {
    .main-element {
        grid-template-columns: 1fr;
        grid-template-areas:
            "intro"
            "featured"
            "p1"
            "p2"
            "p3"
            "c1"
            "c2"
            "c3"
            "contact";
    }
}

.main-page-element {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
    color: var(--text-color);
    background-color: var(--surface-raised);
    border: 1px solid var(--surface-border);
    border-radius: 10px;
    padding: 1rem 1.15rem;
    text-decoration: none;
}

    .main-page-element h2 {
        margin: 0;
        font-size: 1.25rem;
        color: var(--heading-color);
    }

    .main-page-element p {
        margin: 0;
    }

.tile-label {
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: bold;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Intro tile */

.intro {
    background-color: var(--surface);
    gap: 0.9rem;
}

.intro-heading {
    display: flex;
    align-items: center;
    gap: 1rem;
}

    .intro-heading h1 {
        margin: 0;
        text-align: left;
        font-size: 2rem;
    }

.monogram {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #e11d74);
    color: var(--on-accent);
    font-size: 1.5rem;
    font-weight: bold;
}

.headline {
    color: var(--heading-color);
    font-size: 1.05rem;
    line-height: 1.5;
}

.blurb {
    color: var(--muted-text);
    line-height: 1.5;
}

.intro-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.social-links {
    display: flex;
    gap: 0.6rem;
}

.social-button {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background-color: var(--chip-bg);
    transition: transform 150ms ease, background-color 150ms ease;
}

    .social-button:hover {
        transform: translateY(-2px);
        background-color: #fff;
    }

.projects-button {
    justify-content: center;
}

/* Featured project tile */

.featured-image {
    display: block;
    border-radius: 6px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

    .featured-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: top left;
        transition: transform 300ms ease;
    }

    .featured-image:hover img {
        transform: scale(1.03);
    }

/* Small project tiles */

.project-tile {
    transition: transform 150ms ease, border-color 150ms ease;
}

    .project-tile:hover {
        transform: translateY(-3px);
        border-color: var(--accent);
        color: var(--text-color);
    }

    .project-tile .tech-badges {
        margin-top: auto;
    }

/* Certification and contact tiles */

.cert-tile {
    flex-direction: row;
    align-items: center;
    gap: 0.85rem;
}

    .cert-tile img {
        flex-shrink: 0;
        width: 32px;
        height: 32px;
    }

    .cert-tile h2 {
        font-size: 1rem;
    }

    .cert-tile p {
        margin-top: 0.3rem;
        font-size: 0.85rem;
        color: var(--muted-text);
    }

.cert-earned {
    background-color: var(--rose-surface);
    border-color: #5a2a40;
}

.cert-planned {
    background-color: var(--surface);
    border-style: dashed;
}

    .cert-planned img {
        filter: grayscale(1);
        opacity: 0.6;
    }

.contact-tile {
    justify-content: center;
    background-color: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
    transition: background-color 150ms ease;
}

    .contact-tile h2 {
        color: var(--on-accent);
    }

    .contact-tile:hover {
        background-color: var(--accent-hover);
        color: var(--on-accent);
    }

.tile-arrow {
    margin-left: 0.3rem;
}
