body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -5;
    background:
        radial-gradient(circle at 18% 16%, rgba(227, 18, 45, 0.25), transparent 30%),
        radial-gradient(circle at 80% 8%, rgba(53, 192, 255, 0.22), transparent 34%),
        radial-gradient(circle at 54% 86%, rgba(24, 64, 255, 0.22), transparent 40%),
        linear-gradient(180deg, #02040b 0%, #07101f 54%, #02040b 100%);
}

.ambient-scene {
    position: fixed;
    inset: 0;
    z-index: -4;
    pointer-events: none;
    overflow: hidden;
}

.scene-image {
    position: absolute;
    inset: -8%;
    background-image: var(--profile-background-image);
    background-size: cover;
    background-position: center;
    opacity: 0.18;
    filter: blur(34px) saturate(1.35) contrast(1.12);
    transform: scale(1.06);
}

.scene-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 58px 58px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.92), transparent 78%);
}

.scene-grid::before {
    content: "";
    position: absolute;
    inset: -20% -12%;
    background:
        linear-gradient(112deg, transparent 0 43%, rgba(53, 192, 255, 0.16) 44%, transparent 46% 100%),
        linear-gradient(70deg, transparent 0 56%, rgba(227, 18, 45, 0.12) 57%, transparent 59% 100%);
    animation: drift-lines 19s linear infinite;
}

.scene-scanline {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.022) 0, rgba(255, 255, 255, 0.022) 1px, transparent 1px, transparent 9px);
    opacity: 0.32;
}

.particle-canvas {
    position: fixed;
    inset: 0;
    z-index: -3;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

[data-reveal] {
    opacity: 0;
    transform: translateY(20px) scale(0.985);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.19, 1, 0.22, 1);
}

[data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

[data-tilt] {
    --tilt-x: 0deg;
    --tilt-y: 0deg;
    --tilt-z: 0px;
    transform: perspective(900px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) translate3d(0, 0, var(--tilt-z));
    transition: transform 0.24s ease, box-shadow 0.24s ease;
    will-change: transform;
}

[data-tilt]:hover {
    --tilt-z: 8px;
}

.custom-cursor {
    position: fixed;
    inset: 0;
    z-index: 120;
    pointer-events: none;
}

.cursor-dot,
.cursor-ring {
    position: fixed;
    left: 0;
    top: 0;
    border-radius: 50%;
    transform: translate3d(-50%, -50%, 0);
    opacity: 0;
    transition: opacity 0.18s ease, width 0.18s ease, height 0.18s ease, border-color 0.18s ease;
    will-change: transform;
}

.cursor-dot {
    width: 6px;
    height: 6px;
    background: #ffffff;
    box-shadow: 0 0 16px rgba(53, 192, 255, 0.72);
}

.cursor-ring {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(53, 192, 255, 0.62);
}

body.has-custom-cursor .cursor-dot,
body.has-custom-cursor .cursor-ring {
    opacity: 1;
}

body.cursor-active .cursor-ring {
    width: 46px;
    height: 46px;
    border-color: rgba(227, 18, 45, 0.72);
}

.profile-card,
.featured-card,
.social-link-card,
.activity-card,
.mini-panel {
    box-shadow:
        var(--shadow-deep),
        0 0 0 1px rgba(255, 255, 255, 0.03),
        0 0 42px rgba(53, 192, 255, 0.08);
}

.profile-card::after {
    content: "";
    position: absolute;
    inset: -1px;
    z-index: 2;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(53, 192, 255, 0.62), rgba(227, 18, 45, 0.46), rgba(24, 64, 255, 0.40));
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    opacity: 0.66;
}

.social-link-card::before {
    background:
        radial-gradient(circle at var(--shine-x, 12%) var(--shine-y, 20%), var(--card-glow), transparent 34%),
        linear-gradient(90deg, var(--card-glow), transparent 42%);
}

.badge.tone-cyan {
    box-shadow: inset 0 0 18px rgba(53, 192, 255, 0.08), 0 0 18px rgba(53, 192, 255, 0.06);
}

.badge.tone-red {
    box-shadow: inset 0 0 18px rgba(227, 18, 45, 0.10), 0 0 18px rgba(227, 18, 45, 0.06);
}

.badge.tone-blue {
    box-shadow: inset 0 0 18px rgba(24, 64, 255, 0.10), 0 0 18px rgba(24, 64, 255, 0.06);
}

@keyframes drift-lines {
    from {
        transform: translate3d(-2%, -2%, 0);
    }
    to {
        transform: translate3d(2%, 2%, 0);
    }
}

@keyframes orbit-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@media (hover: none), (pointer: coarse) {
    .custom-cursor {
        display: none;
    }
}

@media (max-width: 720px) {
    .scene-image {
        opacity: 0.12;
        filter: blur(28px) saturate(1.2);
    }

    .particle-canvas {
        opacity: 0.72;
    }
}

@media (prefers-reduced-motion: reduce) {
    .particle-canvas,
    .custom-cursor {
        display: none;
    }

    .scene-grid::before,
    .avatar-orbit {
        animation: none !important;
    }

    [data-reveal] {
        opacity: 1;
        transform: none;
    }

    [data-tilt],
    [data-tilt]:hover {
        transform: none !important;
    }
}
