@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&display=swap');
@import url(icons.css);
@import url(variables.css);

/* Анимация fadeIn для body */
@-webkit-keyframes fadeIn {
    0% { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeIn {
    0% { opacity: 0; }
    to { opacity: 1; }
}

/* Анимация scaleUp для изображения */
@-webkit-keyframes scaleUp {
    0% {
        -webkit-transform: scale(0.8);
        opacity: 0;
    }
    100% {
        -webkit-transform: scale(1);
        opacity: 1;
    }
}

@keyframes scaleUp {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Анимация spin для изображения */
@-webkit-keyframes spin {
    0% { -webkit-transform: rotate(0deg); }
    100% { -webkit-transform: rotate(360deg); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    -webkit-animation-name: fadeIn;
    animation-name: fadeIn;
    animation-duration: 1s;
    font-family: 'JetBrains Mono', monospace;
    height: 100%;
    overflow: hidden;
    transition: background-color 0.5s ease;
    opacity: 0;
}

#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 1.5s ease-out, transform 1.5s ease-out;
}

main {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    min-height: 100vh;
    padding: 0 1em;
    position: relative;
    z-index: 1;
}

img {
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 20px;
    border: var(--img-border);
    width: 150px;
    height: 150px;
    -webkit-animation: scaleUp 0.8s ease-out forwards, spin 5s linear infinite;
    animation: scaleUp 0.8s ease-out forwards, spin 5s linear infinite;
    opacity: 0;
    transition: border-color 0.5s ease;
}

#who {
    color: var(--text-color);
    font-size: clamp(25px, 8vw, 30px);
    margin-bottom: 10px;
    opacity: 0;
    transition: color 0.5s ease;
}

#footer {
    color: var(--text-color-light);
    font-size: clamp(12px, 8vw, 20px);
    margin-bottom: 20px;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    text-align: center;
    hyphens: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: color 0.5s ease;
}

button {
    background-color: var(--btn-bg);
    border: var(--btn-border);
    border-radius: 15px;
    padding: 10px 15px;
    font-size: clamp(14px, 2vw, 18px);
    color: var(--btn-color);
    cursor: pointer;
    font-family: 'JetBrains Mono', monospace;
    margin: 8px;
    display: inline-flex;
    align-items: center;
    min-width: 150px;
    max-width: 100%;
    box-sizing: border-box;
    text-align: left;
    opacity: 0;
    transition: background-color 0.5s ease, border-color 0.5s ease, color 0.5s ease;
}

button i.icon {
    margin-right: 8px;
    font-size: 1.1em;
}

a {
    text-decoration: none;
    color: var(--ahref-color);
    font-family: 'JetBrains Mono', monospace;
}

.flexbox {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
}

.icon {
    padding: 5px;
    font-style: normal;
    border: 2px dashed;
    color: var(--icon-color);
    cursor: pointer;
    transition: all 0.4s ease-in-out;
    border-radius: 50%;
    background-color: var(--icon-bg);
    margin-right: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 1em;
    transition: color 0.5s ease, background-color 0.5s ease;
}

::selection {
    background-color: var(--selection);
    transition: background-color 0.5s ease;
}

::-webkit-scrollbar {
    -webkit-appearance: none;
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-button {
    display: none;
}

::-webkit-scrollbar-thumb {
    background-color: var(--scroll-bar);
    transition: background-color 0.5s ease;
}

@media (max-width: 870px) {
    .flexbox {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 10px 0;
        justify-content: center;
        align-items: center;
        z-index: 2;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .flexbox::-webkit-scrollbar {
        display: none;
    }

    button {
        flex: 0 0 auto;
        min-width: 100px;
        font-size: clamp(12px, 2vw, 16px);
        padding: 8px 10px;
        margin: 6px;
        text-align: center;
        transform-origin: center;
        will-change: transform;
    }

    button i.icon {
        font-size: 1.3em;
    }
}