body {
    background: linear-gradient(135deg, #1a122a, #2a1e3f, #1a122a);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    color: #e0e0e0;
    font-family: 'Outfit', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

body::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150px;
    background: linear-gradient(to top, rgba(26, 18, 42, 0.8), transparent); 
    z-index: 0; 
    pointer-events: none; 
}

:root {
    --icon-gradient: linear-gradient(45deg, #87CEEB, #4682B4);
    --button-gradient: linear-gradient(45deg, #6a3093, #a044ff);
    --button-gradient-hover: linear-gradient(45deg, #7e40a9, #b05cff);
    --accent-purple-light: rgba(198, 162, 230, 0.5); 
    --accent-purple-dark: rgba(126, 87, 194, 0.4);
    --bg-deep-1: #1a122a;
    --bg-deep-2: #2a1e3f;
    --blob-1: rgba(160, 68, 255, 0.18);
    --blob-2: rgba(126, 87, 194, 0.22);
    --blob-3: rgba(92, 52, 150, 0.18);
    --blob-4: rgba(48, 24, 96, 0.22);
}

@property --x1 { syntax: '<percentage>'; inherits: false; initial-value: 20%; }
@property --y1 { syntax: '<percentage>'; inherits: false; initial-value: 30%; }
@property --x2 { syntax: '<percentage>'; inherits: false; initial-value: 80%; }
@property --y2 { syntax: '<percentage>'; inherits: false; initial-value: 25%; }
@property --x3 { syntax: '<percentage>'; inherits: false; initial-value: 30%; }
@property --y3 { syntax: '<percentage>'; inherits: false; initial-value: 75%; }
@property --x4 { syntax: '<percentage>'; inherits: false; initial-value: 75%; }
@property --y4 { syntax: '<percentage>'; inherits: false; initial-value: 70%; }

body::before {
    content: '';
    position: fixed;
    inset: -10% -10% -10% -10%;
    z-index: -2; 
    pointer-events: none;
    background:
        radial-gradient(35vmax 35vmax at var(--x1) var(--y1), var(--blob-1), transparent 60%),
        radial-gradient(40vmax 40vmax at var(--x2) var(--y2), var(--blob-2), transparent 60%),
        radial-gradient(32vmax 32vmax at var(--x3) var(--y3), var(--blob-3), transparent 60%),
        radial-gradient(38vmax 38vmax at var(--x4) var(--y4), var(--blob-4), transparent 60%);
    filter: blur(10px) saturate(115%);
    animation: blobShift 22s ease-in-out infinite alternate;
}

@keyframes blobShift {
    0%   { --x1: 18%; --y1: 28%; --x2: 82%; --y2: 22%; --x3: 28%; --y3: 78%; --x4: 72%; --y4: 72%; }
    25%  { --x1: 28%; --y1: 22%; --x2: 78%; --y2: 30%; --x3: 36%; --y3: 70%; --x4: 68%; --y4: 80%; }
    50%  { --x1: 22%; --y1: 36%; --x2: 70%; --y2: 20%; --x3: 26%; --y3: 66%; --x4: 80%; --y4: 64%; }
    75%  { --x1: 30%; --y1: 26%; --x2: 72%; --y2: 34%; --x3: 34%; --y3: 72%; --x4: 76%; --y4: 74%; }
    100% { --x1: 18%; --y1: 28%; --x2: 82%; --y2: 22%; --x3: 28%; --y3: 78%; --x4: 72%; --y4: 72%; }
}

#particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.6;
    filter: blur(2px);
}

header {
    text-align: center;
    padding: 40px 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.avatar {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    margin-bottom: 25px;
    border: 5px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 25px var(--accent-purple-dark);
}

h1 {
    font-size: 3.2em;
    margin-bottom: 10px;
    font-weight: bold;
    font-family: 'Outfit', sans-serif;
    margin: 0 5px;
}

.gradient-text {
    background: linear-gradient(90deg, #d1c4e9, #b39ddb, #9575cd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.2em;
    color: #b0aac0;
    margin-bottom: 25px;
    font-family: 'Exo 2', sans-serif;
    min-height: 1.5em;
    max-width: 90%;
    word-wrap: break-word;
}

.subtitle i {
    margin: 0 5px;
}

.social-links {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 5px;
    margin-bottom: 20px;
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    max-width: 750px;
    padding: 20px;
    border: 1px solid rgba(198, 162, 230, 0.2);
    border-radius: 20px;
    background-color: rgba(42, 30, 63, 0.4);
}

.social-links a {
    text-decoration: none;
    color: white;
    padding: 10px 18px;
    border-radius: 20px; 
    font-size: 1em;
    transition: background 0.4s ease, transform 0.2s ease, box-shadow 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Tektur', sans-serif;
    flex-shrink: 0;
    background: var(--button-gradient);
    border: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    background-size: 150% auto;
}

.social-links a:hover {
    transform: scale(1.05);
    background: var(--button-gradient-hover);
    box-shadow: 0 4px 10px var(--accent-purple-dark);
    background-position: right center; 
}

.social-links img {
    width: 20px; 
    height: 20px;
    margin-right: 8px; 
    vertical-align: middle;
}

.social-links .telegram img { --mask-url: url('https://img.icons8.com/?size=100&id=lUktdBVdL4Kb&format=png&color=FFFFFF'); }
.social-links .discord img { --mask-url: url('https://img.icons8.com/?size=100&id=30888&format=png&color=FFFFFF'); }
.social-links .github img { --mask-url: url('https://img.icons8.com/?size=100&id=62856&format=png&color=FFFFFF'); }
.social-links .tiktok img { --mask-url: url('https://img.icons8.com/?size=100&id=118640&format=png&color=FFFFFF'); }
.social-links .blog img { --mask-url: url('https://img.icons8.com/?size=100&id=7q3g0SaFUiVe&format=png&color=FFFFFF'); }
.social-links .leetcode img { --mask-url: url('https://img.icons8.com/?size=100&id=PZknXs9seWCp&format=png&color=FFFFFF'); }
.social-links .steam img { --mask-url: url('https://img.icons8.com/?size=100&id=468&format=png&color=FFFFFF'); }
.social-links .details img { --mask-url: url('https://img.icons8.com/?size=100&id=6cdJEps4HrFl&format=png&color=FFFFFF'); }

.projects {
    padding: 20px 20px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.projects h2 {
    text-align: center;
    color: #d1c4e9;
    margin-bottom: 30px;
    font-size: 1.6em;
    font-family: 'Outfit', sans-serif;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    opacity: 0;
    animation: fadeInGrid 1s ease-out 0.5s forwards;
}

@keyframes fadeInGrid {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    background-color: #2a1e3f;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    border: 1px solid rgba(198, 162, 230, 0.1);
    cursor: pointer;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--accent-purple-dark);
    border-color: var(--accent-purple-light);
}

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.card-icon {
    width: 32px;
    height: 32px;
    margin-right: 15px;
    background-color: #3e2d5a;
    border-radius: 5px;
    object-fit: contain;
    padding: 4px;
    box-sizing: border-box;
}

.card h3 {
    margin: 0;
    font-size: 1.4em;
    color: #eadeff;
    font-family: 'Outfit', sans-serif;
}

.card-subtitle {
    color: #b0aac0;
    font-size: 0.9em;
    margin-top: -5px;
    margin-bottom: 15px;
    font-family: 'Outfit', sans-serif;
}

.card p {
    font-size: 1em;
    line-height: 1.6;
    color: #d1c4e9;
    margin-bottom: 20px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tags span {
    background-color: rgba(126, 87, 194, 0.2);
    color: #d1c4e9;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    border: 1px solid rgba(198, 162, 230, 0.3);
    font-family: 'Tektur', sans-serif;
}

header, .projects h2 {
    opacity: 0;
    animation: fadeInElement 0.8s ease-out forwards;
}

h1 {
    animation-delay: 0.1s;
}

.subtitle {
    animation-delay: 0.2s;
}

.social-links {
    animation-delay: 0.3s;
}

.projects h2 {
    animation-delay: 0.4s;
}

@keyframes fadeInElement {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
    .avatar {
        width: 220px;
        height: 220px;
    }
    h1 {
        font-size: 2.8em;
    }
    .button-group {
        max-width: 650px;
    }
    .tech-stack {
        max-width: 650px; /* match button-group at this breakpoint */
    }
}

@media (max-width: 768px) {
    header {
        padding: 30px 15px 15px;
    }
    h1 {
        font-size: 2.4em;
    }
    .subtitle {
        font-size: 1.1em;
        min-height: 1.3em;
        margin-bottom: 20px;
    }
    .avatar {
        width: 180px;
        height: 180px;
        margin-bottom: 20px;
    }
    .social-links {
        margin-bottom: 15px;
    }
    .projects-grid {
        grid-template-columns: 1fr;
    }
    .button-group {
        max-width: 90%;
        gap: 10px;
        padding: 15px;
    }
    .tech-stack {
        max-width: 90%; /* follow button-group on tablets */
    }
    .social-links a {
        padding: 10px 16px;
        font-size: 0.95em;
        border-radius: 18px;
    }
    .social-links img {
        width: 18px;
        height: 18px;
        margin-right: 8px;
    }
}

@media (max-width: 480px) {
    header {
        padding: 20px 15px 10px;
    }
    h1 {
        font-size: 2em;
    }
    .subtitle {
        font-size: 1em;
        min-height: 1.2em;
        margin-bottom: 15px;
    }
    .avatar {
        width: 140px;
        height: 140px;
        margin-bottom: 15px;
    }
    .button-group {
        gap: 8px;
        padding: 12px;
        border-radius: 15px;
    }
    .social-links a {
        padding: 9px 12px;
        font-size: 0.85em;
        flex-basis: calc(50% - 6px);
        justify-content: center;
        border-radius: 15px;
    }
    .social-links img {
        width: 16px;
        height: 16px;
        margin-right: 6px;
    }
    .projects {
        padding: 15px 15px 15px;
    }
    .projects h2 {
        font-size: 1.4em;
        margin-bottom: 20px;
    }
    .card {
        padding: 20px;
    }
    .card h3 {
        font-size: 1.3em;
    }
    .card p {
        font-size: 0.95em;
    }
    .tags span {
        font-size: 0.8em;
        padding: 4px 10px;
    }
}

.tech-stack {
    padding: 20px 20px 20px;
    max-width: 750px; /* match .button-group width */
    margin: 40px auto;
    text-align: center;
}

.tech-stack h2 {
    color: #d1c4e9;
    margin-bottom: 30px;
    font-size: 1.6em;
    font-family: 'Outfit', sans-serif;
}

.stack-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    border: 1px solid rgba(198, 162, 230, 0.2);
    border-radius: 20px;
    background-color: rgba(42, 30, 63, 0.4);
}

.tech-item {
    background-color: rgba(126, 87, 194, 0.2);
    color: #d1c4e9;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.9em;
    border: 1px solid rgba(198, 162, 230, 0.3);
    font-family: 'Tektur', sans-serif;
    white-space: nowrap;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.tech-item:hover {
    background-color: rgba(126, 87, 194, 0.4);
    border-color: rgba(198, 162, 230, 0.5);
}

.github-stats {
    padding: 20px 20px 20px;
    max-width: 1200px;
    margin: 40px auto;
    text-align: center;
}

.github-stats h2 {
    color: #d1c4e9;
    margin-bottom: 30px;
    font-size: 1.6em;
    font-family: 'Outfit', sans-serif;
}

.github-graph-container {
    display: flex;
    justify-content: center;
    padding: 20px;
    border: 1px solid rgba(198, 162, 230, 0.2);
    border-radius: 20px;
    background-color: rgba(42, 30, 63, 0.4); /* Similar background to button group */
    max-width: 700px; /* Adjust max-width as needed to control size */
    margin: 0 auto; /* Center the container */
    overflow-x: auto; /* Add scroll if graph is too wide on small screens */
}

.github-graph-container img {
    display: block; /* Remove extra space below the image */
    max-width: 100%; /* Make image responsive within its container */
    height: auto;
    border-radius: 10px; /* Optional: add slight border radius to the image */
}

header, .projects h2 {
    opacity: 0;
    animation: fadeInElement 0.8s ease-out forwards;
}

h1 {
    animation-delay: 0.1s;
}

.subtitle {
    animation-delay: 0.2s;
}

.social-links {
    animation-delay: 0.3s;
}

.projects h2 {
    animation-delay: 0.4s;
}

@keyframes fadeInElement {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
    .avatar {
        width: 220px;
        height: 220px;
    }
    h1 {
        font-size: 2.8em;
    }
    .button-group {
        max-width: 650px;
    }
}

@media (max-width: 768px) {
    header {
        padding: 30px 15px 15px;
    }
    h1 {
        font-size: 2.4em;
    }
    .subtitle {
        font-size: 1.1em;
        min-height: 1.3em;
        margin-bottom: 20px;
    }
    .avatar {
        width: 180px;
        height: 180px;
        margin-bottom: 20px;
    }
    .social-links {
        margin-bottom: 15px;
    }
    .projects-grid {
        grid-template-columns: 1fr;
    }
    .button-group {
        max-width: 90%;
        gap: 10px;
        padding: 15px;
    }
    .social-links a {
        padding: 10px 16px;
        font-size: 0.95em;
        border-radius: 18px;
    }
    .social-links img {
        width: 18px;
        height: 18px;
        margin-right: 8px;
    }
}

@media (max-width: 480px) {
    header {
        padding: 20px 15px 10px;
    }
    h1 {
        font-size: 2em;
    }
    .subtitle {
        font-size: 1em;
        min-height: 1.2em;
        margin-bottom: 15px;
    }
    .avatar {
        width: 140px;
        height: 140px;
        margin-bottom: 15px;
    }
    .button-group {
        gap: 8px;
        padding: 12px;
        border-radius: 15px;
    }
    .social-links a {
        padding: 9px 12px;
        font-size: 0.85em;
        flex-basis: calc(50% - 6px);
        justify-content: center;
        border-radius: 15px;
    }
    .social-links img {
        width: 16px;
        height: 16px;
        margin-right: 6px;
    }
    .projects {
        padding: 15px 15px 15px;
    }
    .projects h2 {
        font-size: 1.4em;
        margin-bottom: 20px;
    }
    .card {
        padding: 20px;
    }
    .card h3 {
        font-size: 1.3em;
    }
    .card p {
        font-size: 0.95em;
    }
    .tags span {
        font-size: 0.8em;
        padding: 4px 10px;
    }
}

#russian-only-message {
    text-align: center;
    padding: 40px 20px;
    color: #b0aac0;
    font-size: 1.1em;
    font-family: 'Exo 2', sans-serif;
    display: none;
}

.now-playing {
    padding: 40px 20px;
    max-width: 600px;
    margin: 40px auto;
    text-align: center;
}

.now-playing h2 {
    color: #d1c4e9;
    margin-bottom: 30px;
    font-size: 1.6em;
    font-family: 'Outfit', sans-serif;
}

.now-playing-card {
    background: linear-gradient(135deg, rgba(126, 87, 194, 0.15), rgba(92, 52, 150, 0.1));
    border: 1px solid rgba(198, 162, 230, 0.3);
    border-radius: 20px;
    padding: 15px 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    transition: all 0.4s ease;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 20px;
}

.now-playing-card:hover {
    border-color: rgba(198, 162, 230, 0.6);
    box-shadow: 0 12px 40px rgba(126, 87, 194, 0.3);
    transform: translateY(-5px);
}

.np-container {
    display: flex;
    align-items: center;
    gap: 25px;
    width: 100%;
}

.np-album-art {
    width: 140px;
    height: 140px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    object-fit: cover;
    border: 2px solid rgba(198, 162, 230, 0.3);
    animation: albumRotate 0.6s ease-out;
    flex-shrink: 0;
}

@keyframes albumRotate {
    from {
        opacity: 0;
        transform: scale(0.8) rotateY(20deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotateY(0deg);
    }
}

.np-info {
    text-align: left;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.np-track-name {
    font-size: 1.3em;
    font-weight: bold;
    color: #eadeff;
    margin-bottom: 10px;
    font-family: 'Outfit', sans-serif;
    word-wrap: break-word;
    animation: slideInUp 0.5s ease-out 0.1s both;
    line-height: 1.3;
}

.np-artist {
    font-size: 1em;
    color: #b0aac0;
    font-family: 'Exo 2', sans-serif;
    animation: slideInUp 0.5s ease-out 0.2s both;
}

.np-badge {
    display: inline-block;
    font-size: 0.75em;
    color: #b0aac0;
    font-family: 'Tektur', sans-serif;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: slideInUp 0.5s ease-out 0.05s both;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.np-loading {
    color: #b0aac0;
    font-size: 1.1em;
    font-family: 'Exo 2', sans-serif;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

@media (max-width: 768px) {
    .now-playing {
        padding: 25px 15px;
        max-width: 90%;
    }

    .now-playing-card {
        padding: 15px;
        min-height: auto;
    }

    .np-container {
        gap: 15px;
    }

    .np-album-art {
        width: 120px;
        height: 120px;
    }

    .np-track-name {
        font-size: 1.1em;
    }

    .np-artist {
        font-size: 0.9em;
    }

    .np-badge {
        font-size: 0.7em;
        margin-bottom: 4px;
    }
}

@media (max-width: 480px) {
    .now-playing {
        padding: 15px 10px;
        margin: 20px auto;
    }

    .now-playing-card {
        padding: 12px;
        min-height: auto;
    }

    .np-container {
        gap: 12px;
        width: 100%;
    }

    .np-album-art {
        width: 90px;
        height: 90px;
    }

    .np-info {
        text-align: left;
    }

    .np-track-name {
        font-size: 0.95em;
        margin-bottom: 5px;
    }

    .np-artist {
        font-size: 0.8em;
    }

    .np-badge {
        font-size: 0.6em;
        margin-bottom: 3px;
    }
} 