/* =========================================
   Hero
   ========================================= */

.profile-home {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    min-height: 65svh;
    padding: clamp(3rem, 8vh, 6rem) clamp(1rem, 3vw, 2rem);
}

.profile-hero {
    display: grid;
    grid-template-columns: clamp(9rem, 19vw, 13rem) minmax(0, 1fr);
    align-items: center;
    gap: clamp(2rem, 5vw, 4rem);

    width: 100%;
    max-width: 58rem;
    margin-inline: auto;
}

.profile-hero__avatar {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;

    border: 1px solid var(--md-default-fg-color--lightest);
    border-radius: 50%;
}

.profile-hero__copy h1 {
    margin: 0;
    font-size: clamp(2.75rem, 6vw, 4.75rem);
    font-weight: 750;
    line-height: 1.05;
    letter-spacing: -0.045em;
}

.profile-hero__description {
    max-width: 45ch;
    margin: 1.25rem 0 0;

    color: var(--md-default-fg-color--light);
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    line-height: 1.75;
}

/* =========================================
   Social links
   ========================================= */

.profile-socials {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.75rem;
}

.profile-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.65rem 0.9rem;

    border: 1px solid var(--md-default-fg-color--lightest);
    border-radius: 0.75rem;

    color: var(--md-default-fg-color);
    font-size: 0.9rem;
    text-decoration: none;

    transition:
        border-color 160ms ease,
        color 160ms ease,
        transform 160ms ease;
}

.profile-social__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.profile-social__icon svg {
    display: block;
    width: 1.1rem;
    height: 1.1rem;
}

.profile-social:hover {
    border-color: var(--md-accent-fg-color);
    color: var(--md-accent-fg-color);
    transform: translateY(-2px);
}

.profile-social:focus-visible {
    outline: 2px solid var(--md-accent-fg-color);
    outline-offset: 3px;
}

/* =========================================
   Projects section
   ========================================= */

.projects-section {
    box-sizing: border-box;
    width: 100%;
    max-width: 58rem;
    margin: 0 auto 5rem;
    padding-inline: clamp(1rem, 3vw, 2rem);
}

.projects-header {
    margin-bottom: 1.75rem;
}

.projects-header h2 {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    letter-spacing: -0.035em;
}

/* =========================================
   Project grid and cards
   ========================================= */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 1.25rem;
}

.project-card {
    position: relative;
    isolation: isolate;

    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;

    border: 1px solid var(--md-default-fg-color--lightest);
    border-radius: 1rem;
    background: var(--md-default-bg-color);

    transition:
        transform 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease;
}

.project-card:hover {
    transform: translateY(-3px);
    border-color: var(--md-accent-fg-color);
    box-shadow: 0 8px 24px rgb(0 0 0 / 8%);
}

.project-card:focus-within {
    outline: 2px solid var(--md-accent-fg-color);
    outline-offset: 3px;
}

/* =========================================
   Project images
   ========================================= */

.project-card__image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--md-code-bg-color);
}

.project-card__image img {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    border-radius: 0;
    object-fit: cover;

    transition: transform 220ms ease;
}

.project-card:hover .project-card__image img {
    transform: scale(1.035);
}

/* =========================================
   Project icons
   ========================================= */

.project-card__icon {
    box-sizing: border-box;
    display: grid;
    place-items: center;
    flex: 0 0 auto;

    width: 3.25rem;
    height: 3.25rem;
    margin: 1.25rem 1.25rem 0;
    padding: 0.75rem;

    border-radius: 0.85rem;
    background: var(--md-code-bg-color);
}

/* Override the theme's default inline icon sizing. */

.md-typeset .project-card__icon .twemoji {
    display: grid;
    place-items: center;

    width: 1.75rem;
    height: 1.75rem;
    font-size: 1.75rem;
    line-height: 1;
}

.md-typeset .project-card__icon .twemoji svg {
    display: block;
    width: 1.75rem;
    height: 1.75rem;
    max-width: none;
}

/* =========================================
   Project card content
   ========================================= */

.project-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;

    padding: 1.25rem;
}

.project-card__body h3 {
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.4;
}

.project-card__title-link {
    color: var(--md-default-fg-color);
    text-decoration: none;
}

/* The main link covers the whole card. */

.project-card__title-link::after {
    position: absolute;
    z-index: 1;
    inset: 0;
    content: "";
}

.project-card__description {
    margin: 0.8rem 0 0;

    color: var(--md-default-fg-color--light);
    font-size: 0.9rem;
    line-height: 1.7;
}

/* =========================================
   Technology badges
   ========================================= */

.project-card__tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;

    margin-top: 0.8rem;
}

.project-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;

    padding: 0.3rem 0.45rem;
    border: 1px solid var(--md-default-fg-color--lightest);
    border-radius: 0.4rem;

    background: var(--md-code-bg-color);
    color: var(--md-default-fg-color--light);

    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.065em;
    line-height: 1.3;
    text-transform: uppercase;
    white-space: nowrap;
}

.project-tag__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;

    width: 0.85rem;
    height: 0.85rem;

    color: var(--md-primary-fg-color);
}

.md-typeset .project-tag__icon .twemoji {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;
}

.md-typeset .project-tag__icon svg {
    display: block;
    width: 0.85rem;
    height: 0.85rem;
    max-width: none;
}

/* =========================================
   Secondary project links
   ========================================= */

.project-card__links {
    position: relative;
    z-index: 2;

    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;

    margin: auto 0 0;
    padding: 1.25rem 0 0;
}

.project-card__links a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;

    padding: 0.4rem 0.6rem;
    border: 1px solid var(--md-default-fg-color--lightest);
    border-radius: 0.55rem;

    color: var(--md-default-fg-color);
    font-size: 0.78rem;
    line-height: 1.3;
    text-decoration: none;

    transition:
        border-color 160ms ease,
        color 160ms ease;
}

.project-card__links a:hover {
    border-color: var(--md-accent-fg-color);
    color: var(--md-accent-fg-color);
}

.project-card__link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.project-card__link-icon svg {
    display: block;
    width: 1rem;
    height: 1rem;
}

/* =========================================
   Responsive layout
   ========================================= */

@media (max-width: 900px) {
    .projects-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .profile-home {
        min-height: auto;
        padding-block: 3.5rem 4rem;
    }

    .profile-hero {
        grid-template-columns: minmax(0, 1fr);
        justify-items: center;
        gap: 2rem;
    }

    .profile-hero__avatar {
        width: min(45vw, 11rem);
    }

    .profile-hero__copy {
        text-align: center;
    }

    .profile-hero__description {
        margin-inline: auto;
    }

    .profile-socials {
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .projects-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 1rem;
    }

    .project-card__image {
        aspect-ratio: 16 / 8;
    }
}

/* =========================================
   Accessibility
   ========================================= */

@media (prefers-reduced-motion: reduce) {
    .profile-social,
    .project-card,
    .project-card__image img,
    .project-card__links a {
        transition: none;
    }

    .profile-social:hover,
    .project-card:hover,
    .project-card:hover .project-card__image img {
        transform: none;
    }
}
