:root { 
    --bg-dark: #000000; 
    --bg-glow: #00A3FF; 
    --text-color: #ffffff; 
    --header-bg: rgba(0, 0, 0, 0.6); 
    --accent-color: #a0bacc; 
    --menu-bg: #0a0a0a; 
    --card-bg: rgba(20, 20, 20, 0.4); 
    --card-border: rgba(160, 186, 204, 0.3);
    --nav-hover-bg: rgba(255, 255, 255, 0.05);
}

body.light-theme { 
    --bg-dark: #ffffff; 
    --bg-glow: #33C1FF; 
    --text-color: #111111; 
    --header-bg: rgba(255, 255, 255, 0.85); 
    --accent-color: #2c3e50; 
    --menu-bg: #ffffff; 
    --card-bg: rgba(255, 255, 255, 0.7); 
    --card-border: rgba(0, 0, 0, 0.1);
    --nav-hover-bg: rgba(0, 0, 0, 0.05);
}

html {
    overflow-y: scroll; 
    scroll-behavior: smooth;
}

html, body { 
    margin: 0; 
    padding: 0; 
    width: 100%; 
    min-height: 100vh; 
    font-family: 'Segoe UI', sans-serif; 
    color: var(--text-color); 
    background-color: var(--bg-dark); 
    display: flex; 
    flex-direction: column; 
    overflow-x: hidden; 
}

h1, h2, h3, .project-title { font-family: 'Dancing Script', cursive; font-weight: 700; }

header {
    position: fixed; 
    top: 0; left: 0; width: 100%; 
    z-index: 1001;
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 30px;
    background-color: var(--header-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--card-border);
    min-height: 80px; box-sizing: border-box;
}

.content ul, 
.content ol {
    margin-bottom: 20px;
    padding-left: 25px; 
}

.content li {
    margin-bottom: 12px; 
    line-height: 1.6;
    font-size: 1.1rem;  
}

.content li:last-child {
    margin-bottom: 0;
}

.brand { display: flex; align-items: center; gap: 15px; text-decoration: none; color: var(--text-color); }
.brand img { height: 45px; width: auto; object-fit: contain; aspect-ratio: 3/2; filter: drop-shadow(0 0 100px var(--bg-glow)); }
.brand h1 { margin: 0; font-size: 2rem; white-space: nowrap; }

.menu-btn { background: none; border: none; cursor: pointer; display: flex; flex-direction: column; gap: 6px; padding: 5px; }
.menu-btn span { width: 30px; height: 2px; background-color: var(--text-color); transition: 0.3s; }
.menu-btn.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.menu-btn.active span:nth-child(2) { opacity: 0; }
.menu-btn.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.theme-btn { 
    background: transparent; color: var(--text-color); border: 2px solid var(--accent-color); 
    display: flex; align-items: center; justify-content: center;   
    height: 38px; border-radius: 19px; min-width: 75px; padding: 0 15px;           
    cursor: pointer; transition: 0.3s; font-family: 'Segoe UI', sans-serif; 
}
.theme-btn:hover { background: var(--bg-glow); border-color: var(--bg-glow); color: #000; box-shadow: 0 0 25px var(--bg-glow); }

.navigation { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 260px; 
    height: 100%; 
    background-color: var(--menu-bg); 
    
    transform: translateX(-100%); 
    
    visibility: hidden;
    transition: transform 0.3s ease-in-out, visibility 0s linear 0.3s, box-shadow 0.3s ease-in-out;
    
    padding-top: 90px; 
    z-index: 1000; 
    display: flex; 
    flex-direction: column; 
    
    box-shadow: none; 
}

.navigation.active { 
    transform: translateX(0); 
    
    visibility: visible;
    transition: transform 0.3s ease-in-out, visibility 0s linear 0s, box-shadow 0.3s ease-in-out;
    
    box-shadow: 5px 0 20px rgba(0,0,0,0.5); 
}

.navigation a, .navigation button.nav-link { display: block; padding: 15px 25px; color: var(--text-color); text-decoration: none; font-size: 1.1rem; transition: 0.2s; border: none; background: none; text-align: left; cursor: pointer; font-family: 'Segoe UI', sans-serif; width: 100%; box-sizing: border-box; }
.navigation a:hover, .navigation button.nav-link:hover { 
    background: var(--nav-hover-bg);
    color: var(--bg-glow); 
    padding-left: 35px; 
    border-left: 3px solid var(--bg-glow); 
}

.navigation a.active-link {
    background: var(--nav-hover-bg);
    color: var(--bg-glow);
    padding-left: 35px;
    border-left: 3px solid var(--bg-glow);
}

.overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); opacity: 0; visibility: hidden; transition: 0.3s; z-index: 999; backdrop-filter: blur(3px); }
.overlay.active { opacity: 1; visibility: visible; }

main { flex: 1; padding: 100px 20px; max-width: 1000px; margin: 0 auto; width: 100%; box-sizing: border-box; transition: opacity 0.15s ease-in-out;}

.about-section { text-align: center; margin-bottom: 60px; position: relative; z-index: 1; }
.about-section h2 { font-size: 3.5rem; margin-bottom: 20px; text-shadow: 0 0 10px rgba(255,255,255,0.3); }
.about-section p { font-size: 1.2rem; color: var(--accent-color); max-width: 650px; margin: 0 auto; line-height: 1.6; }

.project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 25px; position: relative; z-index: 1; }

.nav-card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 30px;
    display: flex; flex-direction: column; justify-content: space-between;
    min-height: 240px; text-decoration: none; color: var(--text-color);
    transition: all 0.3s; backdrop-filter: blur(5px);
    position: relative; overflow: hidden; transform-style: preserve-3d; 
    -webkit-backface-visibility: hidden; backface-visibility: hidden;
    outline: 1px solid transparent; transform: translateZ(0);
}

.card-content, .arrow { transform: translateZ(20px); }
.js-tilt-glare-inner { background: linear-gradient(0deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.1) 100%) !important; }

.nav-card:hover { transform: translateY(-7px); background-color: rgba(0, 163, 255, 0.1); border-color: var(--bg-glow); box-shadow: 0 0 20px rgba(0, 163, 255, 0.3); }
.nav-card h3 { font-size: 2.5rem; margin: 0 0 10px 0; }
.nav-card p { font-family: 'Segoe UI', sans-serif; font-size: 1rem; color: var(--accent-color); line-height: 1.4; }
.arrow { align-self: flex-end; font-size: 1.5rem; opacity: 0.6; transition: 0.3s; font-family: sans-serif; margin-top: auto; }
.nav-card:hover .arrow { opacity: 1; transform: translateX(5px); color: var(--bg-glow); }

.nav-card h3, .nav-card p, .nav-card .tech-tag { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
.nav-footer { display: flex; justify-content: left; gap: 10px; }

.tech-stack { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 15px; }
.tech-tag { 
    font-size: 0.75rem; padding: 4px 10px; border-radius: 12px; 
    background: rgba(160, 186, 204, 0.1); border: 1px solid var(--accent-color); color: var(--accent-color); 
    font-family: 'Segoe UI', sans-serif; transition: 0.3s; white-space: nowrap; 
}
.nav-card:hover .tech-tag { background: var(--bg-glow); color: #000; border-color: var(--bg-glow); box-shadow: 0 0 5px var(--bg-glow); }

.project-detail { background: var(--card-bg); border: 1px solid var(--card-border); padding: 40px; border-radius: 15px; margin-top: 20px; backdrop-filter: blur(5px); position: relative; z-index: 1; }
.project-title { font-size: 3.5rem; padding-right: 160px; margin-bottom: 10px; color: var(--text-color); }
.project-meta { color: var(--accent-color); margin-bottom: 30px; font-weight: bold; text-transform: uppercase; letter-spacing: 2px; font-size: 0.9rem; font-family: 'Segoe UI', sans-serif; }
.content p { line-height: 1.8; font-size: 1.1rem; margin-bottom: 20px; font-family: 'Segoe UI', sans-serif; }

.btn-github {
    position: absolute;
    top: 40px;   
    right: 40px; 

    padding: 10px 20px; 
    font-size: 0.9rem;
    margin-top: 0;
    
    display: inline-block;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    text-decoration: none;
    border-radius: 5px;
    transition: 0.3s;
    font-weight: bold;
    font-family: 'Segoe UI', sans-serif;
}

.btn-github:hover {
    background: var(--bg-glow);
    border-color: var(--bg-glow);
    color: #000;
    box-shadow: 0 0 20px var(--bg-glow);
}

@media (max-width: 768px) {
    .btn-github {
        position: static;
        display: block;
        width: fit-content;
        margin-top: 20px;
        font-size: 1rem;
        padding: 15px 30px;
    }
    
    .project-title {
        padding-right: 0;
    }
}

.back-link { 
    display: inline-flex; align-items: center; gap: 8px; margin-bottom: 20px; color: var(--accent-color); text-decoration: none; font-weight: 600; font-family: 'Segoe UI', sans-serif; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); padding: 8px 12px; border-radius: 8px; margin-left: -12px; 
}
.back-link:hover { transform: translateX(-5px); color: var(--bg-glow); text-shadow: 0 0 8px rgba(0, 163, 255, 0.4); }
.back-link:hover::first-letter { display: inline-block; }

footer { text-align: center; padding: 30px; background: var(--header-bg); border-top: 1px solid var(--card-border); margin-top: auto; position: relative; z-index: 1; }
.socials a { color: var(--accent-color); margin: 0 10px; text-decoration: none; font-weight: bold; transition: 0.3s; font-family: 'Segoe UI', sans-serif; }

/*.socials a[href*="youtube.com"]:hover { 
    color: #FF0000; 
    text-shadow: 0 0 10px #FF0000; 
} */

.socials a[href*="x.com"]:hover { 
    color: #ffffff; 
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8); 
}

.socials a[href*="github.com"]:hover { 
    color: #ffffff; 
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8); 
}

.socials a[href*="t.me"]:hover { 
    color: var(--bg-glow); 
    text-shadow: 0 0 10px var(--bg-glow); 
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--accent-color); border-radius: 5px; border: 2px solid var(--bg-dark); }
::-webkit-scrollbar-thumb:hover { background: var(--bg-glow); }

@media (max-width: 600px) {
    header { padding: 15px 15px; }
    .brand h1 { font-size: 1.4rem; }
    .brand img { height: 35px; width: auto; }
    header > div:first-child { gap: 10px !important; }
    .responsive-banner { margin-left: 5px; }
    .back-to-top { right: 20px; bottom: 20px; }
    :lang(ru) .brand h1 { font-size: 1.6rem !important; margin-top: 2px; }
}

@media (max-width: 370px) {
    .brand h1 { font-size: 1.2rem; }
    :lang(ru) .brand h1 { font-size: 1.3rem !important; }
}

.nav-card:active { transform: scale(0.98) translateZ(0) !important; opacity: 0.9; transition: transform 0.05s ease-out; }
.back-link:active { transform: scale(0.95) translateX(-5px); color: var(--bg-glow); transition: transform 0.05s ease-out; }
.menu-btn:active, .theme-btn:active, .btn-github:active { transform: scale(0.90); transition: transform 0.05s; }
.theme-btn span, .theme-btn i {
    pointer-events: none;
}
.fly-away { transform: translateX(-120vw) !important; opacity: 0; transition: all 0.4s ease-in !important; }
.content a { color: #89CFF0; text-decoration: none; transition: color 0.3s; }
.content a:hover { color: var(--bg-glow); text-decoration: underline; }

.inline-code { padding: 2px 6px; border-radius: 4px; border: 1px solid var(--accent-color); background: rgba(160, 186, 204, 0.1); color: var(--text-color); font-family: 'Consolas', 'Monaco', 'Courier New', monospace; font-size: 0.9em; }

h1, h2, h3 { scroll-margin-top: 110px; }
h1 { border-bottom: 1px solid rgba(255, 255, 255, 0.3); padding-bottom: 15px; margin-bottom: 25px; }
h2 { border-bottom: none; }

ul.checklist { list-style-type: none; padding-left: 5px; }
ul.checklist li { display: flex; align-items: center; margin-bottom: 12px; }
ul.checklist input[type="checkbox"] { appearance: none; -webkit-appearance: none; width: 15px; height: 15px; border: 2px solid var(--accent-color); border-radius: 4px; background-color: transparent; cursor: default; position: relative; margin-right: 15px; opacity: 1; flex-shrink: 0; }
ul.checklist input[type="checkbox"]:checked { background-color: #00A3FF; border-color: #00A3FF; }
ul.checklist input[type="checkbox"]:checked::after { content: ''; position: absolute; left: 3px; top: -1px; width: 5px; height: 10px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg); }

.banner-container { text-align: left; margin-bottom: 20px; }
.responsive-banner { max-width: 100%; height: auto; display: block; margin-left: 20px; border-radius: 8px; }

.brand h1 { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }

:lang(ru) h1, :lang(ru) h2, :lang(ru) h3, :lang(ru) .project-title, :lang(ru) .brand h1 { font-family: 'Marck Script', cursive; font-weight: 400; line-height: 1.2; }
:lang(ru) .brand h1 { font-size: 2.3rem; margin-top: 5px; }

.nav-mobile-controls { display: none;}

@media (max-width: 809px) {
    header { padding: 15px 15px; }
    header .nav-footer { display: none !important; }
    .brand h1 { font-size: 1.4rem; }
    .brand img { height: 35px; width: auto; }
    header > div:first-child { gap: 10px !important; }

    .nav-mobile-controls { 
        display: flex;
        flex-direction: column; 
        gap: 15px; 
        margin-top: 10px; 
        padding: 20px 25px; 
        border-top: 1px solid var(--card-border); 
        width: 100%; 
        box-sizing: border-box;
    }

    .nav-mobile-controls .theme-btn {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        box-sizing: border-box;
    }

    #music-controls-mobile {
        display: flex;        
        flex-direction: row; 
        width: 100%;          
        box-sizing: border-box;
        
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out, margin 0.3s;
        

        margin-top: 0;
        margin-bottom: 0;
        padding: 0;
        
        gap: 10px; 
    }


    #music-controls-mobile.active {
        max-height: 60px;
        opacity: 1;
        margin-top: 5px;
        margin-bottom: 5px;
        overflow: visible; 
        transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out, overflow 0s linear 0.3s;
    }   

    #music-controls-mobile {
        transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out, overflow 0s linear 0s;
    }
    
    #music-controls-mobile .theme-btn {
        flex: 1;      
        min-width: 0;
        padding: 0 !important;
        height: 42px;     
        border-radius: 21px; 
        
        display: flex;
        align-items: center;     
        justify-content: center;
        
        font-size: 1.4rem;       
        line-height: 1;       
    }
    
    #music-controls-mobile .theme-btn span,
    #music-controls-mobile .theme-btn {
        padding-bottom: 2px;
    }
    
    :lang(ru) .brand h1 { font-size: 1.6rem !important; margin-top: 2px; }
}

.back-to-top {
    position: fixed; bottom: 30px; right: 30px; left: auto; transform: translateY(100px);
    width: 50px; height: 50px; border-radius: 50%;
    background: var(--card-bg); border: 1px solid var(--accent-color); color: var(--text-color);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 990; backdrop-filter: blur(5px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); opacity: 0; pointer-events: none;
}
.back-to-top.active { transform: translateY(0); opacity: 1; pointer-events: all; }
.back-to-top:hover { background: var(--bg-glow); border-color: var(--bg-glow); color: #000; box-shadow: 0 0 20px var(--bg-glow); transform: translateY(-5px); }

#music-icon, #music-icon-mobile {
    width: 20px;
    font-size: 1.4rem;   
    margin-left: 5px;   
    line-height: 1;      
    vertical-align: middle;
    margin-top: -3px;
}


.music-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    z-index: 2000; 
}

.music-wrapper > .theme-btn {
    position: relative;
    z-index: 10;
}

.music-controls-slider {
    display: flex;
    gap: 5px;

    overflow: hidden;
    box-sizing: border-box;

    padding: 0;
    margin: 0;


    max-width: 0;
    opacity: 0;
    transform: translateX(20px); 
    pointer-events: none; 
    
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.music-wrapper:hover .music-controls-slider.playable,
.music-wrapper.hover-state .music-controls-slider.playable,
.music-wrapper.is-playing .music-controls-slider.playable,
.music-wrapper.volume-open .music-controls-slider.playable {
    max-width: 350px;
    
    padding: 30px; 
    
    margin: -30px;
    margin-right: -20px;

    opacity: 1;
    transform: translateX(0); 
    pointer-events: all;

    overflow: visible;
}

.icon-btn {
    display: flex;
    min-width: 38px !important;
    padding: 0 !important;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; 
}

#music-controls .icon-btn {
    font-size: 1.4rem; 
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 3px !important;
}


.volume-container-desktop {
    position: relative;
    display: flex;
    align-items: center;
}

@media (max-width: 809px) {
    .volume-container-desktop {
        display: none;
    }
}

.volume-popup {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    
    width: 40px;
    height: 130px; 
    
    background: var(--card-bg); 
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    
    border: 1px solid var(--card-border);
    border-radius: 20px;
    
    display: flex;
    justify-content: center;
    align-items: center;
    
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2005;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    
    margin-top: 15px;
}

.volume-popup.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transform: translateX(-50%) translateY(0);
}

.volume-slider-vertical {
    width: 100px; 
    height: 4px;  
    background: rgba(128,128,128,0.3); 
    border-radius: 2px;
    appearance: none;
    outline: none;
    cursor: pointer;
    
    transform: rotate(-90deg);
}

.volume-slider-vertical::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--text-color);
    border-radius: 50%;
    border: 2px solid var(--accent-color);
    cursor: pointer;
    transition: 0.2s;
}

.volume-slider-vertical::-webkit-slider-thumb:hover {
    background: var(--bg-glow);
    box-shadow: 0 0 10px var(--bg-glow);
}