@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600&display=swap');

*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    border: none;
    outline: none;
    font-family: 'Poppins', sans-serif;
}

html{
    font-size: 62.5%;
}

body{
    width: 100%;
    height: 100vh;
    overflow-x: hidden;
    background-color: black;
    color: white;
}


header{
    margin-top: 20px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1rem 9%;
    background-color: transparent;
    filter: drop-shadow(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.logo{
    font-size: 3rem;
    color: #b74b4b;
    font-weight: 800;
    cursor: pointer;
    transition: 0.5s ease;
}

.logo:hover{
    transform: scale(1.1);
}

.theme-toggle {
    background: none;
    border: 2px solid #b74b4b;
    color: #b74b4b;
    font-size: 2rem;
    padding: 0.8rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 2rem;
    width: 5rem;
    height: 5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background-color: #b74b4b;
    color: black;
    transform: scale(1.1);
    box-shadow: 0 0 15px #b74b4b;
}

.theme-toggle i {
    transition: transform 0.3s ease;
}

.theme-toggle.active i {
    transform: rotate(180deg);
}

nav a{
    font-size: 1.8rem;
    color: white;
    margin-left: 4rem;
    font-weight: 500;
    transition: 0.3s ease;
    border-bottom: 3px solid transparent;
}

nav a:hover,
nav a.active{
    color: #b74b4b;
    border-bottom: 3px solid #b74b4b;
}

@media(max-width:995px){
    nav{
        position: absolute;
        display: none;
        top: 0;
        right: 0;
        width: 40%;
        border-left: 3px solid #b74b4b;
        border-bottom: 3px solid #b74b4b;
        border-bottom-left-radius: 2rem;
        padding: 1rem solid;
        background-color: #161616;
        border-top: 0.1rem solid rgba(0,0,0,0.1);
    }

    nav.active{
        display: block;
    }

    nav a{
        display: block;
        font-size: 2rem;
        margin: 3rem 0;
    }

    nav a:hover,
    nav a.active{
        padding: 1rem;
        border-radius: 0.5rem;
        border-bottom: 0.5rem solid #b74b4b;
    }

    .theme-toggle {
        margin-left: 1rem;
        width: 4rem;
        height: 4rem;
        font-size: 1.6rem;
    }
}

section{
    min-height: 100vh;
    padding: 5rem 9% 5rem;
}

.home{
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8rem;
    background-color: black;
}

.home .home-content h1{
    font-size: 6rem;
    font-weight: 700;
    line-height: 1.3;
}

span{
    color: #b74b4b;
}

.home-content h3{
    font-size: 4rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.home-content p{
    font-size: 1.6rem;
}

.home-img{
    border-radius: 50%;
}

.home-img img{
    border-color: #b74b4b;
    box-shadow: 0 7px 20px firebrick;
    position: relative;
    width: 32vw;
    border-radius: 50%;
    box-shadow: 0 0 25px solid #b74b4b;
    cursor: pointer;
    transition: 0.2s linear;
}

.home-img img:hover{
    font-size: 1.8rem;
    font-weight: 500;
}

.social-icons a{
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 4rem;
    height: 4rem;
    background-color: transparent;
    border: 0.2rem solid #b74b4b;
    font-size: 2rem;
    border-radius: 50%;
    margin: 3rem 1.5rem 3rem 0;
    transition: 0.3s ease;
    color: #b74b4b;
}

.social-icons a:hover{
    color: black;
    transform: scale(1.3) translateY(-5px);
    background-color: #b74b4b;
    box-shadow: 0  0 25px #b74b4b;
}

.btn{
    margin: 5px;
    display: inline-block;
    padding: 1rem 2.8rem;
    background-color: black;
    border-radius: 4rem;
    font-size: 1.6rem;
    color: #b74b4b;
    letter-spacing: 0.3rem;
    font-weight: 600;
    border: 2px solid #b74b4b;
    transition: 0.3s ease;
    cursor: pointer;
}

.btn:hover{
    transform: scale3d(1.03);
    background-color: #b74b4b;
    color: black;
    box-shadow: 0 0 25px #b74b4b;
}

.typing-text{
    font-size: 34px;
    font-weight: 600;
    min-width: 280px;
}

.typing-text span{
    position: relative;
}

.typing-text span::before{
    content: "software Developer";
    color: #b74b4b;
    animation: words 20s infinite;
}

.typing-text span::after{
    content: "";
    background-color: black;
    position: absolute;
    width: calc(100% + 8px);
    height: 100%;
    border-left: 3px solid black;
    right: -8;
    animation: cursor 0.6s infinite;
}

@keyframes cursor{
    to{
        border-left: 3px solid #b74b4b;
    }
}

@keyframes words{
    0%, 20%{
        content: "Веб Разработчик";
    }
    21%, 40%{
        content: "Разработчик";
    }
    41%, 60%{
        content: "Веб Дизайнер";
    }
    61%, 80%{
        content: "Ютубер";
    }
    81%, 100%{
        content: "Сценарист";
    }
}

@media (max-width: 1000px){
    .home{
        gap: 4rem;
    }
}

@media(max-width:995px){
    .home{
        flex-direction: column;
        margin: 5rem 4rem;
    }

    .home .home-content h3{
        font-size: 2.5rem;
    }

    .home-content h1{
        font-size: 5rem;
    }

    .home-img img{
        width: 70vw;
        margin-top: 4rem;
    }
}


/* стили для выпадающего списка */

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-btn {
    font-size: 1.8rem;
    color: white;
    margin-left: 4rem;
    font-weight: 500;
    transition: 0.3s ease;
    border-bottom: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-btn:hover,
.dropdown:hover .dropdown-btn {
    color: #b74b4b;
    border-bottom: 3px solid #b74b4b;
}

.dropdown-btn i {
    font-size: 1.4rem;
    transition: transform 0.3s ease;
}

.dropdown:hover .dropdown-btn i {
    transform: rotate(180deg);
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background-color: #161616;
    border: 2px solid #b74b4b;
    border-radius: 0.5rem;
    box-shadow: 0 8px 16px rgba(183, 75, 75, 0.3);
    z-index: 1000;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: white;
    padding: 1rem 1.5rem;
    text-decoration: none;
    display: block;
    font-size: 1.6rem;
    font-weight: 400;
    transition: 0.3s ease;
    margin: 0;
    border-bottom: none;
}

.dropdown-content a:hover {
    background-color: #b74b4b;
    color: black;
    padding-left: 2rem;
}
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.skills-grid {
    font-size: large;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.skill-card {
    padding: 100px;
    border-radius: 15px;
    background: rgba(255,255, 255, 0.05);
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255, 255, 0.1);
    backdrop-filter: blur(5px);
}

.skill-card:hover {
    transform: translateY(-10px);
    border-color: #b74b4b;
    box-shadow: 0 10px 30px firebrick;
}

.skill-card i {
    font-size: 50px;
    color: #b74b4b;
    margin-bottom: 1rem;
}


footer {
    background: #161616;
    padding: 3rem 5%;
    text-align: center;
    border-top: 1px solid rgba(255,255, 255, 0.1);
}

/* Для мобильной версии */

@media(max-width:995px){
    .dropdown-content{
        position: static;
        display: block;
        background-color: transparent;
        border: none;
        box-shadow: none;
        padding-left: 2rem;
        margin-top: 1rem;
    }
    .dropdown-content a{
        font-size: 1.8rem;
        margin: 1rem 0;
        padding: 0.5rem 1rem; 
    }
}
html {
    scroll-behavior: smooth;
}

/* Стили для секции About */
.about {
    min-height: 100vh;
    padding: 5rem 9% 5rem;
    background-color: black;
    display: flex;
    justify-content: center;
    align-items: center;
}

.about-content {
    max-width: 800px;
    text-align: center;
}

.about-content h2 {
    font-size: 4rem;
    color: #b74b4b;
    margin-bottom: 3rem;
}

.about-content p {
    font-size: 1.8rem;
    color: white;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.about-details {
    display: flex;
    justify-content: space-around;
    margin-top: 4rem;
    gap: 2rem;
}

.detail-item {
    flex: 1;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: 0.3s ease;
}

.detail-item:hover {
    border-color: #b74b4b;
    transform: translateY(-5px);
}

.detail-item h3 {
    font-size: 2rem;
    color: #b74b4b;
    margin-bottom: 1rem;
}

.detail-item p {
    font-size: 1.6rem;
    color: white;
    margin: 0;
}

/* Стили для секции Contact */
.contact {
    min-height: 100vh;
    padding: 5rem 9% 5rem;
    background-color: black;
    display: flex;
    justify-content: center;
    align-items: center;
}

.contact-content {
    max-width: 900px;
    text-align: center;
}

.contact-content h2 {
    font-size: 4rem;
    color: #b74b4b;
    margin-bottom: 2rem;
}

.contact-content p {
    font-size: 1.8rem;
    color: white;
    margin-bottom: 4rem;
    line-height: 1.6;
}

.contact-info {
    display: flex;
    justify-content: space-around;
    margin-bottom: 4rem;
    gap: 2rem;
}

.contact-item {
    flex: 1;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: 0.3s ease;
}

.contact-item:hover {
    border-color: #b74b4b;
    transform: translateY(-5px);
}

.contact-item i {
    font-size: 3rem;
    color: #b74b4b;
    margin-bottom: 1rem;
}

.contact-item h3 {
    font-size: 2rem;
    color: #b74b4b;
    margin-bottom: 1rem;
}

.contact-item p {
    font-size: 1.6rem;
    color: white;
    margin: 0;
}

.contact-item a {
    color: #b74b4b;
    text-decoration: none;
    transition: 0.3s ease;
}

.contact-item a:hover {
    color: white;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.contact-form input,
.contact-form textarea {
    padding: 1.5rem;
    border: 2px solid #b74b4b;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 1.6rem;
    font-family: 'Poppins', sans-serif;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.contact-form textarea {
    min-height: 150px;
    resize: vertical;
}

.contact-form button {
    align-self: center;
}

/* Стили для валидации формы */
.error-field {
    border-color: #ff6b6b !important;
    background-color: rgba(255, 107, 107, 0.1) !important;
}

.error-field::placeholder {
    color: rgba(255, 107, 107, 0.7) !important;
}

/* Светлая тема */
body.light-theme {
    background-color: white;
    color: #333;
}

body.light-theme header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

body.light-theme .logo {
    color: #b74b4b;
}

body.light-theme nav a {
    color: #333;
}

body.light-theme nav a:hover,
body.light-theme nav a.active {
    color: #b74b4b;
    border-bottom-color: #b74b4b;
}

body.light-theme .theme-toggle {
    border-color: #b74b4b;
    color: #b74b4b;
}

body.light-theme .theme-toggle:hover {
    background-color: #b74b4b;
    color: white;
}

body.light-theme .home {
    background-color: white;
}

body.light-theme .home .home-content h1 {
    color: #333;
}

body.light-theme span {
    color: #b74b4b;
}

body.light-theme .home-content p {
    color: #666;
}

body.light-theme .social-icons a {
    border-color: #b74b4b;
    color: #b74b4b;
}

body.light-theme .social-icons a:hover {
    background-color: #b74b4b;
    color: white;
}

body.light-theme .btn {
    background-color: white;
    color: #b74b4b;
    border-color: #b74b4b;
}

body.light-theme .btn:hover {
    background-color: #b74b4b;
    color: white;
}

body.light-theme .skills {
    background-color: white;
}

body.light-theme .about {
    background-color: white;
}

body.light-theme .about-content h2 {
    color: #b74b4b;
}

body.light-theme .about-content p {
    color: #333;
}

body.light-theme .about-details {
    background-color: white;
}

body.light-theme .detail-item {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .detail-item h3 {
    color: #b74b4b;
}

body.light-theme .detail-item p {
    color: #333;
}

body.light-theme .contact {
    background-color: white;
}

body.light-theme .contact-content h2 {
    color: #b74b4b;
}

body.light-theme .contact-content p {
    color: #333;
}

body.light-theme .contact-info {
    background-color: white;
}

body.light-theme .contact-item {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .contact-item i {
    color: #b74b4b;
}

body.light-theme .contact-item h3 {
    color: #b74b4b;
}

body.light-theme .contact-item p {
    color: #333;
}

body.light-theme .contact-item a {
    color: #b74b4b;
}

body.light-theme .contact-item a:hover {
    color: #333;
}

body.light-theme .contact-form input,
body.light-theme .contact-form textarea {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
    border-color: #b74b4b;
}

body.light-theme .contact-form input::placeholder,
body.light-theme .contact-form textarea::placeholder {
    color: rgba(0, 0, 0, 0.5);
}

body.light-theme footer {
    background: #f5f5f5;
    border-top-color: rgba(0, 0, 0, 0.1);
}

body.light-theme footer p {
    color: #333;
}

/* Светлая тема для мобильной навигации */
body.light-theme nav {
    background-color: rgba(255, 255, 255, 0.95);
    border-left-color: #b74b4b;
    border-bottom-color: #b74b4b;
}

body.light-theme nav a {
    color: #333;
}

body.light-theme nav a:hover,
body.light-theme nav a.active {
    background-color: rgba(183, 75, 75, 0.1);
    border-bottom-color: #b74b4b;
}

body.light-theme .hamburger span {
    background-color: #b74b4b;
}

/* Медиа-запросы для мобильных устройств */
@media (max-width: 995px) {
    .hamburger {
        display: flex;
        flex-direction: column;
        cursor: pointer;
        padding: 5px;
        background: none;
        border: none;
        outline: none;
        z-index: 101;
    }

    .hamburger span {
        width: 25px;
        height: 3px;
        background-color: #b74b4b;
        margin: 2px 0;
        transition: 0.3s;
        border-radius: 2px;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }

    nav#navbar {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background-color: #161616;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.3s ease;
        z-index: 100;
    }

    nav#navbar.active {
        right: 0;
    }

    nav#navbar a {
        font-size: 2.5rem;
        margin: 2rem 0;
        text-align: center;
    }

    /* Обновляем стили для dropdown в мобильном меню */
    .dropdown-content {
        position: static;
        display: none; /* Скрываем по умолчанию */
        background-color: transparent;
        border: none;
        box-shadow: none;
        padding-left: 2rem;
        margin-top: 1rem;
        opacity: 0;
        max-height: 0;
        overflow: hidden;
        transition: opacity 0.3s ease, max-height 0.3s ease;
    }

    .dropdown-content.mobile-active {
        display: block;
        opacity: 1;
        max-height: 300px; /* Достаточно для контента */
    }

    /* Добавляем hover эффект для мобильного меню */
    @media (max-width: 995px) {
        .dropdown:hover .dropdown-content {
            display: block;
            opacity: 1;
            max-height: 300px;
        }
    }

    .dropdown-content a {
        font-size: 1.8rem;
        margin: 1rem 0;
        padding: 0.5rem 1rem;
    }

    .about-details,
    .contact-info {
        flex-direction: column;
        gap: 2rem;
    }

    .detail-item,
    .contact-item {
        padding: 1.5rem;
    }

    .contact-form {
        gap: 1.5rem;
    }
}