/* GLOBAL: shared values belong on :root, with the colon. */
:root {
    --black: #151515;
    --background: #ffffff;
    --accent: #d96cff;
    --accent-text: #76218f;
    --light-purple: #d96cff40;
    --dark-gray: #242424;
    --container: 69.375rem;
    --fontsize-body: 1.125rem;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Space Grotesk", system-ui, sans-serif;
    background-color: var(--background);
    color: var(--black);
    font-size: var(--fontsize-body);
    line-height: 1.56;
}

/* Keep readable margins on small screens and cap the width on large ones. */
.container {
    width: min(calc(100% - 2rem), var(--container));
    margin-inline: auto;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: var(--accent-text);
    text-underline-offset: 0.2em;
    text-decoration-thickness: 0.1em;
    overflow-wrap: anywhere;
    transition: color 200ms ease-in-out, background-color 200ms ease-in-out;
}

a:hover {
    color: var(--black);
    text-decoration: underline;
}

/* Keyboard users need to see which link is selected. */
:focus-visible {
    outline: 3px solid var(--accent-text);
    outline-offset: 5px;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: 1rem;
    z-index: 10;
    padding: 0.75rem 1rem;
    background: var(--background);
    color: var(--black);
    border: 2px solid var(--accent-text);
    transform: translateY(-200%);
}

.skip-link:focus {
    transform: translateY(0);
}

main:focus {
    outline: none;
}

section {
    scroll-margin-top: 2rem;
}

h1, h2, p {
    margin: 0;
}

h1, h2 {
    line-height: 1.15;
    overflow-wrap: anywhere;
}

h1 {
    font-size: clamp(2rem, 1.5rem + 2.5vw, 3.5rem);
    margin-bottom: 1.25rem;
}

h2 {
    font-size: clamp(1.75rem, 1.5rem + 1vw, 2.5rem);
    margin-bottom: 1rem;
}

p {
    color: var(--dark-gray);
    max-width: 60ch;
}

/* HEADER */
.header__nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem 2rem;
    padding-block: 1.875rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    max-width: 100%;
}

.header__nav nav {
    max-width: 100%;
}

.header__home {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem 1rem;
}

.header__home a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0.5rem 0.25rem;
    color: var(--black);
    font-size: 1.125rem;
    text-decoration: none;
}

.header__home a:hover {
    color: var(--accent-text);
    text-decoration: underline;
}

/* HERO: start with a single column, then expand when space permits. */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    gap: 2rem;
    padding-block: clamp(2rem, 5vw, 5rem);
    text-align: center;
}

.wrapper {
    min-width: 0;
}

.hero p {
    font-size: clamp(1.125rem, 1rem + 0.6vw, 1.5rem);
    margin-inline: auto;
}

.hero__avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: bottom;
}

h1 > span {
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 4px;
    text-underline-offset: 0.12em;
    text-decoration-skip-ink: auto;
}

.hero__links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.65rem 1rem;
    border: 2px solid var(--accent-text);
    border-radius: 0.375rem;
    color: var(--black);
    font-weight: 700;
    text-decoration: none;
}

.button:hover {
    background-color: var(--light-purple);
}


.content-section {
    padding-block: 3rem;
    border-top: 1px solid #dedede;
}

.content-section > p {
    margin-bottom: 1rem;
}

.footer {
    padding-block: 2rem;
    border-top: 1px solid #dedede;
    font-size: 1rem;
}

@media (min-width: 48rem) {
    .hero {
        grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
        gap: clamp(2rem, 4vw, 4rem);
        text-align: left;
    }

    .hero__links {
        justify-content: flex-start;
    }
}

@media (max-width: 47.999rem) {
    .header__nav {
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    a {
        transition: none;
    }
}

/* Present the portrait without its excess transparent space above the head. */
.hero__portrait {
    width: min(100%, 20rem);
    aspect-ratio: 433 / 415;
    overflow: hidden;
    justify-self: center;
}

.hero .hero__eyebrow {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--accent-text);
    margin-bottom: 1rem;
}

.hero__intro {
    max-width: 48ch;
}

.hero__credentials {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1rem;
    margin: 1.5rem 0 0;
    padding: 0;
    list-style: none;
    color: var(--dark-gray);
    font-size: 0.9375rem;
    font-weight: 500;
}

.hero__credentials li {
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    padding: 0.25rem 0.625rem;
    border: 1px solid #dedede;
    border-radius: 0.25rem;
}

.button--primary {
    color: #ffffff;
    background: var(--accent-text);
}

.button--primary:hover {
    color: #ffffff;
    background: var(--black);
}

.button--secondary {
    border-color: #767676;
}

@media (min-width: 48rem) {
    .hero__portrait {
        width: min(100%, 25rem);
    }

    .hero__credentials {
        justify-content: flex-start;
    }
}


/* Keep the introduction compact and readable across screen sizes. */
.hero .hero__intro {
    font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
    line-height: 1.6;
}

/* PROJECT SHOWCASE */
.projects__intro {
    font-size: 1rem;
}

.projects__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.project-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid #dedede;
    border-radius: 0.75rem;
    background: var(--background);
}

.project-card__image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    background-color: #f6f2f8;
    border-radius: 0.7rem 0.7rem 0 0;
}

.project-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 1rem;
    padding: clamp(1.25rem, 2vw, 1.75rem);
}

.project-card .project-card__category {
    color: var(--accent-text);
    font-size: 0.8125rem;
    font-weight: 600;
}

.project-card h3 {
    margin: 0;
    font-size: 1.375rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.project-card__body > p {
    font-size: 1rem;
}

.project-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.project-card__tags li {
    max-width: 100%;
    overflow-wrap: anywhere;
    padding: 0.25rem 0.625rem;
    border-radius: 0.25rem;
    background: #f6f2f8;
    color: var(--dark-gray);
    font-size: 0.8125rem;
}

.project-card__link {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 0.5rem;
    min-height: 44px;
    margin-top: auto;
    font-size: 1rem;
    font-weight: 600;
}

@media (min-width: 48rem) {
    .projects__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* CONTACT */
.contact__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
}

.contact__intro, .contact__form {
    min-width: 0;
}

.contact__intro > p {
    font-size: 1rem;
    max-width: 40ch;
}

.contact__links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1.5rem 0 0;
    padding: 0;
    list-style: none;
}

.contact__links a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    font-size: 1rem;
    font-weight: 600;
}

.contact__form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: clamp(1.25rem, 2vw, 1.75rem);
    border: 1px solid #dedede;
    border-radius: 0.75rem;
}

.contact__form h3 {
    margin: 0 0 0.25rem;
    font-size: 1.375rem;
    line-height: 1.25;
}

.contact__field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.contact__field label {
    font-size: 0.9375rem;
    font-weight: 500;
}

.contact__required {
    color: #555555;
    font-size: 0.8125rem;
    font-weight: 400;
}

.contact__field input, .contact__field textarea {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 0.75rem;
    border: 1px solid #767676;
    border-radius: 0.375rem;
    background: var(--background);
    color: var(--black);
    font: inherit;
    font-size: 1rem;
    line-height: 1.5;
}

.contact__field textarea {
    resize: vertical;
}

.contact__form .contact__privacy {
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #555555;
}

.contact__form button {
    align-self: flex-start;
    max-width: 100%;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 200ms ease-in-out;
}

.contact__honeypot {
    display: none;
}

@media (min-width: 48rem) {
    .contact__grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
        gap: 3rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .contact__form button {
        transition: none;
    }
}

/* FOOTER CREDITS */
.footer {
    text-align: center;
}

.footer p {
    max-width: none;
    margin-inline: auto;
}
