:root {
    color-scheme: dark;
    --color-background: #000;
    --color-green: rgb(0, 255, 64);
    --color-green-hover: rgb(0, 255, 166);
}

* {
    box-sizing: border-box;
    margin: 0;
    font-family: "Press Start 2P", system-ui;
    font-weight: 400;
    font-style: normal;
}

body {
    min-height: 100vh;
    background-color: var(--color-background);
    color: var(--color-green);
}

header {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 20px;
    margin: 25px;
}

header .logo {
    font-size: 24px;
    font-weight: 700;
    white-space: nowrap;
}

header .header_buttons {
    display: flex;
    flex: 1;
    flex-direction: row;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 4px;
}

header .header_buttons a,
main .first_block p a {
    display: inline-block;
    position: relative;
    padding: 10px;
    border-radius: 25px;
    color: inherit;
    text-decoration: none;
    transition: transform 0.2s ease, color 0.2s ease;
}

header .header_buttons a:hover,
main .first_block p a:hover {
    transform: scale(1.1);
    color: var(--color-green-hover);
}

.border-animation {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    overflow: visible;
    pointer-events: none;
}

.border-animation rect {
    fill: none;
    stroke: var(--color-green);
    stroke-width: 3;
    stroke-dasharray: 6 4;
    vector-effect: non-scaling-stroke;
}

header .header_buttons a:hover .border-animation rect,
main .first_block p a:hover .border-animation rect {
    animation: move-border-dashes 0.8s linear infinite;
}

@keyframes move-border-dashes {
    to {
        stroke-dashoffset: -20;
    }
}

main {
    display: flex;
    flex-direction: column;
    margin: 25px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.contacts {
    padding: 50px;
}

main .about_me .contacts img {
    width: min(300px, 100%);
    height: auto;
}

@media (max-width: 900px) {
    header {
        align-items: flex-start;
        flex-direction: column;
    }

    header .header_buttons {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 600px) {
    header {
        gap: 12px;
        margin: 16px;
    }

    header .logo {
        font-size: 18px;
    }

    header .header_buttons {
        gap: 2px;
    }

    header .header_buttons a {
        padding: 8px;
        font-size: 10px;
    }

    main {
        margin: 16px;
    }

    .contacts_block {
        align-items: stretch;
    }

    .contacts {
        width: 100%;
        min-width: 0;
        padding: 16px;
        overflow-wrap: anywhere;
    }

    .contacts ul {
        padding-left: 20px;
    }

    .contacts li {
        overflow-wrap: anywhere;
    }
}
