:root {
    --bg: #1f1f1f;
    --text: #ffffff;
    --link: #4a77e6;
    --accent: #1d7b3e;
    --border: #3c3c3c;
    --radius: 4px;
}
* {
    box-sizing: border-box;
    margin: 0;
}
body {
    font-family: 'Open Sans', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content:center;
}
main,
footer,
header,
.contact {
    width: 96%;
    margin: 0 auto;
    max-width: 1540px;
}

.contact {
    position:fixed;
    bottom: 24px;
    display: flex;
    justify-content: flex-end;
    gap: 4px;
    left: 0; 
    right: 0;
    margin: 0 auto;
}

h1 {
    font-size: 54px;
    font-weight: 700;
}
h2 {
    font-size: 28px;
    font-weight: 700;
}
p {
    font-size: 18px;
    max-width: 840px;
    line-height: 1.6;
    font-weight: 300;
}
a {
    color: var(--link);
    text-decoration: underline;
    text-underline-offset: 40%;
    text-decoration-thickness: 1px;
    text-decoration-color: color-mix(in srgb, var(--link) 30%, transparent);
    transition: 0.2s;
}
a:hover {
    color: var(--accent);
    text-decoration-color: color-mix(in srgb, var(--accent) 30%, transparent);
}
.btn {
    width: fit-content;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 16px 6px;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    font-size: 22px;
    letter-spacing: 3%;
    background-color: var(--accent);
    transition: 0.2s;
}
.btn:hover {
    background-color: color-mix(in srgb, var(--accent) 80%, transparent);
    color: var(--text);
}

.avatar {
    margin-top: 24px;
    position: relative;
}

.decor {
    color: var(--border);
    position: absolute;
    z-index: 1;
    border: 2px solid var(--border);
    top: -10px;
    left: 10px;
    width: 180px;
    height: 180px;
}

.avatar img {
    position: relative;
    width: 180px;
    height: 180px;
    background-color: var(--white);
    overflow: hidden; /* обрезаем лишнее */
    z-index: 2;
}

.avatar-mobile {
    display: none;
}

@media (max-width: 800px) {
    .avatar-desctop {
        display: none;
    }
    .avatar-mobile {
        display:block;
    }
}

/* =========================
LOYAUT
============================ */

main {
    display: flex;
    flex-direction: column;
    gap: 32px;
    padding: 32px 0;
    flex: 1;
}

.hero {
    display: flex;
    align-items: center;
    gap: 64px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

.about {
    display: flex;
    flex-direction: column;
    gap: 24px;
    flex-grow: 1;
}

.about p {
    max-width: 900px;
}

.portfolio,
.portfolio-container {
    display: flex;
    flex-direction: column;
    gap: 32px;
}
.portfolio-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 24px 16px;
}

.card {
    display: inline-flex;
    flex-direction: column;
    gap: 8px;
    min-width: 220px;
    cursor: pointer;
}
.card-image {
    height: 220px;
}
.card-image img {
    height: 100%;
    width: auto;
    display: block;
}
.card-title {
    height: 54px;
    width: 0;
    min-width: 100%;
    overflow: hidden;
}

footer {
    padding: 32px 300px 32px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
    border-top: 1px solid var(--border);
}
footer a,
.me {
    white-space: nowrap;
    color: #fff;
    text-decoration-color: color-mix(in srgb, var(--text) 30%, transparent);
}
footer .empty {
    height: 27px;
    width: 79px;
}

header {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.me {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    gap: 16px;
}
.me img {
    border-radius: 100%;
}

.project-loyaut {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.project-loyaut h1 {
    margin-bottom: 12px;
}
.project-loyaut h2 {
    margin-top: 32px;
    margin-bottom: 12px;
}
.project-loyaut img {
    width: 100%;
}

.project-photo {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 720px;
    margin-bottom: 16px;
}

.project-photo p {
    font-size: 16px;
}

.fill {
    max-width: none;
}