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

html {
    overflow-x: hidden;
    background: #0d0d0d;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(180deg, #0d0d0d 0%, #1a1a1a 50%, #0d0d0d 100%);
    color: #d4d4d4;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    overscroll-behavior: none;
}

body.video-hidden {
    overflow: hidden;
}

body.video-hidden .background-video {
    display: none;
}

/* Фоновое видео - всегда играет */
.background-video {
    position: fixed;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    z-index: 0;
    object-fit: cover;
    opacity: 0.4;
    pointer-events: none;
}

/* Слой-оверлей, который скрывает видео */
.overlay-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
    background: linear-gradient(180deg, #0d0d0d 0%, #1a1a1a 50%, #0d0d0d 100%);
}

.overlay-layer.hidden {
    opacity: 0;
}

/* Шумовая текстура (статичная) - внутри оверлея */
.noise-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    pointer-events: none;
    background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="noiseFilter"><feTurbulence type="fractalNoise" baseFrequency="4" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noiseFilter)"/></svg>');
}

/* Атмосферный градиент */
.atmospheric-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle at 30% 20%,
        rgba(60, 70, 90, 0.15) 0%,
        transparent 40%
    ),
    radial-gradient(
        circle at 70% 80%,
        rgba(50, 60, 80, 0.12) 0%,
        transparent 40%
    ),
    linear-gradient(
        180deg,
        rgba(20, 25, 35, 0.3) 0%,
        transparent 30%,
        transparent 70%,
        rgba(15, 20, 30, 0.4) 100%
    );
    pointer-events: none;
}

/* Анимированные волны-переливы - внутри оверлея */
.gradient-waves {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    opacity: 0.4;
}

.gradient-waves::before,
.gradient-waves::after {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(70, 80, 100, 0.15) 0%, transparent 50%);
}

.gradient-waves::before {
    top: -50%;
    left: -50%;
    animation: wave-drift 20s infinite ease-in-out;
}

.gradient-waves::after {
    bottom: -50%;
    right: -50%;
    background: radial-gradient(circle, rgba(50, 60, 80, 0.1) 0%, transparent 50%);
    animation: wave-drift 25s infinite ease-in-out reverse;
}

@keyframes wave-drift {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(10%, 10%) scale(1.1);
    }
}

/* Молнии - над оверлеем */
.lightning-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

.lightning {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
}

.lightning svg {
    position: absolute;
    width: 100%;
    height: 100%;
}

.lightning path {
    stroke: rgba(255, 255, 255, 0.95);
    stroke-width: 2;
    fill: none;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.8))
            drop-shadow(0 0 15px rgba(180, 200, 255, 0.6))
            drop-shadow(0 0 25px rgba(150, 180, 255, 0.4));
}

.lightning.strike {
    animation: lightning-strike 0.5s ease-out;
}

@keyframes lightning-strike {
    0% {
        opacity: 0;
    }
    8% {
        opacity: 1;
    }
    15% {
        opacity: 0;
    }
    22% {
        opacity: 0.9;
    }
    28% {
        opacity: 0;
    }
    35% {
        opacity: 0.7;
    }
    50%, 100% {
        opacity: 0;
    }
}

.lightning-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg,
        rgba(200, 220, 255, 0.6) 0%,
        rgba(180, 200, 240, 0.4) 30%,
        rgba(160, 180, 220, 0.2) 60%,
        transparent 100%
    );
    opacity: 0;
    pointer-events: none;
    z-index: 4;
    mix-blend-mode: screen;
}

.lightning-flash.active {
    animation: flash 0.6s ease-out;
}

@keyframes flash {
    0% {
        opacity: 0;
    }
    8% {
        opacity: 1;
    }
    15% {
        opacity: 0.1;
    }
    22% {
        opacity: 0.85;
    }
    28% {
        opacity: 0.05;
    }
    35% {
        opacity: 0.6;
    }
    50%, 100% {
        opacity: 0;
    }
}

/* Эффект на карточки при молнии */
.link-card.thunder-lit {
    animation: thunder-glow 0.6s ease-out;
}

@keyframes thunder-glow {
    0% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
        border-color: rgba(80, 80, 80, 0.2);
    }
    8% {
        box-shadow:
            0 8px 32px rgba(0, 0, 0, 0.4),
            0 0 30px rgba(180, 200, 255, 0.4),
            inset 0 0 20px rgba(180, 200, 255, 0.1);
        border-color: rgba(180, 200, 255, 0.3);
    }
    15% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
        border-color: rgba(80, 80, 80, 0.2);
    }
    22% {
        box-shadow:
            0 8px 32px rgba(0, 0, 0, 0.4),
            0 0 25px rgba(180, 200, 255, 0.3),
            inset 0 0 15px rgba(180, 200, 255, 0.08);
        border-color: rgba(180, 200, 255, 0.25);
    }
    28% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
        border-color: rgba(80, 80, 80, 0.2);
    }
    35% {
        box-shadow:
            0 8px 32px rgba(0, 0, 0, 0.4),
            0 0 20px rgba(180, 200, 255, 0.2);
        border-color: rgba(180, 200, 255, 0.2);
    }
    50%, 100% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
        border-color: rgba(80, 80, 80, 0.2);
    }
}

/* Глитч эффект на текст при молнии */
.link-card.thunder-lit .link-title {
    animation: text-shake 0.6s ease-out;
}

@keyframes text-shake {
    0%, 100% {
        transform: translate(0, 0);
        opacity: 1;
        filter: blur(0);
    }
    8% {
        transform: translate(-2px, 0);
        opacity: 0.8;
        filter: blur(0.5px);
    }
    10% {
        transform: translate(3px, -1px);
        opacity: 0.7;
        text-shadow: -2px 0 rgba(180, 200, 255, 0.4), 2px 0 rgba(255, 255, 255, 0.3);
    }
    12% {
        transform: translate(-1px, 1px);
        opacity: 0.9;
    }
    15% {
        transform: translate(0, 0);
        opacity: 1;
        filter: blur(0);
        text-shadow: none;
    }
    22% {
        transform: translate(2px, 0);
        opacity: 0.75;
        filter: blur(0.3px);
    }
    24% {
        transform: translate(-3px, -1px);
        text-shadow: -1px 0 rgba(180, 200, 255, 0.3), 1px 0 rgba(255, 255, 255, 0.2);
    }
    26% {
        transform: translate(1px, 1px);
        opacity: 0.85;
    }
    28% {
        transform: translate(0, 0);
        opacity: 1;
        filter: blur(0);
        text-shadow: none;
    }
    35% {
        transform: translate(-1px, 0);
        opacity: 0.9;
    }
    37% {
        transform: translate(2px, -1px);
        filter: blur(0.2px);
    }
    40% {
        transform: translate(0, 0);
        opacity: 1;
        filter: blur(0);
    }
}


/* Дождь - внутри оверлея */
.rain-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.raindrop {
    position: absolute;
    width: 1px;
    height: 20px;
    background: linear-gradient(to bottom, transparent, rgba(100, 110, 130, 0.3), transparent);
    animation: fall linear infinite;
    opacity: 0;
}

@keyframes fall {
    0% {
        transform: translateY(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

/* Контейнер */
.container {
    position: relative;
    z-index: 3;
    max-width: 600px;
    margin: 0 auto;
    padding: 60px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (max-height: 900px) {
    .container {
        min-height: auto;
        justify-content: flex-start;
        padding: 40px 20px;
    }
}

/* Секция профиля */
.profile-section {
    text-align: center;
    margin-bottom: 60px;
    animation: fadeInDown 1.2s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.avatar-wrapper {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto 30px;
}

.avatar-blur {
    position: absolute;
    top: -15px;
    left: -15px;
    right: -15px;
    bottom: -15px;
    background: radial-gradient(circle, rgba(80, 90, 110, 0.4), transparent);
    filter: blur(25px);
    animation: breathe 4s infinite ease-in-out;
}

@keyframes breathe {
    0%, 100% {
        transform: scale(0.95);
        opacity: 0.4;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.6;
    }
}

.avatar {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(80, 90, 110, 0.3);
    filter: grayscale(10%) contrast(1.05);
    cursor: pointer;
    transition: transform 0.5s ease;
}

.avatar.spin {
    animation: spin360 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes spin360 {
    0% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(180deg) scale(1.15);
        filter: grayscale(0%) contrast(1.2);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}

.name {
    font-size: 36px;
    font-weight: 300;
    letter-spacing: 2px;
    margin-bottom: 15px;
    color: #d4d4d4;
    text-shadow: 0 0 25px rgba(120, 130, 150, 0.5);
    animation: glow-text 3s infinite ease-in-out;
    position: relative;
    z-index: 10;
}

@keyframes glow-text {
    0%, 100% {
        text-shadow: 0 0 25px rgba(120, 130, 150, 0.5);
    }
    50% {
        text-shadow: 0 0 35px rgba(120, 130, 150, 0.6);
    }
}

.bio {
    font-size: 14px;
    color: #666;
    font-weight: 400;
    letter-spacing: 1px;
}

.bio .highlight {
    color: #a0a0a0;
    font-weight: 500;
    text-shadow: 0 0 10px rgba(160, 160, 160, 0.3);
}

/* Секция ссылок */
.links-section {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 50px;
}

.link-card {
    position: relative;
    display: flex;
    align-items: center;
    padding: 22px 28px;
    background: rgba(30, 30, 30, 0.5);
    border: 1px solid rgba(80, 80, 80, 0.2);
    border-radius: 16px;
    text-decoration: none;
    color: #c0c0c0;
    backdrop-filter: blur(15px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.link-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(100, 100, 100, 0.08),
        transparent
    );
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
    transition: transform 0.8s ease;
}

.link-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 1px;
    background: linear-gradient(135deg,
        rgba(100, 100, 100, 0.2),
        transparent,
        rgba(80, 80, 80, 0.15)
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.link-card.visible {
    animation: slideInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

.link-card.shimmer::before {
    animation: shimmer 1.5s ease-in-out;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.link-card:active {
    transform: scale(0.98);
    border-color: rgba(100, 100, 100, 0.3);
}

.link-card:active::after {
    opacity: 1;
}

.link-card:focus-visible {
    outline: 2px solid rgba(160, 160, 160, 0.5);
    outline-offset: 4px;
    border-color: rgba(160, 160, 160, 0.4);
}

.link-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    margin-right: 20px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.link-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Spotify - зеленый фон */
.spotify-icon {
    background: rgba(30, 215, 96, 0.1);
    border-radius: 14px;
    padding: 8px;
}

.spotify-icon img {
    object-fit: contain;
}

/* Apple Music - уже есть градиент в SVG */
.apple-music-icon {
    border-radius: 14px;
}

.apple-music-icon img {
    border-radius: 14px;
}

/* iTunes - черный логотип, нужен светлый фон */
.itunes-icon {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 14px;
    padding: 10px;
}

.itunes-icon img {
    object-fit: contain;
}

/* VK - уже квадратный */
.vk-icon {
    border-radius: 14px;
}

.vk-icon img {
    border-radius: 14px;
}

/* Yandex - звезда, черный фон */
.yandex-icon {
    background: rgba(0, 0, 0, 0.9);
    border-radius: 14px;
    padding: 8px;
}

.yandex-icon img {
    object-fit: contain;
}

.link-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.link-title {
    font-size: 17px;
    font-weight: 500;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}


.link-arrow {
    font-size: 24px;
    color: rgba(140, 140, 140, 0.5);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.link-card:active .link-arrow {
    transform: translateX(8px);
    color: rgba(160, 160, 160, 0.8);
}

/* Футер */
.footer {
    text-align: center;
    padding: 30px;
    color: #444;
    font-size: 13px;
    letter-spacing: 1px;
    animation: fadeIn 2s ease-out;
}

.footer p {
    margin: 8px 0;
}

.developer-credit {
    margin-top: 12px;
}

.developer-credit a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s ease;
    border-bottom: 1px solid transparent;
}

.developer-credit a:hover {
    color: #a0a0a0;
    border-bottom-color: rgba(160, 160, 160, 0.3);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Эффект рябь */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(100, 100, 100, 0.25);
    transform: scale(0);
    animation: ripple-animation 0.8s ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Адаптивность */
@media (max-width: 480px) {
    .container {
        padding: 40px 18px;
    }

    .avatar-wrapper {
        width: 140px;
        height: 140px;
    }

    .name {
        font-size: 30px;
    }

    .link-card {
        padding: 20px 24px;
    }

    .link-icon {
        width: 48px;
        height: 48px;
        margin-right: 16px;
    }

    .link-title {
        font-size: 16px;
    }
}

/* Дополнительные эффекты глубины */
@media (prefers-reduced-motion: no-preference) {
    .link-card {
        animation-duration: 0.8s;
    }
}
