*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --textPrimary: #4e4b66;
    --textLink: #2e3a46;
    --textLinkHovered: #131415;
    --backgroundColor: white;
    --backgroundColor2: gainsboro;
    --borderRadius: 0;
    --paddingFix: 1rem;
}

body {
    background-color: var(--backgroundColor);
    display: flex;
    flex-direction: column;
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
    color: var(--textPrimary);
    align-items: center;
}

h1, .large-header { font-size: clamp(2em, 5vw, 2.5rem); }
h2 { font-size: clamp(1.5rem, 2.5vw, 1.85rem); }
h3, h4, h5, h6 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }
p, li { font-size: clamp(1rem, 1.5vw, 1.15rem); }
p { line-height: 1.5;}

a {
    color: var(--textPrimary);
    text-decoration: none;
    transition: color 0.3s cubic-bezier(0.075, 0.82, 0.165, 1);
    text-decoration: underline;
    &:hover {
        color: var(--textLinkHovered);
    }
}

main>section {
    padding-top: 3rem;
}

.container {
    max-width: 1280px;
    padding-inline: 16px; /* For mobile gutter */
}
.mtop-1 {
    margin-top: 1rem;
}

.btn {
    position: relative;
    z-index: 1;
    background-color: var(--textLink);
    color: white;
    font-weight: bolder;
    padding: min(0.8rem, 48px) 2rem;
    text-wrap: nowrap;
    border-radius: var(--borderRadius);
    overflow: hidden;
    font-size: 1rem;
    text-decoration: none;

    &::before {
        content: "";
        position: absolute;
        z-index: -1;
        top: 0;
        left: 0;
        opacity: 0;
        width: 0%;
        height: 100%;
        background: var(--textLinkHovered);
        
        transition: width 0.5s cubic-bezier(0.075, 0.82, 0.165, 1), opacity 0.8s cubic-bezier(0.075, 0.82, 0.165, 1);
    }
    &:hover::before{
        opacity: 1;
        width: 100%;
    }
    &:hover {
        color: white;
    }
}
.btn.transparent {
    background-color: unset;
    border: 1px solid var(--textLink);
    color: var(--textPrimary);
    transition: color 0.8s cubic-bezier(0.075, 0.82, 0.165, 1);

    &::before {
        background-color: var(--textLink);
    }
    &:hover {
        color: white;
    }
}

.topper {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;

    & > .title,
    & > .text {
        flex-grow: 1;
        flex-basis: 0;
        display: inline;
    }

    & > .title {
        align-self: center;
        flex-grow: 1;
    }

    & > .text {
        border-left: 1px solid var(--backgroundColor2);
        padding: 2rem;
    }
}
@media (max-width: 600px) {
    .topper {
        flex-direction: column;
        align-items: center;

        & > .text {
        border-left: 0;
        padding: 0;
    }
    }
     
}

/* 
---------------
    HEADER
---------------
*/
header {
    width: 100%;
    background-color: var(--backgroundColor);
    border-bottom: 1px solid var(--backgroundColor);
}
header > .container {
    margin-inline: auto;
}
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.navbar > ul {
    display: flex;
    flex-wrap: wrap;
}
.logo {
    font-weight: bold;
    font-size: clamp(1.5rem, 2.5vw, 1.65rem);
    text-align: center;
    white-space: nowrap;

    &::before {
        content: "<";
        display: inline-block;
        transition: all 0.3s ease;
    }
    &::after { 
        content: "/>";
        display: inline-block;
        transition: all 0.3s ease;
    }
    &:hover::before {
        transform: translateX(-4px);
    }
    &:hover::after {
        transform: translateX(4px);
    }
}
@media (max-width: 600px) {
    .navbar {
        margin-top: 0.95rem;
        display: block;
    }
    .logo {
        text-align: center;
        padding-bottom: 1rem;
    }
    .logo > a::after  {
        font-weight: 400;
    }
}
.navbar ul {
    display: flex;
    justify-content: center;
    list-style-type: none;
}
.navbar li{
    display: block;
    padding: 1.5rem;
    white-space: nowrap;
}
.navbar li.active {
    background-color: var(--textLink);
    & a {
        color: white;
    }
}
/*
---------------
    MAIN
---------------
*/
#about {
    position: relative;
}
#about .contact {
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid var(--backgroundColor2);
}
#about .content {
    display: flex;
}
@media (max-width: 620px) {
    #about .content {
        flex-direction: column;
    }
}
#about p {
    padding-block: 0.25rem;
}
#about p:first-child {
    padding-top: 0;
}
#about h1 {
    margin-bottom: 1rem;
}
@media (max-width: 620px) {
    #about h1 {
        text-align: center;
    }
}
#about img {
    aspect-ratio: auto 256 / 256;
    max-width: 256px;
    width: 100%;
    height: 100%;
    margin-right: 1rem;
    border-top-left-radius: var(--borderRadius);
}
@media (max-width: 620px) {
    #about img {
        max-width: 200px;
        float: none;
        display: block;
        margin: 0 auto 1rem;
    }
}
#about .copy {
    display: flex;
    flex-direction: column;
    align-items:  baseline;
}
#about .buttons {
    display: flex;
    gap: 1rem;
}
@media (max-width: 420px) {
    #about .buttons {
        display: flex;
        flex-direction: column;
    }
}
/* 
---------------
    PROJECTS
---------------
*/
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    list-style: none;
}
@media (max-width: 500px) {
    .cards {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 3rem;
    }
}
.card {
    display: flex;
    flex-direction: column;
}
.card .content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
    background-color: white;
    margin-top: 1.5rem;
    /* padding: 1rem; */

    & .title {
        margin-bottom: 0.5rem;
        flex-grow: 1;
    }

    & .techs {
        flex-grow: 1;
    }

    & > p {
        margin-top: 0.5rem;
        margin-bottom: 0.5rem;
        flex-grow: 2;
    }
}
.card img {
    aspect-ratio: auto 531 / 268;
    width: 100%;
    height: auto;
    object-fit: contain;
    overflow: hidden;
    display: block;
    margin: 0 auto;
}
.card .techs {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    list-style: none;
    gap: 8px;
}
.card .techs li {
    background-color: var(--textLink);
    color: white;
    /* border: 1px solid var(--textLink); */
    padding: 0.25rem 0.5rem;
}
.card .btn {
    margin-top: 1rem;
    width: fit-content;
    padding: 0.5rem 1rem;
    text-align: center;
    display: inline;
}
/* 
---------------
    FOOTER    
---------------
*/ 
footer {
    margin-top: 2rem;
    margin-bottom: 1rem;
}
footer::before {
    content: "";
    margin-bottom: 0.5rem;
    display: block;
    position: relative;
    border-top: 1px solid var(--backgroundColor2);
}