:root {
    --bg-light: #F5F6F7;
    --bg-dark: #1B1D23;
    --text-light: #F5F6F7;
    --text-dark: #1B1D23;
    --text-disabled: #ccc;
    --accent: #FFB84C;
    --accent-hover: #FFD477;
}

body,
html {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    transition: color 0.4s, background 0.4s;
}

body.dark {
    color: var(--text-light);
}

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: var(--bg-dark);
    transition: background 0.4s;
}

body:not(.dark) #bg-canvas {
    background: var(--bg-light);
}

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

#preloader .loader {
    display: flex;
    gap: 12px;
}

#preloader .dot {
    width: 14px;
    height: 14px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 1s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(255, 184, 76, 0.6);
}

#preloader .dot:nth-child(1) {
    animation-delay: 0s;
}

#preloader .dot:nth-child(2) {
    animation-delay: 0.2s;
}

#preloader .dot:nth-child(3) {
    animation-delay: 0.4s;
}

#preloader .dot:nth-child(4) {
    animation-delay: 0.6s;
}

#preloader .dot:nth-child(5) {
    animation-delay: 0.8s;
}

@keyframes pulse {

    0%,
    100% {
        transform: translateY(0) scale(0.6);
        opacity: 0.6;
    }

    50% {
        transform: translateY(-20px) scale(1);
        opacity: 1;
    }
}

#preloader.hide {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.wrapper {
    display: block;
    padding: 2em 0;
    min-height: 100vh;
}

.center-block {
    background: rgba(27, 29, 35, 0.85);
    position: relative;
    padding: 2em;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(255, 184, 76, 0.3);
    max-width: 1000px;
    min-height: 50vh;
    width: 90%;
    margin: 5vh auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: background 0.4s, box-shadow 0.4s, color 0.4s, height 0.5s ease;
}

body:not(.dark) .center-block {
    background: rgba(245, 246, 247, 0.85);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    color: var(--text-dark);
}

.tabs {
    display: flex;
    justify-content: center;
    gap: 1.2em;
    margin-bottom: 2.5em;
    flex-wrap: wrap;
}

.tab-btn {
    background: var(--accent);
    color: var(--text-dark);
    border: none;
    border-radius: 2em;
    padding: 0.7em 1.4em;
    display: flex;
    align-items: center;
    gap: 0.6em;
    font-size: 1.0em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    transform: rotate(0deg);
}


.tab-btn img {
    width: 22px;
    height: 22px;
    transition: transform 0.3s ease;
}

.tab-btn:hover img {
    transform: scale(1.1);
}

.tab-btn.active {
    background: var(--accent-hover);
    background: var(--accent-hover);
    transform: rotate(-5deg) scale(1.05);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.tab-btn:hover {
    transform: scale(1.1) rotate(-2deg);
    background: var(--accent-hover);
    box-shadow: 0 0 15px rgba(255, 184, 76, 0.6);
}

.controls {
    position: absolute;
    top: 1em;
    right: 1em;
    display: flex;
    gap: 0.5em;
}

.controls button {
    width: 35px;
    height: 35px;
    border-radius: 100%;
    border: none;
    background: var(--accent);
    color: var(--text-dark);
    font-size: 1em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.controls button img {
    width: 22px;
    height: 22px;
}

.controls button:hover {
    transform: scale(1.1) rotate(-10deg);
    background: var(--accent-hover);
    box-shadow: 0 0 15px rgba(255, 184, 76, 0.6);
}

.lang-selector {
    position: relative;
    display: inline-block;
}

.lang-toggle {
    padding: 8px;
    border: none;
    border-radius: 12px;
    background: #00adb5;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    width: 50px;
    height: 50px;
}

.lang-toggle img {
    width: 24px;
    height: 24px;
}

.lang-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    flex-direction: column;
    background: var(--accent);
    border-radius: 12px;
    padding: 0;
    list-style: none;
    box-shadow: 0 0 15px rgba(255, 184, 76, 0.6);
    z-index: 100;
    overflow: hidden;
    display: none;
    opacity: 0;
    transform: translateY(0);
    transition: opacity 0.3s ease;
}

.lang-menu.show {
    display: flex;
    opacity: 1;
}


.lang-menu li {
    cursor: pointer;
    padding: 8px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.lang-menu li:hover {
    transform: scale(1.1) rotate(-10deg);
    /*background: var(--accent-hover);*/
}

.lang-menu li img {
    width: 24px;
    height: 24px;
}


.tab-wrapper {
    width: 100%;
    transition: height 0.5s ease;
}

.tab-content {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.tab-content.active {
    display: block;
    opacity: 1;
}

.about-section {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 2em;
}

.profile-container {
    position: relative;
    display: inline-block;
}

.profile-photo {
    width: 240px;
    height: 240px;
    border-radius: 25px;
    object-fit: cover;
    border: 4px solid var(--accent);
    transition: 0.3s;
}

.profile-photo:hover {
    transform: rotate(-2deg) scale(1.05);
    box-shadow: 0 0 15px rgba(255, 184, 76, 0.5);
}


.thought-bubble {
    position: absolute;
    top: -10px;
    left: -50px;
    background: var(--bg-light);
    color: var(--text-dark);
    padding: 8px 12px;
    border-radius: 16px;
    font-size: 0.9em;
    box-shadow: 0 0 10px rgba(255, 184, 76, 0.5);
    white-space: nowrap;
    transform: rotate(-5deg);
    animation: floatBubble 3s ease-in-out infinite;
}

body.dark .thought-bubble {
    background: var(--bg-dark);
    color: var(--text-light);
}

@keyframes floatBubble {

    0%,
    100% {
        transform: translateY(0) rotate(-5deg);
    }

    50% {
        transform: translateY(-5px) rotate(-5deg);
    }
}

.thought-bubble::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 12px;
    width: 8px;
    height: 8px;
    background: inherit;
    border-radius: 50%;
    box-shadow: -6px 6px 0 0 inherit;
}


.about-text {
    max-width: 400px;
    text-align: left;
}

.highlight-projects {
    margin-top: 2.5em;
    text-align: center;
}

.highlight-projects h3 {
    font-size: 1.4em;
    margin-bottom: 1em;
    color: var(--accent);
}

.mini-projects {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5em;
}

.mini-project {
    background: var(--card-bg);
    border-radius: 1em;
    overflow: hidden;
    width: 280px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

.mini-project:hover {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

.mini-project img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.mini-info {
    padding: 0.8em 1em;
}

.mini-info h4 {
    margin: 0;
    font-size: 1.1em;
}

.mini-info p {
    margin-top: 0.3em;
    font-size: 0.9em;
    opacity: 0.85;
}


.socials {
    display: flex;
    gap: 1em;
    margin-top: 1em;
}

.social-btn {
    display: flex;
    align-items: center;
    gap: 0.4em;
    background: var(--accent);
    color: var(--text-dark);
    padding: 0.5em 1em;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: 0.3s;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.social-btn:hover {
    transform: scale(1.05);
    background: var(--accent-hover);
    box-shadow: 0 0 15px rgba(255, 184, 76, 0.5);
}

.social-btn:hover {
    transform: scale(1.1) rotate(2deg);
    background: var(--accent-hover);
    box-shadow: 0 0 15px rgba(255, 184, 76, 0.6);
}

.social-btn img {
    width: 18px;
    height: 18px;
}

.project-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2em;
    padding: 15px;
    justify-content: center;
}

.project-card {
    flex: 1 1 250px;
    max-width: 250px;
    border: 2px solid var(--accent);
    border-radius: 12px;
    overflow: hidden;
    transition: 0.3s;
    background: transparent;
    box-sizing: border-box;

    display: flex;
    flex-direction: column;
}

.project-card.highlight {
    box-shadow: 0 0 15px var(--accent);
    transform: scale(1.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-3px) scale(1.02);
    border-color: var(--accent-hover);
    box-shadow: 0 8px 20px rgba(255, 184, 76, 0.3);
}


.project-card img {
    width: auto;
    object-fit: cover;
    border-bottom: 0px solid var(--accent);
}

.project-info {
    padding: 0.5em 1em;
    text-align: left;

    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-info h3 {
    margin: 0.3em 0;
    font-size: 1.1em;
}

.project-info p {
    font-size: 0.9em;
    margin: 0.3em 0;
    color: inherit;
    opacity: 0.9;
}

.project-link {
    text-decoration: none;
    color: var(--accent);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    font-size: 0.9em;
}

.project-link img {
    width: 16px;
    height: 16px;
}

.project-btn {
    display: flex;
    align-items: center;
    gap: 0.2em;
    background: var(--accent);
    color: var(--text-dark);
    padding: 0.5em 1em;
    border-radius: 10px;
    font-size: small;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: 0.3s;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.project-btn img {
    width: 15px;
    height: 15px;
}

.project-btn:hover {
    transform: none;
    background: var(--accent-hover);
    box-shadow: 0 0 15px rgba(255, 184, 76, 0.6);
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5em;
    margin-top: auto;
}

/*.button-row button {
    flex: 0 1 auto;     
    min-width: 60px;      
  }*/


.contact-socials {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}


.contact-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 750px;
    margin: 20px auto 0;
    padding: 0;
}

.contact-form input,
.contact-form textarea {
    background: transparent;
    color: var(--text-light);
    border: 2px solid var(--accent);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

body:not(.dark) .contact-form input,
body:not(.dark) .contact-form textarea {
    color: var(--text-dark);
}

.contact-form textarea {
    min-height: 140px;
    max-height: 300px;
    resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-hover);
    box-shadow: 0 0 12px rgba(255, 184, 76, 0.5);
}

.contact-form ::placeholder {
    color: rgba(245, 246, 247, 0.7);
}

body:not(.dark) .contact-form ::placeholder {
    color: rgba(27, 29, 35, 0.5);
}

.contact-form button {
    background: var(--accent);
    color: var(--text-dark);
    font-weight: 600;
    border: none;
    padding: 14px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.contact-form button:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 184, 76, 0.5);
}

footer {
    text-align: center;
    padding: 1em 0;
    font-size: 0.9em;
    opacity: 0.8;
    margin-top: 2em;
}

.hidden {
    display: none;
}

.disabled {
    color: var(--text-disabled);
    background: repeating-linear-gradient(135deg,
            rgba(255, 255, 255, 0.1) 0,
            rgba(255, 255, 255, 0.1) 4px,
            transparent 4px,
            transparent 12px);
}

.tab-btn.disabled {
    cursor: not-allowed;
    pointer-events: none;
}



.disabled img {
    filter: brightness(0) invert(0.7);
}

.social-btn.disabled:hover {
    /*color: var(--text-dark);*/
    background: repeating-linear-gradient(135deg,
            rgba(255, 255, 255, 0.1) 0,
            rgba(255, 255, 255, 0.1) 4px,
            transparent 4px,
            transparent 12px);
}

.disabled::after {
    content: attr(title);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: #00adb5;
    color: #222831;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: auto;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: opacity 0.3s ease;
}

.disabled:hover::after {
    opacity: 1;
}


/* === АДАПТИВНАЯ ВЁРСТКА === */
/* Планшеты и меньше */
@media (max-width: 1024px) {
    .center-block {
        width: 90%;
        padding: 1.5em;
        margin: 5vh auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .about-section {
        gap: 1.5em;
        justify-content: center;
    }

    .profile-photo {
        width: 200px;
        height: 200px;
    }

    .about-text {
        max-width: 300px;
    }

    .tabs {
        gap: 0.8em;
        justify-content: center;
    }

    .tab-btn {
        padding: 0.6em 1em;
        font-size: 0.9em;
    }
}

/* Телефоны 768px и меньше */
@media (max-width: 768px) {
    .about-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profile-photo {
        width: 160px;
        height: 160px;
        margin-bottom: 1em;
    }

    .about-text {
        max-width: 90%;
    }

    .mini-projects {
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .mini-project {
        width: auto;
        height: 90%;
        max-width: 340px;
    }

    .tab-btn span {
        display: none;
    }

    .tab-btn img {
        width: 24px;
        height: 24px;
    }

    .tabs {
        justify-content: center;
    }
}

/* Маленькие телефоны 480px и меньше */
@media (max-width: 480px) {
    .center-block {
        width: 95%;
        padding: 1em;
        min-height: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .about-section {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 1em;
    }

    .profile-photo {
        width: 140px;
        height: 140px;
    }

    .about-text h1 {
        font-size: 1.3em;
    }

    .about-text p {
        font-size: 0.95em;
    }

    .mini-projects {
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .mini-project {
        width: 95%;
    }

    .mini-project img {
        height: 10%;
    }

    .mini-info h4 {
        font-size: 1em;
    }

    .mini-info p {
        font-size: 0.85em;
    }

    .tab-btn img {
        width: 20px;
        height: 20px;
    }

    .tab-btn {
        padding: 0.5em 0.8em;
    }

    .tabs {
        gap: 0.5em;
        justify-content: center;
    }
}