@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700;800&family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap');

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --accent: #a855f7;
    --accent-dim: #7c3aed;
    --accent-glow: rgba(168, 85, 247, 0.25);
    --accent-subtle: rgba(168, 85, 247, 0.08);
    --bg: #060608;
    --bg-card: #0d0d12;
    --bg-card-hover: #121219;
    --border: rgba(168, 85, 247, 0.15);
    --border-hover: rgba(168, 85, 247, 0.4);
    --text: #f0f0f5;
    --text-muted: #6b6b80;
    --text-dim: #9090a8;
    --white: #ffffff;
    --font-display: 'Manrope', sans-serif;
    --font-mono: 'Space Mono', monospace;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-display);
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    cursor: default;
}

/* Фоновая сетка */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(168, 85, 247, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(168, 85, 247, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

/* Угловые свечения */
body::after {
    content: '';
    position: fixed;
    top: -200px;
    right: -200px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.link {
    color: var(--accent-dim);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.link:hover {
    color: var(--accent);
    text-shadow: 0 0 20px rgba(0, 255, 247, 0.5);
}

.link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.link:hover::after {
    width: 100%;
}

/* ========== LAYOUT ========== */

.page-wrapper {
    position: relative;
    z-index: 1;
    max-width: 860px;
    margin: 0 auto;
    padding: 0 2rem 6rem;
}

/* ========== HERO ========== */

.hero {
    padding: 7rem 0 4rem;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    align-items: center;
    opacity: 0;
    animation: fadeSlideUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.1s forwards;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--accent);
    border: 1px solid var(--border);
    background: var(--accent-subtle);
    padding: 0.3rem 0.8rem;
    border-radius: 2px;
    margin-bottom: 1.2rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hero-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
    animation: pulse 2s ease-in-out infinite;
}

.hero-name {
    font-size: clamp(2.8rem, 7vw, 5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    background: linear-gradient(135deg, var(--white) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.4rem;
}

.hero-username {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
}

.hero-username span {
    color: var(--accent);
}

.hero-desc {
    font-size: 1.05rem;
    font-weight: 400;
    color: var(--text-dim);
    line-height: 1.7;
    max-width: 520px;
}

.hero-avatar {
    width: 100px;
    height: 100px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    flex-shrink: 0;
    box-shadow: 0 0 40px var(--accent-glow);
    position: relative;
    overflow: hidden;
}

.hero-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ========== MUSIC CARD ========== */

.now-playing {
    border: 1px solid var(--border);
    border-bottom: none;
    background: var(--bg-card);
    border-radius: 12px 12px 0 0;
    padding: 1rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    animation: fadeSlideUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.25s forwards;
}

.now-playing-progress {
    border: 1px solid var(--border);
    border-top: none;
    background: var(--bg-card);
    border-radius: 0 0 12px 12px;
    padding: 0 1.2rem 0.75rem;
    margin-bottom: 4rem;
    opacity: 0;
    animation: fadeSlideUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.25s forwards;
}

/* Когда прогресс скрыт — нижние углы у .now-playing снова скруглены */
.now-playing:has(+ .now-playing-progress[style*="display:none"]),
.now-playing:has(+ .now-playing-progress[style*="display: none"]) {
    border-radius: 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4rem;
}

.now-playing-progress-track {
    height: 3px;
    background: rgba(168, 85, 247, 0.12);
    border-radius: 2px;
    overflow: hidden;
}

.now-playing-progress-bar {
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
    width: 0%;
    transition: width 1s cubic-bezier(0.445, 0.05, 0.55, 0.95);
    box-shadow: 0 0 6px var(--accent-glow);
}

.now-playing-progress-times {
    display: flex;
    justify-content: space-between;
    margin-top: 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.now-playing:hover {
    border-color: var(--border-hover);
    box-shadow: 0 0 20px var(--accent-glow);
}

.now-playing-cover {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: var(--bg-card-hover);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

.now-playing-cover-fallback {
    font-size: 1.2rem;
    position: absolute;
}

.now-playing-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 7px;
    position: relative;
    z-index: 1;
}

.now-playing-info {
    flex: 1;
    min-width: 0;
}

.now-playing-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 0.2rem;
}

.now-playing-track {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.now-playing-artist {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.now-playing-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 20px;
    flex-shrink: 0;
}

.now-playing-bars.paused .bar {
    animation: none;
    height: 3px !important;
}

.bar {
    width: 3px;
    background: var(--accent);
    border-radius: 2px;
    animation: soundBars 1s ease-in-out infinite;
}

.bar:nth-child(1) {
    animation-delay: 0s;
}

.bar:nth-child(2) {
    animation-delay: 0.2s;
}

.bar:nth-child(3) {
    animation-delay: 0.4s;
}

.bar:nth-child(4) {
    animation-delay: 0.1s;
}

/* ========== SECTION ========== */

.section {
    margin-bottom: 4rem;
    opacity: 0;
    animation: fadeSlideUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.section:nth-child(3) {
    animation-delay: 0.35s;
}

.section:nth-child(4) {
    animation-delay: 0.45s;
}

.section:nth-child(5) {
    animation-delay: 0.55s;
}

.section:nth-child(6) {
    animation-delay: 0.65s;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.section-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    flex-shrink: 0;
}

.section-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--border), transparent);
}

/* ========== SKILLS ========== */

.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}

.skill-group {
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: 10px;
    padding: 1rem 1.2rem;
    transition: border-color 0.3s, background 0.3s;
}

.skill-group:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.skill-group-title {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.7rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.skill-tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-dim);
    background: rgba(168, 85, 247, 0.06);
    border: 1px solid var(--border);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.skill-tag:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-subtle);
}

.skill-tag.dim {
    opacity: 0.5;
    font-style: italic;
}

/* ========== PROJECTS ========== */

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.project-card {
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: 10px;
    padding: 1.1rem 1.3rem;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: start;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.3s, background 0.3s, transform 0.2s;
    cursor: pointer;
}

.project-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateX(4px);
}

.project-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.project-badge {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--accent);
    border: 1px solid var(--border);
    background: var(--accent-subtle);
    padding: 0.15rem 0.5rem;
    border-radius: 2px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 400;
}

.project-badge.wip {
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.2);
    background: rgba(245, 158, 11, 0.06);
}

.project-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.project-arrow {
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: color 0.2s, transform 0.2s;
    margin-top: 2px;
    flex-shrink: 0;
}

.project-card:hover .project-arrow {
    color: var(--accent);
    transform: translateX(3px);
}

.project-no-link {
    opacity: 0.6;
    cursor: default;
}

.project-no-link:hover {
    transform: none;
    border-color: var(--border);
    background: var(--bg-card);
}

/* ========== CONTACTS ========== */

.contacts-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--text-dim);
    font-size: 0.88rem;
    font-weight: 500;
    border: 1px solid var(--border);
    background: var(--bg-card);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    transition: all 0.25s ease;
}

.contact-link:hover {
    color: var(--white);
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    box-shadow: 0 0 16px var(--accent-glow);
}

.contact-icon-svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: filter 0.25s ease;
}

/* GitHub — белый */
.contact-gh .contact-icon-svg {
    filter: brightness(0) invert(1);
}

/* Telegram — голубой #29b6f6 */
.contact-tg .contact-icon-svg {
    filter: brightness(0) saturate(100%) invert(62%) sepia(80%) saturate(400%) hue-rotate(170deg) brightness(105%);
}

/* Discord — синий #5865f2 */
.contact-dsc .contact-icon-svg {
    filter: brightness(0) saturate(100%) invert(38%) sepia(90%) saturate(600%) hue-rotate(220deg) brightness(105%);
}

/* ========== FOOTER ========== */

.footer {
    border-top: 1px solid var(--border);
    padding-top: 2rem;
    text-align: center;
}

.footer-text {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.footer-text span {
    color: var(--accent);
}

/* ========== ANIMATIONS ========== */

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

@keyframes soundBars {

    0%,
    100% {
        height: 4px;
    }

    50% {
        height: 18px;
    }
}

/* ========== RESPONSIVE ========== */

@media (max-width: 600px) {
    .hero {
        grid-template-columns: 1fr;
        padding: 4rem 0 3rem;
    }

    .hero-avatar {
        display: none;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .page-wrapper {
        padding: 0 1.2rem 4rem;
    }
}