:root {
    /* Dark Colors */
    --dark-color: rgb(25, 27, 28);
    --dark-color-background: rgb(18, 20, 21);
    --cube-dark-background: rgba(18, 20, 21, 0.7);
    --gray-color: rgb(142, 142, 142);

    --light-color: rgb(240, 240, 240);
    --light-color-filter: brightness(0) saturate(100%) invert(100%) sepia(0%) saturate(7382%) hue-rotate(287deg) brightness(119%) contrast(109%);

    /* Primary Colors */
    --primary-color: rgba(228, 66, 66, 1);
    --primary-color-opacity: rgba(228, 66, 66, .2);
    --primary-color-opacity-full: rgba(228, 66, 66, .1);
    --primary-filter: brightness(0) saturate(100%) invert(42%) sepia(89%) saturate(2053%) hue-rotate(330deg) brightness(87%) contrast(106%);

    /* Layout */
    --max-width: 1440px;
    --max-width-small: 1200px;

    /* Fonts */
    --font-family: "Montserrat", serif;
    --font-size-menu: 15px;
    --font-size-subtitle: 32px;
    --font-size-modal-title: 24px;
    --font-size-title: 36px;
    --font-size-about-title: 72px;
    --font-size-step-number: 72px;
    --font-size-large: 48px;
    --font-size-medium: 18px;
    --font-size-small: 12px;
    --font-opacity: 0.5;

    /* Animation */
    --animation-duration-small: 0.6s;
    --animation-duration: 1s;
    --animation-duration-long: 5s;

    /*  Border  */
    --border-radius: 15px;
}

.light {
    --dark-color: rgb(240, 240, 240);
    --dark-color-background: #e8e8e8;
    --cube-dark-background: rgba(232, 232, 232, 0.7);

    --gray-color: rgb(100, 100, 100);

    --light-color: rgb(25, 27, 28);
    --light-color-filter: brightness(0) saturate(100%) invert(10%) sepia(4%) saturate(684%) hue-rotate(156deg) brightness(102%) contrast(99%);
}


body {
    width: 100vw;
    margin: 0;
    padding: 0;
    overflow-x: hidden;

    font-family: var(--font-family), serif;

    background: var(--dark-color-background);
}

main {
    width: 100%;
    min-height: auto;
}

/* === Заголовок секции === */
.section__heading {
    width: fit-content;
    margin: 0 auto;
    padding: 0 24px;

    display: flex;
    flex-flow: column;
}

.section__title {
    margin: 0;
    padding: 0;

    color: var(--light-color);
    text-align: center;
    font-size: var(--font-size-title);
    font-weight: 900;
}

.section__heading-line {
    width: 100%;
    margin: -5px 0 0;
    padding: 0;

    position: relative;
}

/* Линия под заголовком */
.section__heading-line::before {
    content: '';
    width: 100%;
    height: 2px;

    position: absolute;
    top: 10px;
    left: 0;
    z-index: -1;

    background: var(--gray-color);
}

.section__subtitle {
    width: fit-content;
    margin: 0 auto;
    padding: 0 5px;

    color: var(--gray-color);
    font-size: var(--font-size-menu);
    text-align: center;

    background: var(--dark-color-background);
}

/* Кнопка по умолчанию скрыта */
.toTop {
    position: fixed;
    right: 30px;
    bottom: 30px;

    width: 55px;
    height: 55px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: none;
    border: none;
    outline: none;

    color: var(--dark-color);
    font-size: 22px;
    opacity: 0;

    pointer-events: none; /* нельзя кликнуть, пока не видно */
    cursor: pointer;
    transition-duration: var(--animation-duration);
}

.toTop__circle {
    width: 100%;
    height: 100%;
}

.toTop__arrow {
    position: absolute;
    margin: 0 auto;

    left: 0;
    right: 0;

    color: var(--light-color);

    transition-duration: var(--animation-duration);
}

.toTop__circle--empty {
    stroke: var(--dark-color);
}

.toTop__circle--fill {
    stroke: var(--primary-color);
}

/* когда активна */
.toTop.toTop--show {
    opacity: 1;
    pointer-events: auto;
}

/* ховер‑эффект */
.toTop:hover .toTop__arrow {
    color: var(--primary-color);
}

.theme {
    width: 40px;
    height: 40px;
    padding: 0;

    position: fixed;
    left: 30px;
    bottom: 30px;

    background: none;
    outline: none;
    border: none;
}

.theme__icon {
    width: 100%;
    height: 100%;

    color: var(--gray-color);
    opacity: 0;

    cursor: pointer;
    transition-duration: var(--animation-duration);

    animation: 1s linear theme__icon--anim forwards;
}

@keyframes theme__icon--anim {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.theme:hover .theme__icon {
    color: var(--light-color);

    transform: rotate(720deg) scale(1.1);
}

.theme__icon--moon {
    display: none;
}

.theme--light .theme__icon--sun {
    display: none;
}

.theme--light .theme__icon--moon {
    display: block;
}

.theme__wall {
    width: 100vw;
    height: 100vh;

    position: fixed;
    top: -100vh;
    left: 0;
    z-index: 110;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--dark-color);

    transition-duration: var(--animation-duration);
}

.theme__wall-image {
    width: 100px;

    color: var(--light-color);

    transition-duration: var(--animation-duration);
    animation: 10s linear theme__wall-image--anim infinite;
}

@keyframes theme__wall-image--anim {
    0% {
        transform: rotate(0);
    }
    50% {
        transform: rotate(720deg);
    }
    100% {
        transform: rotate(0);
    }
}

.theme__wall--open {
    top: 0;
}

/* АДАПТАЦИЯ после 1400 */
@media (max-width: 1400px) {
    :root {
        --font-size-large: 40px;
    }
}

/* АДАПТАЦИЯ после 1200 */
@media (max-width: 1200px) {
    :root {
        --font-size-large: 35px;
    }
}

/* АДАПТАЦИЯ после 1100 */
@media (max-width: 1100px) {
    :root {
        --font-size-large: 30px;
    }
}

/* АДАПТАЦИЯ после 800 */
@media (max-width: 800px) {
    :root {
        --font-size-about-title: 60px;
    }

    body {
        padding-top: 80px;
    }
}